Files
pyMC_Repeater/repeater/web/html/assets/plotly.min-DO11Gp-n.js
T
Lloyd 599e4628d9 Changes include:
Features

Neighbour details modal with full info and map view

WebSocket support with heartbeat and automatic reconnection

Improved signal quality calculations (SNR-based RSSI)

Route-based pagination for faster initial loads

UI

Mobile sidebar tweaks (logout, version info, lazy-loaded charts)

Sorting added to the neighbour table

Packet view now shows multi-hop paths

CAD calibration charts respect light/dark themes

Statistics charts now show the full requested time range

Performance

Reduced polling when WebSocket is active

Lazy loading for heavier components

Noise floor data capped to keep charts responsive

Technical

Improved type safety across API responses

Contrast improvements for accessibility

Cleaner WebSocket and MQTT reconnection handling

Additional metrics added to heartbeat stats

Bug fixes

Corrected noise floor history query

Fixed authentication for CAD calibration streams

Nothing major required from users — just update and carry on.
As always, shout if something looks off.
2026-01-18 20:15:50 +00:00

3859 lines
4.6 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{g as FI}from"./_commonjsHelpers-CqkleIqs.js";function BI(e0,Mg){for(var Dp=0;Dp<Mg.length;Dp++){const Yh=Mg[Dp];if(typeof Yh!="string"&&!Array.isArray(Yh)){for(const Fh in Yh)if(Fh!=="default"&&!(Fh in e0)){const lm=Object.getOwnPropertyDescriptor(Yh,Fh);lm&&Object.defineProperty(e0,Fh,lm.get?lm:{enumerable:!0,get:()=>Yh[Fh]})}}}return Object.freeze(Object.defineProperty(e0,Symbol.toStringTag,{value:"Module"}))}var Ey={exports:{}},RI=Ey.exports,O4;function NI(){return O4||(O4=1,function(e0){var Mg={};(function(Dp,Yh){e0.exports?e0.exports=Yh():Dp.moduleName=Yh()})(typeof self<"u"?self:RI,()=>{var Dp=(()=>{var Yh=Object.create,Fh=Object.defineProperty,lm=Object.defineProperties,B4=Object.getOwnPropertyDescriptor,R4=Object.getOwnPropertyDescriptors,N4=Object.getOwnPropertyNames,Sg=Object.getOwnPropertySymbols,j4=Object.getPrototypeOf,zy=Object.prototype.hasOwnProperty,V_=Object.prototype.propertyIsEnumerable,H_=(Z,V,u)=>V in Z?Fh(Z,V,{enumerable:!0,configurable:!0,writable:!0,value:u}):Z[V]=u,gd=(Z,V)=>{for(var u in V||(V={}))zy.call(V,u)&&H_(Z,u,V[u]);if(Sg)for(var u of Sg(V))V_.call(V,u)&&H_(Z,u,V[u]);return Z},um=(Z,V)=>lm(Z,R4(V)),U4=(Z,V)=>{var u={};for(var d in Z)zy.call(Z,d)&&V.indexOf(d)<0&&(u[d]=Z[d]);if(Z!=null&&Sg)for(var d of Sg(Z))V.indexOf(d)<0&&V_.call(Z,d)&&(u[d]=Z[d]);return u},Bl=(Z,V)=>()=>(Z&&(V=Z(Z=0)),V),Vt=(Z,V)=>()=>(V||Z((V={exports:{}}).exports,V),V.exports),q_=(Z,V)=>{for(var u in V)Fh(Z,u,{get:V[u],enumerable:!0})},W_=(Z,V,u,d)=>{if(V&&typeof V=="object"||typeof V=="function")for(let E of N4(V))!zy.call(Z,E)&&E!==u&&Fh(Z,E,{get:()=>V[E],enumerable:!(d=B4(V,E))||d.enumerable});return Z},V4=(Z,V,u)=>(u=Z!=null?Yh(j4(Z)):{},W_(Fh(u,"default",{value:Z,enumerable:!0}),Z)),vd=Z=>W_(Fh({},"__esModule",{value:!0}),Z),Ly=Vt(Z=>{Z.version="3.2.0"}),H4=Vt((Z,V)=>{(function(u,d,E){d[u]=d[u]||E(),typeof V<"u"&&V.exports&&(V.exports=d[u])})("Promise",typeof window<"u"?window:Z,function(){var u,d,E,A=Object.prototype.toString,t=typeof setImmediate<"u"?function(w){return setImmediate(w)}:setTimeout;try{Object.defineProperty({},"x",{}),u=function(w,l,x,y){return Object.defineProperty(w,l,{value:x,writable:!0,configurable:y!==!1})}}catch{u=function(l,x,y){return l[x]=y,l}}E=function(){var w,l,x;function y(S,k){this.fn=S,this.self=k,this.next=void 0}return{add:function(S,k){x=new y(S,k),l?l.next=x:w=x,l=x,x=void 0},drain:function(){var S=w;for(w=l=d=void 0;S;)S.fn.call(S.self),S=S.next}}}();function e(w,l){E.add(w,l),d||(d=t(E.drain))}function r(w){var l,x=typeof w;return w!=null&&(x=="object"||x=="function")&&(l=w.then),typeof l=="function"?l:!1}function i(){for(var w=0;w<this.chain.length;w++)n(this,this.state===1?this.chain[w].success:this.chain[w].failure,this.chain[w]);this.chain.length=0}function n(w,l,x){var y,S;try{l===!1?x.reject(w.msg):(l===!0?y=w.msg:y=l.call(void 0,w.msg),y===x.promise?x.reject(TypeError("Promise-chain cycle")):(S=r(y))?S.call(y,x.resolve,x.reject):x.resolve(y))}catch(k){x.reject(k)}}function o(w){var l,x=this;if(!x.triggered){x.triggered=!0,x.def&&(x=x.def);try{(l=r(w))?e(function(){var y=new f(x);try{l.call(w,function(){o.apply(y,arguments)},function(){a.apply(y,arguments)})}catch(S){a.call(y,S)}}):(x.msg=w,x.state=1,x.chain.length>0&&e(i,x))}catch(y){a.call(new f(x),y)}}}function a(w){var l=this;l.triggered||(l.triggered=!0,l.def&&(l=l.def),l.msg=w,l.state=2,l.chain.length>0&&e(i,l))}function s(w,l,x,y){for(var S=0;S<l.length;S++)(function(k){w.resolve(l[k]).then(function(M){x(k,M)},y)})(S)}function f(w){this.def=w,this.triggered=!1}function v(w){this.promise=w,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function g(w){if(typeof w!="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,y){var S={success:typeof x=="function"?x:!0,failure:typeof y=="function"?y:!1};return S.promise=new this.constructor(function(k,M){if(typeof k!="function"||typeof M!="function")throw TypeError("Not a function");S.resolve=k,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{w.call(void 0,function(x){o.call(l,x)},function(x){a.call(l,x)})}catch(x){a.call(l,x)}}var m=u({},"constructor",g,!1);return g.prototype=m,u(m,"__NPO__",0,!1),u(g,"resolve",function(w){var l=this;return w&&typeof w=="object"&&w.__NPO__===1?w:new l(function(x,y){if(typeof x!="function"||typeof y!="function")throw TypeError("Not a function");x(w)})}),u(g,"reject",function(w){return new this(function(l,x){if(typeof l!="function"||typeof x!="function")throw TypeError("Not a function");x(w)})}),u(g,"all",function(w){var l=this;return A.call(w)!="[object Array]"?l.reject(TypeError("Not an array")):w.length===0?l.resolve([]):new l(function(x,y){if(typeof x!="function"||typeof y!="function")throw TypeError("Not a function");var S=w.length,k=Array(S),M=0;s(l,w,function(T,c){k[T]=c,++M===S&&x(k)},y)})}),u(g,"race",function(w){var l=this;return A.call(w)!="[object Array]"?l.reject(TypeError("Not an array")):new l(function(x,y){if(typeof x!="function"||typeof y!="function")throw TypeError("Not a function");s(l,w,function(S,k){x(k)},y)})}),g})}),Ni=Vt((Z,V)=>{(function(){var u={version:"3.8.2"},d=[].slice,E=function(gt){return d.call(gt)},A=self.document;function t(gt){return gt&&(gt.ownerDocument||gt.document||gt).documentElement}function e(gt){return gt&&(gt.ownerDocument&&gt.ownerDocument.defaultView||gt.document&&gt||gt.defaultView)}if(A)try{E(A.documentElement.childNodes)[0].nodeType}catch{E=function(Et){for(var Xt=Et.length,fe=new Array(Xt);Xt--;)fe[Xt]=Et[Xt];return fe}}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(Et,Xt){i.call(this,Et,Xt+"")},r.setAttributeNS=function(Et,Xt,fe){n.call(this,Et,Xt,fe+"")},o.setProperty=function(Et,Xt,fe){a.call(this,Et,Xt+"",fe)}}u.ascending=s;function s(gt,Et){return gt<Et?-1:gt>Et?1:gt>=Et?0:NaN}u.descending=function(gt,Et){return Et<gt?-1:Et>gt?1:Et>=gt?0:NaN},u.min=function(gt,Et){var Xt=-1,fe=gt.length,me,we;if(arguments.length===1){for(;++Xt<fe;)if((we=gt[Xt])!=null&&we>=we){me=we;break}for(;++Xt<fe;)(we=gt[Xt])!=null&&me>we&&(me=we)}else{for(;++Xt<fe;)if((we=Et.call(gt,gt[Xt],Xt))!=null&&we>=we){me=we;break}for(;++Xt<fe;)(we=Et.call(gt,gt[Xt],Xt))!=null&&me>we&&(me=we)}return me},u.max=function(gt,Et){var Xt=-1,fe=gt.length,me,we;if(arguments.length===1){for(;++Xt<fe;)if((we=gt[Xt])!=null&&we>=we){me=we;break}for(;++Xt<fe;)(we=gt[Xt])!=null&&we>me&&(me=we)}else{for(;++Xt<fe;)if((we=Et.call(gt,gt[Xt],Xt))!=null&&we>=we){me=we;break}for(;++Xt<fe;)(we=Et.call(gt,gt[Xt],Xt))!=null&&we>me&&(me=we)}return me},u.extent=function(gt,Et){var Xt=-1,fe=gt.length,me,we,Ve;if(arguments.length===1){for(;++Xt<fe;)if((we=gt[Xt])!=null&&we>=we){me=Ve=we;break}for(;++Xt<fe;)(we=gt[Xt])!=null&&(me>we&&(me=we),Ve<we&&(Ve=we))}else{for(;++Xt<fe;)if((we=Et.call(gt,gt[Xt],Xt))!=null&&we>=we){me=Ve=we;break}for(;++Xt<fe;)(we=Et.call(gt,gt[Xt],Xt))!=null&&(me>we&&(me=we),Ve<we&&(Ve=we))}return[me,Ve]};function f(gt){return gt===null?NaN:+gt}function v(gt){return!isNaN(gt)}u.sum=function(gt,Et){var Xt=0,fe=gt.length,me,we=-1;if(arguments.length===1)for(;++we<fe;)v(me=+gt[we])&&(Xt+=me);else for(;++we<fe;)v(me=+Et.call(gt,gt[we],we))&&(Xt+=me);return Xt},u.mean=function(gt,Et){var Xt=0,fe=gt.length,me,we=-1,Ve=fe;if(arguments.length===1)for(;++we<fe;)v(me=f(gt[we]))?Xt+=me:--Ve;else for(;++we<fe;)v(me=f(Et.call(gt,gt[we],we)))?Xt+=me:--Ve;if(Ve)return Xt/Ve},u.quantile=function(gt,Et){var Xt=(gt.length-1)*Et+1,fe=Math.floor(Xt),me=+gt[fe-1],we=Xt-fe;return we?me+we*(gt[fe]-me):me},u.median=function(gt,Et){var Xt=[],fe=gt.length,me,we=-1;if(arguments.length===1)for(;++we<fe;)v(me=f(gt[we]))&&Xt.push(me);else for(;++we<fe;)v(me=f(Et.call(gt,gt[we],we)))&&Xt.push(me);if(Xt.length)return u.quantile(Xt.sort(s),.5)},u.variance=function(gt,Et){var Xt=gt.length,fe=0,me,we,Ve=0,je=-1,or=0;if(arguments.length===1)for(;++je<Xt;)v(me=f(gt[je]))&&(we=me-fe,fe+=we/++or,Ve+=we*(me-fe));else for(;++je<Xt;)v(me=f(Et.call(gt,gt[je],je)))&&(we=me-fe,fe+=we/++or,Ve+=we*(me-fe));if(or>1)return Ve/(or-1)},u.deviation=function(){var gt=u.variance.apply(this,arguments);return gt&&Math.sqrt(gt)};function g(gt){return{left:function(Et,Xt,fe,me){for(arguments.length<3&&(fe=0),arguments.length<4&&(me=Et.length);fe<me;){var we=fe+me>>>1;gt(Et[we],Xt)<0?fe=we+1:me=we}return fe},right:function(Et,Xt,fe,me){for(arguments.length<3&&(fe=0),arguments.length<4&&(me=Et.length);fe<me;){var we=fe+me>>>1;gt(Et[we],Xt)>0?me=we:fe=we+1}return fe}}}var m=g(s);u.bisectLeft=m.left,u.bisect=u.bisectRight=m.right,u.bisector=function(gt){return g(gt.length===1?function(Et,Xt){return s(gt(Et),Xt)}:gt)},u.shuffle=function(gt,Et,Xt){(fe=arguments.length)<3&&(Xt=gt.length,fe<2&&(Et=0));for(var fe=Xt-Et,me,we;fe;)we=Math.random()*fe--|0,me=gt[fe+Et],gt[fe+Et]=gt[we+Et],gt[we+Et]=me;return gt},u.permute=function(gt,Et){for(var Xt=Et.length,fe=new Array(Xt);Xt--;)fe[Xt]=gt[Et[Xt]];return fe},u.pairs=function(gt){for(var Et=0,Xt=gt.length-1,fe,me=gt[0],we=new Array(Xt<0?0:Xt);Et<Xt;)we[Et]=[fe=me,me=gt[++Et]];return we},u.transpose=function(gt){if(!(we=gt.length))return[];for(var Et=-1,Xt=u.min(gt,w),fe=new Array(Xt);++Et<Xt;)for(var me=-1,we,Ve=fe[Et]=new Array(we);++me<we;)Ve[me]=gt[me][Et];return fe};function w(gt){return gt.length}u.zip=function(){return u.transpose(arguments)},u.keys=function(gt){var Et=[];for(var Xt in gt)Et.push(Xt);return Et},u.values=function(gt){var Et=[];for(var Xt in gt)Et.push(gt[Xt]);return Et},u.entries=function(gt){var Et=[];for(var Xt in gt)Et.push({key:Xt,value:gt[Xt]});return Et},u.merge=function(gt){for(var Et=gt.length,Xt,fe=-1,me=0,we,Ve;++fe<Et;)me+=gt[fe].length;for(we=new Array(me);--Et>=0;)for(Ve=gt[Et],Xt=Ve.length;--Xt>=0;)we[--me]=Ve[Xt];return we};var l=Math.abs;u.range=function(gt,Et,Xt){if(arguments.length<3&&(Xt=1,arguments.length<2&&(Et=gt,gt=0)),(Et-gt)/Xt===1/0)throw new Error("infinite range");var fe=[],me=x(l(Xt)),we=-1,Ve;if(gt*=me,Et*=me,Xt*=me,Xt<0)for(;(Ve=gt+Xt*++we)>Et;)fe.push(Ve/me);else for(;(Ve=gt+Xt*++we)<Et;)fe.push(Ve/me);return fe};function x(gt){for(var Et=1;gt*Et%1;)Et*=10;return Et}function y(gt,Et){for(var Xt in Et)Object.defineProperty(gt.prototype,Xt,{value:Et[Xt],enumerable:!1})}u.map=function(gt,Et){var Xt=new S;if(gt instanceof S)gt.forEach(function(je,or){Xt.set(je,or)});else if(Array.isArray(gt)){var fe=-1,me=gt.length,we;if(arguments.length===1)for(;++fe<me;)Xt.set(fe,gt[fe]);else for(;++fe<me;)Xt.set(Et.call(gt,we=gt[fe],fe),we)}else for(var Ve in gt)Xt.set(Ve,gt[Ve]);return Xt};function S(){this._=Object.create(null)}var k="__proto__",M="\0";y(S,{has:h,get:function(gt){return this._[T(gt)]},set:function(gt,Et){return this._[T(gt)]=Et},remove:b,keys:_,values:function(){var gt=[];for(var Et in this._)gt.push(this._[Et]);return gt},entries:function(){var gt=[];for(var Et in this._)gt.push({key:c(Et),value:this._[Et]});return gt},size:P,empty:L,forEach:function(gt){for(var Et in this._)gt.call(this,c(Et),this._[Et])}});function T(gt){return(gt+="")===k||gt[0]===M?M+gt:gt}function c(gt){return(gt+="")[0]===M?gt.slice(1):gt}function h(gt){return T(gt)in this._}function b(gt){return(gt=T(gt))in this._&&delete this._[gt]}function _(){var gt=[];for(var Et in this._)gt.push(c(Et));return gt}function P(){var gt=0;for(var Et in this._)++gt;return gt}function L(){for(var gt in this._)return!1;return!0}u.nest=function(){var gt={},Et=[],Xt=[],fe,me;function we(je,or,Cr){if(Cr>=Et.length)return me?me.call(gt,or):fe?or.sort(fe):or;for(var Sr=-1,Wr=or.length,an=Et[Cr++],on,ta,hn,Bn=new S,Hn;++Sr<Wr;)(Hn=Bn.get(on=an(ta=or[Sr])))?Hn.push(ta):Bn.set(on,[ta]);return je?(ta=je(),hn=function(Yn,na){ta.set(Yn,we(je,na,Cr))}):(ta={},hn=function(Yn,na){ta[Yn]=we(je,na,Cr)}),Bn.forEach(hn),ta}function Ve(je,or){if(or>=Et.length)return je;var Cr=[],Sr=Xt[or++];return je.forEach(function(Wr,an){Cr.push({key:Wr,values:Ve(an,or)})}),Sr?Cr.sort(function(Wr,an){return Sr(Wr.key,an.key)}):Cr}return gt.map=function(je,or){return we(or,je,0)},gt.entries=function(je){return Ve(we(u.map,je,0),0)},gt.key=function(je){return Et.push(je),gt},gt.sortKeys=function(je){return Xt[Et.length-1]=je,gt},gt.sortValues=function(je){return fe=je,gt},gt.rollup=function(je){return me=je,gt},gt},u.set=function(gt){var Et=new D;if(gt)for(var Xt=0,fe=gt.length;Xt<fe;++Xt)Et.add(gt[Xt]);return Et};function D(){this._=Object.create(null)}y(D,{has:h,add:function(gt){return this._[T(gt+="")]=!0,gt},remove:b,values:_,size:P,empty:L,forEach:function(gt){for(var Et in this._)gt.call(this,c(Et))}}),u.behavior={};function B(gt){return gt}u.rebind=function(gt,Et){for(var Xt=1,fe=arguments.length,me;++Xt<fe;)gt[me=arguments[Xt]]=R(gt,Et,Et[me]);return gt};function R(gt,Et,Xt){return function(){var fe=Xt.apply(Et,arguments);return fe===Et?gt:fe}}function I(gt,Et){if(Et in gt)return Et;Et=Et.charAt(0).toUpperCase()+Et.slice(1);for(var Xt=0,fe=F.length;Xt<fe;++Xt){var me=F[Xt]+Et;if(me in gt)return me}}var F=["webkit","ms","moz","Moz","o","O"];function N(){}u.dispatch=function(){for(var gt=new j,Et=-1,Xt=arguments.length;++Et<Xt;)gt[arguments[Et]]=G(gt);return gt};function j(){}j.prototype.on=function(gt,Et){var Xt=gt.indexOf("."),fe="";if(Xt>=0&&(fe=gt.slice(Xt+1),gt=gt.slice(0,Xt)),gt)return arguments.length<2?this[gt].on(fe):this[gt].on(fe,Et);if(arguments.length===2){if(Et==null)for(gt in this)this.hasOwnProperty(gt)&&this[gt].on(fe,null);return this}};function G(gt){var Et=[],Xt=new S;function fe(){for(var me=Et,we=-1,Ve=me.length,je;++we<Ve;)(je=me[we].on)&&je.apply(this,arguments);return gt}return fe.on=function(me,we){var Ve=Xt.get(me),je;return arguments.length<2?Ve&&Ve.on:(Ve&&(Ve.on=null,Et=Et.slice(0,je=Et.indexOf(Ve)).concat(Et.slice(je+1)),Xt.remove(me)),we&&Et.push(Xt.set(me,{on:we})),gt)},fe}u.event=null;function rt(){u.event.preventDefault()}function ct(){for(var gt=u.event,Et;Et=gt.sourceEvent;)gt=Et;return gt}function st(gt){for(var Et=new j,Xt=0,fe=arguments.length;++Xt<fe;)Et[arguments[Xt]]=G(Et);return Et.of=function(me,we){return function(Ve){try{var je=Ve.sourceEvent=u.event;Ve.target=gt,u.event=Ve,Et[Ve.type].apply(me,we)}finally{u.event=je}}},Et}u.requote=function(gt){return gt.replace(et,"\\$&")};var et=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,K={}.__proto__?function(gt,Et){gt.__proto__=Et}:function(gt,Et){for(var Xt in Et)gt[Xt]=Et[Xt]};function ot(gt){return K(gt,J),gt}var X=function(gt,Et){return Et.querySelector(gt)},Q=function(gt,Et){return Et.querySelectorAll(gt)},ut=function(gt,Et){var Xt=gt.matches||gt[I(gt,"matchesSelector")];return ut=function(fe,me){return Xt.call(fe,me)},ut(gt,Et)};typeof Sizzle=="function"&&(X=function(gt,Et){return Sizzle(gt,Et)[0]||null},Q=Sizzle,ut=Sizzle.matchesSelector),u.selection=function(){return u.select(A.documentElement)};var J=u.selection.prototype=[];J.select=function(gt){var Et=[],Xt,fe,me,we;gt=q(gt);for(var Ve=-1,je=this.length;++Ve<je;){Et.push(Xt=[]),Xt.parentNode=(me=this[Ve]).parentNode;for(var or=-1,Cr=me.length;++or<Cr;)(we=me[or])?(Xt.push(fe=gt.call(we,we.__data__,or,Ve)),fe&&"__data__"in we&&(fe.__data__=we.__data__)):Xt.push(null)}return ot(Et)};function q(gt){return typeof gt=="function"?gt:function(){return X(gt,this)}}J.selectAll=function(gt){var Et=[],Xt,fe;gt=it(gt);for(var me=-1,we=this.length;++me<we;)for(var Ve=this[me],je=-1,or=Ve.length;++je<or;)(fe=Ve[je])&&(Et.push(Xt=E(gt.call(fe,fe.__data__,je,me))),Xt.parentNode=fe);return ot(Et)};function it(gt){return typeof gt=="function"?gt:function(){return Q(gt,this)}}var nt="http://www.w3.org/1999/xhtml",dt={svg:"http://www.w3.org/2000/svg",xhtml:nt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};u.ns={prefix:dt,qualify:function(gt){var Et=gt.indexOf(":"),Xt=gt;return Et>=0&&(Xt=gt.slice(0,Et))!=="xmlns"&&(gt=gt.slice(Et+1)),dt.hasOwnProperty(Xt)?{space:dt[Xt],local:gt}:gt}},J.attr=function(gt,Et){if(arguments.length<2){if(typeof gt=="string"){var Xt=this.node();return gt=u.ns.qualify(gt),gt.local?Xt.getAttributeNS(gt.space,gt.local):Xt.getAttribute(gt)}for(Et in gt)this.each(Tt(Et,gt[Et]));return this}return this.each(Tt(gt,Et))};function Tt(gt,Et){gt=u.ns.qualify(gt);function Xt(){this.removeAttribute(gt)}function fe(){this.removeAttributeNS(gt.space,gt.local)}function me(){this.setAttribute(gt,Et)}function we(){this.setAttributeNS(gt.space,gt.local,Et)}function Ve(){var or=Et.apply(this,arguments);or==null?this.removeAttribute(gt):this.setAttribute(gt,or)}function je(){var or=Et.apply(this,arguments);or==null?this.removeAttributeNS(gt.space,gt.local):this.setAttributeNS(gt.space,gt.local,or)}return Et==null?gt.local?fe:Xt:typeof Et=="function"?gt.local?je:Ve:gt.local?we:me}function wt(gt){return gt.trim().replace(/\s+/g," ")}J.classed=function(gt,Et){if(arguments.length<2){if(typeof gt=="string"){var Xt=this.node(),fe=(gt=Ct(gt)).length,me=-1;if(Et=Xt.classList){for(;++me<fe;)if(!Et.contains(gt[me]))return!1}else for(Et=Xt.getAttribute("class");++me<fe;)if(!It(gt[me]).test(Et))return!1;return!0}for(Et in gt)this.each(Nt(Et,gt[Et]));return this}return this.each(Nt(gt,Et))};function It(gt){return new RegExp("(?:^|\\s+)"+u.requote(gt)+"(?:\\s+|$)","g")}function Ct(gt){return(gt+"").trim().split(/^|\s+/)}function Nt(gt,Et){gt=Ct(gt).map(ee);var Xt=gt.length;function fe(){for(var we=-1;++we<Xt;)gt[we](this,Et)}function me(){for(var we=-1,Ve=Et.apply(this,arguments);++we<Xt;)gt[we](this,Ve)}return typeof Et=="function"?me:fe}function ee(gt){var Et=It(gt);return function(Xt,fe){if(me=Xt.classList)return fe?me.add(gt):me.remove(gt);var me=Xt.getAttribute("class")||"";fe?(Et.lastIndex=0,Et.test(me)||Xt.setAttribute("class",wt(me+" "+gt))):Xt.setAttribute("class",wt(me.replace(Et," ")))}}J.style=function(gt,Et,Xt){var fe=arguments.length;if(fe<3){if(typeof gt!="string"){fe<2&&(Et="");for(Xt in gt)this.each(Jt(Xt,gt[Xt],Et));return this}if(fe<2){var me=this.node();return e(me).getComputedStyle(me,null).getPropertyValue(gt)}Xt=""}return this.each(Jt(gt,Et,Xt))};function Jt(gt,Et,Xt){function fe(){this.style.removeProperty(gt)}function me(){this.style.setProperty(gt,Et,Xt)}function we(){var Ve=Et.apply(this,arguments);Ve==null?this.style.removeProperty(gt):this.style.setProperty(gt,Ve,Xt)}return Et==null?fe:typeof Et=="function"?we:me}J.property=function(gt,Et){if(arguments.length<2){if(typeof gt=="string")return this.node()[gt];for(Et in gt)this.each(te(Et,gt[Et]));return this}return this.each(te(gt,Et))};function te(gt,Et){function Xt(){delete this[gt]}function fe(){this[gt]=Et}function me(){var we=Et.apply(this,arguments);we==null?delete this[gt]:this[gt]=we}return Et==null?Xt:typeof Et=="function"?me:fe}J.text=function(gt){return arguments.length?this.each(typeof gt=="function"?function(){var Et=gt.apply(this,arguments);this.textContent=Et??""}:gt==null?function(){this.textContent=""}:function(){this.textContent=gt}):this.node().textContent},J.html=function(gt){return arguments.length?this.each(typeof gt=="function"?function(){var Et=gt.apply(this,arguments);this.innerHTML=Et??""}:gt==null?function(){this.innerHTML=""}:function(){this.innerHTML=gt}):this.node().innerHTML},J.append=function(gt){return gt=Kt(gt),this.select(function(){return this.appendChild(gt.apply(this,arguments))})};function Kt(gt){function Et(){var fe=this.ownerDocument,me=this.namespaceURI;return me===nt&&fe.documentElement.namespaceURI===nt?fe.createElement(gt):fe.createElementNS(me,gt)}function Xt(){return this.ownerDocument.createElementNS(gt.space,gt.local)}return typeof gt=="function"?gt:(gt=u.ns.qualify(gt)).local?Xt:Et}J.insert=function(gt,Et){return gt=Kt(gt),Et=q(Et),this.select(function(){return this.insertBefore(gt.apply(this,arguments),Et.apply(this,arguments)||null)})},J.remove=function(){return this.each(mt)};function mt(){var gt=this.parentNode;gt&&gt.removeChild(this)}J.data=function(gt,Et){var Xt=-1,fe=this.length,me,we;if(!arguments.length){for(gt=new Array(fe=(me=this[0]).length);++Xt<fe;)(we=me[Xt])&&(gt[Xt]=we.__data__);return gt}function Ve(Sr,Wr){var an,on=Sr.length,ta=Wr.length,hn=Math.min(on,ta),Bn=new Array(ta),Hn=new Array(ta),Yn=new Array(on),na,_n;if(Et){var Ha=new S,Wa=new Array(on),ri;for(an=-1;++an<on;)(na=Sr[an])&&(Ha.has(ri=Et.call(na,na.__data__,an))?Yn[an]=na:Ha.set(ri,na),Wa[an]=ri);for(an=-1;++an<ta;)(na=Ha.get(ri=Et.call(Wr,_n=Wr[an],an)))?na!==!0&&(Bn[an]=na,na.__data__=_n):Hn[an]=bt(_n),Ha.set(ri,!0);for(an=-1;++an<on;)an in Wa&&Ha.get(Wa[an])!==!0&&(Yn[an]=Sr[an])}else{for(an=-1;++an<hn;)na=Sr[an],_n=Wr[an],na?(na.__data__=_n,Bn[an]=na):Hn[an]=bt(_n);for(;an<ta;++an)Hn[an]=bt(Wr[an]);for(;an<on;++an)Yn[an]=Sr[an]}Hn.update=Bn,Hn.parentNode=Bn.parentNode=Yn.parentNode=Sr.parentNode,je.push(Hn),or.push(Bn),Cr.push(Yn)}var je=Zt([]),or=ot([]),Cr=ot([]);if(typeof gt=="function")for(;++Xt<fe;)Ve(me=this[Xt],gt.call(me,me.parentNode.__data__,Xt));else for(;++Xt<fe;)Ve(me=this[Xt],gt);return or.enter=function(){return je},or.exit=function(){return Cr},or};function bt(gt){return{__data__:gt}}J.datum=function(gt){return arguments.length?this.property("__data__",gt):this.property("__data__")},J.filter=function(gt){var Et=[],Xt,fe,me;typeof gt!="function"&&(gt=vt(gt));for(var we=0,Ve=this.length;we<Ve;we++){Et.push(Xt=[]),Xt.parentNode=(fe=this[we]).parentNode;for(var je=0,or=fe.length;je<or;je++)(me=fe[je])&&gt.call(me,me.__data__,je,we)&&Xt.push(me)}return ot(Et)};function vt(gt){return function(){return ut(this,gt)}}J.order=function(){for(var gt=-1,Et=this.length;++gt<Et;)for(var Xt=this[gt],fe=Xt.length-1,me=Xt[fe],we;--fe>=0;)(we=Xt[fe])&&(me&&me!==we.nextSibling&&me.parentNode.insertBefore(we,me),me=we);return this},J.sort=function(gt){gt=Ut.apply(this,arguments);for(var Et=-1,Xt=this.length;++Et<Xt;)this[Et].sort(gt);return this.order()};function Ut(gt){return arguments.length||(gt=s),function(Et,Xt){return Et&&Xt?gt(Et.__data__,Xt.__data__):!Et-!Xt}}J.each=function(gt){return re(this,function(Et,Xt,fe){gt.call(Et,Et.__data__,Xt,fe)})};function re(gt,Et){for(var Xt=0,fe=gt.length;Xt<fe;Xt++)for(var me=gt[Xt],we=0,Ve=me.length,je;we<Ve;we++)(je=me[we])&&Et(je,we,Xt);return gt}J.call=function(gt){var Et=E(arguments);return gt.apply(Et[0]=this,Et),this},J.empty=function(){return!this.node()},J.node=function(){for(var gt=0,Et=this.length;gt<Et;gt++)for(var Xt=this[gt],fe=0,me=Xt.length;fe<me;fe++){var we=Xt[fe];if(we)return we}return null},J.size=function(){var gt=0;return re(this,function(){++gt}),gt};function Zt(gt){return K(gt,ue),gt}var ue=[];u.selection.enter=Zt,u.selection.enter.prototype=ue,ue.append=J.append,ue.empty=J.empty,ue.node=J.node,ue.call=J.call,ue.size=J.size,ue.select=function(gt){for(var Et=[],Xt,fe,me,we,Ve,je=-1,or=this.length;++je<or;){me=(we=this[je]).update,Et.push(Xt=[]),Xt.parentNode=we.parentNode;for(var Cr=-1,Sr=we.length;++Cr<Sr;)(Ve=we[Cr])?(Xt.push(me[Cr]=fe=gt.call(we.parentNode,Ve.__data__,Cr,je)),fe.__data__=Ve.__data__):Xt.push(null)}return ot(Et)},ue.insert=function(gt,Et){return arguments.length<2&&(Et=Me(this)),J.insert.call(this,gt,Et)};function Me(gt){var Et,Xt;return function(fe,me,we){var Ve=gt[we].update,je=Ve.length,or;for(we!=Xt&&(Xt=we,Et=0),me>=Et&&(Et=me+1);!(or=Ve[Et])&&++Et<je;);return or}}u.select=function(gt){var Et;return typeof gt=="string"?(Et=[X(gt,A)],Et.parentNode=A.documentElement):(Et=[gt],Et.parentNode=t(gt)),ot([Et])},u.selectAll=function(gt){var Et;return typeof gt=="string"?(Et=E(Q(gt,A)),Et.parentNode=A.documentElement):(Et=E(gt),Et.parentNode=null),ot([Et])},J.on=function(gt,Et,Xt){var fe=arguments.length;if(fe<3){if(typeof gt!="string"){fe<2&&(Et=!1);for(Xt in gt)this.each(Ce(Xt,gt[Xt],Et));return this}if(fe<2)return(fe=this.node()["__on"+gt])&&fe._;Xt=!1}return this.each(Ce(gt,Et,Xt))};function Ce(gt,Et,Xt){var fe="__on"+gt,me=gt.indexOf("."),we=qe;me>0&&(gt=gt.slice(0,me));var Ve=We.get(gt);Ve&&(gt=Ve,we=vr);function je(){var Sr=this[fe];Sr&&(this.removeEventListener(gt,Sr,Sr.$),delete this[fe])}function or(){var Sr=we(Et,E(arguments));je.call(this),this.addEventListener(gt,this[fe]=Sr,Sr.$=Xt),Sr._=Et}function Cr(){var Sr=new RegExp("^__on([^.]+)"+u.requote(gt)+"$"),Wr;for(var an in this)if(Wr=an.match(Sr)){var on=this[an];this.removeEventListener(Wr[1],on,on.$),delete this[an]}}return me?Et?or:je:Et?N:Cr}var We=u.map({mouseenter:"mouseover",mouseleave:"mouseout"});A&&We.forEach(function(gt){"on"+gt in A&&We.remove(gt)});function qe(gt,Et){return function(Xt){var fe=u.event;u.event=Xt,Et[0]=this.__data__;try{gt.apply(this,Et)}finally{u.event=fe}}}function vr(gt,Et){var Xt=qe(gt,Et);return function(fe){var me=this,we=fe.relatedTarget;(!we||we!==me&&!(we.compareDocumentPosition(me)&8))&&Xt.call(me,fe)}}var _r,er=0;function Mr(gt){var Et=".dragsuppress-"+ ++er,Xt="click"+Et,fe=u.select(e(gt)).on("touchmove"+Et,rt).on("dragstart"+Et,rt).on("selectstart"+Et,rt);if(_r==null&&(_r="onselectstart"in gt?!1:I(gt.style,"userSelect")),_r){var me=t(gt).style,we=me[_r];me[_r]="none"}return function(Ve){if(fe.on(Et,null),_r&&(me[_r]=we),Ve){var je=function(){fe.on(Xt,null)};fe.on(Xt,function(){rt(),je()},!0),setTimeout(je,0)}}}u.mouse=function(gt){return de(gt,ct())};var Ir=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function de(gt,Et){Et.changedTouches&&(Et=Et.changedTouches[0]);var Xt=gt.ownerSVGElement||gt;if(Xt.createSVGPoint){var fe=Xt.createSVGPoint();if(Ir<0){var me=e(gt);if(me.scrollX||me.scrollY){Xt=u.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var we=Xt[0][0].getScreenCTM();Ir=!(we.f||we.e),Xt.remove()}}return Ir?(fe.x=Et.pageX,fe.y=Et.pageY):(fe.x=Et.clientX,fe.y=Et.clientY),fe=fe.matrixTransform(gt.getScreenCTM().inverse()),[fe.x,fe.y]}var Ve=gt.getBoundingClientRect();return[Et.clientX-Ve.left-gt.clientLeft,Et.clientY-Ve.top-gt.clientTop]}u.touch=function(gt,Et,Xt){if(arguments.length<3&&(Xt=Et,Et=ct().changedTouches),Et){for(var fe=0,me=Et.length,we;fe<me;++fe)if((we=Et[fe]).identifier===Xt)return de(gt,we)}},u.behavior.drag=function(){var gt=st(me,"drag","dragstart","dragend"),Et=null,Xt=we(N,u.mouse,e,"mousemove","mouseup"),fe=we(Dt,u.touch,B,"touchmove","touchend");function me(){this.on("mousedown.drag",Xt).on("touchstart.drag",fe)}function we(Ve,je,or,Cr,Sr){return function(){var Wr=this,an=u.event.target.correspondingElement||u.event.target,on=Wr.parentNode,ta=gt.of(Wr,arguments),hn=0,Bn=Ve(),Hn=".drag"+(Bn==null?"":"-"+Bn),Yn,na=u.select(or(an)).on(Cr+Hn,Wa).on(Sr+Hn,ri),_n=Mr(an),Ha=je(on,Bn);Et?(Yn=Et.apply(Wr,arguments),Yn=[Yn.x-Ha[0],Yn.y-Ha[1]]):Yn=[0,0],ta({type:"dragstart"});function Wa(){var xi=je(on,Bn),ki,zi;xi&&(ki=xi[0]-Ha[0],zi=xi[1]-Ha[1],hn|=ki|zi,Ha=xi,ta({type:"drag",x:xi[0]+Yn[0],y:xi[1]+Yn[1],dx:ki,dy:zi}))}function ri(){je(on,Bn)&&(na.on(Cr+Hn,null).on(Sr+Hn,null),_n(hn),ta({type:"dragend"}))}}}return me.origin=function(Ve){return arguments.length?(Et=Ve,me):Et},u.rebind(me,gt,"on")};function Dt(){return u.event.changedTouches[0].identifier}u.touches=function(gt,Et){return arguments.length<2&&(Et=ct().touches),Et?E(Et).map(function(Xt){var fe=de(gt,Xt);return fe.identifier=Xt.identifier,fe}):[]};var qt=1e-6,_t=qt*qt,lt=Math.PI,yt=2*lt,St=yt-qt,Ht=lt/2,Yt=lt/180,se=180/lt;function ke(gt,Et,Xt){return(Et[0]-gt[0])*(Xt[1]-gt[1])-(Et[1]-gt[1])*(Xt[0]-gt[0])}function Ee(gt){return gt>1?Ht:gt<-1?-Ht:Math.asin(gt)}function Ue(gt){return((gt=Math.exp(gt))-1/gt)/2}function ir(gt){return((gt=Math.exp(gt))+1/gt)/2}function ar(gt){return((gt=Math.exp(2*gt))-1)/(gt+1)}var Ye=Math.SQRT2,Er=2,pn=4;u.interpolateZoom=function(gt,Et){var Xt=gt[0],fe=gt[1],me=gt[2],we=Et[0],Ve=Et[1],je=Et[2],or=we-Xt,Cr=Ve-fe,Sr=or*or+Cr*Cr,Wr,an;if(Sr<_t)an=Math.log(je/me)/Ye,Wr=function(Yn){return[Xt+Yn*or,fe+Yn*Cr,me*Math.exp(Ye*Yn*an)]};else{var on=Math.sqrt(Sr),ta=(je*je-me*me+pn*Sr)/(2*me*Er*on),hn=(je*je-me*me-pn*Sr)/(2*je*Er*on),Bn=Math.log(Math.sqrt(ta*ta+1)-ta),Hn=Math.log(Math.sqrt(hn*hn+1)-hn);an=(Hn-Bn)/Ye,Wr=function(Yn){var na=Yn*an,_n=ir(Bn),Ha=me/(Er*on)*(_n*ar(Ye*na+Bn)-Ue(Bn));return[Xt+Ha*or,fe+Ha*Cr,me*_n/ir(Ye*na+Bn)]}}return Wr.duration=an*1e3,Wr},u.behavior.zoom=function(){var gt={x:0,y:0,k:1},Et,Xt,fe,me=[960,500],we=dn,Ve=250,je=0,or="mousedown.zoom",Cr="mousemove.zoom",Sr="mouseup.zoom",Wr,an="touchstart.zoom",on,ta=st(na,"zoomstart","zoom","zoomend"),hn,Bn,Hn,Yn;Zn||(Zn="onwheel"in A?(bn=function(){return-u.event.deltaY*(u.event.deltaMode?120:1)},"wheel"):"onmousewheel"in A?(bn=function(){return u.event.wheelDelta},"mousewheel"):(bn=function(){return-u.event.detail},"MozMousePixelScroll"));function na(fi){fi.on(or,Ji).on(Zn+".zoom",pl).on("dblclick.zoom",Ns).on(an,es)}na.event=function(fi){fi.each(function(){var Ao=ta.of(this,arguments),Bo=gt;Ai?u.select(this).transition().each("start.zoom",function(){gt=this.__chart__||{x:0,y:0,k:1},zi(Ao)}).tween("zoom:zoom",function(){var Ds=me[0],Ts=me[1],lu=Xt?Xt[0]:Ds/2,ps=Xt?Xt[1]:Ts/2,zs=u.interpolateZoom([(lu-gt.x)/gt.k,(ps-gt.y)/gt.k,Ds/gt.k],[(lu-Bo.x)/Bo.k,(ps-Bo.y)/Bo.k,Ds/Bo.k]);return function(Eu){var ie=zs(Eu),nr=Ds/ie[2];this.__chart__=gt={x:lu-ie[0]*nr,y:ps-ie[1]*nr,k:nr},jo(Ao)}}).each("interrupt.zoom",function(){Ii(Ao)}).each("end.zoom",function(){Ii(Ao)}):(this.__chart__=gt,zi(Ao),jo(Ao),Ii(Ao))})},na.translate=function(fi){return arguments.length?(gt={x:+fi[0],y:+fi[1],k:gt.k},ki(),na):[gt.x,gt.y]},na.scale=function(fi){return arguments.length?(gt={x:gt.x,y:gt.y,k:null},Wa(+fi),ki(),na):gt.k},na.scaleExtent=function(fi){return arguments.length?(we=fi==null?dn:[+fi[0],+fi[1]],na):we},na.center=function(fi){return arguments.length?(fe=fi&&[+fi[0],+fi[1]],na):fe},na.size=function(fi){return arguments.length?(me=fi&&[+fi[0],+fi[1]],na):me},na.duration=function(fi){return arguments.length?(Ve=+fi,na):Ve},na.x=function(fi){return arguments.length?(Bn=fi,hn=fi.copy(),gt={x:0,y:0,k:1},na):Bn},na.y=function(fi){return arguments.length?(Yn=fi,Hn=fi.copy(),gt={x:0,y:0,k:1},na):Yn};function _n(fi){return[(fi[0]-gt.x)/gt.k,(fi[1]-gt.y)/gt.k]}function Ha(fi){return[fi[0]*gt.k+gt.x,fi[1]*gt.k+gt.y]}function Wa(fi){gt.k=Math.max(we[0],Math.min(we[1],fi))}function ri(fi,Ao){Ao=Ha(Ao),gt.x+=fi[0]-Ao[0],gt.y+=fi[1]-Ao[1]}function xi(fi,Ao,Bo,Ds){fi.__chart__={x:gt.x,y:gt.y,k:gt.k},Wa(Math.pow(2,Ds)),ri(Xt=Ao,Bo),fi=u.select(fi),Ve>0&&(fi=fi.transition().duration(Ve)),fi.call(na.event)}function ki(){Bn&&Bn.domain(hn.range().map(function(fi){return(fi-gt.x)/gt.k}).map(hn.invert)),Yn&&Yn.domain(Hn.range().map(function(fi){return(fi-gt.y)/gt.k}).map(Hn.invert))}function zi(fi){je++||fi({type:"zoomstart"})}function jo(fi){ki(),fi({type:"zoom",scale:gt.k,translate:[gt.x,gt.y]})}function Ii(fi){--je||(fi({type:"zoomend"}),Xt=null)}function Ji(){var fi=this,Ao=ta.of(fi,arguments),Bo=0,Ds=u.select(e(fi)).on(Cr,ps).on(Sr,zs),Ts=_n(u.mouse(fi)),lu=Mr(fi);Jn.call(fi),zi(Ao);function ps(){Bo=1,ri(u.mouse(fi),Ts),jo(Ao)}function zs(){Ds.on(Cr,null).on(Sr,null),lu(Bo),Ii(Ao)}}function es(){var fi=this,Ao=ta.of(fi,arguments),Bo={},Ds=0,Ts,lu=".zoom-"+u.event.changedTouches[0].identifier,ps="touchmove"+lu,zs="touchend"+lu,Eu=[],ie=u.select(fi),nr=Mr(fi);sn(),zi(Ao),ie.on(or,null).on(an,sn);function cr(){var qr=u.touches(fi);return Ts=gt.k,qr.forEach(function(Sn){Sn.identifier in Bo&&(Bo[Sn.identifier]=_n(Sn))}),qr}function sn(){var qr=u.event.target;u.select(qr).on(ps,zn).on(zs,Tn),Eu.push(qr);for(var Sn=u.event.changedTouches,sa=0,ea=Sn.length;sa<ea;++sa)Bo[Sn[sa].identifier]=null;var ka=cr(),Ka=Date.now();if(ka.length===1){if(Ka-on<500){var Va=ka[0];xi(fi,Va,Bo[Va.identifier],Math.floor(Math.log(gt.k)/Math.LN2)+1),rt()}on=Ka}else if(ka.length>1){var Va=ka[0],fa=ka[1],Un=Va[0]-fa[0],Nr=Va[1]-fa[1];Ds=Un*Un+Nr*Nr}}function zn(){var qr=u.touches(fi),Sn,sa,ea,ka;Jn.call(fi);for(var Ka=0,Va=qr.length;Ka<Va;++Ka,ka=null)if(ea=qr[Ka],ka=Bo[ea.identifier]){if(sa)break;Sn=ea,sa=ka}if(ka){var fa=(fa=ea[0]-Sn[0])*fa+(fa=ea[1]-Sn[1])*fa,Un=Ds&&Math.sqrt(fa/Ds);Sn=[(Sn[0]+ea[0])/2,(Sn[1]+ea[1])/2],sa=[(sa[0]+ka[0])/2,(sa[1]+ka[1])/2],Wa(Un*Ts)}on=null,ri(Sn,sa),jo(Ao)}function Tn(){if(u.event.touches.length){for(var qr=u.event.changedTouches,Sn=0,sa=qr.length;Sn<sa;++Sn)delete Bo[qr[Sn].identifier];for(var ea in Bo)return void cr()}u.selectAll(Eu).on(lu,null),ie.on(or,Ji).on(an,es),nr(),Ii(Ao)}}function pl(){var fi=ta.of(this,arguments);Wr?clearTimeout(Wr):(Jn.call(this),Et=_n(Xt=fe||u.mouse(this)),zi(fi)),Wr=setTimeout(function(){Wr=null,Ii(fi)},50),rt(),Wa(Math.pow(2,bn()*.002)*gt.k),ri(Xt,Et),jo(fi)}function Ns(){var fi=u.mouse(this),Ao=Math.log(gt.k)/Math.LN2;xi(this,fi,_n(fi),u.event.shiftKey?Math.ceil(Ao)-1:Math.floor(Ao)+1)}return u.rebind(na,ta,"on")};var dn=[0,1/0],bn,Zn;u.color=En;function En(){}En.prototype.toString=function(){return this.rgb()+""},u.hsl=gn;function gn(gt,Et,Xt){return this instanceof gn?(this.h=+gt,this.s=+Et,void(this.l=+Xt)):arguments.length<2?gt instanceof gn?new gn(gt.h,gt.s,gt.l):br(""+gt,Tr,gn):new gn(gt,Et,Xt)}var da=gn.prototype=new En;da.brighter=function(gt){return gt=Math.pow(.7,arguments.length?gt:1),new gn(this.h,this.s,this.l/gt)},da.darker=function(gt){return gt=Math.pow(.7,arguments.length?gt:1),new gn(this.h,this.s,gt*this.l)},da.rgb=function(){return ra(this.h,this.s,this.l)};function ra(gt,Et,Xt){var fe,me;gt=isNaN(gt)?0:(gt%=360)<0?gt+360:gt,Et=isNaN(Et)||Et<0?0:Et>1?1:Et,Xt=Xt<0?0:Xt>1?1:Xt,me=Xt<=.5?Xt*(1+Et):Xt+Et-Xt*Et,fe=2*Xt-me;function we(je){return je>360?je-=360:je<0&&(je+=360),je<60?fe+(me-fe)*je/60:je<180?me:je<240?fe+(me-fe)*(240-je)/60:fe}function Ve(je){return Math.round(we(je)*255)}return new Fa(Ve(gt+120),Ve(gt),Ve(gt-120))}u.hcl=Se;function Se(gt,Et,Xt){return this instanceof Se?(this.h=+gt,this.c=+Et,void(this.l=+Xt)):arguments.length<2?gt instanceof Se?new Se(gt.h,gt.c,gt.l):gt instanceof tr?Kn(gt.l,gt.a,gt.b):Kn((gt=mr((gt=u.rgb(gt)).r,gt.g,gt.b)).l,gt.a,gt.b):new Se(gt,Et,Xt)}var Re=Se.prototype=new En;Re.brighter=function(gt){return new Se(this.h,this.c,Math.min(100,this.l+zr*(arguments.length?gt:1)))},Re.darker=function(gt){return new Se(this.h,this.c,Math.max(0,this.l-zr*(arguments.length?gt:1)))},Re.rgb=function(){return Ze(this.h,this.c,this.l).rgb()};function Ze(gt,Et,Xt){return isNaN(gt)&&(gt=0),isNaN(Et)&&(Et=0),new tr(Xt,Math.cos(gt*=Yt)*Et,Math.sin(gt)*Et)}u.lab=tr;function tr(gt,Et,Xt){return this instanceof tr?(this.l=+gt,this.a=+Et,void(this.b=+Xt)):arguments.length<2?gt instanceof tr?new tr(gt.l,gt.a,gt.b):gt instanceof Se?Ze(gt.h,gt.c,gt.l):mr((gt=Fa(gt)).r,gt.g,gt.b):new tr(gt,Et,Xt)}var zr=18,tn=.95047,Yr=1,$r=1.08883,In=tr.prototype=new En;In.brighter=function(gt){return new tr(Math.min(100,this.l+zr*(arguments.length?gt:1)),this.a,this.b)},In.darker=function(gt){return new tr(Math.max(0,this.l-zr*(arguments.length?gt:1)),this.a,this.b)},In.rgb=function(){return Nn(this.l,this.a,this.b)};function Nn(gt,Et,Xt){var fe=(gt+16)/116,me=fe+Et/500,we=fe-Xt/200;return me=$n(me)*tn,fe=$n(fe)*Yr,we=$n(we)*$r,new Fa(Cn(3.2404542*me-1.5371385*fe-.4985314*we),Cn(-.969266*me+1.8760108*fe+.041556*we),Cn(.0556434*me-.2040259*fe+1.0572252*we))}function Kn(gt,Et,Xt){return gt>0?new Se(Math.atan2(Xt,Et)*se,Math.sqrt(Et*Et+Xt*Xt),gt):new Se(NaN,NaN,gt)}function $n(gt){return gt>.206893034?gt*gt*gt:(gt-4/29)/7.787037}function ia(gt){return gt>.008856?Math.pow(gt,1/3):7.787037*gt+4/29}function Cn(gt){return Math.round(255*(gt<=.00304?12.92*gt:1.055*Math.pow(gt,1/2.4)-.055))}u.rgb=Fa;function Fa(gt,Et,Xt){return this instanceof Fa?(this.r=~~gt,this.g=~~Et,void(this.b=~~Xt)):arguments.length<2?gt instanceof Fa?new Fa(gt.r,gt.g,gt.b):br(""+gt,Fa,ra):new Fa(gt,Et,Xt)}function Ga(gt){return new Fa(gt>>16,gt>>8&255,gt&255)}function ve(gt){return Ga(gt)+""}var ge=Fa.prototype=new En;ge.brighter=function(gt){gt=Math.pow(.7,arguments.length?gt:1);var Et=this.r,Xt=this.g,fe=this.b,me=30;return!Et&&!Xt&&!fe?new Fa(me,me,me):(Et&&Et<me&&(Et=me),Xt&&Xt<me&&(Xt=me),fe&&fe<me&&(fe=me),new Fa(Math.min(255,Et/gt),Math.min(255,Xt/gt),Math.min(255,fe/gt)))},ge.darker=function(gt){return gt=Math.pow(.7,arguments.length?gt:1),new Fa(gt*this.r,gt*this.g,gt*this.b)},ge.hsl=function(){return Tr(this.r,this.g,this.b)},ge.toString=function(){return"#"+dr(this.r)+dr(this.g)+dr(this.b)};function dr(gt){return gt<16?"0"+Math.max(0,gt).toString(16):Math.min(255,gt).toString(16)}function br(gt,Et,Xt){var fe=0,me=0,we=0,Ve,je,or;if(Ve=/([a-z]+)\((.*)\)/.exec(gt=gt.toLowerCase()),Ve)switch(je=Ve[2].split(","),Ve[1]){case"hsl":return Xt(parseFloat(je[0]),parseFloat(je[1])/100,parseFloat(je[2])/100);case"rgb":return Et(Ur(je[0]),Ur(je[1]),Ur(je[2]))}return(or=Or.get(gt))?Et(or.r,or.g,or.b):(gt!=null&&gt.charAt(0)==="#"&&!isNaN(or=parseInt(gt.slice(1),16))&&(gt.length===4?(fe=(or&3840)>>4,fe=fe>>4|fe,me=or&240,me=me>>4|me,we=or&15,we=we<<4|we):gt.length===7&&(fe=(or&16711680)>>16,me=(or&65280)>>8,we=or&255)),Et(fe,me,we))}function Tr(gt,Et,Xt){var fe=Math.min(gt/=255,Et/=255,Xt/=255),me=Math.max(gt,Et,Xt),we=me-fe,Ve,je,or=(me+fe)/2;return we?(je=or<.5?we/(me+fe):we/(2-me-fe),gt==me?Ve=(Et-Xt)/we+(Et<Xt?6:0):Et==me?Ve=(Xt-gt)/we+2:Ve=(gt-Et)/we+4,Ve*=60):(Ve=NaN,je=or>0&&or<1?0:Ve),new gn(Ve,je,or)}function mr(gt,Et,Xt){gt=kr(gt),Et=kr(Et),Xt=kr(Xt);var fe=ia((.4124564*gt+.3575761*Et+.1804375*Xt)/tn),me=ia((.2126729*gt+.7151522*Et+.072175*Xt)/Yr),we=ia((.0193339*gt+.119192*Et+.9503041*Xt)/$r);return tr(116*me-16,500*(fe-me),200*(me-we))}function kr(gt){return(gt/=255)<=.04045?gt/12.92:Math.pow((gt+.055)/1.055,2.4)}function Ur(gt){var Et=parseFloat(gt);return gt.charAt(gt.length-1)==="%"?Math.round(Et*2.55):Et}var Or=u.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});Or.forEach(function(gt,Et){Or.set(gt,Ga(Et))});function pe(gt){return typeof gt=="function"?gt:function(){return gt}}u.functor=pe,u.xhr=Ke(B);function Ke(gt){return function(Et,Xt,fe){return arguments.length===2&&typeof Xt=="function"&&(fe=Xt,Xt=null),xr(Et,Xt,gt,fe)}}function xr(gt,Et,Xt,fe){var me={},we=u.dispatch("beforesend","progress","load","error"),Ve={},je=new XMLHttpRequest,or=null;self.XDomainRequest&&!("withCredentials"in je)&&/^(http(s)?:)?\/\//.test(gt)&&(je=new XDomainRequest),"onload"in je?je.onload=je.onerror=Cr:je.onreadystatechange=function(){je.readyState>3&&Cr()};function Cr(){var Sr=je.status,Wr;if(!Sr&&ln(je)||Sr>=200&&Sr<300||Sr===304){try{Wr=Xt.call(me,je)}catch(an){we.error.call(me,an);return}we.load.call(me,Wr)}else we.error.call(me,je)}return je.onprogress=function(Sr){var Wr=u.event;u.event=Sr;try{we.progress.call(me,je)}finally{u.event=Wr}},me.header=function(Sr,Wr){return Sr=(Sr+"").toLowerCase(),arguments.length<2?Ve[Sr]:(Wr==null?delete Ve[Sr]:Ve[Sr]=Wr+"",me)},me.mimeType=function(Sr){return arguments.length?(Et=Sr==null?null:Sr+"",me):Et},me.responseType=function(Sr){return arguments.length?(or=Sr,me):or},me.response=function(Sr){return Xt=Sr,me},["get","post"].forEach(function(Sr){me[Sr]=function(){return me.send.apply(me,[Sr].concat(E(arguments)))}}),me.send=function(Sr,Wr,an){if(arguments.length===2&&typeof Wr=="function"&&(an=Wr,Wr=null),je.open(Sr,gt,!0),Et!=null&&!("accept"in Ve)&&(Ve.accept=Et+",*/*"),je.setRequestHeader)for(var on in Ve)je.setRequestHeader(on,Ve[on]);return Et!=null&&je.overrideMimeType&&je.overrideMimeType(Et),or!=null&&(je.responseType=or),an!=null&&me.on("error",an).on("load",function(ta){an(null,ta)}),we.beforesend.call(me,je),je.send(Wr??null),me},me.abort=function(){return je.abort(),me},u.rebind(me,we,"on"),fe==null?me:me.get(Gr(fe))}function Gr(gt){return gt.length===1?function(Et,Xt){gt(Et==null?Xt:null)}:gt}function ln(gt){var Et=gt.responseType;return Et&&Et!=="text"?gt.response:gt.responseText}u.dsv=function(gt,Et){var Xt=new RegExp('["'+gt+`
]`),fe=gt.charCodeAt(0);function me(Cr,Sr,Wr){arguments.length<3&&(Wr=Sr,Sr=null);var an=xr(Cr,Et,Sr==null?we:Ve(Sr),Wr);return an.row=function(on){return arguments.length?an.response((Sr=on)==null?we:Ve(on)):Sr},an}function we(Cr){return me.parse(Cr.responseText)}function Ve(Cr){return function(Sr){return me.parse(Sr.responseText,Cr)}}me.parse=function(Cr,Sr){var Wr;return me.parseRows(Cr,function(an,on){if(Wr)return Wr(an,on-1);var ta=function(hn){for(var Bn={},Hn=an.length,Yn=0;Yn<Hn;++Yn)Bn[an[Yn]]=hn[Yn];return Bn};Wr=Sr?function(hn,Bn){return Sr(ta(hn),Bn)}:ta})},me.parseRows=function(Cr,Sr){var Wr={},an={},on=[],ta=Cr.length,hn=0,Bn=0,Hn,Yn;function na(){if(hn>=ta)return an;if(Yn)return Yn=!1,Wr;var Ha=hn;if(Cr.charCodeAt(Ha)===34){for(var Wa=Ha;Wa++<ta;)if(Cr.charCodeAt(Wa)===34){if(Cr.charCodeAt(Wa+1)!==34)break;++Wa}hn=Wa+2;var ri=Cr.charCodeAt(Wa+1);return ri===13?(Yn=!0,Cr.charCodeAt(Wa+2)===10&&++hn):ri===10&&(Yn=!0),Cr.slice(Ha+1,Wa).replace(/""/g,'"')}for(;hn<ta;){var ri=Cr.charCodeAt(hn++),xi=1;if(ri===10)Yn=!0;else if(ri===13)Yn=!0,Cr.charCodeAt(hn)===10&&(++hn,++xi);else if(ri!==fe)continue;return Cr.slice(Ha,hn-xi)}return Cr.slice(Ha)}for(;(Hn=na())!==an;){for(var _n=[];Hn!==Wr&&Hn!==an;)_n.push(Hn),Hn=na();Sr&&(_n=Sr(_n,Bn++))==null||on.push(_n)}return on},me.format=function(Cr){if(Array.isArray(Cr[0]))return me.formatRows(Cr);var Sr=new D,Wr=[];return Cr.forEach(function(an){for(var on in an)Sr.has(on)||Wr.push(Sr.add(on))}),[Wr.map(or).join(gt)].concat(Cr.map(function(an){return Wr.map(function(on){return or(an[on])}).join(gt)})).join(`
`)},me.formatRows=function(Cr){return Cr.map(je).join(`
`)};function je(Cr){return Cr.map(or).join(gt)}function or(Cr){return Xt.test(Cr)?'"'+Cr.replace(/\"/g,'""')+'"':Cr}return me},u.csv=u.dsv(",","text/csv"),u.tsv=u.dsv(" ","text/tab-separated-values");var wn,rn,Qr,vn,Oa=this[I(this,"requestAnimationFrame")]||function(gt){setTimeout(gt,17)};u.timer=function(){Qn.apply(this,arguments)};function Qn(gt,Et,Xt){var fe=arguments.length;fe<2&&(Et=0),fe<3&&(Xt=Date.now());var me=Xt+Et,we={c:gt,t:me,n:null};return rn?rn.n=we:wn=we,rn=we,Qr||(vn=clearTimeout(vn),Qr=1,Oa(Qa)),we}function Qa(){var gt=Ja(),Et=wi()-gt;Et>24?(isFinite(Et)&&(clearTimeout(vn),vn=setTimeout(Qa,Et)),Qr=0):(Qr=1,Oa(Qa))}u.timer.flush=function(){Ja(),wi()};function Ja(){for(var gt=Date.now(),Et=wn;Et;)gt>=Et.t&&Et.c(gt-Et.t)&&(Et.c=null),Et=Et.n;return gt}function wi(){for(var gt,Et=wn,Xt=1/0;Et;)Et.c?(Et.t<Xt&&(Xt=Et.t),Et=(gt=Et).n):Et=gt?gt.n=Et.n:wn=Et.n;return rn=gt,Xt}u.round=function(gt,Et){return Et?Math.round(gt*(Et=Math.pow(10,Et)))/Et:Math.round(gt)},u.geom={};function ci(gt){return gt[0]}function Ti(gt){return gt[1]}u.geom.hull=function(gt){var Et=ci,Xt=Ti;if(arguments.length)return fe(gt);function fe(me){if(me.length<3)return[];var we=pe(Et),Ve=pe(Xt),je,or=me.length,Cr=[],Sr=[];for(je=0;je<or;je++)Cr.push([+we.call(this,me[je],je),+Ve.call(this,me[je],je),je]);for(Cr.sort(Qi),je=0;je<or;je++)Sr.push([Cr[je][0],-Cr[je][1]]);var Wr=Ra(Cr),an=Ra(Sr),on=an[0]===Wr[0],ta=an[an.length-1]===Wr[Wr.length-1],hn=[];for(je=Wr.length-1;je>=0;--je)hn.push(me[Cr[Wr[je]][2]]);for(je=+on;je<an.length-ta;++je)hn.push(me[Cr[an[je]][2]]);return hn}return fe.x=function(me){return arguments.length?(Et=me,fe):Et},fe.y=function(me){return arguments.length?(Xt=me,fe):Xt},fe};function Ra(gt){for(var Et=gt.length,Xt=[0,1],fe=2,me=2;me<Et;me++){for(;fe>1&&ke(gt[Xt[fe-2]],gt[Xt[fe-1]],gt[me])<=0;)--fe;Xt[fe++]=me}return Xt.slice(0,fe)}function Qi(gt,Et){return gt[0]-Et[0]||gt[1]-Et[1]}u.geom.polygon=function(gt){return K(gt,Hi),gt};var Hi=u.geom.polygon.prototype=[];Hi.area=function(){for(var gt=-1,Et=this.length,Xt,fe=this[Et-1],me=0;++gt<Et;)Xt=fe,fe=this[gt],me+=Xt[1]*fe[0]-Xt[0]*fe[1];return me*.5},Hi.centroid=function(gt){var Et=-1,Xt=this.length,fe=0,me=0,we,Ve=this[Xt-1],je;for(arguments.length||(gt=-1/(6*this.area()));++Et<Xt;)we=Ve,Ve=this[Et],je=we[0]*Ve[1]-Ve[0]*we[1],fe+=(we[0]+Ve[0])*je,me+=(we[1]+Ve[1])*je;return[fe*gt,me*gt]},Hi.clip=function(gt){for(var Et,Xt=zo(gt),fe=-1,me=this.length-zo(this),we,Ve,je=this[me-1],or,Cr,Sr;++fe<me;){for(Et=gt.slice(),gt.length=0,or=this[fe],Cr=Et[(Ve=Et.length-Xt)-1],we=-1;++we<Ve;)Sr=Et[we],Ho(Sr,je,or)?(Ho(Cr,je,or)||gt.push(Ci(Cr,Sr,je,or)),gt.push(Sr)):Ho(Cr,je,or)&&gt.push(Ci(Cr,Sr,je,or)),Cr=Sr;Xt&&gt.push(gt[0]),je=or}return gt};function Ho(gt,Et,Xt){return(Xt[0]-Et[0])*(gt[1]-Et[1])<(Xt[1]-Et[1])*(gt[0]-Et[0])}function Ci(gt,Et,Xt,fe){var me=gt[0],we=Xt[0],Ve=Et[0]-me,je=fe[0]-we,or=gt[1],Cr=Xt[1],Sr=Et[1]-or,Wr=fe[1]-Cr,an=(je*(or-Cr)-Wr*(me-we))/(Wr*Ve-je*Sr);return[me+an*Ve,or+an*Sr]}function zo(gt){var Et=gt[0],Xt=gt[gt.length-1];return!(Et[0]-Xt[0]||Et[1]-Xt[1])}var qi,qo,Po,hs=[],Gi,uo,yi=[];function ao(){Jo(this),this.edge=this.site=this.circle=null}function ts(gt){var Et=hs.pop()||new ao;return Et.site=gt,Et}function vs(gt){is(gt),Po.remove(gt),hs.push(gt),Jo(gt)}function As(gt){var Et=gt.circle,Xt=Et.x,fe=Et.cy,me={x:Xt,y:fe},we=gt.P,Ve=gt.N,je=[gt];vs(gt);for(var or=we;or.circle&&l(Xt-or.circle.x)<qt&&l(fe-or.circle.cy)<qt;)we=or.P,je.unshift(or),vs(or),or=we;je.unshift(or),is(or);for(var Cr=Ve;Cr.circle&&l(Xt-Cr.circle.x)<qt&&l(fe-Cr.circle.cy)<qt;)Ve=Cr.N,je.push(Cr),vs(Cr),Cr=Ve;je.push(Cr),is(Cr);var Sr=je.length,Wr;for(Wr=1;Wr<Sr;++Wr)Cr=je[Wr],or=je[Wr-1],Bi(Cr.edge,or.site,Cr.site,me);or=je[0],Cr=je[Sr-1],Cr.edge=Is(or.site,Cr.site,null,me),No(or),No(Cr)}function _o(gt){for(var Et=gt.x,Xt=gt.y,fe,me,we,Ve,je=Po._;je;)if(we=Da(je,Xt)-Et,we>qt)je=je.L;else if(Ve=Et-li(je,Xt),Ve>qt){if(!je.R){fe=je;break}je=je.R}else{we>-qt?(fe=je.P,me=je):Ve>-qt?(fe=je,me=je.N):fe=me=je;break}var or=ts(gt);if(Po.insert(fe,or),!(!fe&&!me)){if(fe===me){is(fe),me=ts(fe.site),Po.insert(or,me),or.edge=me.edge=Is(fe.site,or.site),No(fe),No(me);return}if(!me){or.edge=Is(fe.site,or.site);return}is(fe),is(me);var Cr=fe.site,Sr=Cr.x,Wr=Cr.y,an=gt.x-Sr,on=gt.y-Wr,ta=me.site,hn=ta.x-Sr,Bn=ta.y-Wr,Hn=2*(an*Bn-on*hn),Yn=an*an+on*on,na=hn*hn+Bn*Bn,_n={x:(Bn*Yn-on*na)/Hn+Sr,y:(an*na-hn*Yn)/Hn+Wr};Bi(me.edge,Cr,ta,_n),or.edge=Is(Cr,gt,null,_n),me.edge=Is(gt,ta,null,_n),No(fe),No(me)}}function Da(gt,Et){var Xt=gt.site,fe=Xt.x,me=Xt.y,we=me-Et;if(!we)return fe;var Ve=gt.P;if(!Ve)return-1/0;Xt=Ve.site;var je=Xt.x,or=Xt.y,Cr=or-Et;if(!Cr)return je;var Sr=je-fe,Wr=1/we-1/Cr,an=Sr/Cr;return Wr?(-an+Math.sqrt(an*an-2*Wr*(Sr*Sr/(-2*Cr)-or+Cr/2+me-we/2)))/Wr+fe:(fe+je)/2}function li(gt,Et){var Xt=gt.N;if(Xt)return Da(Xt,Et);var fe=gt.site;return fe.y===Et?fe.x:1/0}function wo(gt){this.site=gt,this.edges=[]}wo.prototype.prepare=function(){for(var gt=this.edges,Et=gt.length,Xt;Et--;)Xt=gt[Et].edge,(!Xt.b||!Xt.a)&&gt.splice(Et,1);return gt.sort(Di),gt.length};function Ms(gt){for(var Et=gt[0][0],Xt=gt[1][0],fe=gt[0][1],me=gt[1][1],we,Ve,je,or,Cr=qo,Sr=Cr.length,Wr,an,on,ta,hn,Bn;Sr--;)if(Wr=Cr[Sr],!(!Wr||!Wr.prepare()))for(on=Wr.edges,ta=on.length,an=0;an<ta;)Bn=on[an].end(),je=Bn.x,or=Bn.y,hn=on[++an%ta].start(),we=hn.x,Ve=hn.y,(l(je-we)>qt||l(or-Ve)>qt)&&(on.splice(an,0,new $s(Wo(Wr.site,Bn,l(je-Et)<qt&&me-or>qt?{x:Et,y:l(we-Et)<qt?Ve:me}:l(or-me)<qt&&Xt-je>qt?{x:l(Ve-me)<qt?we:Xt,y:me}:l(je-Xt)<qt&&or-fe>qt?{x:Xt,y:l(we-Xt)<qt?Ve:fe}:l(or-fe)<qt&&je-Et>qt?{x:l(Ve-fe)<qt?we:Et,y:fe}:null),Wr.site,null)),++ta)}function Di(gt,Et){return Et.angle-gt.angle}function _s(){Jo(this),this.x=this.y=this.arc=this.site=this.cy=null}function No(gt){var Et=gt.P,Xt=gt.N;if(!(!Et||!Xt)){var fe=Et.site,me=gt.site,we=Xt.site;if(fe!==we){var Ve=me.x,je=me.y,or=fe.x-Ve,Cr=fe.y-je,Sr=we.x-Ve,Wr=we.y-je,an=2*(or*Wr-Cr*Sr);if(!(an>=-_t)){var on=or*or+Cr*Cr,ta=Sr*Sr+Wr*Wr,hn=(Wr*on-Cr*ta)/an,Bn=(or*ta-Sr*on)/an,Wr=Bn+je,Hn=yi.pop()||new _s;Hn.arc=gt,Hn.site=me,Hn.x=hn+Ve,Hn.y=Wr+Math.sqrt(hn*hn+Bn*Bn),Hn.cy=Wr,gt.circle=Hn;for(var Yn=null,na=uo._;na;)if(Hn.y<na.y||Hn.y===na.y&&Hn.x<=na.x)if(na.L)na=na.L;else{Yn=na.P;break}else if(na.R)na=na.R;else{Yn=na;break}uo.insert(Yn,Hn),Yn||(Gi=Hn)}}}}function is(gt){var Et=gt.circle;Et&&(Et.P||(Gi=Et.N),uo.remove(Et),yi.push(Et),Jo(Et),gt.circle=null)}function al(gt,Et,Xt,fe){return function(me){var we=me.a,Ve=me.b,je=we.x,or=we.y,Cr=Ve.x,Sr=Ve.y,Wr=0,an=1,on=Cr-je,ta=Sr-or,hn;if(hn=gt-je,!(!on&&hn>0)){if(hn/=on,on<0){if(hn<Wr)return;hn<an&&(an=hn)}else if(on>0){if(hn>an)return;hn>Wr&&(Wr=hn)}if(hn=Xt-je,!(!on&&hn<0)){if(hn/=on,on<0){if(hn>an)return;hn>Wr&&(Wr=hn)}else if(on>0){if(hn<Wr)return;hn<an&&(an=hn)}if(hn=Et-or,!(!ta&&hn>0)){if(hn/=ta,ta<0){if(hn<Wr)return;hn<an&&(an=hn)}else if(ta>0){if(hn>an)return;hn>Wr&&(Wr=hn)}if(hn=fe-or,!(!ta&&hn<0)){if(hn/=ta,ta<0){if(hn>an)return;hn>Wr&&(Wr=hn)}else if(ta>0){if(hn<Wr)return;hn<an&&(an=hn)}return Wr>0&&(me.a={x:je+Wr*on,y:or+Wr*ta}),an<1&&(me.b={x:je+an*on,y:or+an*ta}),me}}}}}}function ii(gt){for(var Et=qi,Xt=al(gt[0][0],gt[0][1],gt[1][0],gt[1][1]),fe=Et.length,me;fe--;)me=Et[fe],(!io(me,gt)||!Xt(me)||l(me.a.x-me.b.x)<qt&&l(me.a.y-me.b.y)<qt)&&(me.a=me.b=null,Et.splice(fe,1))}function io(gt,Et){var Xt=gt.b;if(Xt)return!0;var fe=gt.a,me=Et[0][0],we=Et[1][0],Ve=Et[0][1],je=Et[1][1],or=gt.l,Cr=gt.r,Sr=or.x,Wr=or.y,an=Cr.x,on=Cr.y,ta=(Sr+an)/2,hn=(Wr+on)/2,Bn,Hn;if(on===Wr){if(ta<me||ta>=we)return;if(Sr>an){if(!fe)fe={x:ta,y:Ve};else if(fe.y>=je)return;Xt={x:ta,y:je}}else{if(!fe)fe={x:ta,y:je};else if(fe.y<Ve)return;Xt={x:ta,y:Ve}}}else if(Bn=(Sr-an)/(on-Wr),Hn=hn-Bn*ta,Bn<-1||Bn>1)if(Sr>an){if(!fe)fe={x:(Ve-Hn)/Bn,y:Ve};else if(fe.y>=je)return;Xt={x:(je-Hn)/Bn,y:je}}else{if(!fe)fe={x:(je-Hn)/Bn,y:je};else if(fe.y<Ve)return;Xt={x:(Ve-Hn)/Bn,y:Ve}}else if(Wr<on){if(!fe)fe={x:me,y:Bn*me+Hn};else if(fe.x>=we)return;Xt={x:we,y:Bn*we+Hn}}else{if(!fe)fe={x:we,y:Bn*we+Hn};else if(fe.x<me)return;Xt={x:me,y:Bn*me+Hn}}return gt.a=fe,gt.b=Xt,!0}function co(gt,Et){this.l=gt,this.r=Et,this.a=this.b=null}function Is(gt,Et,Xt,fe){var me=new co(gt,Et);return qi.push(me),Xt&&Bi(me,gt,Et,Xt),fe&&Bi(me,Et,gt,fe),qo[gt.i].edges.push(new $s(me,gt,Et)),qo[Et.i].edges.push(new $s(me,Et,gt)),me}function Wo(gt,Et,Xt){var fe=new co(gt,null);return fe.a=Et,fe.b=Xt,qi.push(fe),fe}function Bi(gt,Et,Xt,fe){!gt.a&&!gt.b?(gt.a=fe,gt.l=Et,gt.r=Xt):gt.l===Xt?gt.b=fe:gt.a=fe}function $s(gt,Et,Xt){var fe=gt.a,me=gt.b;this.edge=gt,this.site=Et,this.angle=Xt?Math.atan2(Xt.y-Et.y,Xt.x-Et.x):gt.l===Et?Math.atan2(me.x-fe.x,fe.y-me.y):Math.atan2(fe.x-me.x,me.y-fe.y)}$s.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 fl(){this._=null}function Jo(gt){gt.U=gt.C=gt.L=gt.R=gt.P=gt.N=null}fl.prototype={insert:function(gt,Et){var Xt,fe,me;if(gt){if(Et.P=gt,Et.N=gt.N,gt.N&&(gt.N.P=Et),gt.N=Et,gt.R){for(gt=gt.R;gt.L;)gt=gt.L;gt.L=Et}else gt.R=Et;Xt=gt}else this._?(gt=Ls(this._),Et.P=null,Et.N=gt,gt.P=gt.L=Et,Xt=gt):(Et.P=Et.N=null,this._=Et,Xt=null);for(Et.L=Et.R=null,Et.U=Xt,Et.C=!0,gt=Et;Xt&&Xt.C;)fe=Xt.U,Xt===fe.L?(me=fe.R,me&&me.C?(Xt.C=me.C=!1,fe.C=!0,gt=fe):(gt===Xt.R&&(us(this,Xt),gt=Xt,Xt=gt.U),Xt.C=!1,fe.C=!0,Ss(this,fe))):(me=fe.L,me&&me.C?(Xt.C=me.C=!1,fe.C=!0,gt=fe):(gt===Xt.L&&(Ss(this,Xt),gt=Xt,Xt=gt.U),Xt.C=!1,fe.C=!0,us(this,fe))),Xt=gt.U;this._.C=!1},remove:function(gt){gt.N&&(gt.N.P=gt.P),gt.P&&(gt.P.N=gt.N),gt.N=gt.P=null;var Et=gt.U,Xt,fe=gt.L,me=gt.R,we,Ve;if(fe?me?we=Ls(me):we=fe:we=me,Et?Et.L===gt?Et.L=we:Et.R=we:this._=we,fe&&me?(Ve=we.C,we.C=gt.C,we.L=fe,fe.U=we,we!==me?(Et=we.U,we.U=gt.U,gt=we.R,Et.L=gt,we.R=me,me.U=we):(we.U=Et,Et=we,gt=we.R)):(Ve=gt.C,gt=we),gt&&(gt.U=Et),!Ve){if(gt&&gt.C){gt.C=!1;return}do{if(gt===this._)break;if(gt===Et.L){if(Xt=Et.R,Xt.C&&(Xt.C=!1,Et.C=!0,us(this,Et),Xt=Et.R),Xt.L&&Xt.L.C||Xt.R&&Xt.R.C){(!Xt.R||!Xt.R.C)&&(Xt.L.C=!1,Xt.C=!0,Ss(this,Xt),Xt=Et.R),Xt.C=Et.C,Et.C=Xt.R.C=!1,us(this,Et),gt=this._;break}}else if(Xt=Et.L,Xt.C&&(Xt.C=!1,Et.C=!0,Ss(this,Et),Xt=Et.L),Xt.L&&Xt.L.C||Xt.R&&Xt.R.C){(!Xt.L||!Xt.L.C)&&(Xt.R.C=!1,Xt.C=!0,us(this,Xt),Xt=Et.L),Xt.C=Et.C,Et.C=Xt.L.C=!1,Ss(this,Et),gt=this._;break}Xt.C=!0,gt=Et,Et=Et.U}while(!gt.C);gt&&(gt.C=!1)}}};function us(gt,Et){var Xt=Et,fe=Et.R,me=Xt.U;me?me.L===Xt?me.L=fe:me.R=fe:gt._=fe,fe.U=me,Xt.U=fe,Xt.R=fe.L,Xt.R&&(Xt.R.U=Xt),fe.L=Xt}function Ss(gt,Et){var Xt=Et,fe=Et.L,me=Xt.U;me?me.L===Xt?me.L=fe:me.R=fe:gt._=fe,fe.U=me,Xt.U=fe,Xt.L=fe.R,Xt.L&&(Xt.L.U=Xt),fe.R=Xt}function Ls(gt){for(;gt.L;)gt=gt.L;return gt}function yl(gt,Et){var Xt=gt.sort(bu).pop(),fe,me,we;for(qi=[],qo=new Array(gt.length),Po=new fl,uo=new fl;;)if(we=Gi,Xt&&(!we||Xt.y<we.y||Xt.y===we.y&&Xt.x<we.x))(Xt.x!==fe||Xt.y!==me)&&(qo[Xt.i]=new wo(Xt),_o(Xt),fe=Xt.x,me=Xt.y),Xt=gt.pop();else if(we)As(we.arc);else break;Et&&(ii(Et),Ms(Et));var Ve={cells:qo,edges:qi};return Po=uo=qi=qo=null,Ve}function bu(gt,Et){return Et.y-gt.y||Et.x-gt.x}u.geom.voronoi=function(gt){var Et=ci,Xt=Ti,fe=Et,me=Xt,we=au;if(gt)return Ve(gt);function Ve(or){var Cr=new Array(or.length),Sr=we[0][0],Wr=we[0][1],an=we[1][0],on=we[1][1];return yl(je(or),we).cells.forEach(function(ta,hn){var Bn=ta.edges,Hn=ta.site,Yn=Cr[hn]=Bn.length?Bn.map(function(na){var _n=na.start();return[_n.x,_n.y]}):Hn.x>=Sr&&Hn.x<=an&&Hn.y>=Wr&&Hn.y<=on?[[Sr,on],[an,on],[an,Wr],[Sr,Wr]]:[];Yn.point=or[hn]}),Cr}function je(or){return or.map(function(Cr,Sr){return{x:Math.round(fe(Cr,Sr)/qt)*qt,y:Math.round(me(Cr,Sr)/qt)*qt,i:Sr}})}return Ve.links=function(or){return yl(je(or)).edges.filter(function(Cr){return Cr.l&&Cr.r}).map(function(Cr){return{source:or[Cr.l.i],target:or[Cr.r.i]}})},Ve.triangles=function(or){var Cr=[];return yl(je(or)).cells.forEach(function(Sr,Wr){for(var an=Sr.site,on=Sr.edges.sort(Di),ta=-1,hn=on.length,Bn,Hn,Yn=on[hn-1].edge,na=Yn.l===an?Yn.r:Yn.l;++ta<hn;)Bn=Yn,Hn=na,Yn=on[ta].edge,na=Yn.l===an?Yn.r:Yn.l,Wr<Hn.i&&Wr<na.i&&fu(an,Hn,na)<0&&Cr.push([or[Wr],or[Hn.i],or[na.i]])}),Cr},Ve.x=function(or){return arguments.length?(fe=pe(Et=or),Ve):Et},Ve.y=function(or){return arguments.length?(me=pe(Xt=or),Ve):Xt},Ve.clipExtent=function(or){return arguments.length?(we=or??au,Ve):we===au?null:we},Ve.size=function(or){return arguments.length?Ve.clipExtent(or&&[[0,0],or]):we===au?null:we&&we[1]},Ve};var au=[[-1e6,-1e6],[1e6,1e6]];function fu(gt,Et,Xt){return(gt.x-Xt.x)*(Et.y-gt.y)-(gt.x-Et.x)*(Xt.y-gt.y)}u.geom.delaunay=function(gt){return u.geom.voronoi().triangles(gt)},u.geom.quadtree=function(gt,Et,Xt,fe,me){var we=ci,Ve=Ti,je;if(je=arguments.length)return we=Ec,Ve=xc,je===3&&(me=Xt,fe=Et,Xt=Et=0),or(gt);function or(Cr){var Sr,Wr=pe(we),an=pe(Ve),on,ta,hn,Bn,Hn,Yn,na,_n;if(Et!=null)Hn=Et,Yn=Xt,na=fe,_n=me;else if(na=_n=-(Hn=Yn=1/0),on=[],ta=[],Bn=Cr.length,je)for(hn=0;hn<Bn;++hn)Sr=Cr[hn],Sr.x<Hn&&(Hn=Sr.x),Sr.y<Yn&&(Yn=Sr.y),Sr.x>na&&(na=Sr.x),Sr.y>_n&&(_n=Sr.y),on.push(Sr.x),ta.push(Sr.y);else for(hn=0;hn<Bn;++hn){var Ha=+Wr(Sr=Cr[hn],hn),Wa=+an(Sr,hn);Ha<Hn&&(Hn=Ha),Wa<Yn&&(Yn=Wa),Ha>na&&(na=Ha),Wa>_n&&(_n=Wa),on.push(Ha),ta.push(Wa)}var ri=na-Hn,xi=_n-Yn;ri>xi?_n=Yn+ri:na=Hn+xi;function ki(Ii,Ji,es,pl,Ns,fi,Ao,Bo){if(!(isNaN(es)||isNaN(pl)))if(Ii.leaf){var Ds=Ii.x,Ts=Ii.y;if(Ds!=null)if(l(Ds-es)+l(Ts-pl)<.01)zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo);else{var lu=Ii.point;Ii.x=Ii.y=Ii.point=null,zi(Ii,lu,Ds,Ts,Ns,fi,Ao,Bo),zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo)}else Ii.x=es,Ii.y=pl,Ii.point=Ji}else zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo)}function zi(Ii,Ji,es,pl,Ns,fi,Ao,Bo){var Ds=(Ns+Ao)*.5,Ts=(fi+Bo)*.5,lu=es>=Ds,ps=pl>=Ts,zs=ps<<1|lu;Ii.leaf=!1,Ii=Ii.nodes[zs]||(Ii.nodes[zs]=cs()),lu?Ns=Ds:Ao=Ds,ps?fi=Ts:Bo=Ts,ki(Ii,Ji,es,pl,Ns,fi,Ao,Bo)}var jo=cs();if(jo.add=function(Ii){ki(jo,Ii,+Wr(Ii,++hn),+an(Ii,hn),Hn,Yn,na,_n)},jo.visit=function(Ii){Gl(Ii,jo,Hn,Yn,na,_n)},jo.find=function(Ii){return zc(jo,Ii[0],Ii[1],Hn,Yn,na,_n)},hn=-1,Et==null){for(;++hn<Bn;)ki(jo,Cr[hn],on[hn],ta[hn],Hn,Yn,na,_n);--hn}else Cr.forEach(jo.add);return on=ta=Cr=Sr=null,jo}return or.x=function(Cr){return arguments.length?(we=Cr,or):we},or.y=function(Cr){return arguments.length?(Ve=Cr,or):Ve},or.extent=function(Cr){return arguments.length?(Cr==null?Et=Xt=fe=me=null:(Et=+Cr[0][0],Xt=+Cr[0][1],fe=+Cr[1][0],me=+Cr[1][1]),or):Et==null?null:[[Et,Xt],[fe,me]]},or.size=function(Cr){return arguments.length?(Cr==null?Et=Xt=fe=me=null:(Et=Xt=0,fe=+Cr[0],me=+Cr[1]),or):Et==null?null:[fe-Et,me-Xt]},or};function Ec(gt){return gt.x}function xc(gt){return gt.y}function cs(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function Gl(gt,Et,Xt,fe,me,we){if(!gt(Et,Xt,fe,me,we)){var Ve=(Xt+me)*.5,je=(fe+we)*.5,or=Et.nodes;or[0]&&Gl(gt,or[0],Xt,fe,Ve,je),or[1]&&Gl(gt,or[1],Ve,fe,me,je),or[2]&&Gl(gt,or[2],Xt,je,Ve,we),or[3]&&Gl(gt,or[3],Ve,je,me,we)}}function zc(gt,Et,Xt,fe,me,we,Ve){var je=1/0,or;return function Cr(Sr,Wr,an,on,ta){if(!(Wr>we||an>Ve||on<fe||ta<me)){if(hn=Sr.point){var hn,Bn=Et-Sr.x,Hn=Xt-Sr.y,Yn=Bn*Bn+Hn*Hn;if(Yn<je){var na=Math.sqrt(je=Yn);fe=Et-na,me=Xt-na,we=Et+na,Ve=Xt+na,or=hn}}for(var _n=Sr.nodes,Ha=(Wr+on)*.5,Wa=(an+ta)*.5,ri=Et>=Ha,xi=Xt>=Wa,ki=xi<<1|ri,zi=ki+4;ki<zi;++ki)if(Sr=_n[ki&3])switch(ki&3){case 0:Cr(Sr,Wr,an,Ha,Wa);break;case 1:Cr(Sr,Ha,an,on,Wa);break;case 2:Cr(Sr,Wr,Wa,Ha,ta);break;case 3:Cr(Sr,Ha,Wa,on,ta);break}}}(gt,fe,me,we,Ve),or}u.interpolateRgb=Al;function Al(gt,Et){gt=u.rgb(gt),Et=u.rgb(Et);var Xt=gt.r,fe=gt.g,me=gt.b,we=Et.r-Xt,Ve=Et.g-fe,je=Et.b-me;return function(or){return"#"+dr(Math.round(Xt+we*or))+dr(Math.round(fe+Ve*or))+dr(Math.round(me+je*or))}}u.interpolateObject=xl;function xl(gt,Et){var Xt={},fe={},me;for(me in gt)me in Et?Xt[me]=Fo(gt[me],Et[me]):fe[me]=gt[me];for(me in Et)me in gt||(fe[me]=Et[me]);return function(we){for(me in Xt)fe[me]=Xt[me](we);return fe}}u.interpolateNumber=Ml;function Ml(gt,Et){return gt=+gt,Et=+Et,function(Xt){return gt*(1-Xt)+Et*Xt}}u.interpolateString=hu;function hu(gt,Et){var Xt=Fs.lastIndex=_l.lastIndex=0,fe,me,we,Ve=-1,je=[],or=[];for(gt=gt+"",Et=Et+"";(fe=Fs.exec(gt))&&(me=_l.exec(Et));)(we=me.index)>Xt&&(we=Et.slice(Xt,we),je[Ve]?je[Ve]+=we:je[++Ve]=we),(fe=fe[0])===(me=me[0])?je[Ve]?je[Ve]+=me:je[++Ve]=me:(je[++Ve]=null,or.push({i:Ve,x:Ml(fe,me)})),Xt=_l.lastIndex;return Xt<Et.length&&(we=Et.slice(Xt),je[Ve]?je[Ve]+=we:je[++Ve]=we),je.length<2?or[0]?(Et=or[0].x,function(Cr){return Et(Cr)+""}):function(){return Et}:(Et=or.length,function(Cr){for(var Sr=0,Wr;Sr<Et;++Sr)je[(Wr=or[Sr]).i]=Wr.x(Cr);return je.join("")})}var Fs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_l=new RegExp(Fs.source,"g");u.interpolate=Fo;function Fo(gt,Et){for(var Xt=u.interpolators.length,fe;--Xt>=0&&!(fe=u.interpolators[Xt](gt,Et)););return fe}u.interpolators=[function(gt,Et){var Xt=typeof Et;return(Xt==="string"?Or.has(Et.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Et)?Al:hu:Et instanceof En?Al:Array.isArray(Et)?bs:Xt==="object"&&isNaN(Et)?xl:Ml)(gt,Et)}],u.interpolateArray=bs;function bs(gt,Et){var Xt=[],fe=[],me=gt.length,we=Et.length,Ve=Math.min(gt.length,Et.length),je;for(je=0;je<Ve;++je)Xt.push(Fo(gt[je],Et[je]));for(;je<me;++je)fe[je]=gt[je];for(;je<we;++je)fe[je]=Et[je];return function(or){for(je=0;je<Ve;++je)fe[je]=Xt[je](or);return fe}}var Iu=function(){return B},Nl=u.map({linear:Iu,poly:nc,quad:function(){return vf},cubic:function(){return os},sin:function(){return pu},exp:function(){return ml},circle:function(){return Lc},elastic:qu,back:dc,bounce:function(){return bl}}),Hu=u.map({in:B,out:of,"in-out":Oo,"out-in":function(gt){return Oo(of(gt))}});u.ease=function(gt){var Et=gt.indexOf("-"),Xt=Et>=0?gt.slice(0,Et):gt,fe=Et>=0?gt.slice(Et+1):"in";return Xt=Nl.get(Xt)||Iu,fe=Hu.get(fe)||B,qs(fe(Xt.apply(null,d.call(arguments,1))))};function qs(gt){return function(Et){return Et<=0?0:Et>=1?1:gt(Et)}}function of(gt){return function(Et){return 1-gt(1-Et)}}function Oo(gt){return function(Et){return .5*(Et<.5?gt(2*Et):2-gt(2-2*Et))}}function vf(gt){return gt*gt}function os(gt){return gt*gt*gt}function Fi(gt){if(gt<=0)return 0;if(gt>=1)return 1;var Et=gt*gt,Xt=Et*gt;return 4*(gt<.5?Xt:3*(gt-Et)+Xt-.75)}function nc(gt){return function(Et){return Math.pow(Et,gt)}}function pu(gt){return 1-Math.cos(gt*Ht)}function ml(gt){return Math.pow(2,10*(gt-1))}function Lc(gt){return 1-Math.sqrt(1-gt*gt)}function qu(gt,Et){var Xt;return arguments.length<2&&(Et=.45),arguments.length?Xt=Et/yt*Math.asin(1/gt):(gt=1,Xt=Et/4),function(fe){return 1+gt*Math.pow(2,-10*fe)*Math.sin((fe-Xt)*yt/Et)}}function dc(gt){return gt||(gt=1.70158),function(Et){return Et*Et*((gt+1)*Et-gt)}}function bl(gt){return gt<1/2.75?7.5625*gt*gt:gt<2/2.75?7.5625*(gt-=1.5/2.75)*gt+.75:gt<2.5/2.75?7.5625*(gt-=2.25/2.75)*gt+.9375:7.5625*(gt-=2.625/2.75)*gt+.984375}u.interpolateHcl=Yc;function Yc(gt,Et){gt=u.hcl(gt),Et=u.hcl(Et);var Xt=gt.h,fe=gt.c,me=gt.l,we=Et.h-Xt,Ve=Et.c-fe,je=Et.l-me;return isNaN(Ve)&&(Ve=0,fe=isNaN(fe)?Et.c:fe),isNaN(we)?(we=0,Xt=isNaN(Xt)?Et.h:Xt):we>180?we-=360:we<-180&&(we+=360),function(or){return Ze(Xt+we*or,fe+Ve*or,me+je*or)+""}}u.interpolateHsl=Fc;function Fc(gt,Et){gt=u.hsl(gt),Et=u.hsl(Et);var Xt=gt.h,fe=gt.s,me=gt.l,we=Et.h-Xt,Ve=Et.s-fe,je=Et.l-me;return isNaN(Ve)&&(Ve=0,fe=isNaN(fe)?Et.s:fe),isNaN(we)?(we=0,Xt=isNaN(Xt)?Et.h:Xt):we>180?we-=360:we<-180&&(we+=360),function(or){return ra(Xt+we*or,fe+Ve*or,me+je*or)+""}}u.interpolateLab=mc;function mc(gt,Et){gt=u.lab(gt),Et=u.lab(Et);var Xt=gt.l,fe=gt.a,me=gt.b,we=Et.l-Xt,Ve=Et.a-fe,je=Et.b-me;return function(or){return Nn(Xt+we*or,fe+Ve*or,me+je*or)+""}}u.interpolateRound=Wu;function Wu(gt,Et){return Et-=gt,function(Xt){return Math.round(gt+Et*Xt)}}u.transform=function(gt){var Et=A.createElementNS(u.ns.prefix.svg,"g");return(u.transform=function(Xt){if(Xt!=null){Et.setAttribute("transform",Xt);var fe=Et.transform.baseVal.consolidate()}return new Cc(fe?fe.matrix:Pu)})(gt)};function Cc(gt){var Et=[gt.a,gt.b],Xt=[gt.c,gt.d],fe=du(Et),me=Ic(Et,Xt),we=du(Bc(Xt,Et,-me))||0;Et[0]*Xt[1]<Xt[0]*Et[1]&&(Et[0]*=-1,Et[1]*=-1,fe*=-1,me*=-1),this.rotate=(fe?Math.atan2(Et[1],Et[0]):Math.atan2(-Xt[0],Xt[1]))*se,this.translate=[gt.e,gt.f],this.scale=[fe,we],this.skew=we?Math.atan2(me,we)*se:0}Cc.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function Ic(gt,Et){return gt[0]*Et[0]+gt[1]*Et[1]}function du(gt){var Et=Math.sqrt(Ic(gt,gt));return Et&&(gt[0]/=Et,gt[1]/=Et),Et}function Bc(gt,Et,Xt){return gt[0]+=Xt*Et[0],gt[1]+=Xt*Et[1],gt}var Pu={a:1,b:0,c:0,d:1,e:0,f:0};u.interpolateTransform=_c;function wu(gt){return gt.length?gt.pop()+",":""}function wl(gt,Et,Xt,fe){if(gt[0]!==Et[0]||gt[1]!==Et[1]){var me=Xt.push("translate(",null,",",null,")");fe.push({i:me-4,x:Ml(gt[0],Et[0])},{i:me-2,x:Ml(gt[1],Et[1])})}else(Et[0]||Et[1])&&Xt.push("translate("+Et+")")}function Ju(gt,Et,Xt,fe){gt!==Et?(gt-Et>180?Et+=360:Et-gt>180&&(gt+=360),fe.push({i:Xt.push(wu(Xt)+"rotate(",null,")")-2,x:Ml(gt,Et)})):Et&&Xt.push(wu(Xt)+"rotate("+Et+")")}function Pc(gt,Et,Xt,fe){gt!==Et?fe.push({i:Xt.push(wu(Xt)+"skewX(",null,")")-2,x:Ml(gt,Et)}):Et&&Xt.push(wu(Xt)+"skewX("+Et+")")}function Es(gt,Et,Xt,fe){if(gt[0]!==Et[0]||gt[1]!==Et[1]){var me=Xt.push(wu(Xt)+"scale(",null,",",null,")");fe.push({i:me-4,x:Ml(gt[0],Et[0])},{i:me-2,x:Ml(gt[1],Et[1])})}else(Et[0]!==1||Et[1]!==1)&&Xt.push(wu(Xt)+"scale("+Et+")")}function _c(gt,Et){var Xt=[],fe=[];return gt=u.transform(gt),Et=u.transform(Et),wl(gt.translate,Et.translate,Xt,fe),Ju(gt.rotate,Et.rotate,Xt,fe),Pc(gt.skew,Et.skew,Xt,fe),Es(gt.scale,Et.scale,Xt,fe),gt=Et=null,function(me){for(var we=-1,Ve=fe.length,je;++we<Ve;)Xt[(je=fe[we]).i]=je.x(me);return Xt.join("")}}function sf(gt,Et){return Et=(Et-=gt=+gt)||1/Et,function(Xt){return(Xt-gt)/Et}}function Rc(gt,Et){return Et=(Et-=gt=+gt)||1/Et,function(Xt){return Math.max(0,Math.min(1,(Xt-gt)/Et))}}u.layout={},u.layout.bundle=function(){return function(gt){for(var Et=[],Xt=-1,fe=gt.length;++Xt<fe;)Et.push(gc(gt[Xt]));return Et}};function gc(gt){for(var Et=gt.source,Xt=gt.target,fe=Zl(Et,Xt),me=[Et];Et!==fe;)Et=Et.parent,me.push(Et);for(var we=me.length;Xt!==fe;)me.splice(we,0,Xt),Xt=Xt.parent;return me}function Nc(gt){for(var Et=[],Xt=gt.parent;Xt!=null;)Et.push(gt),gt=Xt,Xt=Xt.parent;return Et.push(gt),Et}function Zl(gt,Et){if(gt===Et)return gt;for(var Xt=Nc(gt),fe=Nc(Et),me=Xt.pop(),we=fe.pop(),Ve=null;me===we;)Ve=me,me=Xt.pop(),we=fe.pop();return Ve}u.layout.chord=function(){var gt={},Et,Xt,fe,me,we=0,Ve,je,or;function Cr(){var Wr={},an=[],on=u.range(me),ta=[],hn,Bn,Hn,Yn,na;for(Et=[],Xt=[],hn=0,Yn=-1;++Yn<me;){for(Bn=0,na=-1;++na<me;)Bn+=fe[Yn][na];an.push(Bn),ta.push(u.range(me)),hn+=Bn}for(Ve&&on.sort(function(jo,Ii){return Ve(an[jo],an[Ii])}),je&&ta.forEach(function(jo,Ii){jo.sort(function(Ji,es){return je(fe[Ii][Ji],fe[Ii][es])})}),hn=(yt-we*me)/hn,Bn=0,Yn=-1;++Yn<me;){for(Hn=Bn,na=-1;++na<me;){var _n=on[Yn],Ha=ta[_n][na],Wa=fe[_n][Ha],ri=Bn,xi=Bn+=Wa*hn;Wr[_n+"-"+Ha]={index:_n,subindex:Ha,startAngle:ri,endAngle:xi,value:Wa}}Xt[_n]={index:_n,startAngle:Hn,endAngle:Bn,value:an[_n]},Bn+=we}for(Yn=-1;++Yn<me;)for(na=Yn-1;++na<me;){var ki=Wr[Yn+"-"+na],zi=Wr[na+"-"+Yn];(ki.value||zi.value)&&Et.push(ki.value<zi.value?{source:zi,target:ki}:{source:ki,target:zi})}or&&Sr()}function Sr(){Et.sort(function(Wr,an){return or((Wr.source.value+Wr.target.value)/2,(an.source.value+an.target.value)/2)})}return gt.matrix=function(Wr){return arguments.length?(me=(fe=Wr)&&fe.length,Et=Xt=null,gt):fe},gt.padding=function(Wr){return arguments.length?(we=Wr,Et=Xt=null,gt):we},gt.sortGroups=function(Wr){return arguments.length?(Ve=Wr,Et=Xt=null,gt):Ve},gt.sortSubgroups=function(Wr){return arguments.length?(je=Wr,Et=null,gt):je},gt.sortChords=function(Wr){return arguments.length?(or=Wr,Et&&Sr(),gt):or},gt.chords=function(){return Et||Cr(),Et},gt.groups=function(){return Xt||Cr(),Xt},gt},u.layout.force=function(){var gt={},Et=u.dispatch("start","tick","end"),Xt,fe=[1,1],me,we,Ve=.9,je=Ou,or=Rl,Cr=-30,Sr=Yl,Wr=.1,an=.64,on=[],ta=[],hn,Bn,Hn;function Yn(_n){return function(Ha,Wa,ri,xi){if(Ha.point!==_n){var ki=Ha.cx-_n.x,zi=Ha.cy-_n.y,jo=xi-Wa,Ii=ki*ki+zi*zi;if(jo*jo/an<Ii){if(Ii<Sr){var Ji=Ha.charge/Ii;_n.px-=ki*Ji,_n.py-=zi*Ji}return!0}if(Ha.point&&Ii&&Ii<Sr){var Ji=Ha.pointCharge/Ii;_n.px-=ki*Ji,_n.py-=zi*Ji}}return!Ha.charge}}gt.tick=function(){if((we*=.99)<.005)return Xt=null,Et.end({type:"end",alpha:we=0}),!0;var _n=on.length,Ha=ta.length,Wa,ri,xi,ki,zi,jo,Ii,Ji,es;for(ri=0;ri<Ha;++ri)xi=ta[ri],ki=xi.source,zi=xi.target,Ji=zi.x-ki.x,es=zi.y-ki.y,(jo=Ji*Ji+es*es)&&(jo=we*Bn[ri]*((jo=Math.sqrt(jo))-hn[ri])/jo,Ji*=jo,es*=jo,zi.x-=Ji*(Ii=ki.weight+zi.weight?ki.weight/(ki.weight+zi.weight):.5),zi.y-=es*Ii,ki.x+=Ji*(Ii=1-Ii),ki.y+=es*Ii);if((Ii=we*Wr)&&(Ji=fe[0]/2,es=fe[1]/2,ri=-1,Ii))for(;++ri<_n;)xi=on[ri],xi.x+=(Ji-xi.x)*Ii,xi.y+=(es-xi.y)*Ii;if(Cr)for(Bs(Wa=u.geom.quadtree(on),we,Hn),ri=-1;++ri<_n;)(xi=on[ri]).fixed||Wa.visit(Yn(xi));for(ri=-1;++ri<_n;)xi=on[ri],xi.fixed?(xi.x=xi.px,xi.y=xi.py):(xi.x-=(xi.px-(xi.px=xi.x))*Ve,xi.y-=(xi.py-(xi.py=xi.y))*Ve);Et.tick({type:"tick",alpha:we})},gt.nodes=function(_n){return arguments.length?(on=_n,gt):on},gt.links=function(_n){return arguments.length?(ta=_n,gt):ta},gt.size=function(_n){return arguments.length?(fe=_n,gt):fe},gt.linkDistance=function(_n){return arguments.length?(je=typeof _n=="function"?_n:+_n,gt):je},gt.distance=gt.linkDistance,gt.linkStrength=function(_n){return arguments.length?(or=typeof _n=="function"?_n:+_n,gt):or},gt.friction=function(_n){return arguments.length?(Ve=+_n,gt):Ve},gt.charge=function(_n){return arguments.length?(Cr=typeof _n=="function"?_n:+_n,gt):Cr},gt.chargeDistance=function(_n){return arguments.length?(Sr=_n*_n,gt):Math.sqrt(Sr)},gt.gravity=function(_n){return arguments.length?(Wr=+_n,gt):Wr},gt.theta=function(_n){return arguments.length?(an=_n*_n,gt):Math.sqrt(an)},gt.alpha=function(_n){return arguments.length?(_n=+_n,we?_n>0?we=_n:(Xt.c=null,Xt.t=NaN,Xt=null,Et.end({type:"end",alpha:we=0})):_n>0&&(Et.start({type:"start",alpha:we=_n}),Xt=Qn(gt.tick)),gt):we},gt.start=function(){var _n,Ha=on.length,Wa=ta.length,ri=fe[0],xi=fe[1],ki,zi;for(_n=0;_n<Ha;++_n)(zi=on[_n]).index=_n,zi.weight=0;for(_n=0;_n<Wa;++_n)zi=ta[_n],typeof zi.source=="number"&&(zi.source=on[zi.source]),typeof zi.target=="number"&&(zi.target=on[zi.target]),++zi.source.weight,++zi.target.weight;for(_n=0;_n<Ha;++_n)zi=on[_n],isNaN(zi.x)&&(zi.x=jo("x",ri)),isNaN(zi.y)&&(zi.y=jo("y",xi)),isNaN(zi.px)&&(zi.px=zi.x),isNaN(zi.py)&&(zi.py=zi.y);if(hn=[],typeof je=="function")for(_n=0;_n<Wa;++_n)hn[_n]=+je.call(this,ta[_n],_n);else for(_n=0;_n<Wa;++_n)hn[_n]=je;if(Bn=[],typeof or=="function")for(_n=0;_n<Wa;++_n)Bn[_n]=+or.call(this,ta[_n],_n);else for(_n=0;_n<Wa;++_n)Bn[_n]=or;if(Hn=[],typeof Cr=="function")for(_n=0;_n<Ha;++_n)Hn[_n]=+Cr.call(this,on[_n],_n);else for(_n=0;_n<Ha;++_n)Hn[_n]=Cr;function jo(Ii,Ji){if(!ki){for(ki=new Array(Ha),Ns=0;Ns<Ha;++Ns)ki[Ns]=[];for(Ns=0;Ns<Wa;++Ns){var es=ta[Ns];ki[es.source.index].push(es.target),ki[es.target.index].push(es.source)}}for(var pl=ki[_n],Ns=-1,fi=pl.length,Ao;++Ns<fi;)if(!isNaN(Ao=pl[Ns][Ii]))return Ao;return Math.random()*Ji}return gt.resume()},gt.resume=function(){return gt.alpha(.1)},gt.stop=function(){return gt.alpha(0)},gt.drag=function(){if(me||(me=u.behavior.drag().origin(B).on("dragstart.force",jc).on("drag.force",na).on("dragend.force",rl)),!arguments.length)return me;this.on("mouseover.force",Kl).on("mouseout.force",Gu).call(me)};function na(_n){_n.px=u.event.x,_n.py=u.event.y,gt.resume()}return u.rebind(gt,Et,"on")};function jc(gt){gt.fixed|=2}function rl(gt){gt.fixed&=-7}function Kl(gt){gt.fixed|=4,gt.px=gt.x,gt.py=gt.y}function Gu(gt){gt.fixed&=-5}function Bs(gt,Et,Xt){var fe=0,me=0;if(gt.charge=0,!gt.leaf)for(var we=gt.nodes,Ve=we.length,je=-1,or;++je<Ve;)or=we[je],or!=null&&(Bs(or,Et,Xt),gt.charge+=or.charge,fe+=or.charge*or.cx,me+=or.charge*or.cy);if(gt.point){gt.leaf||(gt.point.x+=Math.random()-.5,gt.point.y+=Math.random()-.5);var Cr=Et*Xt[gt.point.index];gt.charge+=gt.pointCharge=Cr,fe+=Cr*gt.point.x,me+=Cr*gt.point.y}gt.cx=fe/gt.charge,gt.cy=me/gt.charge}var Ou=20,Rl=1,Yl=1/0;u.layout.hierarchy=function(){var gt=lf,Et=Zu,Xt=bc;function fe(me){var we=[me],Ve=[],je;for(me.depth=0;(je=we.pop())!=null;)if(Ve.push(je),(Cr=Et.call(fe,je,je.depth))&&(or=Cr.length)){for(var or,Cr,Sr;--or>=0;)we.push(Sr=Cr[or]),Sr.parent=je,Sr.depth=je.depth+1;Xt&&(je.value=0),je.children=Cr}else Xt&&(je.value=+Xt.call(fe,je,je.depth)||0),delete je.children;return Tu(me,function(Wr){var an,on;gt&&(an=Wr.children)&&an.sort(gt),Xt&&(on=Wr.parent)&&(on.value+=Wr.value)}),Ve}return fe.sort=function(me){return arguments.length?(gt=me,fe):gt},fe.children=function(me){return arguments.length?(Et=me,fe):Et},fe.value=function(me){return arguments.length?(Xt=me,fe):Xt},fe.revalue=function(me){return Xt&&(ac(me,function(we){we.children&&(we.value=0)}),Tu(me,function(we){var Ve;we.children||(we.value=+Xt.call(fe,we,we.depth)||0),(Ve=we.parent)&&(Ve.value+=we.value)})),me},fe};function Ws(gt,Et){return u.rebind(gt,Et,"sort","children","value"),gt.nodes=gt,gt.links=Mf,gt}function ac(gt,Et){for(var Xt=[gt];(gt=Xt.pop())!=null;)if(Et(gt),(me=gt.children)&&(fe=me.length))for(var fe,me;--fe>=0;)Xt.push(me[fe])}function Tu(gt,Et){for(var Xt=[gt],fe=[];(gt=Xt.pop())!=null;)if(fe.push(gt),(Ve=gt.children)&&(we=Ve.length))for(var me=-1,we,Ve;++me<we;)Xt.push(Ve[me]);for(;(gt=fe.pop())!=null;)Et(gt)}function Zu(gt){return gt.children}function bc(gt){return gt.value}function lf(gt,Et){return Et.value-gt.value}function Mf(gt){return u.merge(gt.map(function(Et){return(Et.children||[]).map(function(Xt){return{source:Et,target:Xt}})}))}u.layout.partition=function(){var gt=u.layout.hierarchy(),Et=[1,1];function Xt(we,Ve,je,or){var Cr=we.children;if(we.x=Ve,we.y=we.depth*or,we.dx=je,we.dy=or,Cr&&(Wr=Cr.length)){var Sr=-1,Wr,an,on;for(je=we.value?je/we.value:0;++Sr<Wr;)Xt(an=Cr[Sr],Ve,on=an.value*je,or),Ve+=on}}function fe(we){var Ve=we.children,je=0;if(Ve&&(Cr=Ve.length))for(var or=-1,Cr;++or<Cr;)je=Math.max(je,fe(Ve[or]));return 1+je}function me(we,Ve){var je=gt.call(this,we,Ve);return Xt(je[0],0,Et[0],Et[1]/fe(je[0])),je}return me.size=function(we){return arguments.length?(Et=we,me):Et},Ws(me,gt)},u.layout.pie=function(){var gt=Number,Et=ic,Xt=0,fe=yt,me=0;function we(Ve){var je=Ve.length,or=Ve.map(function(Yn,na){return+gt.call(we,Yn,na)}),Cr=+(typeof Xt=="function"?Xt.apply(this,arguments):Xt),Sr=(typeof fe=="function"?fe.apply(this,arguments):fe)-Cr,Wr=Math.min(Math.abs(Sr)/je,+(typeof me=="function"?me.apply(this,arguments):me)),an=Wr*(Sr<0?-1:1),on=u.sum(or),ta=on?(Sr-je*an)/on:0,hn=u.range(je),Bn=[],Hn;return Et!=null&&hn.sort(Et===ic?function(Yn,na){return or[na]-or[Yn]}:function(Yn,na){return Et(Ve[Yn],Ve[na])}),hn.forEach(function(Yn){Bn[Yn]={data:Ve[Yn],value:Hn=or[Yn],startAngle:Cr,endAngle:Cr+=Hn*ta+an,padAngle:Wr}}),Bn}return we.value=function(Ve){return arguments.length?(gt=Ve,we):gt},we.sort=function(Ve){return arguments.length?(Et=Ve,we):Et},we.startAngle=function(Ve){return arguments.length?(Xt=Ve,we):Xt},we.endAngle=function(Ve){return arguments.length?(fe=Ve,we):fe},we.padAngle=function(Ve){return arguments.length?(me=Ve,we):me},we};var ic={};u.layout.stack=function(){var gt=B,Et=Tc,Xt=ku,fe=oc,me=wc,we=Fl;function Ve(je,or){if(!(ta=je.length))return je;var Cr=je.map(function(Yn,na){return gt.call(Ve,Yn,na)}),Sr=Cr.map(function(Yn){return Yn.map(function(na,_n){return[me.call(Ve,na,_n),we.call(Ve,na,_n)]})}),Wr=Et.call(Ve,Sr,or);Cr=u.permute(Cr,Wr),Sr=u.permute(Sr,Wr);var an=Xt.call(Ve,Sr,or),on=Cr[0].length,ta,hn,Bn,Hn;for(Bn=0;Bn<on;++Bn)for(fe.call(Ve,Cr[0][Bn],Hn=an[Bn],Sr[0][Bn][1]),hn=1;hn<ta;++hn)fe.call(Ve,Cr[hn][Bn],Hn+=Sr[hn-1][Bn][1],Sr[hn][Bn][1]);return je}return Ve.values=function(je){return arguments.length?(gt=je,Ve):gt},Ve.order=function(je){return arguments.length?(Et=typeof je=="function"?je:iu.get(je)||Tc,Ve):Et},Ve.offset=function(je){return arguments.length?(Xt=typeof je=="function"?je:sc.get(je)||ku,Ve):Xt},Ve.x=function(je){return arguments.length?(me=je,Ve):me},Ve.y=function(je){return arguments.length?(we=je,Ve):we},Ve.out=function(je){return arguments.length?(fe=je,Ve):fe},Ve};function wc(gt){return gt.x}function Fl(gt){return gt.y}function oc(gt,Et,Xt){gt.y0=Et,gt.y=Xt}var iu=u.map({"inside-out":function(gt){var Et=gt.length,Xt,fe,me=gt.map(Gs),we=gt.map(Du),Ve=u.range(Et).sort(function(Wr,an){return me[Wr]-me[an]}),je=0,or=0,Cr=[],Sr=[];for(Xt=0;Xt<Et;++Xt)fe=Ve[Xt],je<or?(je+=we[fe],Cr.push(fe)):(or+=we[fe],Sr.push(fe));return Sr.reverse().concat(Cr)},reverse:function(gt){return u.range(gt.length).reverse()},default:Tc}),sc=u.map({silhouette:function(gt){var Et=gt.length,Xt=gt[0].length,fe=[],me=0,we,Ve,je,or=[];for(Ve=0;Ve<Xt;++Ve){for(we=0,je=0;we<Et;we++)je+=gt[we][Ve][1];je>me&&(me=je),fe.push(je)}for(Ve=0;Ve<Xt;++Ve)or[Ve]=(me-fe[Ve])/2;return or},wiggle:function(gt){var Et=gt.length,Xt=gt[0],fe=Xt.length,me,we,Ve,je,or,Cr,Sr,Wr,an,on=[];for(on[0]=Wr=an=0,we=1;we<fe;++we){for(me=0,je=0;me<Et;++me)je+=gt[me][we][1];for(me=0,or=0,Sr=Xt[we][0]-Xt[we-1][0];me<Et;++me){for(Ve=0,Cr=(gt[me][we][1]-gt[me][we-1][1])/(2*Sr);Ve<me;++Ve)Cr+=(gt[Ve][we][1]-gt[Ve][we-1][1])/Sr;or+=Cr*gt[me][we][1]}on[we]=Wr-=je?or/je*Sr:0,Wr<an&&(an=Wr)}for(we=0;we<fe;++we)on[we]-=an;return on},expand:function(gt){var Et=gt.length,Xt=gt[0].length,fe=1/Et,me,we,Ve,je=[];for(we=0;we<Xt;++we){for(me=0,Ve=0;me<Et;me++)Ve+=gt[me][we][1];if(Ve)for(me=0;me<Et;me++)gt[me][we][1]/=Ve;else for(me=0;me<Et;me++)gt[me][we][1]=fe}for(we=0;we<Xt;++we)je[we]=0;return je},zero:ku});function Tc(gt){return u.range(gt.length)}function ku(gt){for(var Et=-1,Xt=gt[0].length,fe=[];++Et<Xt;)fe[Et]=0;return fe}function Gs(gt){for(var Et=1,Xt=0,fe=gt[0][1],me,we=gt.length;Et<we;++Et)(me=gt[Et][1])>fe&&(Xt=Et,fe=me);return Xt}function Du(gt){return gt.reduce(Xl,0)}function Xl(gt,Et){return gt+Et[1]}u.layout.histogram=function(){var gt=!0,Et=Number,Xt=vc,fe=Xc;function me(we,Ve){for(var je=[],or=we.map(Et,this),Cr=Xt.call(this,or,Ve),Sr=fe.call(this,Cr,or,Ve),Wr,Ve=-1,an=or.length,on=Sr.length-1,ta=gt?1:1/an,hn;++Ve<on;)Wr=je[Ve]=[],Wr.dx=Sr[Ve+1]-(Wr.x=Sr[Ve]),Wr.y=0;if(on>0)for(Ve=-1;++Ve<an;)hn=or[Ve],hn>=Cr[0]&&hn<=Cr[1]&&(Wr=je[u.bisect(Sr,hn,1,on)-1],Wr.y+=ta,Wr.push(we[Ve]));return je}return me.value=function(we){return arguments.length?(Et=we,me):Et},me.range=function(we){return arguments.length?(Xt=pe(we),me):Xt},me.bins=function(we){return arguments.length?(fe=typeof we=="number"?function(Ve){return Vs(Ve,we)}:pe(we),me):fe},me.frequency=function(we){return arguments.length?(gt=!!we,me):gt},me};function Xc(gt,Et){return Vs(gt,Math.ceil(Math.log(Et.length)/Math.LN2+1))}function Vs(gt,Et){for(var Xt=-1,fe=+gt[0],me=(gt[1]-fe)/Et,we=[];++Xt<=Et;)we[Xt]=me*Xt+fe;return we}function vc(gt){return[u.min(gt),u.max(gt)]}u.layout.pack=function(){var gt=u.layout.hierarchy().sort(Ku),Et=0,Xt=[1,1],fe;function me(we,Ve){var je=gt.call(this,we,Ve),or=je[0],Cr=Xt[0],Sr=Xt[1],Wr=fe==null?Math.sqrt:typeof fe=="function"?fe:function(){return fe};if(or.x=or.y=0,Tu(or,function(on){on.r=+Wr(on.value)}),Tu(or,yc),Et){var an=Et*(fe?1:Math.max(2*or.r/Cr,2*or.r/Sr))/2;Tu(or,function(on){on.r+=an}),Tu(or,yc),Tu(or,function(on){on.r-=an})}return Uc(or,Cr/2,Sr/2,fe?1:1/Math.max(2*or.r/Cr,2*or.r/Sr)),je}return me.size=function(we){return arguments.length?(Xt=we,me):Xt},me.radius=function(we){return arguments.length?(fe=we==null||typeof we=="function"?we:+we,me):fe},me.padding=function(we){return arguments.length?(Et=+we,me):Et},Ws(me,gt)};function Ku(gt,Et){return gt.value-Et.value}function ou(gt,Et){var Xt=gt._pack_next;gt._pack_next=Et,Et._pack_prev=gt,Et._pack_next=Xt,Xt._pack_prev=Et}function Qu(gt,Et){gt._pack_next=Et,Et._pack_prev=gt}function Yu(gt,Et){var Xt=Et.x-gt.x,fe=Et.y-gt.y,me=gt.r+Et.r;return .999*me*me>Xt*Xt+fe*fe}function yc(gt){if(!(Et=gt.children)||!(an=Et.length))return;var Et,Xt=1/0,fe=-1/0,me=1/0,we=-1/0,Ve,je,or,Cr,Sr,Wr,an;function on(_n){Xt=Math.min(_n.x-_n.r,Xt),fe=Math.max(_n.x+_n.r,fe),me=Math.min(_n.y-_n.r,me),we=Math.max(_n.y+_n.r,we)}if(Et.forEach(uf),Ve=Et[0],Ve.x=-Ve.r,Ve.y=0,on(Ve),an>1&&(je=Et[1],je.x=je.r,je.y=0,on(je),an>2))for(or=Et[2],su(Ve,je,or),on(or),ou(Ve,or),Ve._pack_prev=or,ou(or,je),je=Ve._pack_next,Cr=3;Cr<an;Cr++){su(Ve,je,or=Et[Cr]);var ta=0,hn=1,Bn=1;for(Sr=je._pack_next;Sr!==je;Sr=Sr._pack_next,hn++)if(Yu(Sr,or)){ta=1;break}if(ta==1)for(Wr=Ve._pack_prev;Wr!==Sr._pack_prev&&!Yu(Wr,or);Wr=Wr._pack_prev,Bn++);ta?(hn<Bn||hn==Bn&&je.r<Ve.r?Qu(Ve,je=Sr):Qu(Ve=Wr,je),Cr--):(ou(Ve,or),je=or,on(or))}var Hn=(Xt+fe)/2,Yn=(me+we)/2,na=0;for(Cr=0;Cr<an;Cr++)or=Et[Cr],or.x-=Hn,or.y-=Yn,na=Math.max(na,or.r+Math.sqrt(or.x*or.x+or.y*or.y));gt.r=na,Et.forEach(zl)}function uf(gt){gt._pack_next=gt._pack_prev=gt}function zl(gt){delete gt._pack_next,delete gt._pack_prev}function Uc(gt,Et,Xt,fe){var me=gt.children;if(gt.x=Et+=fe*gt.x,gt.y=Xt+=fe*gt.y,gt.r*=fe,me)for(var we=-1,Ve=me.length;++we<Ve;)Uc(me[we],Et,Xt,fe)}function su(gt,Et,Xt){var fe=gt.r+Xt.r,me=Et.x-gt.x,we=Et.y-gt.y;if(fe&&(me||we)){var Ve=Et.r+Xt.r,je=me*me+we*we;Ve*=Ve,fe*=fe;var or=.5+(fe-Ve)/(2*je),Cr=Math.sqrt(Math.max(0,2*Ve*(fe+je)-(fe-=je)*fe-Ve*Ve))/(2*je);Xt.x=gt.x+or*me+Cr*we,Xt.y=gt.y+or*we-Cr*me}else Xt.x=gt.x+fe,Xt.y=gt.y}u.layout.tree=function(){var gt=u.layout.hierarchy().sort(null).value(null),Et=Fu,Xt=[1,1],fe=null;function me(Sr,Wr){var an=gt.call(this,Sr,Wr),on=an[0],ta=we(on);if(Tu(ta,Ve),ta.parent.m=-ta.z,ac(ta,je),fe)ac(on,Cr);else{var hn=on,Bn=on,Hn=on;ac(on,function(Ha){Ha.x<hn.x&&(hn=Ha),Ha.x>Bn.x&&(Bn=Ha),Ha.depth>Hn.depth&&(Hn=Ha)});var Yn=Et(hn,Bn)/2-hn.x,na=Xt[0]/(Bn.x+Et(Bn,hn)/2+Yn),_n=Xt[1]/(Hn.depth||1);ac(on,function(Ha){Ha.x=(Ha.x+Yn)*na,Ha.y=Ha.depth*_n})}return an}function we(Sr){for(var Wr={A:null,children:[Sr]},an=[Wr],on;(on=an.pop())!=null;)for(var ta=on.children,hn,Bn=0,Hn=ta.length;Bn<Hn;++Bn)an.push((ta[Bn]=hn={_:ta[Bn],parent:on,children:(hn=ta[Bn].children)&&hn.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:Bn}).a=hn);return Wr.children[0]}function Ve(Sr){var Wr=Sr.children,an=Sr.parent.children,on=Sr.i?an[Sr.i-1]:null;if(Wr.length){Mu(Sr);var ta=(Wr[0].z+Wr[Wr.length-1].z)/2;on?(Sr.z=on.z+Et(Sr._,on._),Sr.m=Sr.z-ta):Sr.z=ta}else on&&(Sr.z=on.z+Et(Sr._,on._));Sr.parent.A=or(Sr,on,Sr.parent.A||an[0])}function je(Sr){Sr._.x=Sr.z+Sr.parent.m,Sr.m+=Sr.parent.m}function or(Sr,Wr,an){if(Wr){for(var on=Sr,ta=Sr,hn=Wr,Bn=on.parent.children[0],Hn=on.m,Yn=ta.m,na=hn.m,_n=Bn.m,Ha;hn=il(hn),on=Au(on),hn&&on;)Bn=Au(Bn),ta=il(ta),ta.a=Sr,Ha=hn.z+na-on.z-Hn+Et(hn._,on._),Ha>0&&(Cs(lc(hn,Sr,an),Sr,Ha),Hn+=Ha,Yn+=Ha),na+=hn.m,Hn+=on.m,_n+=Bn.m,Yn+=ta.m;hn&&!il(ta)&&(ta.t=hn,ta.m+=na-Yn),on&&!Au(Bn)&&(Bn.t=on,Bn.m+=Hn-_n,an=Sr)}return an}function Cr(Sr){Sr.x*=Xt[0],Sr.y=Sr.depth*Xt[1]}return me.separation=function(Sr){return arguments.length?(Et=Sr,me):Et},me.size=function(Sr){return arguments.length?(fe=(Xt=Sr)==null?Cr:null,me):fe?null:Xt},me.nodeSize=function(Sr){return arguments.length?(fe=(Xt=Sr)==null?null:Cr,me):fe?Xt:null},Ws(me,gt)};function Fu(gt,Et){return gt.parent==Et.parent?1:2}function Au(gt){var Et=gt.children;return Et.length?Et[0]:gt.t}function il(gt){var Et=gt.children,Xt;return(Xt=Et.length)?Et[Xt-1]:gt.t}function Cs(gt,Et,Xt){var fe=Xt/(Et.i-gt.i);Et.c-=fe,Et.s+=Xt,gt.c+=fe,Et.z+=Xt,Et.m+=Xt}function Mu(gt){for(var Et=0,Xt=0,fe=gt.children,me=fe.length,we;--me>=0;)we=fe[me],we.z+=Et,we.m+=Et,Et+=we.s+(Xt+=we.c)}function lc(gt,Et,Xt){return gt.a.parent===Et.parent?gt.a:Xt}u.layout.cluster=function(){var gt=u.layout.hierarchy().sort(null).value(null),Et=Fu,Xt=[1,1],fe=!1;function me(we,Ve){var je=gt.call(this,we,Ve),or=je[0],Cr,Sr=0;Tu(or,function(hn){var Bn=hn.children;Bn&&Bn.length?(hn.x=Oc(Bn),hn.y=Su(Bn)):(hn.x=Cr?Sr+=Et(hn,Cr):0,hn.y=0,Cr=hn)});var Wr=Xe(or),an=yr(or),on=Wr.x-Et(Wr,an)/2,ta=an.x+Et(an,Wr)/2;return Tu(or,fe?function(hn){hn.x=(hn.x-or.x)*Xt[0],hn.y=(or.y-hn.y)*Xt[1]}:function(hn){hn.x=(hn.x-on)/(ta-on)*Xt[0],hn.y=(1-(or.y?hn.y/or.y:1))*Xt[1]}),je}return me.separation=function(we){return arguments.length?(Et=we,me):Et},me.size=function(we){return arguments.length?(fe=(Xt=we)==null,me):fe?null:Xt},me.nodeSize=function(we){return arguments.length?(fe=(Xt=we)!=null,me):fe?Xt:null},Ws(me,gt)};function Su(gt){return 1+u.max(gt,function(Et){return Et.y})}function Oc(gt){return gt.reduce(function(Et,Xt){return Et+Xt.x},0)/gt.length}function Xe(gt){var Et=gt.children;return Et&&Et.length?Xe(Et[0]):gt}function yr(gt){var Et=gt.children,Xt;return Et&&(Xt=Et.length)?yr(Et[Xt-1]):gt}u.layout.treemap=function(){var gt=u.layout.hierarchy(),Et=Math.round,Xt=[1,1],fe=null,me=Kr,we=!1,Ve,je="squarify",or=.5*(1+Math.sqrt(5));function Cr(hn,Bn){for(var Hn=-1,Yn=hn.length,na,_n;++Hn<Yn;)_n=(na=hn[Hn]).value*(Bn<0?0:Bn),na.area=isNaN(_n)||_n<=0?0:_n}function Sr(hn){var Bn=hn.children;if(Bn&&Bn.length){var Hn=me(hn),Yn=[],na=Bn.slice(),_n,Ha=1/0,Wa,ri=je==="slice"?Hn.dx:je==="dice"?Hn.dy:je==="slice-dice"?hn.depth&1?Hn.dy:Hn.dx:Math.min(Hn.dx,Hn.dy),xi;for(Cr(na,Hn.dx*Hn.dy/hn.value),Yn.area=0;(xi=na.length)>0;)Yn.push(_n=na[xi-1]),Yn.area+=_n.area,je!=="squarify"||(Wa=an(Yn,ri))<=Ha?(na.pop(),Ha=Wa):(Yn.area-=Yn.pop().area,on(Yn,ri,Hn,!1),ri=Math.min(Hn.dx,Hn.dy),Yn.length=Yn.area=0,Ha=1/0);Yn.length&&(on(Yn,ri,Hn,!0),Yn.length=Yn.area=0),Bn.forEach(Sr)}}function Wr(hn){var Bn=hn.children;if(Bn&&Bn.length){var Hn=me(hn),Yn=Bn.slice(),na,_n=[];for(Cr(Yn,Hn.dx*Hn.dy/hn.value),_n.area=0;na=Yn.pop();)_n.push(na),_n.area+=na.area,na.z!=null&&(on(_n,na.z?Hn.dx:Hn.dy,Hn,!Yn.length),_n.length=_n.area=0);Bn.forEach(Wr)}}function an(hn,Bn){for(var Hn=hn.area,Yn,na=0,_n=1/0,Ha=-1,Wa=hn.length;++Ha<Wa;)(Yn=hn[Ha].area)&&(Yn<_n&&(_n=Yn),Yn>na&&(na=Yn));return Hn*=Hn,Bn*=Bn,Hn?Math.max(Bn*na*or/Hn,Hn/(Bn*_n*or)):1/0}function on(hn,Bn,Hn,Yn){var na=-1,_n=hn.length,Ha=Hn.x,Wa=Hn.y,ri=Bn?Et(hn.area/Bn):0,xi;if(Bn==Hn.dx){for((Yn||ri>Hn.dy)&&(ri=Hn.dy);++na<_n;)xi=hn[na],xi.x=Ha,xi.y=Wa,xi.dy=ri,Ha+=xi.dx=Math.min(Hn.x+Hn.dx-Ha,ri?Et(xi.area/ri):0);xi.z=!0,xi.dx+=Hn.x+Hn.dx-Ha,Hn.y+=ri,Hn.dy-=ri}else{for((Yn||ri>Hn.dx)&&(ri=Hn.dx);++na<_n;)xi=hn[na],xi.x=Ha,xi.y=Wa,xi.dx=ri,Wa+=xi.dy=Math.min(Hn.y+Hn.dy-Wa,ri?Et(xi.area/ri):0);xi.z=!1,xi.dy+=Hn.y+Hn.dy-Wa,Hn.x+=ri,Hn.dx-=ri}}function ta(hn){var Bn=Ve||gt(hn),Hn=Bn[0];return Hn.x=Hn.y=0,Hn.value?(Hn.dx=Xt[0],Hn.dy=Xt[1]):Hn.dx=Hn.dy=0,Ve&&gt.revalue(Hn),Cr([Hn],Hn.dx*Hn.dy/Hn.value),(Ve?Wr:Sr)(Hn),we&&(Ve=Bn),Bn}return ta.size=function(hn){return arguments.length?(Xt=hn,ta):Xt},ta.padding=function(hn){if(!arguments.length)return fe;function Bn(na){var _n=hn.call(ta,na,na.depth);return _n==null?Kr(na):Rr(na,typeof _n=="number"?[_n,_n,_n,_n]:_n)}function Hn(na){return Rr(na,hn)}var Yn;return me=(fe=hn)==null?Kr:(Yn=typeof hn)=="function"?Bn:(Yn==="number"&&(hn=[hn,hn,hn,hn]),Hn),ta},ta.round=function(hn){return arguments.length?(Et=hn?Math.round:Number,ta):Et!=Number},ta.sticky=function(hn){return arguments.length?(we=hn,Ve=null,ta):we},ta.ratio=function(hn){return arguments.length?(or=hn,ta):or},ta.mode=function(hn){return arguments.length?(je=hn+"",ta):je},Ws(ta,gt)};function Kr(gt){return{x:gt.x,y:gt.y,dx:gt.dx,dy:gt.dy}}function Rr(gt,Et){var Xt=gt.x+Et[3],fe=gt.y+Et[0],me=gt.dx-Et[1]-Et[3],we=gt.dy-Et[0]-Et[2];return me<0&&(Xt+=me/2,me=0),we<0&&(fe+=we/2,we=0),{x:Xt,y:fe,dx:me,dy:we}}u.random={normal:function(gt,Et){var Xt=arguments.length;return Xt<2&&(Et=1),Xt<1&&(gt=0),function(){var fe,me,we;do fe=Math.random()*2-1,me=Math.random()*2-1,we=fe*fe+me*me;while(!we||we>1);return gt+Et*fe*Math.sqrt(-2*Math.log(we)/we)}},logNormal:function(){var gt=u.random.normal.apply(u,arguments);return function(){return Math.exp(gt())}},bates:function(gt){var Et=u.random.irwinHall(gt);return function(){return Et()/gt}},irwinHall:function(gt){return function(){for(var Et=0,Xt=0;Xt<gt;Xt++)Et+=Math.random();return Et}}},u.scale={};function mn(gt){var Et=gt[0],Xt=gt[gt.length-1];return Et<Xt?[Et,Xt]:[Xt,Et]}function Pn(gt){return gt.rangeExtent?gt.rangeExtent():mn(gt.range())}function ha(gt,Et,Xt,fe){var me=Xt(gt[0],gt[1]),we=fe(Et[0],Et[1]);return function(Ve){return we(me(Ve))}}function Ta(gt,Et){var Xt=0,fe=gt.length-1,me=gt[Xt],we=gt[fe],Ve;return we<me&&(Ve=Xt,Xt=fe,fe=Ve,Ve=me,me=we,we=Ve),gt[Xt]=Et.floor(me),gt[fe]=Et.ceil(we),gt}function Ua(gt){return gt?{floor:function(Et){return Math.floor(Et/gt)*gt},ceil:function(Et){return Math.ceil(Et/gt)*gt}}:Ya}var Ya={floor:B,ceil:B};function va(gt,Et,Xt,fe){var me=[],we=[],Ve=0,je=Math.min(gt.length,Et.length)-1;for(gt[je]<gt[0]&&(gt=gt.slice().reverse(),Et=Et.slice().reverse());++Ve<=je;)me.push(Xt(gt[Ve-1],gt[Ve])),we.push(fe(Et[Ve-1],Et[Ve]));return function(or){var Cr=u.bisect(gt,or,1,je)-1;return we[Cr](me[Cr](or))}}u.scale.linear=function(){return Ba([0,1],[0,1],Fo,!1)};function Ba(gt,Et,Xt,fe){var me,we;function Ve(){var or=Math.min(gt.length,Et.length)>2?va:ha,Cr=fe?Rc:sf;return me=or(gt,Et,Cr,Xt),we=or(Et,gt,Cr,Fo),je}function je(or){return me(or)}return je.invert=function(or){return we(or)},je.domain=function(or){return arguments.length?(gt=or.map(Number),Ve()):gt},je.range=function(or){return arguments.length?(Et=or,Ve()):Et},je.rangeRound=function(or){return je.range(or).interpolate(Wu)},je.clamp=function(or){return arguments.length?(fe=or,Ve()):fe},je.interpolate=function(or){return arguments.length?(Xt=or,Ve()):Xt},je.ticks=function(or){return Vi(gt,or)},je.tickFormat=function(or,Cr){return d3_scale_linearTickFormat(gt,or,Cr)},je.nice=function(or){return ca(gt,or),Ve()},je.copy=function(){return Ba(gt,Et,Xt,fe)},Ve()}function za(gt,Et){return u.rebind(gt,Et,"range","rangeRound","interpolate","clamp")}function ca(gt,Et){return Ta(gt,Ua(ei(gt,Et)[2])),Ta(gt,Ua(ei(gt,Et)[2])),gt}function ei(gt,Et){Et==null&&(Et=10);var Xt=mn(gt),fe=Xt[1]-Xt[0],me=Math.pow(10,Math.floor(Math.log(fe/Et)/Math.LN10)),we=Et/fe*me;return we<=.15?me*=10:we<=.35?me*=5:we<=.75&&(me*=2),Xt[0]=Math.ceil(Xt[0]/me)*me,Xt[1]=Math.floor(Xt[1]/me)*me+me*.5,Xt[2]=me,Xt}function Vi(gt,Et){return u.range.apply(u,ei(gt,Et))}u.scale.log=function(){return Oi(u.scale.linear().domain([0,1]),10,!0,[1,10])};function Oi(gt,Et,Xt,fe){function me(je){return(Xt?Math.log(je<0?0:je):-Math.log(je>0?0:-je))/Math.log(Et)}function we(je){return Xt?Math.pow(Et,je):-Math.pow(Et,-je)}function Ve(je){return gt(me(je))}return Ve.invert=function(je){return we(gt.invert(je))},Ve.domain=function(je){return arguments.length?(Xt=je[0]>=0,gt.domain((fe=je.map(Number)).map(me)),Ve):fe},Ve.base=function(je){return arguments.length?(Et=+je,gt.domain(fe.map(me)),Ve):Et},Ve.nice=function(){var je=Ta(fe.map(me),Xt?Math:Wi);return gt.domain(je),fe=je.map(we),Ve},Ve.ticks=function(){var je=mn(fe),or=[],Cr=je[0],Sr=je[1],Wr=Math.floor(me(Cr)),an=Math.ceil(me(Sr)),on=Et%1?2:Et;if(isFinite(an-Wr)){if(Xt){for(;Wr<an;Wr++)for(var ta=1;ta<on;ta++)or.push(we(Wr)*ta);or.push(we(Wr))}else for(or.push(we(Wr));Wr++<an;)for(var ta=on-1;ta>0;ta--)or.push(we(Wr)*ta);for(Wr=0;or[Wr]<Cr;Wr++);for(an=or.length;or[an-1]>Sr;an--);or=or.slice(Wr,an)}return or},Ve.copy=function(){return Oi(gt.copy(),Et,Xt,fe)},za(Ve,gt)}var Wi={floor:function(gt){return-Math.ceil(-gt)},ceil:function(gt){return-Math.floor(-gt)}};u.scale.pow=function(){return Xi(u.scale.linear(),1,[0,1])};function Xi(gt,Et,Xt){var fe=ni(Et),me=ni(1/Et);function we(Ve){return gt(fe(Ve))}return we.invert=function(Ve){return me(gt.invert(Ve))},we.domain=function(Ve){return arguments.length?(gt.domain((Xt=Ve.map(Number)).map(fe)),we):Xt},we.ticks=function(Ve){return Vi(Xt,Ve)},we.tickFormat=function(Ve,je){return d3_scale_linearTickFormat(Xt,Ve,je)},we.nice=function(Ve){return we.domain(ca(Xt,Ve))},we.exponent=function(Ve){return arguments.length?(fe=ni(Et=Ve),me=ni(1/Et),gt.domain(Xt.map(fe)),we):Et},we.copy=function(){return Xi(gt.copy(),Et,Xt)},za(we,gt)}function ni(gt){return function(Et){return Et<0?-Math.pow(-Et,gt):Math.pow(Et,gt)}}u.scale.sqrt=function(){return u.scale.pow().exponent(.5)},u.scale.ordinal=function(){return Za([],{t:"range",a:[[]]})};function Za(gt,Et){var Xt,fe,me;function we(je){return fe[((Xt.get(je)||(Et.t==="range"?Xt.set(je,gt.push(je)):NaN))-1)%fe.length]}function Ve(je,or){return u.range(gt.length).map(function(Cr){return je+or*Cr})}return we.domain=function(je){if(!arguments.length)return gt;gt=[],Xt=new S;for(var or=-1,Cr=je.length,Sr;++or<Cr;)Xt.has(Sr=je[or])||Xt.set(Sr,gt.push(Sr));return we[Et.t].apply(we,Et.a)},we.range=function(je){return arguments.length?(fe=je,me=0,Et={t:"range",a:arguments},we):fe},we.rangePoints=function(je,or){arguments.length<2&&(or=0);var Cr=je[0],Sr=je[1],Wr=gt.length<2?(Cr=(Cr+Sr)/2,0):(Sr-Cr)/(gt.length-1+or);return fe=Ve(Cr+Wr*or/2,Wr),me=0,Et={t:"rangePoints",a:arguments},we},we.rangeRoundPoints=function(je,or){arguments.length<2&&(or=0);var Cr=je[0],Sr=je[1],Wr=gt.length<2?(Cr=Sr=Math.round((Cr+Sr)/2),0):(Sr-Cr)/(gt.length-1+or)|0;return fe=Ve(Cr+Math.round(Wr*or/2+(Sr-Cr-(gt.length-1+or)*Wr)/2),Wr),me=0,Et={t:"rangeRoundPoints",a:arguments},we},we.rangeBands=function(je,or,Cr){arguments.length<2&&(or=0),arguments.length<3&&(Cr=or);var Sr=je[1]<je[0],Wr=je[Sr-0],an=je[1-Sr],on=(an-Wr)/(gt.length-or+2*Cr);return fe=Ve(Wr+on*Cr,on),Sr&&fe.reverse(),me=on*(1-or),Et={t:"rangeBands",a:arguments},we},we.rangeRoundBands=function(je,or,Cr){arguments.length<2&&(or=0),arguments.length<3&&(Cr=or);var Sr=je[1]<je[0],Wr=je[Sr-0],an=je[1-Sr],on=Math.floor((an-Wr)/(gt.length-or+2*Cr));return fe=Ve(Wr+Math.round((an-Wr-(gt.length-or)*on)/2),on),Sr&&fe.reverse(),me=Math.round(on*(1-or)),Et={t:"rangeRoundBands",a:arguments},we},we.rangeBand=function(){return me},we.rangeExtent=function(){return mn(Et.a[0])},we.copy=function(){return Za(gt,Et)},we.domain(gt)}u.scale.category10=function(){return u.scale.ordinal().range($i)},u.scale.category20=function(){return u.scale.ordinal().range(Do)},u.scale.category20b=function(){return u.scale.ordinal().range(ss)},u.scale.category20c=function(){return u.scale.ordinal().range(Ps)};var $i=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ve),Do=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ve),ss=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ve),Ps=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ve);u.scale.quantile=function(){return ys([],[])};function ys(gt,Et){var Xt;function fe(){var we=0,Ve=Et.length;for(Xt=[];++we<Ve;)Xt[we-1]=u.quantile(gt,we/Ve);return me}function me(we){if(!isNaN(we=+we))return Et[u.bisect(Xt,we)]}return me.domain=function(we){return arguments.length?(gt=we.map(f).filter(v).sort(s),fe()):gt},me.range=function(we){return arguments.length?(Et=we,fe()):Et},me.quantiles=function(){return Xt},me.invertExtent=function(we){return we=Et.indexOf(we),we<0?[NaN,NaN]:[we>0?Xt[we-1]:gt[0],we<Xt.length?Xt[we]:gt[gt.length-1]]},me.copy=function(){return ys(gt,Et)},fe()}u.scale.quantize=function(){return Os(0,1,[0,1])};function Os(gt,Et,Xt){var fe,me;function we(je){return Xt[Math.max(0,Math.min(me,Math.floor(fe*(je-gt))))]}function Ve(){return fe=Xt.length/(Et-gt),me=Xt.length-1,we}return we.domain=function(je){return arguments.length?(gt=+je[0],Et=+je[je.length-1],Ve()):[gt,Et]},we.range=function(je){return arguments.length?(Xt=je,Ve()):Xt},we.invertExtent=function(je){return je=Xt.indexOf(je),je=je<0?NaN:je/fe+gt,[je,je+1/fe]},we.copy=function(){return Os(gt,Et,Xt)},Ve()}u.scale.threshold=function(){return Yo([.5],[0,1])};function Yo(gt,Et){function Xt(fe){if(fe<=fe)return Et[u.bisect(gt,fe)]}return Xt.domain=function(fe){return arguments.length?(gt=fe,Xt):gt},Xt.range=function(fe){return arguments.length?(Et=fe,Xt):Et},Xt.invertExtent=function(fe){return fe=Et.indexOf(fe),[gt[fe-1],gt[fe]]},Xt.copy=function(){return Yo(gt,Et)},Xt}u.scale.identity=function(){return ll([0,1])};function ll(gt){function Et(Xt){return+Xt}return Et.invert=Et,Et.domain=Et.range=function(Xt){return arguments.length?(gt=Xt.map(Et),Et):gt},Et.ticks=function(Xt){return Vi(gt,Xt)},Et.tickFormat=function(Xt,fe){return d3_scale_linearTickFormat(gt,Xt,fe)},Et.copy=function(){return ll(gt)},Et}u.svg={};function el(){return 0}u.svg.arc=function(){var gt=bi,Et=so,Xt=el,fe=Rs,me=ws,we=fs,Ve=Ll;function je(){var Cr=Math.max(0,+gt.apply(this,arguments)),Sr=Math.max(0,+Et.apply(this,arguments)),Wr=me.apply(this,arguments)-Ht,an=we.apply(this,arguments)-Ht,on=Math.abs(an-Wr),ta=Wr>an?0:1;if(Sr<Cr&&(hn=Sr,Sr=Cr,Cr=hn),on>=St)return or(Sr,ta)+(Cr?or(Cr,1-ta):"")+"Z";var hn,Bn,Hn,Yn,na=0,_n=0,Ha,Wa,ri,xi,ki,zi,jo,Ii,Ji=[];if((Yn=(+Ve.apply(this,arguments)||0)/2)&&(Hn=fe===Rs?Math.sqrt(Cr*Cr+Sr*Sr):+fe.apply(this,arguments),ta||(_n*=-1),Sr&&(_n=Ee(Hn/Sr*Math.sin(Yn))),Cr&&(na=Ee(Hn/Cr*Math.sin(Yn)))),Sr){Ha=Sr*Math.cos(Wr+_n),Wa=Sr*Math.sin(Wr+_n),ri=Sr*Math.cos(an-_n),xi=Sr*Math.sin(an-_n);var es=Math.abs(an-Wr-2*_n)<=lt?0:1;if(_n&&$l(Ha,Wa,ri,xi)===ta^es){var pl=(Wr+an)/2;Ha=Sr*Math.cos(pl),Wa=Sr*Math.sin(pl),ri=xi=null}}else Ha=Wa=0;if(Cr){ki=Cr*Math.cos(an-na),zi=Cr*Math.sin(an-na),jo=Cr*Math.cos(Wr+na),Ii=Cr*Math.sin(Wr+na);var Ns=Math.abs(Wr-an+2*na)<=lt?0:1;if(na&&$l(ki,zi,jo,Ii)===1-ta^Ns){var fi=(Wr+an)/2;ki=Cr*Math.cos(fi),zi=Cr*Math.sin(fi),jo=Ii=null}}else ki=zi=0;if(on>qt&&(hn=Math.min(Math.abs(Sr-Cr)/2,+Xt.apply(this,arguments)))>.001){Bn=Cr<Sr^ta?0:1;var Ao=hn,Bo=hn;if(on<lt){var Ds=jo==null?[ki,zi]:ri==null?[Ha,Wa]:Ci([Ha,Wa],[jo,Ii],[ri,xi],[ki,zi]),Ts=Ha-Ds[0],lu=Wa-Ds[1],ps=ri-Ds[0],zs=xi-Ds[1],Eu=1/Math.sin(Math.acos((Ts*ps+lu*zs)/(Math.sqrt(Ts*Ts+lu*lu)*Math.sqrt(ps*ps+zs*zs)))/2),ie=Math.sqrt(Ds[0]*Ds[0]+Ds[1]*Ds[1]);Bo=Math.min(hn,(Cr-ie)/(Eu-1)),Ao=Math.min(hn,(Sr-ie)/(Eu+1))}if(ri!=null){var nr=jl(jo==null?[ki,zi]:[jo,Ii],[Ha,Wa],Sr,Ao,ta),cr=jl([ri,xi],[ki,zi],Sr,Ao,ta);hn===Ao?Ji.push("M",nr[0],"A",Ao,",",Ao," 0 0,",Bn," ",nr[1],"A",Sr,",",Sr," 0 ",1-ta^$l(nr[1][0],nr[1][1],cr[1][0],cr[1][1]),",",ta," ",cr[1],"A",Ao,",",Ao," 0 0,",Bn," ",cr[0]):Ji.push("M",nr[0],"A",Ao,",",Ao," 0 1,",Bn," ",cr[0])}else Ji.push("M",Ha,",",Wa);if(jo!=null){var sn=jl([Ha,Wa],[jo,Ii],Cr,-Bo,ta),zn=jl([ki,zi],ri==null?[Ha,Wa]:[ri,xi],Cr,-Bo,ta);hn===Bo?Ji.push("L",zn[0],"A",Bo,",",Bo," 0 0,",Bn," ",zn[1],"A",Cr,",",Cr," 0 ",ta^$l(zn[1][0],zn[1][1],sn[1][0],sn[1][1]),",",1-ta," ",sn[1],"A",Bo,",",Bo," 0 0,",Bn," ",sn[0]):Ji.push("L",zn[0],"A",Bo,",",Bo," 0 0,",Bn," ",sn[0])}else Ji.push("L",ki,",",zi)}else Ji.push("M",Ha,",",Wa),ri!=null&&Ji.push("A",Sr,",",Sr," 0 ",es,",",ta," ",ri,",",xi),Ji.push("L",ki,",",zi),jo!=null&&Ji.push("A",Cr,",",Cr," 0 ",Ns,",",1-ta," ",jo,",",Ii);return Ji.push("Z"),Ji.join("")}function or(Cr,Sr){return"M0,"+Cr+"A"+Cr+","+Cr+" 0 1,"+Sr+" 0,"+-Cr+"A"+Cr+","+Cr+" 0 1,"+Sr+" 0,"+Cr}return je.innerRadius=function(Cr){return arguments.length?(gt=pe(Cr),je):gt},je.outerRadius=function(Cr){return arguments.length?(Et=pe(Cr),je):Et},je.cornerRadius=function(Cr){return arguments.length?(Xt=pe(Cr),je):Xt},je.padRadius=function(Cr){return arguments.length?(fe=Cr==Rs?Rs:pe(Cr),je):fe},je.startAngle=function(Cr){return arguments.length?(me=pe(Cr),je):me},je.endAngle=function(Cr){return arguments.length?(we=pe(Cr),je):we},je.padAngle=function(Cr){return arguments.length?(Ve=pe(Cr),je):Ve},je.centroid=function(){var Cr=(+gt.apply(this,arguments)+ +Et.apply(this,arguments))/2,Sr=(+me.apply(this,arguments)+ +we.apply(this,arguments))/2-Ht;return[Math.cos(Sr)*Cr,Math.sin(Sr)*Cr]},je};var Rs="auto";function bi(gt){return gt.innerRadius}function so(gt){return gt.outerRadius}function ws(gt){return gt.startAngle}function fs(gt){return gt.endAngle}function Ll(gt){return gt&&gt.padAngle}function $l(gt,Et,Xt,fe){return(gt-Xt)*Et-(Et-fe)*gt>0?0:1}function jl(gt,Et,Xt,fe,me){var we=gt[0]-Et[0],Ve=gt[1]-Et[1],je=(me?fe:-fe)/Math.sqrt(we*we+Ve*Ve),or=je*Ve,Cr=-je*we,Sr=gt[0]+or,Wr=gt[1]+Cr,an=Et[0]+or,on=Et[1]+Cr,ta=(Sr+an)/2,hn=(Wr+on)/2,Bn=an-Sr,Hn=on-Wr,Yn=Bn*Bn+Hn*Hn,na=Xt-fe,_n=Sr*on-an*Wr,Ha=(Hn<0?-1:1)*Math.sqrt(Math.max(0,na*na*Yn-_n*_n)),Wa=(_n*Hn-Bn*Ha)/Yn,ri=(-_n*Bn-Hn*Ha)/Yn,xi=(_n*Hn+Bn*Ha)/Yn,ki=(-_n*Bn+Hn*Ha)/Yn,zi=Wa-ta,jo=ri-hn,Ii=xi-ta,Ji=ki-hn;return zi*zi+jo*jo>Ii*Ii+Ji*Ji&&(Wa=xi,ri=ki),[[Wa-or,ri-Cr],[Wa*Xt/na,ri*Xt/na]]}function Bu(){return!0}function Jl(gt){var Et=ci,Xt=Ti,fe=Bu,me=nl,we=me.key,Ve=.7;function je(or){var Cr=[],Sr=[],Wr=-1,an=or.length,on,ta=pe(Et),hn=pe(Xt);function Bn(){Cr.push("M",me(gt(Sr),Ve))}for(;++Wr<an;)fe.call(this,on=or[Wr],Wr)?Sr.push([+ta.call(this,on,Wr),+hn.call(this,on,Wr)]):Sr.length&&(Bn(),Sr=[]);return Sr.length&&Bn(),Cr.length?Cr.join(""):null}return je.x=function(or){return arguments.length?(Et=or,je):Et},je.y=function(or){return arguments.length?(Xt=or,je):Xt},je.defined=function(or){return arguments.length?(fe=or,je):fe},je.interpolate=function(or){return arguments.length?(typeof or=="function"?we=me=or:we=(me=Ru.get(or)||nl).key,je):we},je.tension=function(or){return arguments.length?(Ve=or,je):Ve},je}u.svg.line=function(){return Jl(B)};var Ru=u.map({linear:nl,"linear-closed":Nu,step:Ui,"step-before":fo,"step-after":Ql,basis:xt,"basis-open":kt,"basis-closed":Lt,bundle:le,cardinal:Pt,"cardinal-open":ul,"cardinal-closed":Dc,monotone:Gt});Ru.forEach(function(gt,Et){Et.key=gt,Et.closed=/-closed$/.test(gt)});function nl(gt){return gt.length>1?gt.join("L"):gt+"Z"}function Nu(gt){return gt.join("L")+"Z"}function Ui(gt){for(var Et=0,Xt=gt.length,fe=gt[0],me=[fe[0],",",fe[1]];++Et<Xt;)me.push("H",(fe[0]+(fe=gt[Et])[0])/2,"V",fe[1]);return Xt>1&&me.push("H",fe[0]),me.join("")}function fo(gt){for(var Et=0,Xt=gt.length,fe=gt[0],me=[fe[0],",",fe[1]];++Et<Xt;)me.push("V",(fe=gt[Et])[1],"H",fe[0]);return me.join("")}function Ql(gt){for(var Et=0,Xt=gt.length,fe=gt[0],me=[fe[0],",",fe[1]];++Et<Xt;)me.push("H",(fe=gt[Et])[0],"V",fe[1]);return me.join("")}function ul(gt,Et){return gt.length<4?nl(gt):gt[1]+z(gt.slice(1,-1),at(gt,Et))}function Dc(gt,Et){return gt.length<3?Nu(gt):gt[0]+z((gt.push(gt[0]),gt),at([gt[gt.length-2]].concat(gt,[gt[1]]),Et))}function Pt(gt,Et){return gt.length<3?nl(gt):gt[0]+z(gt,at(gt,Et))}function z(gt,Et){if(Et.length<1||gt.length!=Et.length&&gt.length!=Et.length+2)return nl(gt);var Xt=gt.length!=Et.length,fe="",me=gt[0],we=gt[1],Ve=Et[0],je=Ve,or=1;if(Xt&&(fe+="Q"+(we[0]-Ve[0]*2/3)+","+(we[1]-Ve[1]*2/3)+","+we[0]+","+we[1],me=gt[1],or=2),Et.length>1){je=Et[1],we=gt[or],or++,fe+="C"+(me[0]+Ve[0])+","+(me[1]+Ve[1])+","+(we[0]-je[0])+","+(we[1]-je[1])+","+we[0]+","+we[1];for(var Cr=2;Cr<Et.length;Cr++,or++)we=gt[or],je=Et[Cr],fe+="S"+(we[0]-je[0])+","+(we[1]-je[1])+","+we[0]+","+we[1]}if(Xt){var Sr=gt[or];fe+="Q"+(we[0]+je[0]*2/3)+","+(we[1]+je[1]*2/3)+","+Sr[0]+","+Sr[1]}return fe}function at(gt,Et){for(var Xt=[],fe=(1-Et)/2,me,we=gt[0],Ve=gt[1],je=1,or=gt.length;++je<or;)me=we,we=Ve,Ve=gt[je],Xt.push([fe*(Ve[0]-me[0]),fe*(Ve[1]-me[1])]);return Xt}function xt(gt){if(gt.length<3)return nl(gt);var Et=1,Xt=gt.length,fe=gt[0],me=fe[0],we=fe[1],Ve=[me,me,me,(fe=gt[1])[0]],je=[we,we,we,fe[1]],or=[me,",",we,"L",xe(hr,Ve),",",xe(hr,je)];for(gt.push(gt[Xt-1]);++Et<=Xt;)fe=gt[Et],Ve.shift(),Ve.push(fe[0]),je.shift(),je.push(fe[1]),pr(or,Ve,je);return gt.pop(),or.push("L",fe),or.join("")}function kt(gt){if(gt.length<4)return nl(gt);for(var Et=[],Xt=-1,fe=gt.length,me,we=[0],Ve=[0];++Xt<3;)me=gt[Xt],we.push(me[0]),Ve.push(me[1]);for(Et.push(xe(hr,we)+","+xe(hr,Ve)),--Xt;++Xt<fe;)me=gt[Xt],we.shift(),we.push(me[0]),Ve.shift(),Ve.push(me[1]),pr(Et,we,Ve);return Et.join("")}function Lt(gt){for(var Et,Xt=-1,fe=gt.length,me=fe+4,we,Ve=[],je=[];++Xt<4;)we=gt[Xt%fe],Ve.push(we[0]),je.push(we[1]);for(Et=[xe(hr,Ve),",",xe(hr,je)],--Xt;++Xt<me;)we=gt[Xt%fe],Ve.shift(),Ve.push(we[0]),je.shift(),je.push(we[1]),pr(Et,Ve,je);return Et.join("")}function le(gt,Et){var Xt=gt.length-1;if(Xt)for(var fe=gt[0][0],me=gt[0][1],we=gt[Xt][0]-fe,Ve=gt[Xt][1]-me,je=-1,or,Cr;++je<=Xt;)or=gt[je],Cr=je/Xt,or[0]=Et*or[0]+(1-Et)*(fe+Cr*we),or[1]=Et*or[1]+(1-Et)*(me+Cr*Ve);return xt(gt)}function xe(gt,Et){return gt[0]*Et[0]+gt[1]*Et[1]+gt[2]*Et[2]+gt[3]*Et[3]}var Pe=[0,2/3,1/3,0],$e=[0,1/3,2/3,0],hr=[0,1/6,2/3,1/6];function pr(gt,Et,Xt){gt.push("C",xe(Pe,Et),",",xe(Pe,Xt),",",xe($e,Et),",",xe($e,Xt),",",xe(hr,Et),",",xe(hr,Xt))}function Br(gt,Et){return(Et[1]-gt[1])/(Et[0]-gt[0])}function Jr(gt){for(var Et=0,Xt=gt.length-1,fe=[],me=gt[0],we=gt[1],Ve=fe[0]=Br(me,we);++Et<Xt;)fe[Et]=(Ve+(Ve=Br(me=we,we=gt[Et+1])))/2;return fe[Et]=Ve,fe}function Rt(gt){for(var Et=[],Xt,fe,me,we,Ve=Jr(gt),je=-1,or=gt.length-1;++je<or;)Xt=Br(gt[je],gt[je+1]),l(Xt)<qt?Ve[je]=Ve[je+1]=0:(fe=Ve[je]/Xt,me=Ve[je+1]/Xt,we=fe*fe+me*me,we>9&&(we=Xt*3/Math.sqrt(we),Ve[je]=we*fe,Ve[je+1]=we*me));for(je=-1;++je<=or;)we=(gt[Math.min(or,je+1)][0]-gt[Math.max(0,je-1)][0])/(6*(1+Ve[je]*Ve[je])),Et.push([we||0,Ve[je]*we||0]);return Et}function Gt(gt){return gt.length<3?nl(gt):gt[0]+z(gt,Rt(gt))}u.svg.line.radial=function(){var gt=Jl(ae);return gt.radius=gt.x,delete gt.x,gt.angle=gt.y,delete gt.y,gt};function ae(gt){for(var Et,Xt=-1,fe=gt.length,me,we;++Xt<fe;)Et=gt[Xt],me=Et[0],we=Et[1]-Ht,Et[0]=me*Math.cos(we),Et[1]=me*Math.sin(we);return gt}function ce(gt){var Et=ci,Xt=ci,fe=0,me=Ti,we=Bu,Ve=nl,je=Ve.key,or=Ve,Cr="L",Sr=.7;function Wr(an){var on=[],ta=[],hn=[],Bn=-1,Hn=an.length,Yn,na=pe(Et),_n=pe(fe),Ha=Et===Xt?function(){return ri}:pe(Xt),Wa=fe===me?function(){return xi}:pe(me),ri,xi;function ki(){on.push("M",Ve(gt(hn),Sr),Cr,or(gt(ta.reverse()),Sr),"Z")}for(;++Bn<Hn;)we.call(this,Yn=an[Bn],Bn)?(ta.push([ri=+na.call(this,Yn,Bn),xi=+_n.call(this,Yn,Bn)]),hn.push([+Ha.call(this,Yn,Bn),+Wa.call(this,Yn,Bn)])):ta.length&&(ki(),ta=[],hn=[]);return ta.length&&ki(),on.length?on.join(""):null}return Wr.x=function(an){return arguments.length?(Et=Xt=an,Wr):Xt},Wr.x0=function(an){return arguments.length?(Et=an,Wr):Et},Wr.x1=function(an){return arguments.length?(Xt=an,Wr):Xt},Wr.y=function(an){return arguments.length?(fe=me=an,Wr):me},Wr.y0=function(an){return arguments.length?(fe=an,Wr):fe},Wr.y1=function(an){return arguments.length?(me=an,Wr):me},Wr.defined=function(an){return arguments.length?(we=an,Wr):we},Wr.interpolate=function(an){return arguments.length?(typeof an=="function"?je=Ve=an:je=(Ve=Ru.get(an)||nl).key,or=Ve.reverse||Ve,Cr=Ve.closed?"M":"L",Wr):je},Wr.tension=function(an){return arguments.length?(Sr=an,Wr):Sr},Wr}fo.reverse=Ql,Ql.reverse=fo,u.svg.area=function(){return ce(B)},u.svg.area.radial=function(){var gt=ce(ae);return gt.radius=gt.x,delete gt.x,gt.innerRadius=gt.x0,delete gt.x0,gt.outerRadius=gt.x1,delete gt.x1,gt.angle=gt.y,delete gt.y,gt.startAngle=gt.y0,delete gt.y0,gt.endAngle=gt.y1,delete gt.y1,gt};function Te(gt){return gt.source}function ye(gt){return gt.target}u.svg.chord=function(){var gt=Te,Et=ye,Xt=ze,fe=ws,me=fs;function we(Sr,Wr){var an=Ve(this,gt,Sr,Wr),on=Ve(this,Et,Sr,Wr);return"M"+an.p0+or(an.r,an.p1,an.a1-an.a0)+(je(an,on)?Cr(an.r,an.p1,an.r,an.p0):Cr(an.r,an.p1,on.r,on.p0)+or(on.r,on.p1,on.a1-on.a0)+Cr(on.r,on.p1,an.r,an.p0))+"Z"}function Ve(Sr,Wr,an,on){var ta=Wr.call(Sr,an,on),hn=Xt.call(Sr,ta,on),Bn=fe.call(Sr,ta,on)-Ht,Hn=me.call(Sr,ta,on)-Ht;return{r:hn,a0:Bn,a1:Hn,p0:[hn*Math.cos(Bn),hn*Math.sin(Bn)],p1:[hn*Math.cos(Hn),hn*Math.sin(Hn)]}}function je(Sr,Wr){return Sr.a0==Wr.a0&&Sr.a1==Wr.a1}function or(Sr,Wr,an){return"A"+Sr+","+Sr+" 0 "+ +(an>lt)+",1 "+Wr}function Cr(Sr,Wr,an,on){return"Q 0,0 "+on}return we.radius=function(Sr){return arguments.length?(Xt=pe(Sr),we):Xt},we.source=function(Sr){return arguments.length?(gt=pe(Sr),we):gt},we.target=function(Sr){return arguments.length?(Et=pe(Sr),we):Et},we.startAngle=function(Sr){return arguments.length?(fe=pe(Sr),we):fe},we.endAngle=function(Sr){return arguments.length?(me=pe(Sr),we):me},we};function ze(gt){return gt.radius}u.svg.diagonal=function(){var gt=Te,Et=ye,Xt=rr;function fe(me,we){var Ve=gt.call(this,me,we),je=Et.call(this,me,we),or=(Ve.y+je.y)/2,Cr=[Ve,{x:Ve.x,y:or},{x:je.x,y:or},je];return Cr=Cr.map(Xt),"M"+Cr[0]+"C"+Cr[1]+" "+Cr[2]+" "+Cr[3]}return fe.source=function(me){return arguments.length?(gt=pe(me),fe):gt},fe.target=function(me){return arguments.length?(Et=pe(me),fe):Et},fe.projection=function(me){return arguments.length?(Xt=me,fe):Xt},fe};function rr(gt){return[gt.x,gt.y]}u.svg.diagonal.radial=function(){var gt=u.svg.diagonal(),Et=rr,Xt=gt.projection;return gt.projection=function(fe){return arguments.length?Xt(fr(Et=fe)):Et},gt};function fr(gt){return function(){var Et=gt.apply(this,arguments),Xt=Et[0],fe=Et[1]-Ht;return[Xt*Math.cos(fe),Xt*Math.sin(fe)]}}u.svg.symbol=function(){var gt=Lr,Et=gr;function Xt(fe,me){return(nn.get(gt.call(this,fe,me))||Hr)(Et.call(this,fe,me))}return Xt.type=function(fe){return arguments.length?(gt=pe(fe),Xt):gt},Xt.size=function(fe){return arguments.length?(Et=pe(fe),Xt):Et},Xt};function gr(){return 64}function Lr(){return"circle"}function Hr(gt){var Et=Math.sqrt(gt/lt);return"M0,"+Et+"A"+Et+","+Et+" 0 1,1 0,"+-Et+"A"+Et+","+Et+" 0 1,1 0,"+Et+"Z"}var nn=u.map({circle:Hr,cross:function(gt){var Et=Math.sqrt(gt/5)/2;return"M"+-3*Et+","+-Et+"H"+-Et+"V"+-3*Et+"H"+Et+"V"+-Et+"H"+3*Et+"V"+Et+"H"+Et+"V"+3*Et+"H"+-Et+"V"+Et+"H"+-3*Et+"Z"},diamond:function(gt){var Et=Math.sqrt(gt/(2*Mn)),Xt=Et*Mn;return"M0,"+-Et+"L"+Xt+",0 0,"+Et+" "+-Xt+",0Z"},square:function(gt){var Et=Math.sqrt(gt)/2;return"M"+-Et+","+-Et+"L"+Et+","+-Et+" "+Et+","+Et+" "+-Et+","+Et+"Z"},"triangle-down":function(gt){var Et=Math.sqrt(gt/cn),Xt=Et*cn/2;return"M0,"+Xt+"L"+Et+","+-Xt+" "+-Et+","+-Xt+"Z"},"triangle-up":function(gt){var Et=Math.sqrt(gt/cn),Xt=Et*cn/2;return"M0,"+-Xt+"L"+Et+","+Xt+" "+-Et+","+Xt+"Z"}});u.svg.symbolTypes=nn.keys();var cn=Math.sqrt(3),Mn=Math.tan(30*Yt);J.transition=function(gt){for(var Et=Ai||++ai,Xt=Xo(gt),fe=[],me,we,Ve=mi||{time:Date.now(),ease:Fi,delay:0,duration:250},je=-1,or=this.length;++je<or;){fe.push(me=[]);for(var Cr=this[je],Sr=-1,Wr=Cr.length;++Sr<Wr;)(we=Cr[Sr])&&po(we,Sr,Xt,Et,Ve),me.push(we)}return xa(fe,Xt,Et)},J.interrupt=function(gt){return this.each(gt==null?Jn:_a(Xo(gt)))};var Jn=_a(Xo());function _a(gt){return function(){var Et,Xt,fe;(Et=this[gt])&&(fe=Et[Xt=Et.active])&&(fe.timer.c=null,fe.timer.t=NaN,--Et.count?delete Et[Xt]:delete this[gt],Et.active+=.5,fe.event&&fe.event.interrupt.call(this,this.__data__,fe.index))}}function xa(gt,Et,Xt){return K(gt,La),gt.namespace=Et,gt.id=Xt,gt}var La=[],ai=0,Ai,mi;La.call=J.call,La.empty=J.empty,La.node=J.node,La.size=J.size,u.transition=function(gt,Et){return gt&&gt.transition?Ai?gt.transition(Et):gt:u.selection().transition(gt)},u.transition.prototype=La,La.select=function(gt){var Et=this.id,Xt=this.namespace,fe=[],me,we,Ve;gt=q(gt);for(var je=-1,or=this.length;++je<or;){fe.push(me=[]);for(var Cr=this[je],Sr=-1,Wr=Cr.length;++Sr<Wr;)(Ve=Cr[Sr])&&(we=gt.call(Ve,Ve.__data__,Sr,je))?("__data__"in Ve&&(we.__data__=Ve.__data__),po(we,Sr,Xt,Et,Ve[Xt][Et]),me.push(we)):me.push(null)}return xa(fe,Xt,Et)},La.selectAll=function(gt){var Et=this.id,Xt=this.namespace,fe=[],me,we,Ve,je,or;gt=it(gt);for(var Cr=-1,Sr=this.length;++Cr<Sr;)for(var Wr=this[Cr],an=-1,on=Wr.length;++an<on;)if(Ve=Wr[an]){or=Ve[Xt][Et],we=gt.call(Ve,Ve.__data__,an,Cr),fe.push(me=[]);for(var ta=-1,hn=we.length;++ta<hn;)(je=we[ta])&&po(je,ta,Xt,Et,or),me.push(je)}return xa(fe,Xt,Et)},La.filter=function(gt){var Et=[],Xt,fe,me;typeof gt!="function"&&(gt=vt(gt));for(var we=0,Ve=this.length;we<Ve;we++){Et.push(Xt=[]);for(var fe=this[we],je=0,or=fe.length;je<or;je++)(me=fe[je])&&gt.call(me,me.__data__,je,we)&&Xt.push(me)}return xa(Et,this.namespace,this.id)},La.tween=function(gt,Et){var Xt=this.id,fe=this.namespace;return arguments.length<2?this.node()[fe][Xt].tween.get(gt):re(this,Et==null?function(me){me[fe][Xt].tween.remove(gt)}:function(me){me[fe][Xt].tween.set(gt,Et)})};function Yi(gt,Et,Xt,fe){var me=gt.id,we=gt.namespace;return re(gt,typeof Xt=="function"?function(Ve,je,or){Ve[we][me].tween.set(Et,fe(Xt.call(Ve,Ve.__data__,je,or)))}:(Xt=fe(Xt),function(Ve){Ve[we][me].tween.set(Et,Xt)}))}La.attr=function(gt,Et){if(arguments.length<2){for(Et in gt)this.attr(Et,gt[Et]);return this}var Xt=gt=="transform"?_c:Fo,fe=u.ns.qualify(gt);function me(){this.removeAttribute(fe)}function we(){this.removeAttributeNS(fe.space,fe.local)}function Ve(or){return or==null?me:(or+="",function(){var Cr=this.getAttribute(fe),Sr;return Cr!==or&&(Sr=Xt(Cr,or),function(Wr){this.setAttribute(fe,Sr(Wr))})})}function je(or){return or==null?we:(or+="",function(){var Cr=this.getAttributeNS(fe.space,fe.local),Sr;return Cr!==or&&(Sr=Xt(Cr,or),function(Wr){this.setAttributeNS(fe.space,fe.local,Sr(Wr))})})}return Yi(this,"attr."+gt,Et,fe.local?je:Ve)},La.attrTween=function(gt,Et){var Xt=u.ns.qualify(gt);function fe(we,Ve){var je=Et.call(this,we,Ve,this.getAttribute(Xt));return je&&function(or){this.setAttribute(Xt,je(or))}}function me(we,Ve){var je=Et.call(this,we,Ve,this.getAttributeNS(Xt.space,Xt.local));return je&&function(or){this.setAttributeNS(Xt.space,Xt.local,je(or))}}return this.tween("attr."+gt,Xt.local?me:fe)},La.style=function(gt,Et,Xt){var fe=arguments.length;if(fe<3){if(typeof gt!="string"){fe<2&&(Et="");for(Xt in gt)this.style(Xt,gt[Xt],Et);return this}Xt=""}function me(){this.style.removeProperty(gt)}function we(Ve){return Ve==null?me:(Ve+="",function(){var je=e(this).getComputedStyle(this,null).getPropertyValue(gt),or;return je!==Ve&&(or=Fo(je,Ve),function(Cr){this.style.setProperty(gt,or(Cr),Xt)})})}return Yi(this,"style."+gt,Et,we)},La.styleTween=function(gt,Et,Xt){arguments.length<3&&(Xt="");function fe(me,we){var Ve=Et.call(this,me,we,e(this).getComputedStyle(this,null).getPropertyValue(gt));return Ve&&function(je){this.style.setProperty(gt,Ve(je),Xt)}}return this.tween("style."+gt,fe)},La.text=function(gt){return Yi(this,"text",gt,Go)};function Go(gt){return gt==null&&(gt=""),function(){this.textContent=gt}}La.remove=function(){var gt=this.namespace;return this.each("end.transition",function(){var Et;this[gt].count<2&&(Et=this.parentNode)&&Et.removeChild(this)})},La.ease=function(gt){var Et=this.id,Xt=this.namespace;return arguments.length<1?this.node()[Xt][Et].ease:(typeof gt!="function"&&(gt=u.ease.apply(u,arguments)),re(this,function(fe){fe[Xt][Et].ease=gt}))},La.delay=function(gt){var Et=this.id,Xt=this.namespace;return arguments.length<1?this.node()[Xt][Et].delay:re(this,typeof gt=="function"?function(fe,me,we){fe[Xt][Et].delay=+gt.call(fe,fe.__data__,me,we)}:(gt=+gt,function(fe){fe[Xt][Et].delay=gt}))},La.duration=function(gt){var Et=this.id,Xt=this.namespace;return arguments.length<1?this.node()[Xt][Et].duration:re(this,typeof gt=="function"?function(fe,me,we){fe[Xt][Et].duration=Math.max(1,gt.call(fe,fe.__data__,me,we))}:(gt=Math.max(1,gt),function(fe){fe[Xt][Et].duration=gt}))},La.each=function(gt,Et){var Xt=this.id,fe=this.namespace;if(arguments.length<2){var me=mi,we=Ai;try{Ai=Xt,re(this,function(Ve,je,or){mi=Ve[fe][Xt],gt.call(Ve,Ve.__data__,je,or)})}finally{mi=me,Ai=we}}else re(this,function(Ve){var je=Ve[fe][Xt];(je.event||(je.event=u.dispatch("start","end","interrupt"))).on(gt,Et)});return this},La.transition=function(){for(var gt=this.id,Et=++ai,Xt=this.namespace,fe=[],me,we,Ve,je,or=0,Cr=this.length;or<Cr;or++){fe.push(me=[]);for(var we=this[or],Sr=0,Wr=we.length;Sr<Wr;Sr++)(Ve=we[Sr])&&(je=Ve[Xt][gt],po(Ve,Sr,Xt,Et,{time:je.time,ease:je.ease,delay:je.delay+je.duration,duration:je.duration})),me.push(Ve)}return xa(fe,Xt,Et)};function Xo(gt){return gt==null?"__transition__":"__transition_"+gt+"__"}function po(gt,Et,Xt,fe,me){var we=gt[Xt]||(gt[Xt]={active:0,count:0}),Ve=we[fe],je,or,Cr,Sr,Wr;function an(hn){var Bn=Ve.delay;if(or.t=Bn+je,Bn<=hn)return on(hn-Bn);or.c=on}function on(hn){var Bn=we.active,Hn=we[Bn];Hn&&(Hn.timer.c=null,Hn.timer.t=NaN,--we.count,delete we[Bn],Hn.event&&Hn.event.interrupt.call(gt,gt.__data__,Hn.index));for(var Yn in we)if(+Yn<fe){var na=we[Yn];na.timer.c=null,na.timer.t=NaN,--we.count,delete we[Yn]}or.c=ta,Qn(function(){return or.c&&ta(hn||1)&&(or.c=null,or.t=NaN),1},0,je),we.active=fe,Ve.event&&Ve.event.start.call(gt,gt.__data__,Et),Wr=[],Ve.tween.forEach(function(_n,Ha){(Ha=Ha.call(gt,gt.__data__,Et))&&Wr.push(Ha)}),Sr=Ve.ease,Cr=Ve.duration}function ta(hn){for(var Bn=hn/Cr,Hn=Sr(Bn),Yn=Wr.length;Yn>0;)Wr[--Yn].call(gt,Hn);if(Bn>=1)return Ve.event&&Ve.event.end.call(gt,gt.__data__,Et),--we.count?delete we[fe]:delete gt[Xt],1}Ve||(je=me.time,or=Qn(an,0,je),Ve=we[fe]={tween:new S,time:je,timer:or,delay:me.delay,duration:me.duration,ease:me.ease,index:Et},me=null,++we.count)}u.svg.axis=function(){var gt=u.scale.linear(),Et=Qo,Xt=6,fe=6,me=3,we=[10],Ve=null,je;function or(Cr){Cr.each(function(){var Sr=u.select(this),Wr=this.__chart__||gt,an=this.__chart__=gt.copy(),on=Ve??(an.ticks?an.ticks.apply(an,we):an.domain()),ta=je??(an.tickFormat?an.tickFormat.apply(an,we):B),hn=Sr.selectAll(".tick").data(on,an),Bn=hn.enter().insert("g",".domain").attr("class","tick").style("opacity",qt),Hn=u.transition(hn.exit()).style("opacity",qt).remove(),Yn=u.transition(hn.order()).style("opacity",1),na=Math.max(Xt,0)+me,_n,Ha=Pn(an),Wa=Sr.selectAll(".domain").data([0]),ri=(Wa.enter().append("path").attr("class","domain"),u.transition(Wa));Bn.append("line"),Bn.append("text");var xi=Bn.select("line"),ki=Yn.select("line"),zi=hn.select("text").text(ta),jo=Bn.select("text"),Ii=Yn.select("text"),Ji=Et==="top"||Et==="left"?-1:1,es,pl,Ns,fi;if(Et==="bottom"||Et==="top"?(_n=Us,es="x",Ns="y",pl="x2",fi="y2",zi.attr("dy",Ji<0?"0em":".71em").style("text-anchor","middle"),ri.attr("d","M"+Ha[0]+","+Ji*fe+"V0H"+Ha[1]+"V"+Ji*fe)):(_n=To,es="y",Ns="x",pl="y2",fi="x2",zi.attr("dy",".32em").style("text-anchor",Ji<0?"end":"start"),ri.attr("d","M"+Ji*fe+","+Ha[0]+"H0V"+Ha[1]+"H"+Ji*fe)),xi.attr(fi,Ji*Xt),jo.attr(Ns,Ji*na),ki.attr(pl,0).attr(fi,Ji*Xt),Ii.attr(es,0).attr(Ns,Ji*na),an.rangeBand){var Ao=an,Bo=Ao.rangeBand()/2;Wr=an=function(Ds){return Ao(Ds)+Bo}}else Wr.rangeBand?Wr=an:Hn.call(_n,an,Wr);Bn.call(_n,Wr,an),Yn.call(_n,an,an)})}return or.scale=function(Cr){return arguments.length?(gt=Cr,or):gt},or.orient=function(Cr){return arguments.length?(Et=Cr in Js?Cr+"":Qo,or):Et},or.ticks=function(){return arguments.length?(we=E(arguments),or):we},or.tickValues=function(Cr){return arguments.length?(Ve=Cr,or):Ve},or.tickFormat=function(Cr){return arguments.length?(je=Cr,or):je},or.tickSize=function(Cr){var Sr=arguments.length;return Sr?(Xt=+Cr,fe=+arguments[Sr-1],or):Xt},or.innerTickSize=function(Cr){return arguments.length?(Xt=+Cr,or):Xt},or.outerTickSize=function(Cr){return arguments.length?(fe=+Cr,or):fe},or.tickPadding=function(Cr){return arguments.length?(me=+Cr,or):me},or.tickSubdivide=function(){return arguments.length&&or},or};var Qo="bottom",Js={top:1,right:1,bottom:1,left:1};function Us(gt,Et,Xt){gt.attr("transform",function(fe){var me=Et(fe);return"translate("+(isFinite(me)?me:Xt(fe))+",0)"})}function To(gt,Et,Xt){gt.attr("transform",function(fe){var me=Et(fe);return"translate(0,"+(isFinite(me)?me:Xt(fe))+")"})}u.svg.brush=function(){var gt=st(Sr,"brushstart","brush","brushend"),Et=null,Xt=null,fe=[0,0],me=[0,0],we,Ve,je=!0,or=!0,Cr=hl[0];function Sr(hn){hn.each(function(){var Bn=u.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ta).on("touchstart.brush",ta),Hn=Bn.selectAll(".background").data([0]);Hn.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Bn.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Yn=Bn.selectAll(".resize").data(Cr,B);Yn.exit().remove(),Yn.enter().append("g").attr("class",function(Wa){return"resize "+Wa}).style("cursor",function(Wa){return ko[Wa]}).append("rect").attr("x",function(Wa){return/[ew]$/.test(Wa)?-3:null}).attr("y",function(Wa){return/^[ns]/.test(Wa)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Yn.style("display",Sr.empty()?"none":null);var na=u.transition(Bn),_n=u.transition(Hn),Ha;Et&&(Ha=Pn(Et),_n.attr("x",Ha[0]).attr("width",Ha[1]-Ha[0]),an(na)),Xt&&(Ha=Pn(Xt),_n.attr("y",Ha[0]).attr("height",Ha[1]-Ha[0]),on(na)),Wr(na)})}Sr.event=function(hn){hn.each(function(){var Bn=gt.of(this,arguments),Hn={x:fe,y:me,i:we,j:Ve},Yn=this.__chart__||Hn;this.__chart__=Hn,Ai?u.select(this).transition().each("start.brush",function(){we=Yn.i,Ve=Yn.j,fe=Yn.x,me=Yn.y,Bn({type:"brushstart"})}).tween("brush:brush",function(){var na=bs(fe,Hn.x),_n=bs(me,Hn.y);return we=Ve=null,function(Ha){fe=Hn.x=na(Ha),me=Hn.y=_n(Ha),Bn({type:"brush",mode:"resize"})}}).each("end.brush",function(){we=Hn.i,Ve=Hn.j,Bn({type:"brush",mode:"resize"}),Bn({type:"brushend"})}):(Bn({type:"brushstart"}),Bn({type:"brush",mode:"resize"}),Bn({type:"brushend"}))})};function Wr(hn){hn.selectAll(".resize").attr("transform",function(Bn){return"translate("+fe[+/e$/.test(Bn)]+","+me[+/^s/.test(Bn)]+")"})}function an(hn){hn.select(".extent").attr("x",fe[0]),hn.selectAll(".extent,.n>rect,.s>rect").attr("width",fe[1]-fe[0])}function on(hn){hn.select(".extent").attr("y",me[0]),hn.selectAll(".extent,.e>rect,.w>rect").attr("height",me[1]-me[0])}function ta(){var hn=this,Bn=u.select(u.event.target),Hn=gt.of(hn,arguments),Yn=u.select(hn),na=Bn.datum(),_n=!/^(n|s)$/.test(na)&&Et,Ha=!/^(e|w)$/.test(na)&&Xt,Wa=Bn.classed("extent"),ri=Mr(hn),xi,ki=u.mouse(hn),zi,jo=u.select(e(hn)).on("keydown.brush",es).on("keyup.brush",pl);if(u.event.changedTouches?jo.on("touchmove.brush",Ns).on("touchend.brush",Ao):jo.on("mousemove.brush",Ns).on("mouseup.brush",Ao),Yn.interrupt().selectAll("*").interrupt(),Wa)ki[0]=fe[0]-ki[0],ki[1]=me[0]-ki[1];else if(na){var Ii=+/w$/.test(na),Ji=+/^n/.test(na);zi=[fe[1-Ii]-ki[0],me[1-Ji]-ki[1]],ki[0]=fe[Ii],ki[1]=me[Ji]}else u.event.altKey&&(xi=ki.slice());Yn.style("pointer-events","none").selectAll(".resize").style("display",null),u.select("body").style("cursor",Bn.style("cursor")),Hn({type:"brushstart"}),Ns();function es(){u.event.keyCode==32&&(Wa||(xi=null,ki[0]-=fe[1],ki[1]-=me[1],Wa=2),rt())}function pl(){u.event.keyCode==32&&Wa==2&&(ki[0]+=fe[1],ki[1]+=me[1],Wa=0,rt())}function Ns(){var Bo=u.mouse(hn),Ds=!1;zi&&(Bo[0]+=zi[0],Bo[1]+=zi[1]),Wa||(u.event.altKey?(xi||(xi=[(fe[0]+fe[1])/2,(me[0]+me[1])/2]),ki[0]=fe[+(Bo[0]<xi[0])],ki[1]=me[+(Bo[1]<xi[1])]):xi=null),_n&&fi(Bo,Et,0)&&(an(Yn),Ds=!0),Ha&&fi(Bo,Xt,1)&&(on(Yn),Ds=!0),Ds&&(Wr(Yn),Hn({type:"brush",mode:Wa?"move":"resize"}))}function fi(Bo,Ds,Ts){var lu=Pn(Ds),ps=lu[0],zs=lu[1],Eu=ki[Ts],ie=Ts?me:fe,nr=ie[1]-ie[0],cr,sn;if(Wa&&(ps-=Eu,zs-=nr+Eu),cr=(Ts?or:je)?Math.max(ps,Math.min(zs,Bo[Ts])):Bo[Ts],Wa?sn=(cr+=Eu)+nr:(xi&&(Eu=Math.max(ps,Math.min(zs,2*xi[Ts]-cr))),Eu<cr?(sn=cr,cr=Eu):sn=Eu),ie[0]!=cr||ie[1]!=sn)return Ts?Ve=null:we=null,ie[0]=cr,ie[1]=sn,!0}function Ao(){Ns(),Yn.style("pointer-events","all").selectAll(".resize").style("display",Sr.empty()?"none":null),u.select("body").style("cursor",null),jo.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),ri(),Hn({type:"brushend"})}}return Sr.x=function(hn){return arguments.length?(Et=hn,Cr=hl[!Et<<1|!Xt],Sr):Et},Sr.y=function(hn){return arguments.length?(Xt=hn,Cr=hl[!Et<<1|!Xt],Sr):Xt},Sr.clamp=function(hn){return arguments.length?(Et&&Xt?(je=!!hn[0],or=!!hn[1]):Et?je=!!hn:Xt&&(or=!!hn),Sr):Et&&Xt?[je,or]:Et?je:Xt?or:null},Sr.extent=function(hn){var Bn,Hn,Yn,na,_n;return arguments.length?(Et&&(Bn=hn[0],Hn=hn[1],Xt&&(Bn=Bn[0],Hn=Hn[0]),we=[Bn,Hn],Et.invert&&(Bn=Et(Bn),Hn=Et(Hn)),Hn<Bn&&(_n=Bn,Bn=Hn,Hn=_n),(Bn!=fe[0]||Hn!=fe[1])&&(fe=[Bn,Hn])),Xt&&(Yn=hn[0],na=hn[1],Et&&(Yn=Yn[1],na=na[1]),Ve=[Yn,na],Xt.invert&&(Yn=Xt(Yn),na=Xt(na)),na<Yn&&(_n=Yn,Yn=na,na=_n),(Yn!=me[0]||na!=me[1])&&(me=[Yn,na])),Sr):(Et&&(we?(Bn=we[0],Hn=we[1]):(Bn=fe[0],Hn=fe[1],Et.invert&&(Bn=Et.invert(Bn),Hn=Et.invert(Hn)),Hn<Bn&&(_n=Bn,Bn=Hn,Hn=_n))),Xt&&(Ve?(Yn=Ve[0],na=Ve[1]):(Yn=me[0],na=me[1],Xt.invert&&(Yn=Xt.invert(Yn),na=Xt.invert(na)),na<Yn&&(_n=Yn,Yn=na,na=_n))),Et&&Xt?[[Bn,Yn],[Hn,na]]:Et?[Bn,Hn]:Xt&&[Yn,na])},Sr.clear=function(){return Sr.empty()||(fe=[0,0],me=[0,0],we=Ve=null),Sr},Sr.empty=function(){return!!Et&&fe[0]==fe[1]||!!Xt&&me[0]==me[1]},u.rebind(Sr,gt,"on")};var ko={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},hl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];u.text=Ke(function(gt){return gt.responseText}),u.json=function(gt,Et){return xr(gt,"application/json",Sl,Et)};function Sl(gt){return JSON.parse(gt.responseText)}u.html=function(gt,Et){return xr(gt,"text/html",tu,Et)};function tu(gt){var Et=A.createRange();return Et.selectNode(A.body),Et.createContextualFragment(gt.responseText)}u.xml=Ke(function(gt){return gt.responseXML}),typeof V=="object"&&V.exports?V.exports=u:this.d3=u}).apply(self)}),G_=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.d3=u.d3||{}))})(Z,function(u){var d=new Date,E=new Date;function A(vt,Ut,re,Zt){function ue(Me){return vt(Me=arguments.length===0?new Date:new Date(+Me)),Me}return ue.floor=function(Me){return vt(Me=new Date(+Me)),Me},ue.ceil=function(Me){return vt(Me=new Date(Me-1)),Ut(Me,1),vt(Me),Me},ue.round=function(Me){var Ce=ue(Me),We=ue.ceil(Me);return Me-Ce<We-Me?Ce:We},ue.offset=function(Me,Ce){return Ut(Me=new Date(+Me),Ce==null?1:Math.floor(Ce)),Me},ue.range=function(Me,Ce,We){var qe=[],vr;if(Me=ue.ceil(Me),We=We==null?1:Math.floor(We),!(Me<Ce)||!(We>0))return qe;do qe.push(vr=new Date(+Me)),Ut(Me,We),vt(Me);while(vr<Me&&Me<Ce);return qe},ue.filter=function(Me){return A(function(Ce){if(Ce>=Ce)for(;vt(Ce),!Me(Ce);)Ce.setTime(Ce-1)},function(Ce,We){if(Ce>=Ce)if(We<0)for(;++We<=0;)for(;Ut(Ce,-1),!Me(Ce););else for(;--We>=0;)for(;Ut(Ce,1),!Me(Ce););})},re&&(ue.count=function(Me,Ce){return d.setTime(+Me),E.setTime(+Ce),vt(d),vt(E),Math.floor(re(d,E))},ue.every=function(Me){return Me=Math.floor(Me),!isFinite(Me)||!(Me>0)?null:Me>1?ue.filter(Zt?function(Ce){return Zt(Ce)%Me===0}:function(Ce){return ue.count(0,Ce)%Me===0}):ue}),ue}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,re){Ut.setTime(+Ut+re*vt)},function(Ut,re){return(re-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()}),f=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()}),g=v.range,m=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()}),w=m.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 y(vt){return A(function(Ut){Ut.setDate(Ut.getDate()-(Ut.getDay()+7-vt)%7),Ut.setHours(0,0,0,0)},function(Ut,re){Ut.setDate(Ut.getDate()+re*7)},function(Ut,re){return(re-Ut-(re.getTimezoneOffset()-Ut.getTimezoneOffset())*i)/a})}var S=y(0),k=y(1),M=y(2),T=y(3),c=y(4),h=y(5),b=y(6),_=S.range,P=k.range,L=M.range,D=T.range,B=c.range,R=h.range,I=b.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,re){Ut.setFullYear(Ut.getFullYear()+re*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,st=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()}),et=st.range,K=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}),ot=K.range;function X(vt){return A(function(Ut){Ut.setUTCDate(Ut.getUTCDate()-(Ut.getUTCDay()+7-vt)%7),Ut.setUTCHours(0,0,0,0)},function(Ut,re){Ut.setUTCDate(Ut.getUTCDate()+re*7)},function(Ut,re){return(re-Ut)/a})}var Q=X(0),ut=X(1),J=X(2),q=X(3),it=X(4),nt=X(5),dt=X(6),Tt=Q.range,wt=ut.range,It=J.range,Ct=q.range,Nt=it.range,ee=nt.range,Jt=dt.range,te=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()}),Kt=te.range,mt=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()});mt.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,re){Ut.setUTCFullYear(Ut.getUTCFullYear()+re*vt)})};var bt=mt.range;u.timeDay=l,u.timeDays=x,u.timeFriday=h,u.timeFridays=R,u.timeHour=m,u.timeHours=w,u.timeInterval=A,u.timeMillisecond=t,u.timeMilliseconds=e,u.timeMinute=v,u.timeMinutes=g,u.timeMonday=k,u.timeMondays=P,u.timeMonth=F,u.timeMonths=N,u.timeSaturday=b,u.timeSaturdays=I,u.timeSecond=s,u.timeSeconds=f,u.timeSunday=S,u.timeSundays=_,u.timeThursday=c,u.timeThursdays=B,u.timeTuesday=M,u.timeTuesdays=L,u.timeWednesday=T,u.timeWednesdays=D,u.timeWeek=S,u.timeWeeks=_,u.timeYear=j,u.timeYears=G,u.utcDay=K,u.utcDays=ot,u.utcFriday=nt,u.utcFridays=ee,u.utcHour=st,u.utcHours=et,u.utcMillisecond=t,u.utcMilliseconds=e,u.utcMinute=rt,u.utcMinutes=ct,u.utcMonday=ut,u.utcMondays=wt,u.utcMonth=te,u.utcMonths=Kt,u.utcSaturday=dt,u.utcSaturdays=Jt,u.utcSecond=s,u.utcSeconds=f,u.utcSunday=Q,u.utcSundays=Tt,u.utcThursday=it,u.utcThursdays=Nt,u.utcTuesday=J,u.utcTuesdays=It,u.utcWednesday=q,u.utcWednesdays=Ct,u.utcWeek=Q,u.utcWeeks=Tt,u.utcYear=mt,u.utcYears=bt,Object.defineProperty(u,"__esModule",{value:!0})})}),cm=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,G_()):(u=u||self,d(u.d3=u.d3||{},u.d3))})(Z,function(u,d){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,_t){return{y:Dt,m:qt,d:_t,H:0,M:0,S:0,L:0}}function e(Dt){var qt=Dt.dateTime,_t=Dt.date,lt=Dt.time,yt=Dt.periods,St=Dt.days,Ht=Dt.shortDays,Yt=Dt.months,se=Dt.shortMonths,ke=f(yt),Ee=v(yt),Ue=f(St),ir=v(St),ar=f(Ht),Ye=v(Ht),Er=f(Yt),pn=v(Yt),dn=f(se),bn=v(se),Zn={a:Nn,A:Kn,b:$n,B:ia,c:null,d:F,e:F,f:ct,H:N,I:j,j:G,L:rt,m:st,M:et,p:Cn,q:Fa,Q:Ce,s:We,S:K,u:ot,U:X,V:Q,w:ut,W:J,x:null,X:null,y:q,Y:it,Z:nt,"%":Me},En={a:Ga,A:ve,b:ge,B:dr,c:null,d:dt,e:dt,f:Nt,H:Tt,I:wt,j:It,L:Ct,m:ee,M:Jt,p:br,q:Tr,Q:Ce,s:We,S:te,u:Kt,U:mt,V:bt,w:vt,W:Ut,x:null,X:null,y:re,Y:Zt,Z:ue,"%":Me},gn={a:Ze,A:tr,b:zr,B:tn,c:Yr,d:c,e:c,f:D,H:b,I:b,j:h,L,m:T,M:_,p:Re,q:M,Q:R,s:I,S:P,u:m,U:w,V:l,w:g,W:x,x:$r,X:In,y:S,Y:y,Z:k,"%":B};Zn.x=da(_t,Zn),Zn.X=da(lt,Zn),Zn.c=da(qt,Zn),En.x=da(_t,En),En.X=da(lt,En),En.c=da(qt,En);function da(mr,kr){return function(Ur){var Or=[],pe=-1,Ke=0,xr=mr.length,Gr,ln,wn;for(Ur instanceof Date||(Ur=new Date(+Ur));++pe<xr;)mr.charCodeAt(pe)===37&&(Or.push(mr.slice(Ke,pe)),(ln=r[Gr=mr.charAt(++pe)])!=null?Gr=mr.charAt(++pe):ln=Gr==="e"?" ":"0",(wn=kr[Gr])&&(Gr=wn(Ur,ln)),Or.push(Gr),Ke=pe+1);return Or.push(mr.slice(Ke,pe)),Or.join("")}}function ra(mr,kr){return function(Ur){var Or=t(1900,void 0,1),pe=Se(Or,mr,Ur+="",0),Ke,xr;if(pe!=Ur.length)return null;if("Q"in Or)return new Date(Or.Q);if("s"in Or)return new Date(Or.s*1e3+("L"in Or?Or.L:0));if(kr&&!("Z"in Or)&&(Or.Z=0),"p"in Or&&(Or.H=Or.H%12+Or.p*12),Or.m===void 0&&(Or.m="q"in Or?Or.q:0),"V"in Or){if(Or.V<1||Or.V>53)return null;"w"in Or||(Or.w=1),"Z"in Or?(Ke=A(t(Or.y,0,1)),xr=Ke.getUTCDay(),Ke=xr>4||xr===0?d.utcMonday.ceil(Ke):d.utcMonday(Ke),Ke=d.utcDay.offset(Ke,(Or.V-1)*7),Or.y=Ke.getUTCFullYear(),Or.m=Ke.getUTCMonth(),Or.d=Ke.getUTCDate()+(Or.w+6)%7):(Ke=E(t(Or.y,0,1)),xr=Ke.getDay(),Ke=xr>4||xr===0?d.timeMonday.ceil(Ke):d.timeMonday(Ke),Ke=d.timeDay.offset(Ke,(Or.V-1)*7),Or.y=Ke.getFullYear(),Or.m=Ke.getMonth(),Or.d=Ke.getDate()+(Or.w+6)%7)}else("W"in Or||"U"in Or)&&("w"in Or||(Or.w="u"in Or?Or.u%7:"W"in Or?1:0),xr="Z"in Or?A(t(Or.y,0,1)).getUTCDay():E(t(Or.y,0,1)).getDay(),Or.m=0,Or.d="W"in Or?(Or.w+6)%7+Or.W*7-(xr+5)%7:Or.w+Or.U*7-(xr+6)%7);return"Z"in Or?(Or.H+=Or.Z/100|0,Or.M+=Or.Z%100,A(Or)):E(Or)}}function Se(mr,kr,Ur,Or){for(var pe=0,Ke=kr.length,xr=Ur.length,Gr,ln;pe<Ke;){if(Or>=xr)return-1;if(Gr=kr.charCodeAt(pe++),Gr===37){if(Gr=kr.charAt(pe++),ln=gn[Gr in r?kr.charAt(pe++):Gr],!ln||(Or=ln(mr,Ur,Or))<0)return-1}else if(Gr!=Ur.charCodeAt(Or++))return-1}return Or}function Re(mr,kr,Ur){var Or=ke.exec(kr.slice(Ur));return Or?(mr.p=Ee[Or[0].toLowerCase()],Ur+Or[0].length):-1}function Ze(mr,kr,Ur){var Or=ar.exec(kr.slice(Ur));return Or?(mr.w=Ye[Or[0].toLowerCase()],Ur+Or[0].length):-1}function tr(mr,kr,Ur){var Or=Ue.exec(kr.slice(Ur));return Or?(mr.w=ir[Or[0].toLowerCase()],Ur+Or[0].length):-1}function zr(mr,kr,Ur){var Or=dn.exec(kr.slice(Ur));return Or?(mr.m=bn[Or[0].toLowerCase()],Ur+Or[0].length):-1}function tn(mr,kr,Ur){var Or=Er.exec(kr.slice(Ur));return Or?(mr.m=pn[Or[0].toLowerCase()],Ur+Or[0].length):-1}function Yr(mr,kr,Ur){return Se(mr,qt,kr,Ur)}function $r(mr,kr,Ur){return Se(mr,_t,kr,Ur)}function In(mr,kr,Ur){return Se(mr,lt,kr,Ur)}function Nn(mr){return Ht[mr.getDay()]}function Kn(mr){return St[mr.getDay()]}function $n(mr){return se[mr.getMonth()]}function ia(mr){return Yt[mr.getMonth()]}function Cn(mr){return yt[+(mr.getHours()>=12)]}function Fa(mr){return 1+~~(mr.getMonth()/3)}function Ga(mr){return Ht[mr.getUTCDay()]}function ve(mr){return St[mr.getUTCDay()]}function ge(mr){return se[mr.getUTCMonth()]}function dr(mr){return Yt[mr.getUTCMonth()]}function br(mr){return yt[+(mr.getUTCHours()>=12)]}function Tr(mr){return 1+~~(mr.getUTCMonth()/3)}return{format:function(mr){var kr=da(mr+="",Zn);return kr.toString=function(){return mr},kr},parse:function(mr){var kr=ra(mr+="",!1);return kr.toString=function(){return mr},kr},utcFormat:function(mr){var kr=da(mr+="",En);return kr.toString=function(){return mr},kr},utcParse:function(mr){var kr=ra(mr+="",!0);return kr.toString=function(){return mr},kr}}}var r={"-":"",_:" ",0:"0"},i=/^\s*\d+/,n=/^%/,o=/[\\^$*+?|[\]().{}]/g;function a(Dt,qt,_t){var lt=Dt<0?"-":"",yt=(lt?-Dt:Dt)+"",St=yt.length;return lt+(St<_t?new Array(_t-St+1).join(qt)+yt:yt)}function s(Dt){return Dt.replace(o,"\\$&")}function f(Dt){return new RegExp("^(?:"+Dt.map(s).join("|")+")","i")}function v(Dt){for(var qt={},_t=-1,lt=Dt.length;++_t<lt;)qt[Dt[_t].toLowerCase()]=_t;return qt}function g(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+1));return lt?(Dt.w=+lt[0],_t+lt[0].length):-1}function m(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+1));return lt?(Dt.u=+lt[0],_t+lt[0].length):-1}function w(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.U=+lt[0],_t+lt[0].length):-1}function l(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.V=+lt[0],_t+lt[0].length):-1}function x(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.W=+lt[0],_t+lt[0].length):-1}function y(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+4));return lt?(Dt.y=+lt[0],_t+lt[0].length):-1}function S(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.y=+lt[0]+(+lt[0]>68?1900:2e3),_t+lt[0].length):-1}function k(Dt,qt,_t){var lt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(qt.slice(_t,_t+6));return lt?(Dt.Z=lt[1]?0:-(lt[2]+(lt[3]||"00")),_t+lt[0].length):-1}function M(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+1));return lt?(Dt.q=lt[0]*3-3,_t+lt[0].length):-1}function T(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.m=lt[0]-1,_t+lt[0].length):-1}function c(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.d=+lt[0],_t+lt[0].length):-1}function h(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+3));return lt?(Dt.m=0,Dt.d=+lt[0],_t+lt[0].length):-1}function b(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.H=+lt[0],_t+lt[0].length):-1}function _(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.M=+lt[0],_t+lt[0].length):-1}function P(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+2));return lt?(Dt.S=+lt[0],_t+lt[0].length):-1}function L(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+3));return lt?(Dt.L=+lt[0],_t+lt[0].length):-1}function D(Dt,qt,_t){var lt=i.exec(qt.slice(_t,_t+6));return lt?(Dt.L=Math.floor(lt[0]/1e3),_t+lt[0].length):-1}function B(Dt,qt,_t){var lt=n.exec(qt.slice(_t,_t+1));return lt?_t+lt[0].length:-1}function R(Dt,qt,_t){var lt=i.exec(qt.slice(_t));return lt?(Dt.Q=+lt[0],_t+lt[0].length):-1}function I(Dt,qt,_t){var lt=i.exec(qt.slice(_t));return lt?(Dt.s=+lt[0],_t+lt[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+d.timeDay.count(d.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 st(Dt,qt){return a(Dt.getMonth()+1,qt,2)}function et(Dt,qt){return a(Dt.getMinutes(),qt,2)}function K(Dt,qt){return a(Dt.getSeconds(),qt,2)}function ot(Dt){var qt=Dt.getDay();return qt===0?7:qt}function X(Dt,qt){return a(d.timeSunday.count(d.timeYear(Dt)-1,Dt),qt,2)}function Q(Dt,qt){var _t=Dt.getDay();return Dt=_t>=4||_t===0?d.timeThursday(Dt):d.timeThursday.ceil(Dt),a(d.timeThursday.count(d.timeYear(Dt),Dt)+(d.timeYear(Dt).getDay()===4),qt,2)}function ut(Dt){return Dt.getDay()}function J(Dt,qt){return a(d.timeMonday.count(d.timeYear(Dt)-1,Dt),qt,2)}function q(Dt,qt){return a(Dt.getFullYear()%100,qt,2)}function it(Dt,qt){return a(Dt.getFullYear()%1e4,qt,4)}function nt(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 Tt(Dt,qt){return a(Dt.getUTCHours(),qt,2)}function wt(Dt,qt){return a(Dt.getUTCHours()%12||12,qt,2)}function It(Dt,qt){return a(1+d.utcDay.count(d.utcYear(Dt),Dt),qt,3)}function Ct(Dt,qt){return a(Dt.getUTCMilliseconds(),qt,3)}function Nt(Dt,qt){return Ct(Dt,qt)+"000"}function ee(Dt,qt){return a(Dt.getUTCMonth()+1,qt,2)}function Jt(Dt,qt){return a(Dt.getUTCMinutes(),qt,2)}function te(Dt,qt){return a(Dt.getUTCSeconds(),qt,2)}function Kt(Dt){var qt=Dt.getUTCDay();return qt===0?7:qt}function mt(Dt,qt){return a(d.utcSunday.count(d.utcYear(Dt)-1,Dt),qt,2)}function bt(Dt,qt){var _t=Dt.getUTCDay();return Dt=_t>=4||_t===0?d.utcThursday(Dt):d.utcThursday.ceil(Dt),a(d.utcThursday.count(d.utcYear(Dt),Dt)+(d.utcYear(Dt).getUTCDay()===4),qt,2)}function vt(Dt){return Dt.getUTCDay()}function Ut(Dt,qt){return a(d.utcMonday.count(d.utcYear(Dt)-1,Dt),qt,2)}function re(Dt,qt){return a(Dt.getUTCFullYear()%100,qt,2)}function Zt(Dt,qt){return a(Dt.getUTCFullYear()%1e4,qt,4)}function ue(){return"+0000"}function Me(){return"%"}function Ce(Dt){return+Dt}function We(Dt){return Math.floor(+Dt/1e3)}var qe;vr({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 vr(Dt){return qe=e(Dt),u.timeFormat=qe.format,u.timeParse=qe.parse,u.utcFormat=qe.utcFormat,u.utcParse=qe.utcParse,qe}var _r="%Y-%m-%dT%H:%M:%S.%LZ";function er(Dt){return Dt.toISOString()}var Mr=Date.prototype.toISOString?er:u.utcFormat(_r);function Ir(Dt){var qt=new Date(Dt);return isNaN(qt)?null:qt}var de=+new Date("2000-01-01T00:00:00.000Z")?Ir:u.utcParse(_r);u.isoFormat=Mr,u.isoParse=de,u.timeFormatDefaultLocale=vr,u.timeFormatLocale=e,Object.defineProperty(u,"__esModule",{value:!0})})}),Z_=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=typeof globalThis<"u"?globalThis:u||self,d(u.d3=u.d3||{}))})(Z,function(u){function d(T){return Math.abs(T=Math.round(T))>=1e21?T.toLocaleString("en").replace(/,/g,""):T.toString(10)}function E(T,c){if((h=(T=c?T.toExponential(c-1):T.toExponential()).indexOf("e"))<0)return null;var h,b=T.slice(0,h);return[b.length>1?b[0]+b.slice(2):b,+T.slice(h+1)]}function A(T){return T=E(Math.abs(T)),T?T[1]:NaN}function t(T,c){return function(h,b){for(var _=h.length,P=[],L=0,D=T[0],B=0;_>0&&D>0&&(B+D+1>b&&(D=Math.max(1,b-B)),P.push(h.substring(_-=D,_+D)),!((B+=D+1)>b));)D=T[L=(L+1)%T.length];return P.reverse().join(c)}}function e(T){return function(c){return c.replace(/[0-9]/g,function(h){return T[+h]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(T){if(!(c=r.exec(T)))throw new Error("invalid format: "+T);var c;return new n({fill:c[1],align:c[2],sign:c[3],symbol:c[4],zero:c[5],width:c[6],comma:c[7],precision:c[8]&&c[8].slice(1),trim:c[9],type:c[10]})}i.prototype=n.prototype;function n(T){this.fill=T.fill===void 0?" ":T.fill+"",this.align=T.align===void 0?">":T.align+"",this.sign=T.sign===void 0?"-":T.sign+"",this.symbol=T.symbol===void 0?"":T.symbol+"",this.zero=!!T.zero,this.width=T.width===void 0?void 0:+T.width,this.comma=!!T.comma,this.precision=T.precision===void 0?void 0:+T.precision,this.trim=!!T.trim,this.type=T.type===void 0?"":T.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(T){t:for(var c=T.length,h=1,b=-1,_;h<c;++h)switch(T[h]){case".":b=_=h;break;case"0":b===0&&(b=h),_=h;break;default:if(!+T[h])break t;b>0&&(b=0);break}return b>0?T.slice(0,b)+T.slice(_+1):T}var a;function s(T,c){var h=E(T,c);if(!h)return T+"";var b=h[0],_=h[1],P=_-(a=Math.max(-8,Math.min(8,Math.floor(_/3)))*3)+1,L=b.length;return P===L?b:P>L?b+new Array(P-L+1).join("0"):P>0?b.slice(0,P)+"."+b.slice(P):"0."+new Array(1-P).join("0")+E(T,Math.max(0,c+P-1))[0]}function f(T,c){var h=E(T,c);if(!h)return T+"";var b=h[0],_=h[1];return _<0?"0."+new Array(-_).join("0")+b:b.length>_+1?b.slice(0,_+1)+"."+b.slice(_+1):b+new Array(_-b.length+2).join("0")}var v={"%":function(T,c){return(T*100).toFixed(c)},b:function(T){return Math.round(T).toString(2)},c:function(T){return T+""},d,e:function(T,c){return T.toExponential(c)},f:function(T,c){return T.toFixed(c)},g:function(T,c){return T.toPrecision(c)},o:function(T){return Math.round(T).toString(8)},p:function(T,c){return f(T*100,c)},r:f,s,X:function(T){return Math.round(T).toString(16).toUpperCase()},x:function(T){return Math.round(T).toString(16)}};function g(T){return T}var m=Array.prototype.map,w=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(T){var c=T.grouping===void 0||T.thousands===void 0?g:t(m.call(T.grouping,Number),T.thousands+""),h=T.currency===void 0?"":T.currency[0]+"",b=T.currency===void 0?"":T.currency[1]+"",_=T.decimal===void 0?".":T.decimal+"",P=T.numerals===void 0?g:e(m.call(T.numerals,String)),L=T.percent===void 0?"%":T.percent+"",D=T.minus===void 0?"-":T.minus+"",B=T.nan===void 0?"NaN":T.nan+"";function R(F){F=i(F);var N=F.fill,j=F.align,G=F.sign,rt=F.symbol,ct=F.zero,st=F.width,et=F.comma,K=F.precision,ot=F.trim,X=F.type;X==="n"?(et=!0,X="g"):v[X]||(K===void 0&&(K=12),ot=!0,X="g"),(ct||N==="0"&&j==="=")&&(ct=!0,N="0",j="=");var Q=rt==="$"?h:rt==="#"&&/[boxX]/.test(X)?"0"+X.toLowerCase():"",ut=rt==="$"?b:/[%p]/.test(X)?L:"",J=v[X],q=/[defgprs%]/.test(X);K=K===void 0?6:/[gprs]/.test(X)?Math.max(1,Math.min(21,K)):Math.max(0,Math.min(20,K));function it(nt){var dt=Q,Tt=ut,wt,It,Ct;if(X==="c")Tt=J(nt)+Tt,nt="";else{nt=+nt;var Nt=nt<0||1/nt<0;if(nt=isNaN(nt)?B:J(Math.abs(nt),K),ot&&(nt=o(nt)),Nt&&+nt==0&&G!=="+"&&(Nt=!1),dt=(Nt?G==="("?G:D:G==="-"||G==="("?"":G)+dt,Tt=(X==="s"?w[8+a/3]:"")+Tt+(Nt&&G==="("?")":""),q){for(wt=-1,It=nt.length;++wt<It;)if(Ct=nt.charCodeAt(wt),48>Ct||Ct>57){Tt=(Ct===46?_+nt.slice(wt+1):nt.slice(wt))+Tt,nt=nt.slice(0,wt);break}}}et&&!ct&&(nt=c(nt,1/0));var ee=dt.length+nt.length+Tt.length,Jt=ee<st?new Array(st-ee+1).join(N):"";switch(et&&ct&&(nt=c(Jt+nt,Jt.length?st-Tt.length:1/0),Jt=""),j){case"<":nt=dt+nt+Tt+Jt;break;case"=":nt=dt+Jt+nt+Tt;break;case"^":nt=Jt.slice(0,ee=Jt.length>>1)+dt+nt+Tt+Jt.slice(ee);break;default:nt=Jt+dt+nt+Tt;break}return P(nt)}return it.toString=function(){return F+""},it}function I(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=w[8+G/3];return function(st){return j(rt*st)+ct}}return{format:R,formatPrefix:I}}var x;y({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function y(T){return x=l(T),u.format=x.format,u.formatPrefix=x.formatPrefix,x}function S(T){return Math.max(0,-A(Math.abs(T)))}function k(T,c){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(A(c)/3)))*3-A(Math.abs(T)))}function M(T,c){return T=Math.abs(T),c=Math.abs(c)-T,Math.max(0,A(c)-A(T))+1}u.FormatSpecifier=n,u.formatDefaultLocale=y,u.formatLocale=l,u.formatSpecifier=i,u.precisionFixed=S,u.precisionPrefix=k,u.precisionRound=M,Object.defineProperty(u,"__esModule",{value:!0})})}),q4=Vt((Z,V)=>{V.exports=function(u){for(var d=u.length,E,A=0;A<d;A++)if(E=u.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}}),Lo=Vt((Z,V)=>{var u=q4();V.exports=function(d){var E=typeof d;if(E==="string"){var A=d;if(d=+d,d===0&&u(A))return!1}else if(E!=="number")return!1;return d-d<1}}),ks=Vt((Z,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:""}}),K_=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=typeof globalThis<"u"?globalThis:u||self,d(u["base64-arraybuffer"]={}))})(Z,function(u){for(var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=typeof Uint8Array>"u"?[]:new Uint8Array(256),A=0;A<d.length;A++)E[d.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+=d[i[n]>>2],a+=d[(i[n]&3)<<4|i[n+1]>>4],a+=d[(i[n+1]&15)<<2|i[n+2]>>6],a+=d[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,f,v,g;r[r.length-1]==="="&&(i--,r[r.length-2]==="="&&i--);var m=new ArrayBuffer(i),w=new Uint8Array(m);for(o=0;o<n;o+=4)s=E[r.charCodeAt(o)],f=E[r.charCodeAt(o+1)],v=E[r.charCodeAt(o+2)],g=E[r.charCodeAt(o+3)],w[a++]=s<<2|f>>4,w[a++]=(f&15)<<4|v>>2,w[a++]=(v&3)<<6|g&63;return m};u.decode=e,u.encode=t,Object.defineProperty(u,"__esModule",{value:!0})})}),Fp=Vt((Z,V)=>{V.exports=function(u){return window&&window.process&&window.process.versions?Object.prototype.toString.call(u)==="[object Object]":Object.prototype.toString.call(u)==="[object Object]"&&Object.getPrototypeOf(u).hasOwnProperty("hasOwnProperty")}}),rh=Vt(Z=>{var V=K_().decode,u=Fp(),d=Array.isArray,E=ArrayBuffer,A=DataView;function t(s){return E.isView(s)&&!(s instanceof A)}Z.isTypedArray=t;function e(s){return d(s)||t(s)}Z.isArrayOrTypedArray=e;function r(s){return!e(s[0])}Z.isArray1D=r,Z.ensureArray=function(s,f){return d(s)||(s=[]),s.length=f,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}Z.isArrayBuffer=n,Z.decodeTypedArraySpec=function(s){var f=[],v=o(s),g=v.dtype,m=i[g];if(!m)throw new Error('Error in dtype: "'+g+'"');var w=m.BYTES_PER_ELEMENT,l=v.bdata;n(l)||(l=V(l));var x=v.shape===void 0?[l.byteLength/w]:(""+v.shape).split(",");x.reverse();var y=x.length,S,k,M=+x[0],T=w*M,c=0;if(y===1)f=new m(l);else if(y===2)for(S=+x[1],k=0;k<S;k++)f[k]=new m(l,c,M),c+=T;else if(y===3){S=+x[1];for(var h=+x[2],b=0;b<h;b++)for(f[b]=[],k=0;k<S;k++)f[b][k]=new m(l,c,M),c+=T}else throw new Error("ndim: "+y+'is not supported with the shape:"'+v.shape+'"');return f.bdata=v.bdata,f.dtype=v.dtype,f.shape=x.reverse().join(","),s._inputArray=f,f},Z.isTypedArraySpec=function(s){return u(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}}Z.concat=function(){var s=[],f=!0,v=0,g,m,w,l,x,y,S,k;for(w=0;w<arguments.length;w++)l=arguments[w],y=l.length,y&&(m?s.push(l):(m=l,x=y),d(l)?g=!1:(f=!1,v?g!==l.constructor&&(g=!1):g=l.constructor),v+=y);if(!v)return[];if(!s.length)return m;if(f)return m.concat.apply(m,s);if(g){for(S=new g(v),S.set(m),w=0;w<s.length;w++)l=s[w],S.set(l,x),x+=l.length;return S}for(S=new Array(v),k=0;k<m.length;k++)S[k]=m[k];for(w=0;w<s.length;w++){for(l=s[w],k=0;k<l.length;k++)S[x+k]=l[k];x+=k}return S},Z.maxRowLength=function(s){return a(s,Math.max,0)},Z.minRowLength=function(s){return a(s,Math.min,1/0)};function a(s,f,v){if(e(s))if(e(s[0])){for(var g=v,m=0;m<s.length;m++)g=f(g,s[m].length);return g}else return s.length;return 0}}),Eg=Vt((Z,V)=>{var u=Lo(),d=rh().isArrayOrTypedArray;V.exports=function(a,s){if(u(s))s=String(s);else if(typeof s!="string"||s.substr(s.length-4)==="[-1]")throw"bad property string";var f=s.split("."),v,g,m,w;for(w=0;w<f.length;w++)if(String(f[w]).slice(0,2)==="__")throw"bad property string";for(w=0;w<f.length;){if(v=String(f[w]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),v){if(v[1])f[w]=v[1];else if(w===0)f.splice(0,1);else throw"bad property string";for(g=v[2].substr(1,v[2].length-2).split("]["),m=0;m<g.length;m++)w++,f.splice(w,0,Number(g[m]))}w++}return typeof a!="object"?o(a,s,f):{set:e(a,f,s),get:E(a,f),astr:s,parts:f,obj:a}};function E(a,s){return function(f){var v=a,g,m,w,l,x;for(l=0;l<s.length-1;l++){if(g=s[l],g===-1){for(m=!0,w=[],x=0;x<v.length;x++)w[x]=E(v[x],s.slice(l+1))(f),w[x]!==w[0]&&(m=!1);return m?w[0]:w}if(typeof g=="number"&&!d(v)||(v=v[g],typeof v!="object"||v===null))return}if(!(typeof v!="object"||v===null)&&(w=v[s[l]],!(!f&&w===null)))return w}}var A=/(^|\.)args\[/;function t(a,s){return a===void 0||a===null&&!s.match(A)}function e(a,s,f){return function(v){var g=a,m="",w=t(v,f),l,x;for(x=0;x<s.length-1;x++){if(l=s[x],typeof l=="number"&&!d(g))throw"array index but container is not an array";if(l===-1){if(w=!i(g,s.slice(x+1),v,f),w)break;return}if(!n(g,l,s[x+1],w))break;if(g=g[l],typeof g!="object"||g===null)throw"container is not an object";m=r(m,l)}if(w){if(x===s.length-1&&(delete g[s[x]],Array.isArray(g)&&+s[x]===g.length-1))for(;g.length&&g[g.length-1]===void 0;)g.pop()}else g[s[x]]=v}}function r(a,s){var f=s;return u(s)?f="["+s+"]":a&&(f="."+s),a+f}function i(a,s,f,v){var g=d(f),m=!0,w=f,l=v.replace("-1",0),x=g?!1:t(f,l),y=s[0],S;for(S=0;S<a.length;S++)l=v.replace("-1",S),g&&(w=f[S%f.length],x=t(w,l)),x&&(m=!1),n(a,S,y,x)&&e(a[S],s,v.replace("-1",S))(w);return m}function n(a,s,f,v){if(a[s]===void 0){if(v)return!1;typeof f=="number"?a[s]=[]:a[s]={}}return!0}function o(a,s,f){return{set:function(){throw"bad container"},get:function(){},astr:s,parts:f,obj:a}}}),W4=Vt((Z,V)=>{var u=Eg(),d=/^\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,f,v,g={};n&&n.length?(v=u(i,n),f=v.get()):f=i,n=n||"";var m={};if(f)for(s=0;s<f.length;s++)m[f[s][o]]=s;var w=d.test(a),l={set:function(x,y){var S=y===null?r:E;if(!f){if(!v||S===r)return;f=[],v.set(f)}var k=m[x];if(k===void 0){if(S===r)return;S=S|e,k=f.length,m[x]=k}else y!==(w?f[k][a]:u(f[k],a).get())&&(S=S|t);var M=f[k]=f[k]||{};return M[o]=x,w?M[a]=y:u(M,a).set(y),y!==null&&(S=S&~r),g[k]=g[k]|S,l},get:function(x){if(f){var y=m[x];if(y!==void 0)return w?f[y][a]:u(f[y],a).get()}},rename:function(x,y){var S=m[x];return S===void 0||(g[S]=g[S]|A,m[y]=S,delete m[x],f[S][o]=y),l},remove:function(x){var y=m[x];if(y===void 0)return l;var S=f[y];if(Object.keys(S).length>2)return g[y]=g[y]|t,l.set(x,null);if(w){for(s=y;s<f.length;s++)g[s]=g[s]|e;for(s=y;s<f.length;s++)m[f[s][o]]--;f.splice(y,1),delete m[x]}else u(S,a).set(null),g[y]=g[y]|t|r;return l},constructUpdate:function(){for(var x,y,S={},k=Object.keys(g),M=0;M<k.length;M++)y=k[M],x=n+"["+y+"]",f[y]?(g[y]&A&&(S[x+"."+o]=f[y][o]),g[y]&t&&(w?S[x+"."+a]=g[y]&r?null:f[y][a]:S[x+"."+a]=g[y]&r?null:u(f[y],a).get())):S[x]=null;return S}};return l}}),G4=Vt((Z,V)=>{var u=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,d=/^[^\.\[\]]+$/;V.exports=function(E,A){for(;A;){var t=E.match(u);if(t)E=t[1];else if(E.match(d))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}}),Cy=Vt((Z,V)=>{var u=Lo();V.exports=function(d,E){if(d>0)return Math.log(d)/Math.LN10;var A=Math.log(Math.min(E[0],E[1]))/Math.LN10;return u(A)||(A=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),A}}),Z4=Vt((Z,V)=>{var u=rh().isArrayOrTypedArray,d=Fp();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(u(r)&&u(i)&&d(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]&&d(r[o])&&d(i[o])&&E(i[o],r[o])}else d(r)&&d(i)&&(E(i,r),Object.keys(i).length||delete A[e])}}}),fm=Vt((Z,V)=>{function u(E,A){var t=E%A;return t<0?t+A:t}function d(E,A){return Math.abs(E)>A/2?E-Math.round(E/A)*A:E}V.exports={mod:u,modHalf:d}}),kf=Vt((Z,V)=>{(function(u){var d=/^\s+/,E=/\s+$/,A=0,t=u.round,e=u.min,r=u.max,i=u.random;function n(q,it){if(q=q||"",it=it||{},q instanceof n)return q;if(!(this instanceof n))return new n(q,it);var nt=o(q);this._originalInput=q,this._r=nt.r,this._g=nt.g,this._b=nt.b,this._a=nt.a,this._roundA=t(100*this._a)/100,this._format=it.format||nt.format,this._gradientType=it.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=nt.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(),it,nt,dt,Tt,wt,It;return it=q.r/255,nt=q.g/255,dt=q.b/255,it<=.03928?Tt=it/12.92:Tt=u.pow((it+.055)/1.055,2.4),nt<=.03928?wt=nt/12.92:wt=u.pow((nt+.055)/1.055,2.4),dt<=.03928?It=dt/12.92:It=u.pow((dt+.055)/1.055,2.4),.2126*Tt+.7152*wt+.0722*It},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),it=t(q.h*360),nt=t(q.s*100),dt=t(q.v*100);return this._a==1?"hsv("+it+", "+nt+"%, "+dt+"%)":"hsva("+it+", "+nt+"%, "+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),it=t(q.h*360),nt=t(q.s*100),dt=t(q.l*100);return this._a==1?"hsl("+it+", "+nt+"%, "+dt+"%)":"hsla("+it+", "+nt+"%, "+dt+"%, "+this._roundA+")"},toHex:function(q){return m(this._r,this._g,this._b,q)},toHexString:function(q){return"#"+this.toHex(q)},toHex8:function(q){return w(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[m(this._r,this._g,this._b,!0)]||!1},toFilter:function(q){var it="#"+l(this._r,this._g,this._b,this._a),nt=it,dt=this._gradientType?"GradientType = 1, ":"";if(q){var Tt=n(q);nt="#"+l(Tt._r,Tt._g,Tt._b,Tt._a)}return"progid:DXImageTransform.Microsoft.gradient("+dt+"startColorstr="+it+",endColorstr="+nt+")"},toString:function(q){var it=!!q;q=q||this._format;var nt=!1,dt=this._a<1&&this._a>=0,Tt=!it&&dt&&(q==="hex"||q==="hex6"||q==="hex3"||q==="hex4"||q==="hex8"||q==="name");return Tt?q==="name"&&this._a===0?this.toName():this.toRgbString():(q==="rgb"&&(nt=this.toRgbString()),q==="prgb"&&(nt=this.toPercentageRgbString()),(q==="hex"||q==="hex6")&&(nt=this.toHexString()),q==="hex3"&&(nt=this.toHexString(!0)),q==="hex4"&&(nt=this.toHex8String(!0)),q==="hex8"&&(nt=this.toHex8String()),q==="name"&&(nt=this.toName()),q==="hsl"&&(nt=this.toHslString()),q==="hsv"&&(nt=this.toHsvString()),nt||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(q,it){var nt=q.apply(null,[this].concat([].slice.call(it)));return this._r=nt._r,this._g=nt._g,this._b=nt._b,this.setAlpha(nt._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(M,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(c,arguments)},_applyCombination:function(q,it){return q.apply(null,[this].concat([].slice.call(it)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(h,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},n.fromRatio=function(q,it){if(typeof q=="object"){var nt={};for(var dt in q)q.hasOwnProperty(dt)&&(dt==="a"?nt[dt]=q[dt]:nt[dt]=et(q[dt]));q=nt}return n(q,it)};function o(q){var it={r:0,g:0,b:0},nt=1,dt=null,Tt=null,wt=null,It=!1,Ct=!1;return typeof q=="string"&&(q=ut(q)),typeof q=="object"&&(Q(q.r)&&Q(q.g)&&Q(q.b)?(it=a(q.r,q.g,q.b),It=!0,Ct=String(q.r).substr(-1)==="%"?"prgb":"rgb"):Q(q.h)&&Q(q.s)&&Q(q.v)?(dt=et(q.s),Tt=et(q.v),it=g(q.h,dt,Tt),It=!0,Ct="hsv"):Q(q.h)&&Q(q.s)&&Q(q.l)&&(dt=et(q.s),wt=et(q.l),it=f(q.h,dt,wt),It=!0,Ct="hsl"),q.hasOwnProperty("a")&&(nt=q.a)),nt=F(nt),{ok:It,format:q.format||Ct,r:e(255,r(it.r,0)),g:e(255,r(it.g,0)),b:e(255,r(it.b,0)),a:nt}}function a(q,it,nt){return{r:N(q,255)*255,g:N(it,255)*255,b:N(nt,255)*255}}function s(q,it,nt){q=N(q,255),it=N(it,255),nt=N(nt,255);var dt=r(q,it,nt),Tt=e(q,it,nt),wt,It,Ct=(dt+Tt)/2;if(dt==Tt)wt=It=0;else{var Nt=dt-Tt;switch(It=Ct>.5?Nt/(2-dt-Tt):Nt/(dt+Tt),dt){case q:wt=(it-nt)/Nt+(it<nt?6:0);break;case it:wt=(nt-q)/Nt+2;break;case nt:wt=(q-it)/Nt+4;break}wt/=6}return{h:wt,s:It,l:Ct}}function f(q,it,nt){var dt,Tt,wt;q=N(q,360),it=N(it,100),nt=N(nt,100);function It(ee,Jt,te){return te<0&&(te+=1),te>1&&(te-=1),te<1/6?ee+(Jt-ee)*6*te:te<1/2?Jt:te<2/3?ee+(Jt-ee)*(2/3-te)*6:ee}if(it===0)dt=Tt=wt=nt;else{var Ct=nt<.5?nt*(1+it):nt+it-nt*it,Nt=2*nt-Ct;dt=It(Nt,Ct,q+1/3),Tt=It(Nt,Ct,q),wt=It(Nt,Ct,q-1/3)}return{r:dt*255,g:Tt*255,b:wt*255}}function v(q,it,nt){q=N(q,255),it=N(it,255),nt=N(nt,255);var dt=r(q,it,nt),Tt=e(q,it,nt),wt,It,Ct=dt,Nt=dt-Tt;if(It=dt===0?0:Nt/dt,dt==Tt)wt=0;else{switch(dt){case q:wt=(it-nt)/Nt+(it<nt?6:0);break;case it:wt=(nt-q)/Nt+2;break;case nt:wt=(q-it)/Nt+4;break}wt/=6}return{h:wt,s:It,v:Ct}}function g(q,it,nt){q=N(q,360)*6,it=N(it,100),nt=N(nt,100);var dt=u.floor(q),Tt=q-dt,wt=nt*(1-it),It=nt*(1-Tt*it),Ct=nt*(1-(1-Tt)*it),Nt=dt%6,ee=[nt,It,wt,wt,Ct,nt][Nt],Jt=[Ct,nt,nt,It,wt,wt][Nt],te=[wt,wt,Ct,nt,nt,It][Nt];return{r:ee*255,g:Jt*255,b:te*255}}function m(q,it,nt,dt){var Tt=[st(t(q).toString(16)),st(t(it).toString(16)),st(t(nt).toString(16))];return dt&&Tt[0].charAt(0)==Tt[0].charAt(1)&&Tt[1].charAt(0)==Tt[1].charAt(1)&&Tt[2].charAt(0)==Tt[2].charAt(1)?Tt[0].charAt(0)+Tt[1].charAt(0)+Tt[2].charAt(0):Tt.join("")}function w(q,it,nt,dt,Tt){var wt=[st(t(q).toString(16)),st(t(it).toString(16)),st(t(nt).toString(16)),st(K(dt))];return Tt&&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[3].charAt(0)==wt[3].charAt(1)?wt[0].charAt(0)+wt[1].charAt(0)+wt[2].charAt(0)+wt[3].charAt(0):wt.join("")}function l(q,it,nt,dt){var Tt=[st(K(dt)),st(t(q).toString(16)),st(t(it).toString(16)),st(t(nt).toString(16))];return Tt.join("")}n.equals=function(q,it){return!q||!it?!1:n(q).toRgbString()==n(it).toRgbString()},n.random=function(){return n.fromRatio({r:i(),g:i(),b:i()})};function x(q,it){it=it===0?0:it||10;var nt=n(q).toHsl();return nt.s-=it/100,nt.s=j(nt.s),n(nt)}function y(q,it){it=it===0?0:it||10;var nt=n(q).toHsl();return nt.s+=it/100,nt.s=j(nt.s),n(nt)}function S(q){return n(q).desaturate(100)}function k(q,it){it=it===0?0:it||10;var nt=n(q).toHsl();return nt.l+=it/100,nt.l=j(nt.l),n(nt)}function M(q,it){it=it===0?0:it||10;var nt=n(q).toRgb();return nt.r=r(0,e(255,nt.r-t(255*-(it/100)))),nt.g=r(0,e(255,nt.g-t(255*-(it/100)))),nt.b=r(0,e(255,nt.b-t(255*-(it/100)))),n(nt)}function T(q,it){it=it===0?0:it||10;var nt=n(q).toHsl();return nt.l-=it/100,nt.l=j(nt.l),n(nt)}function c(q,it){var nt=n(q).toHsl(),dt=(nt.h+it)%360;return nt.h=dt<0?360+dt:dt,n(nt)}function h(q){var it=n(q).toHsl();return it.h=(it.h+180)%360,n(it)}function b(q){var it=n(q).toHsl(),nt=it.h;return[n(q),n({h:(nt+120)%360,s:it.s,l:it.l}),n({h:(nt+240)%360,s:it.s,l:it.l})]}function _(q){var it=n(q).toHsl(),nt=it.h;return[n(q),n({h:(nt+90)%360,s:it.s,l:it.l}),n({h:(nt+180)%360,s:it.s,l:it.l}),n({h:(nt+270)%360,s:it.s,l:it.l})]}function P(q){var it=n(q).toHsl(),nt=it.h;return[n(q),n({h:(nt+72)%360,s:it.s,l:it.l}),n({h:(nt+216)%360,s:it.s,l:it.l})]}function L(q,it,nt){it=it||6,nt=nt||30;var dt=n(q).toHsl(),Tt=360/nt,wt=[n(q)];for(dt.h=(dt.h-(Tt*it>>1)+720)%360;--it;)dt.h=(dt.h+Tt)%360,wt.push(n(dt));return wt}function D(q,it){it=it||6;for(var nt=n(q).toHsv(),dt=nt.h,Tt=nt.s,wt=nt.v,It=[],Ct=1/it;it--;)It.push(n({h:dt,s:Tt,v:wt})),wt=(wt+Ct)%1;return It}n.mix=function(q,it,nt){nt=nt===0?0:nt||50;var dt=n(q).toRgb(),Tt=n(it).toRgb(),wt=nt/100,It={r:(Tt.r-dt.r)*wt+dt.r,g:(Tt.g-dt.g)*wt+dt.g,b:(Tt.b-dt.b)*wt+dt.b,a:(Tt.a-dt.a)*wt+dt.a};return n(It)},n.readability=function(q,it){var nt=n(q),dt=n(it);return(u.max(nt.getLuminance(),dt.getLuminance())+.05)/(u.min(nt.getLuminance(),dt.getLuminance())+.05)},n.isReadable=function(q,it,nt){var dt=n.readability(q,it),Tt,wt;switch(wt=!1,Tt=J(nt),Tt.level+Tt.size){case"AAsmall":case"AAAlarge":wt=dt>=4.5;break;case"AAlarge":wt=dt>=3;break;case"AAAsmall":wt=dt>=7;break}return wt},n.mostReadable=function(q,it,nt){var dt=null,Tt=0,wt,It,Ct,Nt;nt=nt||{},It=nt.includeFallbackColors,Ct=nt.level,Nt=nt.size;for(var ee=0;ee<it.length;ee++)wt=n.readability(q,it[ee]),wt>Tt&&(Tt=wt,dt=n(it[ee]));return n.isReadable(q,dt,{level:Ct,size:Nt})||!It?dt:(nt.includeFallbackColors=!1,n.mostReadable(q,["#fff","#000"],nt))};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=I(B);function I(q){var it={};for(var nt in q)q.hasOwnProperty(nt)&&(it[q[nt]]=nt);return it}function F(q){return q=parseFloat(q),(isNaN(q)||q<0||q>1)&&(q=1),q}function N(q,it){rt(q)&&(q="100%");var nt=ct(q);return q=e(it,r(0,parseFloat(q))),nt&&(q=parseInt(q*it,10)/100),u.abs(q-it)<1e-6?1:q%it/parseFloat(it)}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 st(q){return q.length==1?"0"+q:""+q}function et(q){return q<=1&&(q=q*100+"%"),q}function K(q){return u.round(parseFloat(q)*255).toString(16)}function ot(q){return G(q)/255}var X=function(){var q="[-\\+]?\\d+%?",it="[-\\+]?\\d*\\.\\d+%?",nt="(?:"+it+")|(?:"+q+")",dt="[\\s|\\(]+("+nt+")[,|\\s]+("+nt+")[,|\\s]+("+nt+")\\s*\\)?",Tt="[\\s|\\(]+("+nt+")[,|\\s]+("+nt+")[,|\\s]+("+nt+")[,|\\s]+("+nt+")\\s*\\)?";return{CSS_UNIT:new RegExp(nt),rgb:new RegExp("rgb"+dt),rgba:new RegExp("rgba"+Tt),hsl:new RegExp("hsl"+dt),hsla:new RegExp("hsla"+Tt),hsv:new RegExp("hsv"+dt),hsva:new RegExp("hsva"+Tt),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!!X.CSS_UNIT.exec(q)}function ut(q){q=q.replace(d,"").replace(E,"").toLowerCase();var it=!1;if(B[q])q=B[q],it=!0;else if(q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var nt;return(nt=X.rgb.exec(q))?{r:nt[1],g:nt[2],b:nt[3]}:(nt=X.rgba.exec(q))?{r:nt[1],g:nt[2],b:nt[3],a:nt[4]}:(nt=X.hsl.exec(q))?{h:nt[1],s:nt[2],l:nt[3]}:(nt=X.hsla.exec(q))?{h:nt[1],s:nt[2],l:nt[3],a:nt[4]}:(nt=X.hsv.exec(q))?{h:nt[1],s:nt[2],v:nt[3]}:(nt=X.hsva.exec(q))?{h:nt[1],s:nt[2],v:nt[3],a:nt[4]}:(nt=X.hex8.exec(q))?{r:G(nt[1]),g:G(nt[2]),b:G(nt[3]),a:ot(nt[4]),format:it?"name":"hex8"}:(nt=X.hex6.exec(q))?{r:G(nt[1]),g:G(nt[2]),b:G(nt[3]),format:it?"name":"hex"}:(nt=X.hex4.exec(q))?{r:G(nt[1]+""+nt[1]),g:G(nt[2]+""+nt[2]),b:G(nt[3]+""+nt[3]),a:ot(nt[4]+""+nt[4]),format:it?"name":"hex8"}:(nt=X.hex3.exec(q))?{r:G(nt[1]+""+nt[1]),g:G(nt[2]+""+nt[2]),b:G(nt[3]+""+nt[3]),format:it?"name":"hex"}:!1}function J(q){var it,nt;return q=q||{level:"AA",size:"small"},it=(q.level||"AA").toUpperCase(),nt=(q.size||"small").toLowerCase(),it!=="AA"&&it!=="AAA"&&(it="AA"),nt!=="small"&&nt!=="large"&&(nt="small"),{level:it,size:nt}}typeof V<"u"&&V.exports?V.exports=n:window.tinycolor=n})(Math)}),So=Vt(Z=>{var V=Fp(),u=Array.isArray;function d(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}Z.extendFlat=function(){return E(arguments,!1,!1,!1)},Z.extendDeep=function(){return E(arguments,!0,!1,!1)},Z.extendDeepAll=function(){return E(arguments,!0,!0,!1)},Z.extendDeepNoArrays=function(){return E(arguments,!0,!1,!0)};function E(A,t,e,r){var i=A[0],n=A.length,o,a,s,f,v,g,m;if(n===2&&u(i)&&u(A[1])&&i.length===0){if(m=d(A[1],i),m)return i;i.splice(0,i.length)}for(var w=1;w<n;w++){o=A[w];for(a in o)s=i[a],f=o[a],r&&u(f)?i[a]=f:t&&f&&(V(f)||(v=u(f)))?(v?(v=!1,g=s&&u(s)?s:[]):g=s&&V(s)?s:{},i[a]=E([g,f],t,e,r)):(typeof f<"u"||e)&&(i[a]=f)}return i}}),yu=Vt((Z,V)=>{V.exports=function(u){var d=u.variantValues,E=u.editType,A=u.colorEditType;A===void 0&&(A=E);var t={editType:E,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};u.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:u.noFontVariant?void 0:{editType:E,valType:"enumerated",values:d||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:u.noFontTextcase?void 0:{editType:E,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:u.noFontLineposition?void 0:{editType:E,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:u.noFontShadow?void 0:{editType:E,valType:"string",dflt:u.autoShadowDflt?"auto":"none"},editType:E};return u.autoSize&&(e.size.dflt="auto"),u.autoColor&&(e.color.dflt="auto"),u.arrayOk&&(e.family.arrayOk=!0,e.weight.arrayOk=!0,e.style.arrayOk=!0,u.noFontVariant||(e.variant.arrayOk=!0),u.noFontTextcase||(e.textcase.arrayOk=!0),u.noFontLineposition||(e.lineposition.arrayOk=!0),u.noFontShadow||(e.shadow.arrayOk=!0),e.size.arrayOk=!0,e.color.arrayOk=!0),e}}),zg=Vt((Z,V)=>{V.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),yd=Vt((Z,V)=>{var u=zg(),d=yu(),E=d({editType:"none"});E.family.dflt=u.HOVERFONT,E.size.dflt=u.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:d({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),hm=Vt((Z,V)=>{var u=yu(),d=yd().hoverlabel,E=So().extendFlat;V.exports={hoverlabel:{bgcolor:E({},d.bgcolor,{arrayOk:!0}),bordercolor:E({},d.bordercolor,{arrayOk:!0}),font:u({arrayOk:!0,editType:"none"}),align:E({},d.align,{arrayOk:!0}),namelength:E({},d.namelength,{arrayOk:!0}),showarrow:E({},d.showarrow),editType:"none"}}}),Tl=Vt((Z,V)=>{var u=yu(),d=hm();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:u({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:d.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"}}}),r0=Vt((Z,V)=>{var u=kf(),d={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=d.RdBu;function A(r,i){if(i||(i=E),!r)return i;function n(){try{r=d[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||!u(o[1]).isValid())return!1;i=+o[0]}return!0}function e(r){return d[r]!==void 0?!0:t(r)}V.exports={scales:d,defaultScale:E,get:A,isValid:e}}),nf=Vt(Z=>{Z.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Z.defaultLine="#444",Z.lightLine="#eee",Z.background="#fff",Z.borderLine="#BEC8D9",Z.lightFraction=1e3/11}),Pi=Vt((Z,V)=>{var u=kf(),d=Lo(),E=rh().isTypedArray,A=V.exports={},t=nf();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(u(n))},A.opacity=function(n){return n?u(n).getAlpha():0},A.addOpacity=function(n,o){var a=u(n).toRgb();return"rgba("+Math.round(a.r)+", "+Math.round(a.g)+", "+Math.round(a.b)+", "+o+")"},A.combine=function(n,o){var a=u(n).toRgb();if(a.a===1)return u(n).toRgbString();var s=u(o||r).toRgb(),f=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:f.r*(1-a.a)+a.r*a.a,g:f.g*(1-a.a)+a.g*a.a,b:f.b*(1-a.a)+a.b*a.a};return u(v).toRgbString()},A.interpolate=function(n,o,a){var s=u(n).toRgb(),f=u(o).toRgb(),v={r:a*s.r+(1-a)*f.r,g:a*s.g+(1-a)*f.g,b:a*s.b+(1-a)*f.b};return u(v).toRgbString()},A.contrast=function(n,o,a){var s=u(n);s.getAlpha()!==1&&(s=u(A.combine(n,r)));var f=s.isDark()?o?s.lighten(o):r:a?s.darken(a):e;return f.toString()},A.stroke=function(n,o){var a=u(o);n.style({stroke:A.tinyRGB(a),"stroke-opacity":a.getAlpha()})},A.fill=function(n,o){var a=u(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,f,v;for(a=0;a<o.length;a++)if(f=o[a],v=n[f],f.substr(f.length-5)==="color")if(Array.isArray(v))for(s=0;s<v.length;s++)v[s]=i(v[s]);else n[f]=i(v);else if(f.substr(f.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 g=v[0];if(!Array.isArray(g)&&g&&typeof g=="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(d(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*/),f=o.charAt(3)==="a"&&s.length===4;if(!f&&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 g=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+g+", "+s[3]+")":"rgb("+g+")"}}),xd=Vt((Z,V)=>{V.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),pm=Vt(Z=>{Z.counter=function(V,u,d,E){var A=(u||"")+(d?"":"$"),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)}}),K4=Vt(Z=>{var V=Lo(),u=kf(),d=So().extendFlat,E=Tl(),A=r0(),t=Pi(),e=xd().DESELECTDIM,r=Eg(),i=pm().counter,n=fm().modHalf,o=rh().isArrayOrTypedArray,a=rh().isTypedArraySpec,s=rh().decodeTypedArraySpec;Z.valObjectMeta={data_array:{coerceFunction:function(v,g,m){g.set(o(v)?v:a(v)?s(v):m)}},enumerated:{coerceFunction:function(v,g,m,w){w.coerceNumber&&(v=+v),w.values.indexOf(v)===-1?g.set(m):g.set(v)},validateFunction:function(v,g){g.coerceNumber&&(v=+v);for(var m=g.values,w=0;w<m.length;w++){var l=String(m[w]);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===m[w])return!0}return!1}},boolean:{coerceFunction:function(v,g,m){v===!0||v===!1?g.set(v):g.set(m)}},number:{coerceFunction:function(v,g,m,w){a(v)&&(v=s(v)),!V(v)||w.min!==void 0&&v<w.min||w.max!==void 0&&v>w.max?g.set(m):g.set(+v)}},integer:{coerceFunction:function(v,g,m,w){if((w.extras||[]).indexOf(v)!==-1){g.set(v);return}a(v)&&(v=s(v)),v%1||!V(v)||w.min!==void 0&&v<w.min||w.max!==void 0&&v>w.max?g.set(m):g.set(+v)}},string:{coerceFunction:function(v,g,m,w){if(typeof v!="string"){var l=typeof v=="number";w.strict===!0||!l?g.set(m):g.set(String(v))}else w.noBlank&&!v?g.set(m):g.set(v)}},color:{coerceFunction:function(v,g,m){a(v)&&(v=s(v)),u(v).isValid()?g.set(v):g.set(m)}},colorlist:{coerceFunction:function(v,g,m){function w(l){return u(l).isValid()}!Array.isArray(v)||!v.length?g.set(m):v.every(w)?g.set(v):g.set(m)}},colorscale:{coerceFunction:function(v,g,m){g.set(A.get(v,m))}},angle:{coerceFunction:function(v,g,m){a(v)&&(v=s(v)),v==="auto"?g.set("auto"):V(v)?g.set(n(+v,360)):g.set(m)}},subplotid:{coerceFunction:function(v,g,m,w){var l=w.regex||i(m);if(typeof v=="string"&&l.test(v)){g.set(v);return}g.set(m)},validateFunction:function(v,g){var m=g.dflt;return v===m?!0:typeof v!="string"?!1:!!i(m).test(v)}},flaglist:{coerceFunction:function(v,g,m,w){if((w.extras||[]).indexOf(v)!==-1){g.set(v);return}if(typeof v!="string"){g.set(m);return}for(var l=v.split("+"),x=0;x<l.length;){var y=l[x];w.flags.indexOf(y)===-1||l.indexOf(y)<x?l.splice(x,1):x++}l.length?g.set(l.join("+")):g.set(m)}},any:{coerceFunction:function(v,g,m){v===void 0?g.set(m):g.set(a(v)?s(v):v)}},info_array:{coerceFunction:function(v,g,m,w){function l(B,R,I){var F,N={set:function(j){F=j}};return I===void 0&&(I=R.dflt),Z.valObjectMeta[R.valType].coerceFunction(B,N,I,R),F}if(a(v)&&(v=s(v)),!o(v)){g.set(m);return}var x=w.dimensions===2||w.dimensions==="1-2"&&Array.isArray(v)&&o(v[0]),y=w.items,S=[],k=Array.isArray(y),M=k&&x&&o(y[0]),T=x&&k&&!M,c=k&&!T?y.length:v.length,h,b,_,P,L,D;if(m=Array.isArray(m)?m:[],x)for(h=0;h<c;h++)for(S[h]=[],_=o(v[h])?v[h]:[],T?L=y.length:k?L=y[h].length:L=_.length,b=0;b<L;b++)T?P=y[b]:k?P=y[h][b]:P=y,D=l(_[b],P,(m[h]||[])[b]),D!==void 0&&(S[h][b]=D);else for(h=0;h<c;h++)D=l(v[h],k?y[h]:y,m[h]),D!==void 0&&(S[h]=D);g.set(S)},validateFunction:function(v,g){if(!o(v))return!1;var m=g.items,w=Array.isArray(m),l=g.dimensions===2;if(!g.freeLength&&v.length!==m.length)return!1;for(var x=0;x<v.length;x++)if(l){if(!o(v[x])||!g.freeLength&&v[x].length!==m[x].length)return!1;for(var y=0;y<v[x].length;y++)if(!f(v[x][y],w?m[x][y]:m))return!1}else if(!f(v[x],w?m[x]:m))return!1;return!0}}},Z.coerce=function(v,g,m,w,l){var x=r(m,w).get(),y=r(v,w),S=r(g,w),k=y.get(),M=g._template;if(k===void 0&&M&&(k=r(M,w).get(),M=0),l===void 0&&(l=x.dflt),x.arrayOk){if(o(k))return S.set(k),k;if(a(k))return k=s(k),S.set(k),k}var T=Z.valObjectMeta[x.valType].coerceFunction;T(k,S,l,x);var c=S.get();return M&&c===l&&!f(k,x)&&(k=r(M,w).get(),T(k,S,l,x),c=S.get()),c},Z.coerce2=function(v,g,m,w,l){var x=r(v,w),y=Z.coerce(v,g,m,w,l),S=x.get();return S!=null?y:!1},Z.coerceFont=function(v,g,m,w){w||(w={}),m=d({},m),m=d(m,w.overrideDflt||{});var l={family:v(g+".family",m.family),size:v(g+".size",m.size),color:v(g+".color",m.color),weight:v(g+".weight",m.weight),style:v(g+".style",m.style)};if(w.noFontVariant||(l.variant=v(g+".variant",m.variant)),w.noFontLineposition||(l.lineposition=v(g+".lineposition",m.lineposition)),w.noFontTextcase||(l.textcase=v(g+".textcase",m.textcase)),!w.noFontShadow){var x=m.shadow;x==="none"&&w.autoShadowDflt&&(x="auto"),l.shadow=v(g+".shadow",x)}return l},Z.coercePattern=function(v,g,m,w){var l=v(g+".shape"),x;if(l||(x=v(g+".path")),l||x){l&&v(g+".solidity"),v(g+".size");var y=v(g+".fillmode"),S=y==="overlay";if(!w){var k=v(g+".bgcolor",S?m:void 0);v(g+".fgcolor",S?t.contrast(k):m)}v(g+".fgopacity",S?.5:1)}},Z.coerceHoverinfo=function(v,g,m){var w=g._module.attributes,l=w.hoverinfo?w:E,x=l.hoverinfo,y;if(m._dataLength===1){var S=x.dflt==="all"?x.flags.slice():x.dflt.split("+");S.splice(S.indexOf("name"),1),y=S.join("+")}return Z.coerce(v,g,l,"hoverinfo",y)},Z.coerceSelectionMarkerOpacity=function(v,g){if(v.marker){var m=v.marker.opacity;if(m!==void 0){var w,l;!o(m)&&!v.selected&&!v.unselected&&(w=m,l=e*m),g("selected.marker.opacity",w),g("unselected.marker.opacity",l)}}};function f(v,g){var m=Z.valObjectMeta[g.valType];if(g.arrayOk&&o(v))return!0;if(m.validateFunction)return m.validateFunction(v,g);var w={},l=w,x={set:function(y){l=y}};return m.coerceFunction(v,x,w,g),l!==w}Z.validate=f}),n0=Vt((Z,V)=>{var u={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/un/"},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:{}}},d={};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(u,d),V.exports={configAttributes:u,dfltConfig:d}}),Y_=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=[];V.exports=function(A,t){if(E.indexOf(A)!==-1)return;E.push(A);var e=1e3;d(t)?e=t:t==="long"&&(e=3e3);var r=u.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),u.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var a=u.select(this);a.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){a.transition().call(n)});for(var s=a.append("p"),f=o.split(/<br\s*\/?>/g),v=0;v<f.length;v++)v&&s.append("br"),s.append("span").text(f[v]);t==="stick"?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(e).call(n)})}}),_d=Vt((Z,V)=>{var u=n0().dfltConfig,d=Y_(),E=V.exports={};E.log=function(){var A;if(u.logging>1){var t=["LOG:"];for(A=0;A<arguments.length;A++)t.push(arguments[A]);console.trace.apply(console,t)}if(u.notifyOnLogging>1){var e=[];for(A=0;A<arguments.length;A++)e.push(arguments[A]);d(e.join("<br>"),"long")}},E.warn=function(){var A;if(u.logging>0){var t=["WARN:"];for(A=0;A<arguments.length;A++)t.push(arguments[A]);console.trace.apply(console,t)}if(u.notifyOnLogging>0){var e=[];for(A=0;A<arguments.length;A++)e.push(arguments[A]);d(e.join("<br>"),"stick")}},E.error=function(){var A;if(u.logging>0){var t=["ERROR:"];for(A=0;A<arguments.length;A++)t.push(arguments[A]);console.error.apply(console,t)}if(u.notifyOnLogging>0){var e=[];for(A=0;A<arguments.length;A++)e.push(arguments[A]);d(e.join("<br>"),"stick")}}}),Iy=Vt((Z,V)=>{V.exports=function(){}}),X_=Vt((Z,V)=>{V.exports=function(u,d){if(d instanceof RegExp){for(var E=d.toString(),A=0;A<u.length;A++)if(u[A]instanceof RegExp&&u[A].toString()===E)return u;u.push(d)}else(d||d===0)&&u.indexOf(d)===-1&&u.push(d);return u}}),Y4=Vt((Z,V)=>{V.exports=u;function u(){var d=new Float32Array(16);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}}),X4=Vt((Z,V)=>{V.exports=u;function u(d){var E=new Float32Array(16);return E[0]=d[0],E[1]=d[1],E[2]=d[2],E[3]=d[3],E[4]=d[4],E[5]=d[5],E[6]=d[6],E[7]=d[7],E[8]=d[8],E[9]=d[9],E[10]=d[10],E[11]=d[11],E[12]=d[12],E[13]=d[13],E[14]=d[14],E[15]=d[15],E}}),$4=Vt((Z,V)=>{V.exports=u;function u(d,E){return d[0]=E[0],d[1]=E[1],d[2]=E[2],d[3]=E[3],d[4]=E[4],d[5]=E[5],d[6]=E[6],d[7]=E[7],d[8]=E[8],d[9]=E[9],d[10]=E[10],d[11]=E[11],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15],d}}),$_=Vt((Z,V)=>{V.exports=u;function u(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}}),J4=Vt((Z,V)=>{V.exports=u;function u(d,E){if(d===E){var A=E[1],t=E[2],e=E[3],r=E[6],i=E[7],n=E[11];d[1]=E[4],d[2]=E[8],d[3]=E[12],d[4]=A,d[6]=E[9],d[7]=E[13],d[8]=t,d[9]=r,d[11]=E[14],d[12]=e,d[13]=i,d[14]=n}else d[0]=E[0],d[1]=E[4],d[2]=E[8],d[3]=E[12],d[4]=E[1],d[5]=E[5],d[6]=E[9],d[7]=E[13],d[8]=E[2],d[9]=E[6],d[10]=E[10],d[11]=E[14],d[12]=E[3],d[13]=E[7],d[14]=E[11],d[15]=E[15];return d}}),Q4=Vt((Z,V)=>{V.exports=u;function u(d,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],f=E[9],v=E[10],g=E[11],m=E[12],w=E[13],l=E[14],x=E[15],y=A*n-t*i,S=A*o-e*i,k=A*a-r*i,M=t*o-e*n,T=t*a-r*n,c=e*a-r*o,h=s*w-f*m,b=s*l-v*m,_=s*x-g*m,P=f*l-v*w,L=f*x-g*w,D=v*x-g*l,B=y*D-S*L+k*P+M*_-T*b+c*h;return B?(B=1/B,d[0]=(n*D-o*L+a*P)*B,d[1]=(e*L-t*D-r*P)*B,d[2]=(w*c-l*T+x*M)*B,d[3]=(v*T-f*c-g*M)*B,d[4]=(o*_-i*D-a*b)*B,d[5]=(A*D-e*_+r*b)*B,d[6]=(l*k-m*c-x*S)*B,d[7]=(s*c-v*k+g*S)*B,d[8]=(i*L-n*_+a*h)*B,d[9]=(t*_-A*L-r*h)*B,d[10]=(m*T-w*k+x*y)*B,d[11]=(f*k-s*T-g*y)*B,d[12]=(n*b-i*P-o*h)*B,d[13]=(A*P-t*b+e*h)*B,d[14]=(w*S-m*M-l*y)*B,d[15]=(s*M-f*S+v*y)*B,d):null}}),tT=Vt((Z,V)=>{V.exports=u;function u(d,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],f=E[9],v=E[10],g=E[11],m=E[12],w=E[13],l=E[14],x=E[15];return d[0]=n*(v*x-g*l)-f*(o*x-a*l)+w*(o*g-a*v),d[1]=-(t*(v*x-g*l)-f*(e*x-r*l)+w*(e*g-r*v)),d[2]=t*(o*x-a*l)-n*(e*x-r*l)+w*(e*a-r*o),d[3]=-(t*(o*g-a*v)-n*(e*g-r*v)+f*(e*a-r*o)),d[4]=-(i*(v*x-g*l)-s*(o*x-a*l)+m*(o*g-a*v)),d[5]=A*(v*x-g*l)-s*(e*x-r*l)+m*(e*g-r*v),d[6]=-(A*(o*x-a*l)-i*(e*x-r*l)+m*(e*a-r*o)),d[7]=A*(o*g-a*v)-i*(e*g-r*v)+s*(e*a-r*o),d[8]=i*(f*x-g*w)-s*(n*x-a*w)+m*(n*g-a*f),d[9]=-(A*(f*x-g*w)-s*(t*x-r*w)+m*(t*g-r*f)),d[10]=A*(n*x-a*w)-i*(t*x-r*w)+m*(t*a-r*n),d[11]=-(A*(n*g-a*f)-i*(t*g-r*f)+s*(t*a-r*n)),d[12]=-(i*(f*l-v*w)-s*(n*l-o*w)+m*(n*v-o*f)),d[13]=A*(f*l-v*w)-s*(t*l-e*w)+m*(t*v-e*f),d[14]=-(A*(n*l-o*w)-i*(t*l-e*w)+m*(t*o-e*n)),d[15]=A*(n*v-o*f)-i*(t*v-e*f)+s*(t*o-e*n),d}}),eT=Vt((Z,V)=>{V.exports=u;function u(d){var E=d[0],A=d[1],t=d[2],e=d[3],r=d[4],i=d[5],n=d[6],o=d[7],a=d[8],s=d[9],f=d[10],v=d[11],g=d[12],m=d[13],w=d[14],l=d[15],x=E*i-A*r,y=E*n-t*r,S=E*o-e*r,k=A*n-t*i,M=A*o-e*i,T=t*o-e*n,c=a*m-s*g,h=a*w-f*g,b=a*l-v*g,_=s*w-f*m,P=s*l-v*m,L=f*l-v*w;return x*L-y*P+S*_+k*b-M*h+T*c}}),rT=Vt((Z,V)=>{V.exports=u;function u(d,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],f=E[8],v=E[9],g=E[10],m=E[11],w=E[12],l=E[13],x=E[14],y=E[15],S=A[0],k=A[1],M=A[2],T=A[3];return d[0]=S*t+k*n+M*f+T*w,d[1]=S*e+k*o+M*v+T*l,d[2]=S*r+k*a+M*g+T*x,d[3]=S*i+k*s+M*m+T*y,S=A[4],k=A[5],M=A[6],T=A[7],d[4]=S*t+k*n+M*f+T*w,d[5]=S*e+k*o+M*v+T*l,d[6]=S*r+k*a+M*g+T*x,d[7]=S*i+k*s+M*m+T*y,S=A[8],k=A[9],M=A[10],T=A[11],d[8]=S*t+k*n+M*f+T*w,d[9]=S*e+k*o+M*v+T*l,d[10]=S*r+k*a+M*g+T*x,d[11]=S*i+k*s+M*m+T*y,S=A[12],k=A[13],M=A[14],T=A[15],d[12]=S*t+k*n+M*f+T*w,d[13]=S*e+k*o+M*v+T*l,d[14]=S*r+k*a+M*g+T*x,d[15]=S*i+k*s+M*m+T*y,d}}),nT=Vt((Z,V)=>{V.exports=u;function u(d,E,A){var t=A[0],e=A[1],r=A[2],i,n,o,a,s,f,v,g,m,w,l,x;return E===d?(d[12]=E[0]*t+E[4]*e+E[8]*r+E[12],d[13]=E[1]*t+E[5]*e+E[9]*r+E[13],d[14]=E[2]*t+E[6]*e+E[10]*r+E[14],d[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],f=E[5],v=E[6],g=E[7],m=E[8],w=E[9],l=E[10],x=E[11],d[0]=i,d[1]=n,d[2]=o,d[3]=a,d[4]=s,d[5]=f,d[6]=v,d[7]=g,d[8]=m,d[9]=w,d[10]=l,d[11]=x,d[12]=i*t+s*e+m*r+E[12],d[13]=n*t+f*e+w*r+E[13],d[14]=o*t+v*e+l*r+E[14],d[15]=a*t+g*e+x*r+E[15]),d}}),aT=Vt((Z,V)=>{V.exports=u;function u(d,E,A){var t=A[0],e=A[1],r=A[2];return d[0]=E[0]*t,d[1]=E[1]*t,d[2]=E[2]*t,d[3]=E[3]*t,d[4]=E[4]*e,d[5]=E[5]*e,d[6]=E[6]*e,d[7]=E[7]*e,d[8]=E[8]*r,d[9]=E[9]*r,d[10]=E[10]*r,d[11]=E[11]*r,d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15],d}}),iT=Vt((Z,V)=>{V.exports=u;function u(d,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,f,v,g,m,w,l,x,y,S,k,M,T,c,h,b,_,P,L,D,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,f=E[0],v=E[1],g=E[2],m=E[3],w=E[4],l=E[5],x=E[6],y=E[7],S=E[8],k=E[9],M=E[10],T=E[11],c=e*e*s+a,h=r*e*s+i*o,b=i*e*s-r*o,_=e*r*s-i*o,P=r*r*s+a,L=i*r*s+e*o,D=e*i*s+r*o,B=r*i*s-e*o,R=i*i*s+a,d[0]=f*c+w*h+S*b,d[1]=v*c+l*h+k*b,d[2]=g*c+x*h+M*b,d[3]=m*c+y*h+T*b,d[4]=f*_+w*P+S*L,d[5]=v*_+l*P+k*L,d[6]=g*_+x*P+M*L,d[7]=m*_+y*P+T*L,d[8]=f*D+w*B+S*R,d[9]=v*D+l*B+k*R,d[10]=g*D+x*B+M*R,d[11]=m*D+y*B+T*R,E!==d&&(d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d)}}),oT=Vt((Z,V)=>{V.exports=u;function u(d,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],f=E[10],v=E[11];return E!==d&&(d[0]=E[0],d[1]=E[1],d[2]=E[2],d[3]=E[3],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d[4]=r*e+a*t,d[5]=i*e+s*t,d[6]=n*e+f*t,d[7]=o*e+v*t,d[8]=a*e-r*t,d[9]=s*e-i*t,d[10]=f*e-n*t,d[11]=v*e-o*t,d}}),sT=Vt((Z,V)=>{V.exports=u;function u(d,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],f=E[10],v=E[11];return E!==d&&(d[4]=E[4],d[5]=E[5],d[6]=E[6],d[7]=E[7],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d[0]=r*e-a*t,d[1]=i*e-s*t,d[2]=n*e-f*t,d[3]=o*e-v*t,d[8]=r*t+a*e,d[9]=i*t+s*e,d[10]=n*t+f*e,d[11]=o*t+v*e,d}}),lT=Vt((Z,V)=>{V.exports=u;function u(d,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],f=E[6],v=E[7];return E!==d&&(d[8]=E[8],d[9]=E[9],d[10]=E[10],d[11]=E[11],d[12]=E[12],d[13]=E[13],d[14]=E[14],d[15]=E[15]),d[0]=r*e+a*t,d[1]=i*e+s*t,d[2]=n*e+f*t,d[3]=o*e+v*t,d[4]=a*e-r*t,d[5]=s*e-i*t,d[6]=f*e-n*t,d[7]=v*e-o*t,d}}),uT=Vt((Z,V)=>{V.exports=u;function u(d,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,d[0]=i*i*r+e,d[1]=n*i*r+o*t,d[2]=o*i*r-n*t,d[3]=0,d[4]=i*n*r-o*t,d[5]=n*n*r+e,d[6]=o*n*r+i*t,d[7]=0,d[8]=i*o*r+n*t,d[9]=n*o*r-i*t,d[10]=o*o*r+e,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d)}}),cT=Vt((Z,V)=>{V.exports=u;function u(d,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,f=t*o,v=t*a,g=e*o,m=e*a,w=r*a,l=i*n,x=i*o,y=i*a;return d[0]=1-(g+w),d[1]=f+y,d[2]=v-x,d[3]=0,d[4]=f-y,d[5]=1-(s+w),d[6]=m+l,d[7]=0,d[8]=v+x,d[9]=m-l,d[10]=1-(s+g),d[11]=0,d[12]=A[0],d[13]=A[1],d[14]=A[2],d[15]=1,d}}),fT=Vt((Z,V)=>{V.exports=u;function u(d,E){return d[0]=E[0],d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=E[1],d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=E[2],d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),hT=Vt((Z,V)=>{V.exports=u;function u(d,E){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]=E[0],d[13]=E[1],d[14]=E[2],d[15]=1,d}}),pT=Vt((Z,V)=>{V.exports=u;function u(d,E){var A=Math.sin(E),t=Math.cos(E);return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=t,d[6]=A,d[7]=0,d[8]=0,d[9]=-A,d[10]=t,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),dT=Vt((Z,V)=>{V.exports=u;function u(d,E){var A=Math.sin(E),t=Math.cos(E);return d[0]=t,d[1]=0,d[2]=-A,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=A,d[9]=0,d[10]=t,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),mT=Vt((Z,V)=>{V.exports=u;function u(d,E){var A=Math.sin(E),t=Math.cos(E);return d[0]=t,d[1]=A,d[2]=0,d[3]=0,d[4]=-A,d[5]=t,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}}),gT=Vt((Z,V)=>{V.exports=u;function u(d,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,f=t*n,v=e*i,g=e*n,m=e*o,w=r*i,l=r*n,x=r*o;return d[0]=1-f-m,d[1]=s+x,d[2]=v-l,d[3]=0,d[4]=s-x,d[5]=1-a-m,d[6]=g+w,d[7]=0,d[8]=v+l,d[9]=g-w,d[10]=1-a-f,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}}),vT=Vt((Z,V)=>{V.exports=u;function u(d,E,A,t,e,r,i){var n=1/(A-E),o=1/(e-t),a=1/(r-i);return d[0]=r*2*n,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=r*2*o,d[6]=0,d[7]=0,d[8]=(A+E)*n,d[9]=(e+t)*o,d[10]=(i+r)*a,d[11]=-1,d[12]=0,d[13]=0,d[14]=i*r*2*a,d[15]=0,d}}),yT=Vt((Z,V)=>{V.exports=u;function u(d,E,A,t,e){var r=1/Math.tan(E/2),i=1/(t-e);return d[0]=r/A,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=r,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=(e+t)*i,d[11]=-1,d[12]=0,d[13]=0,d[14]=2*e*t*i,d[15]=0,d}}),xT=Vt((Z,V)=>{V.exports=u;function u(d,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 d[0]=o,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=a,d[6]=0,d[7]=0,d[8]=-((i-n)*o*.5),d[9]=(e-r)*a*.5,d[10]=t/(A-t),d[11]=-1,d[12]=0,d[13]=0,d[14]=t*A/(A-t),d[15]=0,d}}),_T=Vt((Z,V)=>{V.exports=u;function u(d,E,A,t,e,r,i){var n=1/(E-A),o=1/(t-e),a=1/(r-i);return d[0]=-2*n,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*o,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=2*a,d[11]=0,d[12]=(E+A)*n,d[13]=(e+t)*o,d[14]=(i+r)*a,d[15]=1,d}}),bT=Vt((Z,V)=>{var u=$_();V.exports=d;function d(E,A,t,e){var r,i,n,o,a,s,f,v,g,m,w=A[0],l=A[1],x=A[2],y=e[0],S=e[1],k=e[2],M=t[0],T=t[1],c=t[2];return Math.abs(w-M)<1e-6&&Math.abs(l-T)<1e-6&&Math.abs(x-c)<1e-6?u(E):(f=w-M,v=l-T,g=x-c,m=1/Math.sqrt(f*f+v*v+g*g),f*=m,v*=m,g*=m,r=S*g-k*v,i=k*f-y*g,n=y*v-S*f,m=Math.sqrt(r*r+i*i+n*n),m?(m=1/m,r*=m,i*=m,n*=m):(r=0,i=0,n=0),o=v*n-g*i,a=g*r-f*n,s=f*i-v*r,m=Math.sqrt(o*o+a*a+s*s),m?(m=1/m,o*=m,a*=m,s*=m):(o=0,a=0,s=0),E[0]=r,E[1]=o,E[2]=f,E[3]=0,E[4]=i,E[5]=a,E[6]=v,E[7]=0,E[8]=n,E[9]=s,E[10]=g,E[11]=0,E[12]=-(r*w+i*l+n*x),E[13]=-(o*w+a*l+s*x),E[14]=-(f*w+v*l+g*x),E[15]=1,E)}}),wT=Vt((Z,V)=>{V.exports=u;function u(d){return"mat4("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+", "+d[6]+", "+d[7]+", "+d[8]+", "+d[9]+", "+d[10]+", "+d[11]+", "+d[12]+", "+d[13]+", "+d[14]+", "+d[15]+")"}}),J_=Vt((Z,V)=>{V.exports={create:Y4(),clone:X4(),copy:$4(),identity:$_(),transpose:J4(),invert:Q4(),adjoint:tT(),determinant:eT(),multiply:rT(),translate:nT(),scale:aT(),rotate:iT(),rotateX:oT(),rotateY:sT(),rotateZ:lT(),fromRotation:uT(),fromRotationTranslation:cT(),fromScaling:fT(),fromTranslation:hT(),fromXRotation:pT(),fromYRotation:dT(),fromZRotation:mT(),fromQuat:gT(),frustum:vT(),perspective:yT(),perspectiveFromFieldOfView:xT(),ortho:_T(),lookAt:bT(),str:wT()}}),Py=Vt(Z=>{var V=J_();Z.init2dArray=function(u,d){for(var E=new Array(u),A=0;A<u;A++)E[A]=new Array(d);return E},Z.transposeRagged=function(u){var d=0,E=u.length,A,t;for(A=0;A<E;A++)d=Math.max(d,u[A].length);var e=new Array(d);for(A=0;A<d;A++)for(e[A]=new Array(E),t=0;t<E;t++)e[A][t]=u[t][A];return e},Z.dot=function(u,d){if(!(u.length&&d.length)||u.length!==d.length)return null;var E=u.length,A,t;if(u[0].length)for(A=new Array(E),t=0;t<E;t++)A[t]=Z.dot(u[t],d);else if(d[0].length){var e=Z.transposeRagged(d);for(A=new Array(e.length),t=0;t<e.length;t++)A[t]=Z.dot(u,e[t])}else for(A=0,t=0;t<E;t++)A+=u[t]*d[t];return A},Z.translationMatrix=function(u,d){return[[1,0,u],[0,1,d],[0,0,1]]},Z.rotationMatrix=function(u){var d=u*Math.PI/180;return[[Math.cos(d),-Math.sin(d),0],[Math.sin(d),Math.cos(d),0],[0,0,1]]},Z.rotationXYMatrix=function(u,d,E){return Z.dot(Z.dot(Z.translationMatrix(d,E),Z.rotationMatrix(u)),Z.translationMatrix(-d,-E))},Z.apply3DTransform=function(u){return function(){var d=arguments,E=arguments.length===1?d[0]:[d[0],d[1],d[2]||0];return Z.dot(u,[E[0],E[1],E[2],1]).slice(0,3)}},Z.apply2DTransform=function(u){return function(){var d=arguments;d.length===3&&(d=d[0]);var E=arguments.length===1?d[0]:[d[0],d[1]];return Z.dot(u,[E[0],E[1],1]).slice(0,2)}},Z.apply2DTransform2=function(u){var d=Z.apply2DTransform(u);return function(E){return d(E.slice(0,2)).concat(d(E.slice(2,4)))}},Z.convertCssMatrix=function(u){if(u){var d=u.length;if(d===16)return u;if(d===6)return[u[0],u[1],0,0,u[2],u[3],0,0,0,0,1,0,u[4],u[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Z.inverseTransformMatrix=function(u){var d=[];return V.invert(d,u),[[d[0],d[1],d[2],d[3]],[d[4],d[5],d[6],d[7]],[d[8],d[9],d[10],d[11]],[d[12],d[13],d[14],d[15]]]}}),Lg=Vt((Z,V)=>{var u=Ni(),d=_d(),E=Py(),A=J_();function t(w){var l;if(typeof w=="string"){if(l=document.getElementById(w),l===null)throw new Error("No DOM element with id '"+w+"' exists on the page.");return l}else if(w==null)throw new Error("DOM element provided is null or undefined");return w}function e(w){var l=u.select(w);return l.node()instanceof HTMLElement&&l.size()&&l.classed("js-plotly-plot")}function r(w){var l=w&&w.parentNode;l&&l.removeChild(w)}function i(w,l){n("global",w,l)}function n(w,l,x){var y="plotly.js-style-"+w,S=document.getElementById(y);if(!(S&&S.matches(".no-inline-styles"))){S||(S=document.createElement("style"),S.setAttribute("id",y),S.appendChild(document.createTextNode("")),document.head.appendChild(S));var k=S.sheet;k?k.insertRule?k.insertRule(l+"{"+x+"}",0):k.addRule?k.addRule(l,x,0):d.warn("addStyleRule failed"):d.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function o(w){var l="plotly.js-style-"+w,x=document.getElementById(l);x&&r(x)}function a(w,l,x,y,S,k){var M=y.split(":"),T=S.split(":"),c="data-btn-style-event-added";k||(k=document),k.querySelectorAll(w).forEach(function(h){h.getAttribute(c)||(h.addEventListener("mouseenter",function(){var b=this.querySelector(x);b&&(b.style[M[0]]=M[1])}),h.addEventListener("mouseleave",function(){var b=this.querySelector(x);b&&(l&&this.matches(l)?b.style[M[0]]=M[1]:b.style[T[0]]=T[1])}),h.setAttribute(c,!0))})}function s(w){var l=v(w),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return l.forEach(function(y){var S=f(y);if(S){var k=E.convertCssMatrix(S);x=A.multiply(x,x,k)}}),x}function f(w){var l=window.getComputedStyle(w,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(y){return+y})}function v(w){for(var l=[];g(w);)l.push(w),w=w.parentNode,typeof ShadowRoot=="function"&&w instanceof ShadowRoot&&(w=w.host);return l}function g(w){return w&&(w instanceof Element||w instanceof HTMLElement)}function m(w,l){return w&&l&&w.top===l.top&&w.left===l.left&&w.right===l.right&&w.bottom===l.bottom}V.exports={getGraphDiv:t,isPlotDiv:e,removeElement:r,addStyleRule:i,addRelatedStyleRule:n,deleteRelatedStyleRule:o,setStyleOnHover:a,getFullTransformMatrix:s,getElementTransformMatrix:f,getElementAndAncestors:v,equalDomRects:m}}),Cg=Vt((Z,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"}}}}),Cu=Vt((Z,V)=>{var u=So().extendFlat,d=Fp(),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 f=s.split("+"),v=0;v<f.length;v++)o[f[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 f=u({},o);for(var v in f){var g=f[v];d(g)&&(f[v]=n(g,a,s,v))}return s==="from-root"&&(f.editType=a),f}function n(o,a,s,f){if(o.valType){var v=u({},o);if(v.editType=a,Array.isArray(o.items)){v.items=new Array(o.items.length);for(var g=0;g<o.items.length;g++)v.items[g]=n(o.items[g],a)}return v}else return i(o,a,f.charAt(0)==="_"?"nested":"from-root")}}),Cf=Vt(Z=>{Z.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},Z.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",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"}}),Q_=Vt((Z,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"}}),kl=Vt(Z=>{var{DATE_FORMAT_LINK:V,FORMAT_LINK:u}=Q_(),d=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function E({supportOther:A}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(A?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,u,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,V,"for details on the date formatting syntax.",d].join(" ")}Z.templateFormatStringDescription=E,Z.hovertemplateAttrs=({editType:A="none",arrayOk:t}={},e={})=>gd({valType:"string",dflt:"",editType:A},t!==!1?{arrayOk:!0}:{}),Z.texttemplateAttrs=({editType:A="calc",arrayOk:t}={},e={})=>gd({valType:"string",dflt:"",editType:A},t!==!1?{arrayOk:!0}:{}),Z.shapeTexttemplateAttrs=({editType:A="arraydraw",newshape:t}={},e={})=>({valType:"string",dflt:"",editType:A}),Z.templatefallbackAttrs=({editType:A="none"}={})=>({valType:"any",dflt:"-",editType:A})}),Oy=Vt((Z,V)=>{function u(x,y){return y?y.d2l(x):x}function d(x,y){return y?y.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,y){return u(x.x1,y)+i(x)-u(x.x0,y)-r(x)}function s(x,y,S){return u(x.y1,S)+o(x)-u(x.y0,S)-n(x)}function f(x,y){return Math.abs(a(x,y))}function v(x,y,S){return Math.abs(s(x,y,S))}function g(x,y,S){return x.type!=="line"?void 0:Math.sqrt(Math.pow(a(x,y),2)+Math.pow(s(x,y,S),2))}function m(x,y){return d((u(x.x1,y)+i(x)+u(x.x0,y)+r(x))/2,y)}function w(x,y,S){return d((u(x.y1,S)+o(x)+u(x.y0,S)+n(x))/2,S)}function l(x,y,S){return x.type!=="line"?void 0:s(x,y,S)/a(x,y)}V.exports={x0:E,x1:A,y0:t,y1:e,slope:l,dx:a,dy:s,width:f,height:v,length:g,xcenter:m,ycenter:w}}),TT=Vt((Z,V)=>{var u=Cu().overrideAll,d=Tl(),E=yu(),A=Cf().dash,t=So().extendFlat,{shapeTexttemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=Oy();V.exports=u({newshape:{visible:t({},d.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:t({},d.legend,{}),legendgroup:t({},d.legendgroup,{}),legendgrouptitle:{text:t({},d.legendgrouptitle.text,{}),font:E({})},legendrank:t({},d.legendrank,{}),legendwidth:t({},d.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({},d.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:e({newshape:!0},{keys:Object.keys(i)}),texttemplatefallback:r({editType:"arraydraw"}),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)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),kT=Vt((Z,V)=>{var u=Cf().dash,d=So().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:d({},u,{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"}}}),Dy=Vt((Z,V)=>{V.exports=function(u){var d=u.editType;return{t:{valType:"number",dflt:0,editType:d},r:{valType:"number",dflt:0,editType:d},b:{valType:"number",dflt:0,editType:d},l:{valType:"number",dflt:0,editType:d},editType:d}}}),dm=Vt((Z,V)=>{var u=yu(),d=Cg(),E=nf(),A=TT(),t=kT(),e=Dy(),r=So().extendFlat,i=u({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:u({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:u({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({},d.transition,{editType:"none"})}}),AT=Vt(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var Z=document.createElement("style");Z.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",Z.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(Z)}})()}),ji=Vt(Z=>{var V=_d(),u=Iy(),d=X_(),E=Fp(),A=Lg().addStyleRule,t=So(),e=Tl(),r=dm(),i=t.extendFlat,n=t.extendDeepAll;Z.modules={},Z.allCategories={},Z.allTypes=[],Z.subplotsRegistry={},Z.componentsRegistry={},Z.layoutArrayContainers=[],Z.layoutArrayRegexes=[],Z.traceLayoutAttributes={},Z.localeRegistry={},Z.apiMethodRegistry={},Z.collectableSubplotTypes=null,Z.register=function(x){if(Z.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var y=0;y<x.length;y++){var S=x[y];if(!S)throw new Error("Invalid module was attempted to be registered!");switch(S.moduleType){case"trace":o(S);break;case"transform":f(S);break;case"component":s(S);break;case"locale":v(S);break;case"apiMethod":var k=S.name;Z.apiMethodRegistry[k]=S.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},Z.getModule=function(x){var y=Z.modules[l(x)];return y?y._module:!1},Z.traceIs=function(x,y){if(x=l(x),x==="various")return!1;var S=Z.modules[x];return S||(x&&V.log("Unrecognized trace type "+x+"."),S=Z.modules[e.type.dflt]),!!S.categories[y]},Z.getComponentMethod=function(x,y){var S=Z.componentsRegistry[x];return S&&S[y]||u},Z.call=function(){var x=arguments[0],y=[].slice.call(arguments,1);return Z.apiMethodRegistry[x].apply(null,y)};function o(x){var y=x.name,S=x.categories,k=x.meta;if(Z.modules[y]){V.log("Type "+y+" already registered");return}Z.subplotsRegistry[x.basePlotModule.name]||a(x.basePlotModule);for(var M={},T=0;T<S.length;T++)M[S[T]]=!0,Z.allCategories[S[T]]=!0;Z.modules[y]={_module:x,categories:M},k&&Object.keys(k).length&&(Z.modules[y].meta=k),Z.allTypes.push(y);for(var c in Z.componentsRegistry)m(c,y);x.layoutAttributes&&i(Z.traceLayoutAttributes,x.layoutAttributes);var h=x.basePlotModule,b=h.name;if(b==="mapbox"){var _=h.constants.styleRules;for(var P in _)A(".js-plotly-plot .plotly .mapboxgl-"+P,_[P])}b==="map"&&AT(),(b==="geo"||b==="mapbox"||b==="map")&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function a(x){var y=x.name;if(Z.subplotsRegistry[y]){V.log("Plot type "+y+" already registered.");return}g(x),Z.subplotsRegistry[y]=x;for(var S in Z.componentsRegistry)w(S,x.name)}function s(x){if(typeof x.name!="string")throw new Error("Component module *name* must be a string.");var y=x.name;Z.componentsRegistry[y]=x,x.layoutAttributes&&(x.layoutAttributes._isLinkedToArray&&d(Z.layoutArrayContainers,y),g(x));for(var S in Z.modules)m(y,S);for(var k in Z.subplotsRegistry)w(y,k);x.schema&&x.schema.layout&&n(r,x.schema.layout)}function f(x){if(typeof x.name!="string")throw new Error("Transform module *name* must be a string.");var y="Transform module "+x.name,S=typeof x.transform=="function",k=typeof x.calcTransform=="function";if(!S&&!k)throw new Error(y+" is missing a *transform* or *calcTransform* method.");S&&k&&V.log([y+" 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(y+" registered without an *attributes* object."),typeof x.supplyDefaults!="function"&&V.log(y+" registered without a *supplyDefaults* method.")}function v(x){var y=x.name,S=y.split("-")[0],k=x.dictionary,M=x.format,T=k&&Object.keys(k).length,c=M&&Object.keys(M).length,h=Z.localeRegistry,b=h[y];if(b||(h[y]=b={}),S!==y){var _=h[S];_||(h[S]=_={}),T&&_.dictionary===b.dictionary&&(_.dictionary=k),c&&_.format===b.format&&(_.format=M)}T&&(b.dictionary=k),c&&(b.format=M)}function g(x){if(x.layoutAttributes){var y=x.layoutAttributes._arrayAttrRegexps;if(y)for(var S=0;S<y.length;S++)d(Z.layoutArrayRegexes,y[S])}}function m(x,y){var S=Z.componentsRegistry[x].schema;if(!(!S||!S.traces)){var k=S.traces[y];k&&n(Z.modules[y]._module.attributes,k)}}function w(x,y){var S=Z.componentsRegistry[x].schema;if(!(!S||!S.subplots)){var k=Z.subplotsRegistry[y],M=k.layoutAttributes,T=k.attr==="subplot"?k.name:k.attr;Array.isArray(T)&&(T=T[0]);var c=S.subplots[T];M&&c&&n(M,c)}}function l(x){return typeof x=="object"&&(x=x.type),x}}),MT=Vt(Z=>{var V=cm().timeFormat,u=Lo(),d=_d(),E=fm().mod,A=ks(),t=A.BADNUM,e=A.ONEDAY,r=A.ONEHOUR,i=A.ONEMIN,n=A.ONESEC,o=A.EPOCHJD,a=ji(),s=cm().utcFormat,f=/^\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,g=new Date().getFullYear()-70;function m(B){return B&&a.componentsRegistry.calendars&&typeof B=="string"&&B!=="gregorian"}Z.dateTick0=function(B,R){var I=w(B,!!R);if(R<2)return I;var F=Z.dateTime2ms(I,B);return F+=e*(R-1),Z.ms2DateTime(F,0,B)};function w(B,R){return m(B)?R?a.getComponentMethod("calendars","CANONICAL_SUNDAY")[B]:a.getComponentMethod("calendars","CANONICAL_TICK")[B]:R?"2000-01-02":"2000-01-01"}Z.dfltRange=function(B){return m(B)?a.getComponentMethod("calendars","DFLTRANGE")[B]:["2000-01-01","2001-01-01"]},Z.isJSDate=function(B){return typeof B=="object"&&B!==null&&typeof B.getTime=="function"};var l,x;Z.dateTime2ms=function(B,R){if(Z.isJSDate(B)){var I=B.getTimezoneOffset()*i,F=(B.getUTCMinutes()-B.getMinutes())*i+(B.getUTCSeconds()-B.getSeconds())*n+(B.getUTCMilliseconds()-B.getMilliseconds());if(F){var N=3*i;I=I-N/2+E(F-I+N/2,N)}return B=Number(B)-I,B>=l&&B<=x?B:t}if(typeof B!="string"&&typeof B!="number")return t;B=String(B);var j=m(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:f);if(!ct)return t;var st=ct[1],et=ct[3]||"1",K=Number(ct[5]||1),ot=Number(ct[7]||0),X=Number(ct[9]||0),Q=Number(ct[11]||0);if(j){if(st.length===2)return t;st=Number(st);var ut;try{var J=a.getComponentMethod("calendars","getCal")(R);if(rt){var q=et.charAt(et.length-1)==="i";et=parseInt(et,10),ut=J.newDate(st,J.toMonthIndex(st,et,q),K)}else ut=J.newDate(st,Number(et),K)}catch{return t}return ut?(ut.toJD()-o)*e+ot*r+X*i+Q*n:t}st.length===2?st=(Number(st)+2e3-g)%100+g:st=Number(st),et-=1;var it=new Date(Date.UTC(2e3,et,K,ot,X));return it.setUTCFullYear(st),it.getUTCMonth()!==et||it.getUTCDate()!==K?t:it.getTime()+Q*n},l=Z.MIN_MS=Z.dateTime2ms("-9999"),x=Z.MAX_MS=Z.dateTime2ms("9999-12-31 23:59:59.9999"),Z.isDateTime=function(B,R){return Z.dateTime2ms(B,R)!==t};function y(B,R){return String(B+Math.pow(10,R)).substr(1)}var S=90*e,k=3*r,M=5*i;Z.ms2DateTime=function(B,R,I){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,st,et;if(m(I)){var K=Math.floor(N/e)+o,ot=Math.floor(E(B,e));try{j=a.getComponentMethod("calendars","getCal")(I).fromJD(K).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(ot/r):0,rt=R<S?Math.floor(ot%r/i):0,ct=R<k?Math.floor(ot%i/n):0,st=R<M?ot%n*10+F:0}else et=new Date(N),j=s("%Y-%m-%d")(et),G=R<S?et.getUTCHours():0,rt=R<S?et.getUTCMinutes():0,ct=R<k?et.getUTCSeconds():0,st=R<M?et.getUTCMilliseconds()*10+F:0;return T(j,G,rt,ct,st)},Z.ms2DateTimeLocal=function(B){if(!(B>=l+e&&B<=x-e))return t;var R=Math.floor(E(B+.05,1)*10),I=new Date(Math.round(B-R/10)),F=V("%Y-%m-%d")(I),N=I.getHours(),j=I.getMinutes(),G=I.getSeconds(),rt=I.getUTCMilliseconds()*10+R;return T(F,N,j,G,rt)};function T(B,R,I,F,N){if((R||I||F||N)&&(B+=" "+y(R,2)+":"+y(I,2),(F||N)&&(B+=":"+y(F,2),N))){for(var j=4;N%10===0;)j-=1,N/=10;B+="."+y(N,j)}return B}Z.cleanDate=function(B,R,I){if(B===t)return R;if(Z.isJSDate(B)||typeof B=="number"&&isFinite(B)){if(m(I))return d.error("JS Dates and milliseconds are incompatible with world calendars",B),R;if(B=Z.ms2DateTimeLocal(+B),!B&&R!==void 0)return R}else if(!Z.isDateTime(B,I))return d.error("unrecognized date",B),R;return B};var c=/%\d?f/g,h=/%h/g,b={1:"1",2:"1",3:"2",4:"2"};function _(B,R,I,F){B=B.replace(c,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(h,function(){return b[I("%q")(N)]}),m(F))try{B=a.getComponentMethod("calendars","worldCalFmt")(B,R,F)}catch{return"Invalid"}return I(B)(N)}var P=[59,59.9,59.99,59.999,59.9999];function L(B,R){var I=E(B+.05,e),F=y(Math.floor(I/r),2)+":"+y(E(Math.floor(I/i),60),2);if(R!=="M"){u(R)||(R=0);var N=Math.min(E(B/n,60),P[R]),j=(100+N).toFixed(R).substr(1);R>0&&(j=j.replace(/0+$/,"").replace(/[\.]$/,"")),F+=":"+j}return F}Z.formatDate=function(B,R,I,F,N,j){if(N=m(N)&&N,!R)if(I==="y")R=j.year;else if(I==="m")R=j.month;else if(I==="d")R=j.dayMonth+`
`+j.year;else return L(B,I)+`
`+_(j.dayMonthYear,B,F,N);return _(R,B,F,N)};var D=3*e;Z.incrementMonth=function(B,R,I){I=m(I)&&I;var F=E(B,e);if(B=Math.round(B-F),I)try{var N=Math.round(B/e)+o,j=a.getComponentMethod("calendars","getCal")(I),G=j.fromJD(N);return R%12?j.add(G,R,"m"):j.add(G,R/12,"y"),(G.toJD()-o)*e+F}catch{d.error("invalid ms "+B+" in calendar "+I)}var rt=new Date(B+D);return rt.setUTCMonth(rt.getUTCMonth()+R)+F-D},Z.findExactDates=function(B,R){for(var I=0,F=0,N=0,j=0,G,rt,ct=m(R)&&a.getComponentMethod("calendars","getCal")(R),st=0;st<B.length;st++){if(rt=B[st],!u(rt)){j++;continue}if(!(rt%e))if(ct)try{G=ct.fromJD(rt/e+o),G.day()===1?G.month()===1?I++:F++:N++}catch{}else G=new Date(rt),G.getUTCDate()===1?G.getUTCMonth()===0?I++:F++:N++}F+=I,N+=F;var et=B.length-j;return{exactYears:I/et,exactMonths:F/et,exactDays:N/et}}}),Ig=Vt((Z,V)=>{V.exports=function(u){return u}}),Fy=Vt(Z=>{var V=Lo(),u=_d(),d=Ig(),E=ks().BADNUM,A=1e-9;Z.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,f=o.length,v=0,g=f>1?(o[f-1]-o[0])/(f-1):1,m,w;for(g>=0?w=a?t:e:w=a?i:r,n+=g*A*(a?-1:1)*(g>=0?1:-1);s<f&&v++<100;)m=Math.floor((s+f)/2),w(o[m],n)?s=m+1:f=m;return v>90&&u.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}Z.sorterAsc=function(n,o){return n-o},Z.sorterDes=function(n,o){return o-n},Z.distinctVals=function(n){var o=n.slice();o.sort(Z.sorterAsc);var a;for(a=o.length-1;a>-1&&o[a]===E;a--);for(var s=o[a]-o[0]||1,f=s/(a||1)/1e4,v=[],g,m=0;m<=a;m++){var w=o[m],l=w-g;g===void 0?(v.push(w),g=w):l>f&&(s=Math.min(s,l),v.push(w),g=w)}return{vals:v,minDiff:s}},Z.roundUp=function(n,o,a){for(var s=0,f=o.length-1,v,g=0,m=a?0:1,w=a?1:0,l=a?Math.ceil:Math.floor;s<f&&g++<100;)v=l((s+f)/2),o[v]<=n?s=v+m:f=v-w;return o[s]},Z.sort=function(n,o){for(var a=0,s=0,f=1;f<n.length;f++){var v=o(n[f],n[f-1]);if(v<0?a=1:v>0&&(s=1),a&&s)return n.sort(o)}return s?n:n.reverse()},Z.findIndexOfMin=function(n,o){o=o||d;for(var a=1/0,s,f=0;f<n.length;f++){var v=o(n[f]);v<a&&(a=v,s=f)}return s}}),bd=Vt((Z,V)=>{V.exports=function(u){return Object.keys(u).sort()}}),ST=Vt(Z=>{var V=Lo(),u=rh().isArrayOrTypedArray;Z.aggNums=function(d,E,A,t){var e,r;if((!t||t>A.length)&&(t=A.length),V(E)||(E=!1),u(A[0])){for(r=new Array(t),e=0;e<t;e++)r[e]=Z.aggNums(d,E,A[e]);A=r}for(e=0;e<t;e++)V(E)?V(A[e])&&(E=d(+E,+A[e])):E=A[e];return E},Z.len=function(d){return Z.aggNums(function(E){return E+1},0,d)},Z.mean=function(d,E){return E||(E=Z.len(d)),Z.aggNums(function(A,t){return A+t},0,d)/E},Z.geometricMean=function(d,E){return E||(E=Z.len(d)),Math.pow(Z.aggNums(function(A,t){return A*t},1,d),1/E)},Z.midRange=function(d){if(!(d===void 0||d.length===0))return(Z.aggNums(Math.max,null,d)+Z.aggNums(Math.min,null,d))/2},Z.variance=function(d,E,A){return E||(E=Z.len(d)),V(A)||(A=Z.mean(d,E)),Z.aggNums(function(t,e){return t+Math.pow(e-A,2)},0,d)/E},Z.stdev=function(d,E,A){return Math.sqrt(Z.variance(d,E,A))},Z.median=function(d){var E=d.slice().sort();return Z.interp(E,.5)},Z.interp=function(d,E){if(!V(E))throw"n should be a finite number";if(E=E*d.length-.5,E<0)return d[0];if(E>d.length-1)return d[d.length-1];var A=E%1;return A*d[Math.ceil(E)]+(1-A)*d[Math.floor(E)]}}),ET=Vt((Z,V)=>{var u=fm(),d=u.mod,E=u.modHalf,A=Math.PI,t=2*A;function e(w){return w/180*A}function r(w){return w/A*180}function i(w){return Math.abs(w[1]-w[0])>t-1e-14}function n(w,l){return E(l-w,t)}function o(w,l){return Math.abs(n(w,l))}function a(w,l){if(i(l))return!0;var x,y;l[0]<l[1]?(x=l[0],y=l[1]):(x=l[1],y=l[0]),x=d(x,t),y=d(y,t),x>y&&(y+=t);var S=d(w,t),k=S+t;return S>=x&&S<=y||k>=x&&k<=y}function s(w,l,x,y){if(!a(l,y))return!1;var S,k;return x[0]<x[1]?(S=x[0],k=x[1]):(S=x[1],k=x[0]),w>=S&&w<=k}function f(w,l,x,y,S,k,M){S=S||0,k=k||0;var T=i([x,y]),c,h,b,_,P;T?(c=0,h=A,b=t):x<y?(c=x,b=y):(c=y,b=x),w<l?(_=w,P=l):(_=l,P=w);function L(I,F){return[I*Math.cos(F)+S,k-I*Math.sin(F)]}var D=Math.abs(b-c)<=A?0:1;function B(I,F,N){return"A"+[I,I]+" "+[0,D,N]+" "+L(I,F)}var R;return T?_===null?R="M"+L(P,c)+B(P,h,0)+B(P,b,0)+"Z":R="M"+L(_,c)+B(_,h,0)+B(_,b,0)+"ZM"+L(P,c)+B(P,h,1)+B(P,b,1)+"Z":_===null?(R="M"+L(P,c)+B(P,b,0),M&&(R+="L0,0Z")):R="M"+L(_,c)+"L"+L(P,c)+B(P,b,0)+"L"+L(_,b)+B(_,c,1)+"Z",R}function v(w,l,x,y,S){return f(null,w,l,x,y,S,0)}function g(w,l,x,y,S){return f(null,w,l,x,y,S,1)}function m(w,l,x,y,S,k){return f(w,l,x,y,S,k,1)}V.exports={deg2rad:e,rad2deg:r,angleDelta:n,angleDist:o,isFullCircle:i,isAngleInsideSector:a,isPtInsideSector:s,pathArc:v,pathSector:g,pathAnnulus:m}}),zT=Vt(Z=>{Z.isLeftAnchor=function(V){return V.xanchor==="left"||V.xanchor==="auto"&&V.x<=1/3},Z.isCenterAnchor=function(V){return V.xanchor==="center"||V.xanchor==="auto"&&V.x>1/3&&V.x<2/3},Z.isRightAnchor=function(V){return V.xanchor==="right"||V.xanchor==="auto"&&V.x>=2/3},Z.isTopAnchor=function(V){return V.yanchor==="top"||V.yanchor==="auto"&&V.y>=2/3},Z.isMiddleAnchor=function(V){return V.yanchor==="middle"||V.yanchor==="auto"&&V.y>1/3&&V.y<2/3},Z.isBottomAnchor=function(V){return V.yanchor==="bottom"||V.yanchor==="auto"&&V.y<=1/3}}),LT=Vt(Z=>{var V=fm().mod;Z.segmentsIntersect=u;function u(e,r,i,n,o,a,s,f){var v=i-e,g=o-e,m=s-o,w=n-r,l=a-r,x=f-a,y=v*x-m*w;if(y===0)return null;var S=(g*x-m*l)/y,k=(g*w-v*l)/y;return k<0||k>1||S<0||S>1?null:{x:e+v*S,y:r+w*S}}Z.segmentDistance=function(e,r,i,n,o,a,s,f){if(u(e,r,i,n,o,a,s,f))return 0;var v=i-e,g=n-r,m=s-o,w=f-a,l=v*v+g*g,x=m*m+w*w,y=Math.min(d(v,g,l,o-e,a-r),d(v,g,l,s-e,f-r),d(m,w,x,e-o,r-a),d(m,w,x,i-o,n-a));return Math.sqrt(y)};function d(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,f=o-r;return s*s+f*f}else{var v=n*r-o*e;return v*v/i}}var E,A,t;Z.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)),f=e.getPointAtLength(V(i,r)),v=(f.x*4+o.x+a.x)/6,g=(f.y*4+o.y+a.y)/6,m={x:v,y:g,theta:s};return E[i]=m,m},Z.clearLocationCache=function(){A=null},Z.getVisibleSegment=function(e,r,i){var n=r.left,o=r.right,a=r.top,s=r.bottom,f=0,v=e.getTotalLength(),g=v,m,w;function l(y){var S=e.getPointAtLength(y);y===0?m=S:y===v&&(w=S);var k=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(k*k+M*M)}for(var x=l(f);x;){if(f+=x+i,f>g)return;x=l(f)}for(x=l(g);x;){if(g-=x+i,f>g)return;x=l(g)}return{min:f,max:g,len:g-f,total:v,isClosed:f===0&&g===v&&Math.abs(m.x-w.x)<.1&&Math.abs(m.y-w.y)<.1}},Z.findPointOnPath=function(e,r,i,n){n=n||{};for(var o=n.pathLength||e.getTotalLength(),a=n.tolerance||.001,s=n.iterationLimit||30,f=e.getPointAtLength(0)[i]>e.getPointAtLength(o)[i]?-1:1,v=0,g=0,m=o,w,l,x;v<s;){if(w=(g+m)/2,l=e.getPointAtLength(w),x=l[i]-r,Math.abs(x)<a)return l;f*x>0?m=w:g=w,v++}return l}}),By=Vt(Z=>{var V={};Z.throttle=function(d,E,A){var t=V[d],e=Date.now();if(!t){for(var r in V)V[r].ts<e-6e4&&delete V[r];t=V[d]={ts:0,timer:null}}u(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)},Z.done=function(d){var E=V[d];return!E||!E.timer?Promise.resolve():new Promise(function(A){var t=E.onDone;E.onDone=function(){t&&t(),A(),E.onDone=null}})},Z.clear=function(d){if(d)u(V[d]),delete V[d];else for(var E in V)Z.clear(E)};function u(d){d&&d.timer!==null&&(clearTimeout(d.timer),d.timer=null)}}),CT=Vt((Z,V)=>{V.exports=function(u){u._responsiveChartHandler&&(window.removeEventListener("resize",u._responsiveChartHandler),delete u._responsiveChartHandler)}}),IT=Vt((Z,V)=>{V.exports=A,V.exports.isMobile=A,V.exports.default=A;var u=/(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,d=/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=u.test(e)&&!d.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}}),PT=Vt((Z,V)=>{var u=Lo(),d=IT();V.exports=function(A){var t;if(A&&A.hasOwnProperty("userAgent")?t=A.userAgent:t=E(),typeof t!="string")return!0;var e=d({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(u(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}}),OT=Vt((Z,V)=>{var u=Ni();V.exports=function(d,E,A){var t=d.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=d.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(r){r[0][e]=u.select(this)}),t}}),DT=Vt((Z,V)=>{var u=ji();V.exports=function(d,E){for(var A=d._context.locale,t=0;t<2;t++){for(var e=d._context.locales,r=0;r<2;r++){var i=(e[A]||{}).dictionary;if(i){var n=i[E];if(n)return n}e=u.localeRegistry}var o=A.split("-")[0];if(o===A)break;A=o}return E}}),tb=Vt((Z,V)=>{V.exports=function(u){for(var d={},E=[],A=0,t=0;t<u.length;t++){var e=u[t];d[e]!==1&&(d[e]=1,E[A++]=e)}return E}}),FT=Vt((Z,V)=>{V.exports=function(A){for(var t=E(A)?d:u,e=[],r=0;r<A.length;r++){var i=A[r];t(i)&&e.push(i)}return e};function u(A){return A.visible===!0}function d(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}}),BT=Vt((Z,V)=>{V.exports=function(u,d){if(!d)return u;var E=1/Math.abs(d),A=E>1?(E*u+E*d)/E:u+d,t=String(A).length;if(t>16){var e=String(d).length,r=String(u).length;if(t>=r+e){var i=parseFloat(A).toPrecision(12);i.indexOf("e+")===-1&&(A=+i)}}return A}}),RT=Vt((Z,V)=>{var u=Lo(),d=ks().BADNUM,E=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;V.exports=function(A){return typeof A=="string"&&(A=A.replace(E,"")),u(A)?Number(A):d}}),Xr=Vt((Z,V)=>{var u=Ni(),d=cm().utcFormat,E=Z_().format,A=Lo(),t=ks(),e=t.FP_SAFE,r=-e,i=t.BADNUM,n=V.exports={};n.adjustFormat=function(J){return!J||/^\d[.]\df/.test(J)||/[.]\d%/.test(J)?J:J==="0.f"?"~f":/^\d%/.test(J)?"~%":/^\ds/.test(J)?"~s":!/^[~,.0$]/.test(J)&&/[&fps]/.test(J)?"~"+J:J};var o={};n.warnBadFormat=function(J){var q=String(J);o[q]||(o[q]=1,n.warn('encountered bad format: "'+q+'"'))},n.noFormat=function(J){return String(J)},n.numberFormat=function(J){var q;try{q=E(n.adjustFormat(J))}catch{return n.warnBadFormat(J),n.noFormat}return q},n.nestedProperty=Eg(),n.keyedContainer=W4(),n.relativeAttr=G4(),n.isPlainObject=Fp(),n.toLogRange=Cy(),n.relinkPrivateKeys=Z4();var a=rh();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=fm();n.mod=s.mod,n.modHalf=s.modHalf;var f=K4();n.valObjectMeta=f.valObjectMeta,n.coerce=f.coerce,n.coerce2=f.coerce2,n.coerceFont=f.coerceFont,n.coercePattern=f.coercePattern,n.coerceHoverinfo=f.coerceHoverinfo,n.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,n.validate=f.validate;var v=MT();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 g=Fy();n.findBin=g.findBin,n.sorterAsc=g.sorterAsc,n.sorterDes=g.sorterDes,n.distinctVals=g.distinctVals,n.roundUp=g.roundUp,n.sort=g.sort,n.findIndexOfMin=g.findIndexOfMin,n.sortObjectKeys=bd();var m=ST();n.aggNums=m.aggNums,n.len=m.len,n.mean=m.mean,n.geometricMean=m.geometricMean,n.median=m.median,n.midRange=m.midRange,n.variance=m.variance,n.stdev=m.stdev,n.interp=m.interp;var w=Py();n.init2dArray=w.init2dArray,n.transposeRagged=w.transposeRagged,n.dot=w.dot,n.translationMatrix=w.translationMatrix,n.rotationMatrix=w.rotationMatrix,n.rotationXYMatrix=w.rotationXYMatrix,n.apply3DTransform=w.apply3DTransform,n.apply2DTransform=w.apply2DTransform,n.apply2DTransform2=w.apply2DTransform2,n.convertCssMatrix=w.convertCssMatrix,n.inverseTransformMatrix=w.inverseTransformMatrix;var l=ET();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=zT();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 y=LT();n.segmentsIntersect=y.segmentsIntersect,n.segmentDistance=y.segmentDistance,n.getTextLocation=y.getTextLocation,n.clearLocationCache=y.clearLocationCache,n.getVisibleSegment=y.getVisibleSegment,n.findPointOnPath=y.findPointOnPath;var S=So();n.extendFlat=S.extendFlat,n.extendDeep=S.extendDeep,n.extendDeepAll=S.extendDeepAll,n.extendDeepNoArrays=S.extendDeepNoArrays;var k=_d();n.log=k.log,n.warn=k.warn,n.error=k.error;var M=pm();n.counterRegex=M.counter;var T=By();n.throttle=T.throttle,n.throttleDone=T.done,n.clearThrottle=T.clear;var c=Lg();n.getGraphDiv=c.getGraphDiv,n.isPlotDiv=c.isPlotDiv,n.removeElement=c.removeElement,n.addStyleRule=c.addStyleRule,n.addRelatedStyleRule=c.addRelatedStyleRule,n.deleteRelatedStyleRule=c.deleteRelatedStyleRule,n.setStyleOnHover=c.setStyleOnHover,n.getFullTransformMatrix=c.getFullTransformMatrix,n.getElementTransformMatrix=c.getElementTransformMatrix,n.getElementAndAncestors=c.getElementAndAncestors,n.equalDomRects=c.equalDomRects,n.clearResponsive=CT(),n.preserveDrawingBuffer=PT(),n.makeTraceGroups=OT(),n._=DT(),n.notifier=Y_(),n.filterUnique=tb(),n.filterVisible=FT(),n.pushUnique=X_(),n.increment=BT(),n.cleanNumber=RT(),n.ensureNumber=function(J){return A(J)?(J=Number(J),J>e||J<r?i:J):i},n.isIndex=function(J,q){return q!==void 0&&J>=q?!1:A(J)&&J>=0&&J%1===0},n.noop=Iy(),n.identity=Ig(),n.repeat=function(J,q){for(var it=new Array(q),nt=0;nt<q;nt++)it[nt]=J;return it},n.swapAttrs=function(J,q,it,nt){it||(it="x"),nt||(nt="y");for(var dt=0;dt<q.length;dt++){var Tt=q[dt],wt=n.nestedProperty(J,Tt.replace("?",it)),It=n.nestedProperty(J,Tt.replace("?",nt)),Ct=wt.get();wt.set(It.get()),It.set(Ct)}},n.raiseToTop=function(J){J.parentNode.appendChild(J)},n.cancelTransition=function(J){return J.transition().duration(0)},n.constrain=function(J,q,it){return q>it?Math.max(it,Math.min(q,J)):Math.max(q,Math.min(it,J))},n.bBoxIntersect=function(J,q,it){return it=it||0,J.left<=q.right+it&&q.left<=J.right+it&&J.top<=q.bottom+it&&q.top<=J.bottom+it},n.simpleMap=function(J,q,it,nt,dt){for(var Tt=J.length,wt=new Array(Tt),It=0;It<Tt;It++)wt[It]=q(J[It],it,nt,dt);return wt},n.randstr=function J(q,it,nt,dt){if(nt||(nt=16),it===void 0&&(it=24),it<=0)return"0";var Tt=Math.log(Math.pow(2,it))/Math.log(nt),wt="",It,Ct,Nt;for(It=2;Tt===1/0;It*=2)Tt=Math.log(Math.pow(2,it/It))/Math.log(nt)*It;var ee=Tt-Math.floor(Tt);for(It=0;It<Math.floor(Tt);It++)Nt=Math.floor(Math.random()*nt).toString(nt),wt=Nt+wt;ee&&(Ct=Math.pow(nt,ee),Nt=Math.floor(Math.random()*Ct).toString(nt),wt=Nt+wt);var Jt=parseInt(wt,nt);return q&&q[wt]||Jt!==1/0&&Jt>=Math.pow(2,it)?dt>10?(n.warn("randstr failed uniqueness"),wt):J(q,it,nt,(dt||0)+1):wt},n.OptionControl=function(J,q){J||(J={}),q||(q="opt");var it={};return it.optionList=[],it._newoption=function(nt){nt[q]=J,it[nt.name]=nt,it.optionList.push(nt)},it["_"+q]=J,it},n.smooth=function(J,q){if(q=Math.round(q)||0,q<2)return J;var it=J.length,nt=2*it,dt=2*q-1,Tt=new Array(dt),wt=new Array(it),It,Ct,Nt,ee;for(It=0;It<dt;It++)Tt[It]=(1-Math.cos(Math.PI*(It+1)/q))/(2*q);for(It=0;It<it;It++){for(ee=0,Ct=0;Ct<dt;Ct++)Nt=It+Ct+1-q,Nt<-it?Nt-=nt*Math.round(Nt/nt):Nt>=nt&&(Nt-=nt*Math.floor(Nt/nt)),Nt<0?Nt=-1-Nt:Nt>=it&&(Nt=nt-1-Nt),ee+=J[Nt]*Tt[Ct];wt[It]=ee}return wt},n.syncOrAsync=function(J,q,it){var nt,dt;function Tt(){return n.syncOrAsync(J,q,it)}for(;J.length;)if(dt=J.splice(0,1)[0],nt=dt(q),nt&&nt.then)return nt.then(Tt);return it&&it(q)},n.stripTrailingSlash=function(J){return J.substr(-1)==="/"?J.substr(0,J.length-1):J},n.noneOrAll=function(J,q,it){if(J){var nt=!1,dt=!0,Tt,wt;for(Tt=0;Tt<it.length;Tt++)wt=J[it[Tt]],wt!=null?nt=!0:dt=!1;if(nt&&!dt)for(Tt=0;Tt<it.length;Tt++)J[it[Tt]]=q[it[Tt]]}},n.mergeArray=function(J,q,it,nt){var dt=typeof nt=="function";if(n.isArrayOrTypedArray(J))for(var Tt=Math.min(J.length,q.length),wt=0;wt<Tt;wt++){var It=J[wt];q[wt][it]=dt?nt(It):It}},n.mergeArrayCastPositive=function(J,q,it){return n.mergeArray(J,q,it,function(nt){var dt=+nt;return isFinite(dt)&&dt>0?dt:0})},n.fillArray=function(J,q,it,nt){if(nt=nt||n.identity,n.isArrayOrTypedArray(J))for(var dt=0;dt<q.length;dt++)q[dt][it]=nt(J[dt])},n.castOption=function(J,q,it,nt){nt=nt||n.identity;var dt=n.nestedProperty(J,it).get();return n.isArrayOrTypedArray(dt)?Array.isArray(q)&&n.isArrayOrTypedArray(dt[q[0]])?nt(dt[q[0]][q[1]]):nt(dt[q]):dt},n.extractOption=function(J,q,it,nt){if(it in J)return J[it];var dt=n.nestedProperty(q,nt).get();if(!Array.isArray(dt))return dt};function h(J){var q={};for(var it in J)for(var nt=J[it],dt=0;dt<nt.length;dt++)q[nt[dt]]=+it;return q}n.tagSelected=function(J,q,it){var nt=q.selectedpoints,dt=q._indexToPoints,Tt;dt&&(Tt=h(dt));function wt(Jt){return Jt!==void 0&&Jt<J.length}for(var It=0;It<nt.length;It++){var Ct=nt[It];if(n.isIndex(Ct)||n.isArrayOrTypedArray(Ct)&&n.isIndex(Ct[0])&&n.isIndex(Ct[1])){var Nt=Tt?Tt[Ct]:Ct,ee=it?it[Nt]:Nt;wt(ee)&&(J[ee].selected=1)}}},n.selIndices2selPoints=function(J){var q=J.selectedpoints,it=J._indexToPoints;if(it){for(var nt=h(it),dt=[],Tt=0;Tt<q.length;Tt++){var wt=q[Tt];if(n.isIndex(wt)){var It=nt[wt];n.isIndex(It)&&dt.push(It)}}return dt}else return q},n.getTargetArray=function(J,q){var it=q.target;if(typeof it=="string"&&it){var nt=n.nestedProperty(J,it).get();return n.isArrayOrTypedArray(nt)?nt:!1}else if(n.isArrayOrTypedArray(it))return it;return!1};function b(J,q,it){var nt={};typeof q!="object"&&(q={});var dt=it==="pieLike"?-1:3,Tt=Object.keys(J),wt,It,Ct;for(wt=0;wt<Tt.length;wt++)It=Tt[wt],Ct=J[It],!(It.charAt(0)==="_"||typeof Ct=="function")&&(It==="module"?nt[It]=Ct:Array.isArray(Ct)?It==="colorscale"||dt===-1?nt[It]=Ct.slice():nt[It]=Ct.slice(0,dt):n.isTypedArray(Ct)?dt===-1?nt[It]=Ct.subarray():nt[It]=Ct.subarray(0,dt):Ct&&typeof Ct=="object"?nt[It]=b(J[It],q[It],it):nt[It]=Ct);for(Tt=Object.keys(q),wt=0;wt<Tt.length;wt++)It=Tt[wt],Ct=q[It],(typeof Ct!="object"||!(It in nt)||typeof nt[It]!="object")&&(nt[It]=Ct);return nt}n.minExtend=b,n.titleCase=function(J){return J.charAt(0).toUpperCase()+J.substr(1)},n.containsAny=function(J,q){for(var it=0;it<q.length;it++)if(J.indexOf(q[it])!==-1)return!0;return!1};var _=/Version\/[\d\.]+.*Safari/;n.isSafari=function(){return _.test(window.navigator.userAgent)};var P=/iPad|iPhone|iPod/;n.isIOS=function(){return P.test(window.navigator.userAgent)};var L=/Macintosh.+AppleWebKit.+Gecko\)$/;n.isMacWKWebView=()=>L.test(window.navigator.userAgent);var D=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var J=D.exec(window.navigator.userAgent);if(J&&J.length===2){var q=parseInt(J[1]);if(!isNaN(q))return q}return null},n.isD3Selection=function(J){return J instanceof u.selection},n.ensureSingle=function(J,q,it,nt){var dt=J.select(q+(it?"."+it:""));if(dt.size())return dt;var Tt=J.append(q);return it&&Tt.classed(it,!0),nt&&Tt.call(nt),Tt},n.ensureSingleById=function(J,q,it,nt){var dt=J.select(q+"#"+it);if(dt.size())return dt;var Tt=J.append(q).attr("id",it);return nt&&Tt.call(nt),Tt},n.objectFromPath=function(J,q){for(var it=J.split("."),nt,dt=nt={},Tt=0;Tt<it.length;Tt++){var wt=it[Tt],It=null,Ct=it[Tt].match(/(.*)\[([0-9]+)\]/);Ct?(wt=Ct[1],It=Ct[2],nt=nt[wt]=[],Tt===it.length-1?nt[It]=q:nt[It]={},nt=nt[It]):(Tt===it.length-1?nt[wt]=q:nt[wt]={},nt=nt[wt])}return dt};var B=/^([^\[\.]+)\.(.+)?/,R=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function I(J){return J.slice(0,2)==="__"}n.expandObjectPaths=function(J){var q,it,nt,dt,Tt,wt,It;if(typeof J=="object"&&!Array.isArray(J)){for(it in J)if(J.hasOwnProperty(it))if(q=it.match(B)){if(dt=J[it],nt=q[1],I(nt))continue;delete J[it],J[nt]=n.extendDeepNoArrays(J[nt]||{},n.objectFromPath(it,n.expandObjectPaths(dt))[nt])}else if(q=it.match(R)){if(dt=J[it],nt=q[1],I(nt))continue;if(Tt=parseInt(q[2]),delete J[it],J[nt]=J[nt]||[],q[3]===".")It=q[4],wt=J[nt][Tt]=J[nt][Tt]||{},n.extendDeepNoArrays(wt,n.objectFromPath(It,n.expandObjectPaths(dt)));else{if(I(nt))continue;J[nt][Tt]=n.expandObjectPaths(dt)}}else{if(I(it))continue;J[it]=n.expandObjectPaths(J[it])}}return J},n.numSeparate=function(J,q,it){if(it||(it=!1),typeof q!="string"||q.length===0)throw new Error("Separator string required for formatting!");typeof J=="number"&&(J=String(J));var nt=/(\d+)(\d{3})/,dt=q.charAt(0),Tt=q.charAt(1),wt=J.split("."),It=wt[0],Ct=wt.length>1?dt+wt[1]:"";if(Tt&&(wt.length>1||It.length>4||it))for(;nt.test(It);)It=It.replace(nt,"$1"+Tt+"$2");return It+Ct},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var F=/^\w*$/;n.templateString=function(J,q){var it={};return J.replace(n.TEMPLATE_STRING_REGEX,function(nt,dt){var Tt;return F.test(dt)?Tt=q[dt]:(it[dt]=it[dt]||n.nestedProperty(q,dt).get,Tt=it[dt](!0)),Tt!==void 0?Tt:""})};var N={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=J=>et(um(gd({},J),{opts:N}));var j={max:10,count:0,name:"texttemplate"};n.texttemplateString=J=>et(um(gd({},J),{opts:j}));var G=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function rt(J){var q=J.match(G);return q?{key:q[1],op:q[2],number:Number(q[3])}:{key:J,op:null,number:null}}var ct={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=J=>et(um(gd({},J),{opts:ct}));var st=/^[:|\|]/;function et({data:J=[],locale:q,fallback:it,labels:nt={},opts:dt,template:Tt}){return Tt.replace(n.TEMPLATE_STRING_REGEX,(wt,It,Ct)=>{let Nt=["xother","yother"].includes(It),ee=["_xother","_yother"].includes(It),Jt=["_xother_","_yother_"].includes(It),te=["xother_","yother_"].includes(It),Kt=Nt||ee||te||Jt;(ee||Jt)&&(It=It.substring(1)),(te||Jt)&&(It=It.substring(0,It.length-1));let mt=null,bt=null;if(dt.parseMultDiv){var vt=rt(It);It=vt.key,mt=vt.op,bt=vt.number}let Ut;if(Kt){if(nt[It]===void 0)return"";Ut=nt[It]}else for(let Me of J)if(Me){if(Me.hasOwnProperty(It)){Ut=Me[It];break}if(F.test(It)||(Ut=n.nestedProperty(Me,It).get(!0)),Ut!==void 0)break}if(Ut===void 0){let{count:Me,max:Ce,name:We}=dt,qe=it===!1?wt:it;return Me<Ce&&n.warn([`Variable '${It}' in ${We} could not be found!`,"Please verify that the template is correct.",`Using value: '${qe}'.`].join(" ")),Me===Ce&&n.warn(`Too many '${We}' warnings - additional warnings will be suppressed.`),dt.count++,qe}if(mt==="*"&&(Ut*=bt),mt==="/"&&(Ut/=bt),Ct){var re;if(Ct[0]===":"&&(re=q?q.numberFormat:n.numberFormat,Ut!==""&&(Ut=re(Ct.replace(st,""))(Ut))),Ct[0]==="|"){re=q?q.timeFormat:d;var Zt=n.dateTime2ms(Ut);Ut=n.formatDate(Zt,Ct.replace(st,""),!1,re)}}else{var ue=It+"Label";nt.hasOwnProperty(ue)&&(Ut=nt[ue])}return Kt&&(Ut="("+Ut+")",(ee||Jt)&&(Ut=" "+Ut),(te||Jt)&&(Ut=Ut+" ")),Ut})}var K=48,ot=57;n.subplotSort=function(J,q){for(var it=Math.min(J.length,q.length)+1,nt=0,dt=0,Tt=0;Tt<it;Tt++){var wt=J.charCodeAt(Tt)||0,It=q.charCodeAt(Tt)||0,Ct=wt>=K&&wt<=ot,Nt=It>=K&&It<=ot;if(Ct&&(nt=10*nt+wt-K),Nt&&(dt=10*dt+It-K),!Ct||!Nt){if(nt!==dt)return nt-dt;if(wt!==It)return wt-It}}return dt-nt};var X=2e9;n.seedPseudoRandom=function(){X=2e9},n.pseudoRandom=function(){var J=X;return X=(69069*X+1)%4294967296,Math.abs(X-J)<429496729?n.pseudoRandom():X/4294967296},n.fillText=function(J,q,it){var nt=Array.isArray(it)?function(wt){it.push(wt)}:function(wt){it.text=wt},dt=n.extractOption(J,q,"htx","hovertext");if(n.isValidTextValue(dt))return nt(dt);var Tt=n.extractOption(J,q,"tx","text");if(n.isValidTextValue(Tt))return nt(Tt)},n.isValidTextValue=function(J){return J||J===0},n.formatPercent=function(J,q){q=q||0;for(var it=(Math.round(100*J*Math.pow(10,q))*Math.pow(.1,q)).toFixed(q)+"%",nt=0;nt<q;nt++)it.indexOf(".")!==-1&&(it=it.replace("0%","%"),it=it.replace(".%","%"));return it},n.isHidden=function(J){var q=window.getComputedStyle(J).display;return!q||q==="none"},n.strTranslate=function(J,q){return J||q?"translate("+J+","+q+")":""},n.strRotate=function(J){return J?"rotate("+J+")":""},n.strScale=function(J){return J!==1?"scale("+J+")":""},n.getTextTransform=function(J){var q=J.noCenter,it=J.textX,nt=J.textY,dt=J.targetX,Tt=J.targetY,wt=J.anchorX||0,It=J.anchorY||0,Ct=J.rotate,Nt=J.scale;return Nt?Nt>1&&(Nt=1):Nt=0,n.strTranslate(dt-Nt*(it+wt),Tt-Nt*(nt+It))+n.strScale(Nt)+(Ct?"rotate("+Ct+(q?"":" "+it+" "+nt)+")":"")},n.setTransormAndDisplay=function(J,q){J.attr("transform",n.getTextTransform(q)),J.style("display",q.scale?null:"none")},n.ensureUniformFontSize=function(J,q){var it=n.extendFlat({},q);return it.size=Math.max(q.size,J._fullLayout.uniformtext.minsize||0),it},n.join2=function(J,q,it){var nt=J.length;return nt>1?J.slice(0,-1).join(q)+it+J[nt-1]:J.join(q)},n.bigFont=function(J){return Math.round(1.2*J)};var Q=n.getFirefoxVersion(),ut=Q!==null&&Q<86;n.getPositionFromD3Event=function(){return ut?[u.event.layerX,u.event.layerY]:[u.event.offsetX,u.event.offsetY]}}),NT=Vt(()=>{var Z=Xr(),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:focus-within .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-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","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(d in V)u=d.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Z.addStyleRule(u,V[d]);var u,d}),eb=Vt((Z,V)=>{V.exports=!0}),rb=Vt((Z,V)=>{var u=eb(),d;typeof window.matchMedia=="function"?d=!window.matchMedia("(hover: none)").matches:d=u,V.exports=d}),a0=Vt((Z,V)=>{var u=typeof Reflect=="object"?Reflect:null,d=u&&typeof u.apply=="function"?u.apply:function(S,k,M){return Function.prototype.apply.call(S,k,M)},E;u&&typeof u.ownKeys=="function"?E=u.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 k=[],M=1;M<arguments.length;M++)k.push(arguments[M]);var T=S==="error",c=this._events;if(c!==void 0)T=T&&c.error===void 0;else if(!T)return!1;if(T){var h;if(k.length>0&&(h=k[0]),h instanceof Error)throw h;var b=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw b.context=h,b}var _=c[S];if(_===void 0)return!1;if(typeof _=="function")d(_,this,k);else for(var P=_.length,L=g(_,P),M=0;M<P;++M)d(L[M],this,k);return!0};function o(S,k,M,T){var c,h,b;if(i(M),h=S._events,h===void 0?(h=S._events=Object.create(null),S._eventsCount=0):(h.newListener!==void 0&&(S.emit("newListener",k,M.listener?M.listener:M),h=S._events),b=h[k]),b===void 0)b=h[k]=M,++S._eventsCount;else if(typeof b=="function"?b=h[k]=T?[M,b]:[b,M]:T?b.unshift(M):b.push(M),c=n(S),c>0&&b.length>c&&!b.warned){b.warned=!0;var _=new Error("Possible EventEmitter memory leak detected. "+b.length+" "+String(k)+" listeners added. Use emitter.setMaxListeners() to increase limit");_.name="MaxListenersExceededWarning",_.emitter=S,_.type=k,_.count=b.length,A(_)}return S}e.prototype.addListener=function(S,k){return o(this,S,k,!1)},e.prototype.on=e.prototype.addListener,e.prototype.prependListener=function(S,k){return o(this,S,k,!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,k,M){var T={fired:!1,wrapFn:void 0,target:S,type:k,listener:M},c=a.bind(T);return c.listener=M,T.wrapFn=c,c}e.prototype.once=function(S,k){return i(k),this.on(S,s(this,S,k)),this},e.prototype.prependOnceListener=function(S,k){return i(k),this.prependListener(S,s(this,S,k)),this},e.prototype.removeListener=function(S,k){var M,T,c,h,b;if(i(k),T=this._events,T===void 0)return this;if(M=T[S],M===void 0)return this;if(M===k||M.listener===k)--this._eventsCount===0?this._events=Object.create(null):(delete T[S],T.removeListener&&this.emit("removeListener",S,M.listener||k));else if(typeof M!="function"){for(c=-1,h=M.length-1;h>=0;h--)if(M[h]===k||M[h].listener===k){b=M[h].listener,c=h;break}if(c<0)return this;c===0?M.shift():m(M,c),M.length===1&&(T[S]=M[0]),T.removeListener!==void 0&&this.emit("removeListener",S,b||k)}return this},e.prototype.off=e.prototype.removeListener,e.prototype.removeAllListeners=function(S){var k,M,T;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 c=Object.keys(M),h;for(T=0;T<c.length;++T)h=c[T],h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(k=M[S],typeof k=="function")this.removeListener(S,k);else if(k!==void 0)for(T=k.length-1;T>=0;T--)this.removeListener(S,k[T]);return this};function f(S,k,M){var T=S._events;if(T===void 0)return[];var c=T[k];return c===void 0?[]:typeof c=="function"?M?[c.listener||c]:[c]:M?w(c):g(c,c.length)}e.prototype.listeners=function(S){return f(this,S,!0)},e.prototype.rawListeners=function(S){return f(this,S,!1)},e.listenerCount=function(S,k){return typeof S.listenerCount=="function"?S.listenerCount(k):v.call(S,k)},e.prototype.listenerCount=v;function v(S){var k=this._events;if(k!==void 0){var M=k[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 g(S,k){for(var M=new Array(k),T=0;T<k;++T)M[T]=S[T];return M}function m(S,k){for(;k+1<S.length;k++)S[k]=S[k+1];S.pop()}function w(S){for(var k=new Array(S.length),M=0;M<k.length;++M)k[M]=S[M].listener||S[M];return k}function l(S,k){return new Promise(function(M,T){function c(b){S.removeListener(k,h),T(b)}function h(){typeof S.removeListener=="function"&&S.removeListener("error",c),M([].slice.call(arguments))}y(S,k,h,{once:!0}),k!=="error"&&x(S,c,{once:!0})})}function x(S,k,M){typeof S.on=="function"&&y(S,"error",k,M)}function y(S,k,M,T){if(typeof S.on=="function")T.once?S.once(k,M):S.on(k,M);else if(typeof S.addEventListener=="function")S.addEventListener(k,function c(h){T.once&&S.removeEventListener(k,c),M(h)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}}),mm=Vt((Z,V)=>{var u=a0().EventEmitter,d={init:function(E){if(E._ev instanceof u)return E;var A=new u,t=new u;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)},typeof E.addEventListener=="function"&&E.addEventListener("wheel",()=>{},{passive:!0}),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=d}),jT=Vt((Z,V)=>{var u=Xr(),d=n0().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)?u.extendDeep([],i):u.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>d.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}),nb=Vt((Z,V)=>{V.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),gm=Vt(Z=>{var V=ji(),u=Xr(),d=Tl(),E=dm(),A=nb(),t=Cg(),e=n0().configAttributes,r=Cu(),i=u.extendDeepAll,n=u.isPlainObject,o=u.isArrayOrTypedArray,a=u.nestedProperty,s=u.valObjectMeta,f="_isSubplotObj",v="_isLinkedToArray",g="_arrayAttrRegexps",m="_deprecated",w=[f,v,g,m];Z.IS_SUBPLOT_OBJ=f,Z.IS_LINKED_TO_ARRAY=v,Z.DEPRECATED=m,Z.UNDERSCORE_ATTRS=w,Z.get=function(){var L={};return V.allTypes.forEach(function(D){L[D]=S(D)}),{defs:{valObjects:s,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:r.traces,layout:r.layout},impliedEdits:{}},traces:L,layout:k(),frames:M(),animation:T(t),config:T(e)}},Z.crawl=function(L,D,B,R){var I=B||0;R=R||"",Object.keys(L).forEach(function(F){var N=L[F];if(w.indexOf(F)===-1){var j=(R?R+".":"")+F;D(N,F,L,I,j),!Z.isValObject(N)&&n(N)&&F!=="impliedEdits"&&Z.crawl(N,D,I+1,j)}})},Z.isValObject=function(L){return L&&L.valType!==void 0},Z.findArrayAttributes=function(L){var D=[],B=[],R=[],I,F;function N(G,rt,ct,st){B=B.slice(0,st).concat([rt]),R=R.slice(0,st).concat([G&&G._isLinkedToArray]);var et=G&&(G.valType==="data_array"||G.arrayOk===!0)&&!(B[st-1]==="colorbar"&&(rt==="ticktext"||rt==="tickvals"));et&&j(I,0,"")}function j(G,rt,ct){var st=G[B[rt]],et=ct+B[rt];if(rt===B.length-1)o(st)&&D.push(F+et);else if(R[rt]){if(Array.isArray(st))for(var K=0;K<st.length;K++)n(st[K])&&j(st[K],rt+1,et+"["+K+"].")}else n(st)&&j(st,rt+1,et+".")}return I=L,F="",Z.crawl(d,N),L._module&&L._module.attributes&&Z.crawl(L._module.attributes,N),D},Z.getTraceValObject=function(L,D){var B=D[0],R=1,I,F,N=L._module;if(N||(N=(V.modules[L.type||d.type.dflt]||{})._module),!N)return!1;if(I=N.attributes,F=I&&I[B],!F){var j=N.basePlotModule;j&&j.attributes&&(F=j.attributes[B])}return F||(F=d[B]),x(F,D,R)},Z.getLayoutValObject=function(L,D){var B=l(L,D[0]);return x(B,D,1)};function l(L,D){var B,R,I,F,N=L._basePlotModules;if(N){var j;for(B=0;B<N.length;B++){if(I=N[B],I.attrRegex&&I.attrRegex.test(D)){if(I.layoutAttrOverrides)return I.layoutAttrOverrides;!j&&I.layoutAttributes&&(j=I.layoutAttributes)}var G=I.baseLayoutAttrOverrides;if(G&&D in G)return G[D]}if(j)return j}var rt=L._modules;if(rt){for(B=0;B<rt.length;B++)if(F=rt[B].layoutAttributes,F&&D in F)return F[D]}for(R in V.componentsRegistry){if(I=V.componentsRegistry[R],I.name==="colorscale"&&D.indexOf("coloraxis")===0)return I.layoutAttributes[D];if(!I.schema&&D===I.name)return I.layoutAttributes}return D in E?E[D]:!1}function x(L,D,B){if(!L)return!1;if(L._isLinkedToArray){if(y(D[B]))B++;else if(B<D.length)return!1}for(;B<D.length;B++){var R=L[D[B]];if(n(R))L=R;else break;if(B===D.length-1)break;if(L._isLinkedToArray){if(B++,!y(D[B]))return!1}else if(L.valType==="info_array"){B++;var I=D[B];if(!y(I))return!1;var F=L.items;if(Array.isArray(F)){if(I>=F.length)return!1;if(L.dimensions===2){if(B++,D.length===B)return L;var N=D[B];if(!y(N))return!1;L=F[I][N]}else L=F[I]}else L=F}}return L}function y(L){return L===Math.round(L)&&L>=0}function S(L){var D,B;D=V.modules[L]._module,B=D.basePlotModule;var R={};R.type=null;var I=i({},d),F=i({},D.attributes);Z.crawl(F,function(G,rt,ct,st,et){a(I,et).set(void 0),G===void 0&&a(F,et).set(void 0)}),i(R,I),V.traceIs(L,"noOpacity")&&delete R.opacity,V.traceIs(L,"showLegend")||(delete R.showlegend,delete R.legendgroup),V.traceIs(L,"noHover")&&(delete R.hoverinfo,delete R.hoverlabel),D.selectPoints||delete R.selectedpoints,i(R,F),B.attributes&&i(R,B.attributes),R.type=L;var N={meta:D.meta||{},categories:D.categories||{},animatable:!!D.animatable,type:L,attributes:T(R)};if(D.layoutAttributes){var j={};i(j,D.layoutAttributes),N.layoutAttributes=T(j)}return D.animatable||Z.crawl(N,function(G){Z.isValObject(G)&&"anim"in G&&delete G.anim}),N}function k(){var L={},D,B;i(L,E);for(D in V.subplotsRegistry)if(B=V.subplotsRegistry[D],!!B.layoutAttributes)if(Array.isArray(B.attr))for(var R=0;R<B.attr.length;R++)_(L,B,B.attr[R]);else{var I=B.attr==="subplot"?B.name:B.attr;_(L,B,I)}for(D in V.componentsRegistry){B=V.componentsRegistry[D];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 L.yaxis[j];delete L.xaxis.shift,delete L.xaxis.autoshift}else B.name==="colorscale"?i(L,B.layoutAttributes):B.layoutAttributes&&P(L,B.layoutAttributes,B.name)}return{layoutAttributes:T(L)}}function M(){var L={frames:i({},A)};return T(L),L.frames}function T(L){return c(L),h(L),b(L),L}function c(L){function D(R){return{valType:"string",editType:"none"}}function B(R,I,F){Z.isValObject(R)?(R.arrayOk===!0||R.valType==="data_array")&&(F[I+"src"]=D()):n(R)&&(R.role="object")}Z.crawl(L,B)}function h(L){function D(B,R,I){if(B){var F=B[v];F&&(delete B[v],I[R]={items:{}},I[R].items[F]=B,I[R].role="object")}}Z.crawl(L,D)}function b(L){function D(B){for(var R in B)if(n(B[R]))D(B[R]);else if(Array.isArray(B[R]))for(var I=0;I<B[R].length;I++)D(B[R][I]);else B[R]instanceof RegExp&&(B[R]=B[R].toString())}D(L)}function _(L,D,B){var R=a(L,B),I=i({},D.layoutAttributes);I[f]=!0,R.set(I)}function P(L,D,B){var R=a(L,B);R.set(i(R.get()||{},D))}}),cl=Vt(Z=>{var V=Xr(),u=Tl(),d="templateitemname",E={name:{valType:"string",editType:"none"}};E[d]={valType:"string",editType:"calc"},Z.templatedArray=function(e,r){return r._isLinkedToArray=e,r.name=E.name,r[d]=E[d],r},Z.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,{},u,"type");var s={type:i,_template:null};if(i in r){n=e[i];var f=r[i]%n.length;r[i]++,s._template=n[f]}return s}return{newTrace:o}},Z.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},Z.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 f(g){var m={name:g.name,_input:g},w=m[d]=g[d];if(!A(w))return m._template=o,m;for(var l=0;l<a.length;l++){var x=a[l];if(x.name===w)return s[w]=1,m._template=x,m}return m[i]=g[i]||!1,m._template=!1,m}function v(){for(var g=[],m=0;m<a.length;m++){var w=a[m],l=w.name;if(A(l)&&!s[l]){var x={_template:w,name:l,_input:{_templateitemname:l}};x[d]=w[d],g.push(x),s[l]=1}}return g}return{newItem:f,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"}Z.arrayDefaultKey=t,Z.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+"]",f;function v(){f={},a&&(f[s]={},f[s][d]=a)}v();function g(x,y){f[x]=y}function m(x,y){a?V.nestedProperty(f[s],x).set(y):f[s+"."+x]=y}function w(){var x=f;return v(),x}function l(x,y){x&&m(x,y);var S=w();for(var k in S)V.nestedProperty(e,k).set(S[k])}return{modifyBase:g,modifyItem:m,getUpdateObj:w,applyUpdate:l}}}),Af=Vt((Z,V)=>{var u=pm().counter;V.exports={idRegex:{x:u("x","( domain)?"),y:u("y","( domain)?")},attrRegex:u("[xy]axis"),xAxisMatch:u("xaxis"),yAxisMatch:u("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"}}),cc=Vt(Z=>{var V=ji(),u=Af();Z.id2name=function(E){if(!(typeof E!="string"||!E.match(u.AX_ID_PATTERN))){var A=E.split(" ")[0].substr(1);return A==="1"&&(A=""),E.charAt(0)+"axis"+A}},Z.name2id=function(E){if(E.match(u.AX_NAME_PATTERN)){var A=E.substr(5);return A==="1"&&(A=""),E.charAt(0)+A}},Z.cleanId=function(E,A,t){var e=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(u.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":"")}},Z.list=function(E,A,t){var e=E._fullLayout;if(!e)return[];var r=Z.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},Z.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)},Z.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[Z.id2name(A)]},Z.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=Z.getFromId(E,A[t+"axis"]||t);return r},Z.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)},Z.ref2id=function(E){return/^[xyz]/.test(E)?E.split(" ")[0]:!1};function d(E,A){if(A&&A.length){for(var t=0;t<A.length;t++)if(A[t][E])return!0}return!1}Z.isLinked=function(E,A){return d(A,E._axisMatchGroups)||d(A,E._axisConstraintGroups)}}),wd=Vt((Z,V)=>{function u(E){var A=E._fullLayout._zoomlayer;A&&A.selectAll(".outline-controllers").remove()}function d(E){var A=E._fullLayout._zoomlayer;A&&A.selectAll(".select-outline").remove(),E._fullLayout._outlining=!1}V.exports={clearOutlineControllers:u,clearOutline:d}}),Ry=Vt((Z,V)=>{V.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),If=Vt(Z=>{var V=ji();Af().SUBPLOT_PATTERN,Z.getSubplotCalcData=function(u,d,E){var A=V.subplotsRegistry[d];if(!A)return[];for(var t=A.attr,e=[],r=0;r<u.length;r++){var i=u[r],n=i[0].trace;n[t]===E&&e.push(i)}return e},Z.getModuleCalcData=function(u,d,E){var A=[],t=[],e;if(typeof d=="string"?e=V.getModule(d).plot:typeof d=="function"?e=d:e=d.plot,!e)return[A,u];for(var r=E,i=0;i<u.length;i++){var n=u[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]},Z.getSubplotData=function(u,d,E){if(!V.subplotsRegistry[d])return[];for(var A=V.subplotsRegistry[d].attr,t=[],e,r,i,n=0;n<u.length;n++)e=u[n],e[A]===E&&t.push(e);return t}}),UT=Vt(Z=>{var V=ji(),u=Xr();Z.manageCommandObserver=function(r,i,n,o){var a={},s=!0;i&&i._commandObserver&&(a=i._commandObserver),a.cache||(a.cache={}),a.lookupTable={};var f=Z.hasSimpleAPICommandBindings(r,n,a.lookupTable);if(i&&i._commandObserver){if(f)return a;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,a}if(f){d(r,f,a.cache),a.check=function(){if(s){var m=d(r,f,a.cache);return m.changed&&o&&a.lookupTable[m.value]!==void 0&&(a.disable(),Promise.resolve(o({value:m.value,type:f.type,prop:f.prop,traces:f.traces,index:a.lookupTable[m.value]})).then(a.enable,a.enable)),m.changed}};for(var v=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],g=0;g<v.length;g++)r._internalOn(v[g],a.check);a.remove=function(){for(var m=0;m<v.length;m++)r._removeInternalListener(v[m],a.check)}}else u.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},Z.hasSimpleAPICommandBindings=function(r,i,n){var o,a=i.length,s;for(o=0;o<a;o++){var f,v=i[o],g=v.method,m=v.args;if(Array.isArray(m)||(m=[]),!g)return!1;var w=Z.computeAPICommandBindings(r,g,m);if(w.length!==1)return!1;if(!s)s=w[0],Array.isArray(s.traces)&&s.traces.sort();else{if(f=w[0],f.type!==s.type||f.prop!==s.prop)return!1;if(Array.isArray(s.traces))if(Array.isArray(f.traces)){f.traces.sort();for(var l=0;l<s.traces.length;l++)if(s.traces[l]!==f.traces[l])return!1}else return!1;else if(f.prop!==s.prop)return!1}f=w[0];var x=f.value;if(Array.isArray(x))if(x.length===1)x=x[0];else return!1;n&&(n[x]=o)}return s};function d(r,i,n){var o,a,s,f=!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=u.nestedProperty(o,i.prop).get(),s=n[i.type]=n[i.type]||{},s.hasOwnProperty(i.prop)&&s[i.prop]!==a&&(f=!0),s[i.prop]=a,{changed:f,value:a}}Z.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(f){return u.warn("API call to Plotly."+i+" rejected.",f),Promise.reject(f)})},Z.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(u.isPlainObject(o))a=o;else return n;return e(a,function(s,f,v){n.push({type:"layout",prop:s,value:v})},"",0),n}function t(r,i){var n,o,a,s,f=[];if(o=i[0],a=i[1],n=i[2],s={},typeof o=="string")s[o]=a;else if(u.isPlainObject(o))s=o,n===void 0&&(n=a);else return f;return n===void 0&&(n=null),e(s,function(v,g,m){var w,l;if(Array.isArray(m)){l=m.slice();var x=Math.min(l.length,r.data.length);n&&(x=Math.min(x,n.length)),w=[];for(var y=0;y<x;y++)w[y]=n?n[y]:y}else l=m,w=n?n.slice():null;if(w===null)Array.isArray(l)&&(l=l[0]);else if(Array.isArray(w)){if(!Array.isArray(l)){var S=l;l=[];for(var k=0;k<w.length;k++)l[k]=S}l.length=Math.min(w.length,l.length)}f.push({type:"data",prop:v,traces:w,value:l})},"",0),f}function e(r,i,n,o){Object.keys(r).forEach(function(a){var s=r[a];if(a[0]!=="_"){var f=n+(o>0?".":"")+a;u.isPlainObject(s)?e(s,i,f,o+1):i(f,a,s)}})}}),Uu=Vt((Z,V)=>{var u=Ni(),d=cm().timeFormatLocale,E=Z_().formatLocale,A=Lo(),t=K_(),e=ji(),r=gm(),i=cl(),n=Xr(),o=Pi(),a=ks().BADNUM,s=cc(),f=wd().clearOutline,v=Ry(),g=Cg(),m=nb(),w=If().getModuleCalcData,l=n.relinkPrivateKeys,x=n._,y=V.exports={};n.extendFlat(y,e),y.attributes=Tl(),y.attributes.type.values=y.allTypes,y.fontAttrs=yu(),y.layoutAttributes=dm();var S=UT();y.executeAPICommand=S.executeAPICommand,y.computeAPICommandBindings=S.computeAPICommandBindings,y.manageCommandObserver=S.manageCommandObserver,y.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,y.redrawText=function(K){return K=n.getGraphDiv(K),new Promise(function(ot){setTimeout(function(){K._fullLayout&&(e.getComponentMethod("annotations","draw")(K),e.getComponentMethod("legend","draw")(K),e.getComponentMethod("colorbar","draw")(K),ot(y.previousPromises(K)))},300)})},y.resize=function(K){K=n.getGraphDiv(K);var ot,X=new Promise(function(Q,ut){(!K||n.isHidden(K))&&ut(new Error("Resize must be passed a displayed plot div element.")),K._redrawTimer&&clearTimeout(K._redrawTimer),K._resolveResize&&(ot=K._resolveResize),K._resolveResize=Q,K._redrawTimer=setTimeout(function(){if(!K.layout||K.layout.width&&K.layout.height||n.isHidden(K)){Q(K);return}delete K.layout.width,delete K.layout.height;var J=K.changed;K.autoplay=!0,e.call("relayout",K,{autosize:!0}).then(function(){K.changed=J,K._resolveResize===Q&&(delete K._resolveResize,Q(K))})},100)});return ot&&ot(X),X},y.previousPromises=function(K){if((K._promises||[]).length)return Promise.all(K._promises).then(function(){K._promises=[]})},y.addLinks=function(K){if(!(!K._context.showLink&&!K._context.showSources)){var ot=K._fullLayout,X=n.ensureSingle(ot._paper,"text","js-plot-link-container",function(nt){nt.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:o.defaultLine,"pointer-events":"all"}).each(function(){var dt=u.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=X.node(),ut={y:ot._paper.attr("height")-9};document.body.contains(Q)&&Q.getComputedTextLength()>=ot.width-20?(ut["text-anchor"]="start",ut.x=5):(ut["text-anchor"]="end",ut.x=ot._paper.attr("width")-7),X.attr(ut);var J=X.select(".js-link-to-tool"),q=X.select(".js-link-spacer"),it=X.select(".js-sourcelinks");K._context.showSources&&K._context.showSources(K),K._context.showLink&&k(K,J),q.text(J.text()&&it.text()?" - ":"")}};function k(K,ot){ot.text("");var X=ot.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(K._context.linkText+" »");if(K._context.sendData)X.on("click",function(){y.sendDataToCloud(K)});else{var Q=window.location.pathname.split("/"),ut=window.location.search;X.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+Q[2].split(".")[0]+"/"+Q[1]+ut})}}y.sendDataToCloud=function(K){var ot=(window.PLOTLYENV||{}).BASE_URL||K._context.plotlyServerURL;if(ot){K.emit("plotly_beforeexport");var X=u.select(K).append("div").attr("id","hiddenform").style("display","none"),Q=X.append("form").attr({action:ot+"/external",method:"post",target:"_blank"}),ut=Q.append("input").attr({type:"text",name:"data"});return ut.node().value=y.graphJson(K,!1,"keepdata"),Q.node().submit(),X.remove(),K.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];y.supplyDefaults=function(K,ot){var X=ot&&ot.skipUpdateCalc,Q=K._fullLayout||{};if(Q._skipDefaults){delete Q._skipDefaults;return}var ut=K._fullLayout={},J=K.layout||{},q=K._fullData||[],it=K._fullData=[],nt=K.data||[],dt=K.calcdata||[],Tt=K._context||{},wt;K._transitionData||y.createTransitionData(K),ut._dfltTitle={plot:x(K,"Click to enter Plot title"),subtitle:x(K,"Click to enter Plot subtitle"),x:x(K,"Click to enter X axis title"),y:x(K,"Click to enter Y axis title"),colorbar:x(K,"Click to enter Colorscale title"),annotation:x(K,"new text")},ut._traceWord=x(K,"trace");var It=b(K,M);if(ut._mapboxAccessToken=Tt.mapboxAccessToken,Q._initialAutoSizeIsDone){var Ct=Q.width,Nt=Q.height;y.supplyLayoutGlobalDefaults(J,ut,It),J.width||(ut.width=Ct),J.height||(ut.height=Nt),y.sanitizeMargins(ut)}else{y.supplyLayoutGlobalDefaults(J,ut,It);var ee=!J.width||!J.height,Jt=ut.autosize,te=Tt.autosizable,Kt=ee&&(Jt||te);Kt?y.plotAutoSize(K,J,ut):ee&&y.sanitizeMargins(ut),!Jt&&ee&&(J.width=ut.width,J.height=ut.height)}ut._d3locale=_(It,ut.separators),ut._extraFormat=b(K,T),ut._initialAutoSizeIsDone=!0,ut._dataLength=nt.length,ut._modules=[],ut._visibleModules=[],ut._basePlotModules=[];var mt=ut._subplots=h(),bt=ut._splomAxes={x:{},y:{}},vt=ut._splomSubplots={};ut._splomGridDflt={},ut._scatterStackOpts={},ut._firstScatter={},ut._alignmentOpts={},ut._colorAxes={},ut._requestRangeslider={},ut._traceUids=c(q,nt),y.supplyDataDefaults(nt,it,J,ut);var Ut=Object.keys(bt.x),re=Object.keys(bt.y);if(Ut.length>1&&re.length>1){for(e.getComponentMethod("grid","sizeDefaults")(J,ut),wt=0;wt<Ut.length;wt++)n.pushUnique(mt.xaxis,Ut[wt]);for(wt=0;wt<re.length;wt++)n.pushUnique(mt.yaxis,re[wt]);for(var Zt in vt)n.pushUnique(mt.cartesian,Zt)}if(ut._has=y._hasPlotType.bind(ut),q.length===it.length)for(wt=0;wt<it.length;wt++)l(it[wt],q[wt]);y.supplyLayoutModuleDefaults(J,ut,it,K._transitionData);var ue=ut._visibleModules,Me=[];for(wt=0;wt<ue.length;wt++){var Ce=ue[wt].crossTraceDefaults;Ce&&n.pushUnique(Me,Ce)}for(wt=0;wt<Me.length;wt++)Me[wt](it,ut);ut._hasOnlyLargeSploms=ut._basePlotModules.length===1&&ut._basePlotModules[0].name==="splom"&&Ut.length>15&&re.length>15&&ut.shapes.length===0&&ut.images.length===0,y.linkSubplots(it,ut,q,Q),y.cleanPlot(it,ut,q,Q);var We=!!(Q._has&&Q._has("cartesian")),qe=!!(ut._has&&ut._has("cartesian")),vr=We,_r=qe;vr&&!_r?Q._bgLayer.remove():_r&&!vr&&(ut._shouldCreateBgLayer=!0),Q._zoomlayer&&!K._dragging&&f({_fullLayout:Q}),P(it,ut),l(ut,Q),e.getComponentMethod("colorscale","crossTraceDefaults")(it,ut),ut._preGUI||(ut._preGUI={}),ut._tracePreGUI||(ut._tracePreGUI={});var er=ut._tracePreGUI,Mr={},Ir;for(Ir in er)Mr[Ir]="old";for(wt=0;wt<it.length;wt++)Ir=it[wt]._fullInput.uid,Mr[Ir]||(er[Ir]={}),Mr[Ir]="new";for(Ir in Mr)Mr[Ir]==="old"&&delete er[Ir];B(ut),e.getComponentMethod("rangeslider","makeData")(ut),!X&&dt.length===it.length&&y.supplyDefaultsUpdateCalc(dt,it)},y.supplyDefaultsUpdateCalc=function(K,ot){for(var X=0;X<ot.length;X++){var Q=ot[X],ut=(K[X]||[])[0];if(ut&&ut.trace){var J=ut.trace;if(J._hasCalcTransform){var q=J._arrayAttrs,it,nt,dt;for(it=0;it<q.length;it++)nt=q[it],dt=n.nestedProperty(J,nt).get().slice(),n.nestedProperty(Q,nt).set(dt)}ut.trace=Q}}};function c(K,ot){var X=ot.length,Q=[],ut,J;for(ut=0;ut<K.length;ut++){var q=K[ut]._fullInput;q!==J&&Q.push(q),J=q}var it=Q.length,nt=new Array(X),dt={};function Tt(Ct,Nt){nt[Nt]=Ct,dt[Ct]=1}function wt(Ct,Nt){if(Ct&&typeof Ct=="string"&&!dt[Ct])return Tt(Ct,Nt),!0}for(ut=0;ut<X;ut++){var It=ot[ut].uid;typeof It=="number"&&(It=String(It)),!wt(It,ut)&&(ut<it&&wt(Q[ut].uid,ut)||Tt(n.randstr(dt),ut))}return nt}function h(){var K=e.collectableSubplotTypes,ot={},X,Q;if(!K){K=[];var ut=e.subplotsRegistry;for(var J in ut){var q=ut[J],it=q.attr;if(it&&(K.push(J),Array.isArray(it)))for(Q=0;Q<it.length;Q++)n.pushUnique(K,it[Q])}}for(X=0;X<K.length;X++)ot[K[X]]=[];return ot}function b(K,ot){var X=K._context.locale;X||(X="en-US");var Q=!1,ut={};function J(wt){for(var It=!0,Ct=0;Ct<ot.length;Ct++){var Nt=ot[Ct];ut[Nt]||(wt[Nt]?ut[Nt]=wt[Nt]:It=!1)}It&&(Q=!0)}for(var q=0;q<2;q++){for(var it=K._context.locales,nt=0;nt<2;nt++){var dt=(it[X]||{}).format;if(dt&&(J(dt),Q))break;it=e.localeRegistry}var Tt=X.split("-")[0];if(Q||Tt===X)break;X=Tt}return Q||J(e.localeRegistry.en.format),ut}function _(K,ot){return K.decimal=ot.charAt(0),K.thousands=ot.charAt(1),{numberFormat:function(X){try{X=E(K).format(n.adjustFormat(X))}catch{return n.warnBadFormat(X),n.noFormat}return X},timeFormat:d(K).utcFormat}}function P(K,ot){var X,Q=[];ot.meta&&(X=ot._meta={meta:ot.meta,layout:{meta:ot.meta}});for(var ut=0;ut<K.length;ut++){var J=K[ut];J.meta?Q[J.index]=J._meta={meta:J.meta}:ot.meta&&(J._meta={meta:ot.meta}),ot.meta&&(J._meta.layout={meta:ot.meta})}Q.length&&(X||(X=ot._meta={}),X.data=Q)}y.createTransitionData=function(K){K._transitionData||(K._transitionData={}),K._transitionData._frames||(K._transitionData._frames=[]),K._transitionData._frameHash||(K._transitionData._frameHash={}),K._transitionData._counter||(K._transitionData._counter=0),K._transitionData._interruptCallbacks||(K._transitionData._interruptCallbacks=[])},y._hasPlotType=function(K){var ot,X=this._basePlotModules||[];for(ot=0;ot<X.length;ot++)if(X[ot].name===K)return!0;var Q=this._modules||[];for(ot=0;ot<Q.length;ot++){var ut=Q[ot].name;if(ut===K)return!0;var J=e.modules[ut];if(J&&J.categories[K])return!0}return!1},y.cleanPlot=function(K,ot,X,Q){var ut,J,q=Q._basePlotModules||[];for(ut=0;ut<q.length;ut++){var it=q[ut];it.clean&&it.clean(K,ot,X,Q)}var nt=Q._has&&Q._has("gl"),dt=ot._has&&ot._has("gl");nt&&!dt&&Q._glcontainer!==void 0&&(Q._glcontainer.selectAll(".gl-canvas").remove(),Q._glcontainer.selectAll(".no-webgl").remove(),Q._glcanvas=null);var Tt=!!Q._infolayer;t:for(ut=0;ut<X.length;ut++){var wt=X[ut],It=wt.uid;for(J=0;J<K.length;J++){var Ct=K[J];if(It===Ct.uid)continue t}Tt&&Q._infolayer.select(".cb"+It).remove()}},y.linkSubplots=function(K,ot,X,Q){var ut,J,q=Q._plots||{},it=ot._plots={},nt=ot._subplots,dt={_fullData:K,_fullLayout:ot},Tt=nt.cartesian||[];for(ut=0;ut<Tt.length;ut++){var wt=Tt[ut],It=q[wt],Ct=s.getFromId(dt,wt,"x"),Nt=s.getFromId(dt,wt,"y"),ee;for(It?ee=it[wt]=It:(ee=it[wt]={},ee.id=wt),Ct._counterAxes.push(Nt._id),Nt._counterAxes.push(Ct._id),Ct._subplotsWith.push(wt),Nt._subplotsWith.push(wt),ee.xaxis=Ct,ee.yaxis=Nt,ee._hasClipOnAxisFalse=!1,J=0;J<K.length;J++){var Jt=K[J];if(Jt.xaxis===ee.xaxis._id&&Jt.yaxis===ee.yaxis._id&&Jt.cliponaxis===!1){ee._hasClipOnAxisFalse=!0;break}}}var te=s.list(dt,null,!0),Kt;for(ut=0;ut<te.length;ut++){Kt=te[ut];var mt=null;Kt.overlaying&&(mt=s.getFromId(dt,Kt.overlaying),mt&&mt.overlaying&&(Kt.overlaying=!1,mt=null)),Kt._mainAxis=mt||Kt,mt&&(Kt.domain=mt.domain.slice()),Kt._anchorAxis=Kt.anchor==="free"?null:s.getFromId(dt,Kt.anchor)}for(ut=0;ut<te.length;ut++)if(Kt=te[ut],Kt._counterAxes.sort(s.idSort),Kt._subplotsWith.sort(n.subplotSort),Kt._mainSubplot=L(Kt,ot),Kt._counterAxes.length&&(Kt.spikemode&&Kt.spikemode.indexOf("across")!==-1||Kt.automargin&&Kt.mirror&&Kt.anchor!=="free"||e.getComponentMethod("rangeslider","isVisible")(Kt))){var bt=1,vt=0;for(J=0;J<Kt._counterAxes.length;J++){var Ut=s.getFromId(dt,Kt._counterAxes[J]);bt=Math.min(bt,Ut.domain[0]),vt=Math.max(vt,Ut.domain[1])}bt<vt&&(Kt._counterDomainMin=bt,Kt._counterDomainMax=vt)}};function L(K,ot){var X={_fullLayout:ot},Q=K._id.charAt(0)==="x",ut=K._mainAxis._anchorAxis,J="",q="",it="";if(ut&&(it=ut._mainAxis._id,J=Q?K._id+it:it+K._id),!J||!ot._plots[J]){J="";for(var nt=K._counterAxes,dt=0;dt<nt.length;dt++){var Tt=nt[dt],wt=Q?K._id+Tt:Tt+K._id;q||(q=wt);var It=s.getFromId(X,Tt);if(it&&It.overlaying===it){J=wt;break}}}return J||q}y.clearExpandedTraceDefaultColors=function(K){var ot,X,Q;function ut(q,it,nt,dt){X[dt]=it,X.length=dt+1,q.valType==="color"&&q.dflt===void 0&&ot.push(X.join("."))}for(X=[],ot=K._module._colorAttrs,ot||(K._module._colorAttrs=ot=[],r.crawl(K._module.attributes,ut)),Q=0;Q<ot.length;Q++){var J=n.nestedProperty(K,"_input."+ot[Q]);J.get()||n.nestedProperty(K,ot[Q]).set(null)}},y.supplyDataDefaults=function(K,ot,X,Q){var ut=Q._modules,J=Q._visibleModules,q=Q._basePlotModules,it=0,nt,dt,Tt;Q._transformModules=[];function wt(te){ot.push(te);var Kt=te._module;Kt&&(n.pushUnique(ut,Kt),te.visible===!0&&n.pushUnique(J,Kt),n.pushUnique(q,te._module.basePlotModule),te._input.visible!==!1&&it++)}var It={},Ct=[],Nt=(X.template||{}).data||{},ee=i.traceTemplater(Nt);for(nt=0;nt<K.length;nt++)Tt=K[nt],dt=ee.newTrace(Tt),dt.uid=Q._traceUids[nt],y.supplyTraceDefaults(Tt,dt,it,Q,nt),dt.index=nt,dt._input=Tt,dt._fullInput=dt,wt(dt),e.traceIs(dt,"carpetAxis")&&(It[dt.carpet]=dt),e.traceIs(dt,"carpetDependent")&&Ct.push(nt);for(nt=0;nt<Ct.length;nt++)if(dt=ot[Ct[nt]],!!dt.visible){var Jt=It[dt.carpet];if(dt._carpet=Jt,!Jt||!Jt.visible){dt.visible=!1;continue}dt.xaxis=Jt.xaxis,dt.yaxis=Jt.yaxis}},y.supplyAnimationDefaults=function(K){K=K||{};var ot,X={};function Q(ut,J){return n.coerce(K||{},X,g,ut,J)}if(Q("mode"),Q("direction"),Q("fromcurrent"),Array.isArray(K.frame))for(X.frame=[],ot=0;ot<K.frame.length;ot++)X.frame[ot]=y.supplyAnimationFrameDefaults(K.frame[ot]||{});else X.frame=y.supplyAnimationFrameDefaults(K.frame||{});if(Array.isArray(K.transition))for(X.transition=[],ot=0;ot<K.transition.length;ot++)X.transition[ot]=y.supplyAnimationTransitionDefaults(K.transition[ot]||{});else X.transition=y.supplyAnimationTransitionDefaults(K.transition||{});return X},y.supplyAnimationFrameDefaults=function(K){var ot={};function X(Q,ut){return n.coerce(K||{},ot,g.frame,Q,ut)}return X("duration"),X("redraw"),ot},y.supplyAnimationTransitionDefaults=function(K){var ot={};function X(Q,ut){return n.coerce(K||{},ot,g.transition,Q,ut)}return X("duration"),X("easing"),ot},y.supplyFrameDefaults=function(K){var ot={};function X(Q,ut){return n.coerce(K,ot,m,Q,ut)}return X("group"),X("name"),X("traces"),X("baseframe"),X("data"),X("layout"),ot},y.supplyTraceDefaults=function(K,ot,X,Q,ut){var J=Q.colorway||o.defaults,q=J[X%J.length],it;function nt(mt,bt){return n.coerce(K,ot,y.attributes,mt,bt)}var dt=nt("visible");nt("type"),nt("name",Q._traceWord+" "+ut),nt("uirevision",Q.uirevision);var Tt=y.getModule(ot);if(ot._module=Tt,Tt){var wt=Tt.basePlotModule,It=wt.attr,Ct=wt.attributes;if(It&&Ct){var Nt=Q._subplots,ee="";if(Array.isArray(It))for(it=0;it<It.length;it++){var Jt=It[it],te=n.coerce(K,ot,Ct,Jt);Nt[Jt]&&n.pushUnique(Nt[Jt],te),ee+=te}else ee=n.coerce(K,ot,Ct,It);Nt[wt.name]&&n.pushUnique(Nt[wt.name],ee)}}if(dt&&(nt("customdata"),nt("ids"),nt("meta"),e.traceIs(ot,"showLegend")?(n.coerce(K,ot,Tt.attributes.showlegend?Tt.attributes:y.attributes,"showlegend"),nt("legend"),nt("legendwidth"),nt("legendgroup"),nt("legendgrouptitle.text"),nt("legendrank"),ot._dfltShowLegend=!0):ot._dfltShowLegend=!1,Tt&&Tt.supplyDefaults(K,ot,q,Q),e.traceIs(ot,"noOpacity")||nt("opacity"),e.traceIs(ot,"notLegendIsolatable")&&(ot.visible=!!ot.visible),e.traceIs(ot,"noHover")||(ot.hovertemplate||n.coerceHoverinfo(K,ot,Q),ot.type!=="parcats"&&e.getComponentMethod("fx","supplyDefaults")(K,ot,q,Q)),Tt&&Tt.selectPoints)){var Kt=nt("selectedpoints");n.isTypedArray(Kt)&&(ot.selectedpoints=Array.from(Kt))}return ot},y.supplyLayoutGlobalDefaults=function(K,ot,X){function Q(wt,It){return n.coerce(K,ot,y.layoutAttributes,wt,It)}var ut=K.template;n.isPlainObject(ut)&&(ot.template=ut,ot._template=ut.layout,ot._dataTemplate=ut.data),Q("autotypenumbers");var J=n.coerceFont(Q,"font"),q=J.size;n.coerceFont(Q,"title.font",J,{overrideDflt:{size:Math.round(q*1.4)}}),Q("title.text",ot._dfltTitle.plot),Q("title.xref");var it=Q("title.yref");Q("title.pad.t"),Q("title.pad.r"),Q("title.pad.b"),Q("title.pad.l");var nt=Q("title.automargin");Q("title.x"),Q("title.xanchor"),Q("title.y"),Q("title.yanchor"),Q("title.subtitle.text",ot._dfltTitle.subtitle),n.coerceFont(Q,"title.subtitle.font",J,{overrideDflt:{size:Math.round(ot.title.font.size*.7)}}),nt&&(it==="paper"&&(ot.title.y!==0&&(ot.title.y=1),ot.title.yanchor==="auto"&&(ot.title.yanchor=ot.title.y===0?"top":"bottom")),it==="container"&&(ot.title.y==="auto"&&(ot.title.y=1),ot.title.yanchor==="auto"&&(ot.title.yanchor=ot.title.y<.5?"bottom":"top")));var dt=Q("uniformtext.mode");dt&&Q("uniformtext.minsize"),Q("autosize",!(K.width&&K.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"),K.width&&K.height&&y.sanitizeMargins(ot),e.getComponentMethod("grid","sizeDefaults")(K,ot),Q("paper_bgcolor"),Q("separators",X.decimal+X.thousands),Q("hidesources"),Q("colorway"),Q("datarevision");var Tt=Q("uirevision");Q("editrevision",Tt),Q("selectionrevision",Tt),e.getComponentMethod("modebar","supplyLayoutDefaults")(K,ot),e.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(K,ot,Q),e.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(K,ot,Q),Q("meta"),n.isPlainObject(K.transition)&&(Q("transition.duration"),Q("transition.easing"),Q("transition.ordering")),e.getComponentMethod("calendars","handleDefaults")(K,ot,"calendar"),e.getComponentMethod("fx","supplyLayoutGlobalDefaults")(K,ot,Q),n.coerce(K,ot,v,"scattermode")};function D(K){return typeof K=="string"&&K.substr(K.length-2)==="px"&&parseFloat(K)}y.plotAutoSize=function(K,ot,X){var Q=K._context||{},ut=Q.frameMargins,J,q,it=n.isPlotDiv(K);if(it&&K.emit("plotly_autosize"),Q.fillFrame)J=window.innerWidth,q=window.innerHeight,document.body.style.overflow="hidden";else{var nt=it?window.getComputedStyle(K):{};if(J=D(nt.width)||D(nt.maxWidth)||X.width,q=D(nt.height)||D(nt.maxHeight)||X.height,A(ut)&&ut>0){var dt=1-2*ut;J=Math.round(dt*J),q=Math.round(dt*q)}}var Tt=y.layoutAttributes.width.min,wt=y.layoutAttributes.height.min;J<Tt&&(J=Tt),q<wt&&(q=wt);var It=!ot.width&&Math.abs(X.width-J)>1,Ct=!ot.height&&Math.abs(X.height-q)>1;(Ct||It)&&(It&&(X.width=J),Ct&&(X.height=q)),K._initialAutoSize||(K._initialAutoSize={width:J,height:q}),y.sanitizeMargins(X)},y.supplyLayoutModuleDefaults=function(K,ot,X,Q){var ut=e.componentsRegistry,J=ot._basePlotModules,q,it,nt,dt=e.subplotsRegistry.cartesian;for(q in ut)nt=ut[q],nt.includeBasePlot&&nt.includeBasePlot(K,ot);J.length||J.push(dt),ot._has("cartesian")&&(e.getComponentMethod("grid","contentDefaults")(K,ot),dt.finalizeSubplots(K,ot));for(var Tt in ot._subplots)ot._subplots[Tt].sort(n.subplotSort);for(it=0;it<J.length;it++)nt=J[it],nt.supplyLayoutDefaults&&nt.supplyLayoutDefaults(K,ot,X);var wt=ot._modules;for(it=0;it<wt.length;it++)nt=wt[it],nt.supplyLayoutDefaults&&nt.supplyLayoutDefaults(K,ot,X);var It=ot._transformModules;for(it=0;it<It.length;it++)nt=It[it],nt.supplyLayoutDefaults&&nt.supplyLayoutDefaults(K,ot,X,Q);for(q in ut)nt=ut[q],nt.supplyLayoutDefaults&&nt.supplyLayoutDefaults(K,ot,X)},y.purge=function(K){var ot=K._fullLayout||{};ot._glcontainer!==void 0&&(ot._glcontainer.selectAll(".gl-canvas").remove(),ot._glcontainer.remove(),ot._glcanvas=null),ot._modeBar&&ot._modeBar.destroy(),K._transitionData&&(K._transitionData._interruptCallbacks&&(K._transitionData._interruptCallbacks.length=0),K._transitionData._animationRaf&&window.cancelAnimationFrame(K._transitionData._animationRaf)),n.clearThrottle(),n.clearResponsive(K),delete K.data,delete K.layout,delete K._fullData,delete K._fullLayout,delete K.calcdata,delete K.empty,delete K.fid,delete K.undoqueue,delete K.undonum,delete K.autoplay,delete K.changed,delete K._promises,delete K._redrawTimer,delete K._hmlumcount,delete K._hmpixcount,delete K._transitionData,delete K._transitioning,delete K._initialAutoSize,delete K._transitioningWithDuration,delete K._dragging,delete K._dragged,delete K._dragdata,delete K._hoverdata,delete K._snapshotInProgress,delete K._editing,delete K._mouseDownTime,delete K._legendMouseDownTime,K.removeAllListeners&&K.removeAllListeners()},y.style=function(K){var ot=K._fullLayout._visibleModules,X=[],Q;for(Q=0;Q<ot.length;Q++){var ut=ot[Q];ut.style&&n.pushUnique(X,ut.style)}for(Q=0;Q<X.length;Q++)X[Q](K)},y.sanitizeMargins=function(K){if(!(!K||!K.margin)){var ot=K.width,X=K.height,Q=K.margin,ut=ot-(Q.l+Q.r),J=X-(Q.t+Q.b),q;ut<0&&(q=(ot-1)/(Q.l+Q.r),Q.l=Math.floor(q*Q.l),Q.r=Math.floor(q*Q.r)),J<0&&(q=(X-1)/(Q.t+Q.b),Q.t=Math.floor(q*Q.t),Q.b=Math.floor(q*Q.b))}},y.clearAutoMarginIds=function(K){K._fullLayout._pushmarginIds={}},y.allowAutoMargin=function(K,ot){K._fullLayout._pushmarginIds[ot]=1};function B(K){var ot=K.margin;if(!K._size){var X=K._size={l:Math.round(ot.l),r:Math.round(ot.r),t:Math.round(ot.t),b:Math.round(ot.b),p:Math.round(ot.pad)};X.w=Math.round(K.width)-X.l-X.r,X.h=Math.round(K.height)-X.t-X.b}K._pushmargin||(K._pushmargin={}),K._pushmarginIds||(K._pushmarginIds={}),K._reservedMargin||(K._reservedMargin={})}var R=2,I=2;y.autoMargin=function(K,ot,X){var Q=K._fullLayout,ut=Q.width,J=Q.height,q=Q.margin,it=Q.minreducedwidth,nt=Q.minreducedheight,dt=n.constrain(ut-q.l-q.r,R,it),Tt=n.constrain(J-q.t-q.b,I,nt),wt=Math.max(0,ut-dt),It=Math.max(0,J-Tt),Ct=Q._pushmargin,Nt=Q._pushmarginIds;if(q.autoexpand!==!1){if(!X)delete Ct[ot],delete Nt[ot];else{var ee=X.pad;if(ee===void 0&&(ee=Math.min(12,q.l,q.r,q.t,q.b)),wt){var Jt=(X.l+X.r)/wt;Jt>1&&(X.l/=Jt,X.r/=Jt)}if(It){var te=(X.t+X.b)/It;te>1&&(X.t/=te,X.b/=te)}var Kt=X.xl!==void 0?X.xl:X.x,mt=X.xr!==void 0?X.xr:X.x,bt=X.yt!==void 0?X.yt:X.y,vt=X.yb!==void 0?X.yb:X.y;Ct[ot]={l:{val:Kt,size:X.l+ee},r:{val:mt,size:X.r+ee},b:{val:vt,size:X.b+ee},t:{val:bt,size:X.t+ee}},Nt[ot]=1}if(!Q._replotting)return y.doAutoMargin(K)}};function F(K){if("_redrawFromAutoMarginCount"in K._fullLayout)return!1;var ot=s.list(K,"",!0);for(var X in ot)if(ot[X].autoshift||ot[X].shift)return!0;return!1}y.doAutoMargin=function(K){var ot=K._fullLayout,X=ot.width,Q=ot.height;ot._size||(ot._size={}),B(ot);var ut=ot._size,J=ot.margin,q={t:0,b:0,l:0,r:0},it=n.extendFlat({},ut),nt=J.l,dt=J.r,Tt=J.t,wt=J.b,It=ot._pushmargin,Ct=ot._pushmarginIds,Nt=ot.minreducedwidth,ee=ot.minreducedheight;if(J.autoexpand!==!1){for(var Jt in It)Ct[Jt]||delete It[Jt];var te=K._fullLayout._reservedMargin;for(var Kt in te)for(var mt in te[Kt]){var bt=te[Kt][mt];q[mt]=Math.max(q[mt],bt)}It.base={l:{val:0,size:nt},r:{val:1,size:dt},t:{val:1,size:Tt},b:{val:0,size:wt}};for(var vt in q){var Ut=0;for(var re in It)re!=="base"&&A(It[re][vt].size)&&(Ut=It[re][vt].size>Ut?It[re][vt].size:Ut);var Zt=Math.max(0,J[vt]-Ut);q[vt]=Math.max(0,q[vt]-Zt)}for(var ue in It){var Me=It[ue].l||{},Ce=It[ue].b||{},We=Me.val,qe=Me.size,vr=Ce.val,_r=Ce.size,er=X-q.r-q.l,Mr=Q-q.t-q.b;for(var Ir in It){if(A(qe)&&It[Ir].r){var de=It[Ir].r.val,Dt=It[Ir].r.size;if(de>We){var qt=(qe*de+(Dt-er)*We)/(de-We),_t=(Dt*(1-We)+(qe-er)*(1-de))/(de-We);qt+_t>nt+dt&&(nt=qt,dt=_t)}}if(A(_r)&&It[Ir].t){var lt=It[Ir].t.val,yt=It[Ir].t.size;if(lt>vr){var St=(_r*lt+(yt-Mr)*vr)/(lt-vr),Ht=(yt*(1-vr)+(_r-Mr)*(1-lt))/(lt-vr);St+Ht>wt+Tt&&(wt=St,Tt=Ht)}}}}}var Yt=n.constrain(X-J.l-J.r,R,Nt),se=n.constrain(Q-J.t-J.b,I,ee),ke=Math.max(0,X-Yt),Ee=Math.max(0,Q-se);if(ke){var Ue=(nt+dt)/ke;Ue>1&&(nt/=Ue,dt/=Ue)}if(Ee){var ir=(wt+Tt)/Ee;ir>1&&(wt/=ir,Tt/=ir)}if(ut.l=Math.round(nt)+q.l,ut.r=Math.round(dt)+q.r,ut.t=Math.round(Tt)+q.t,ut.b=Math.round(wt)+q.b,ut.p=Math.round(J.pad),ut.w=Math.round(X)-ut.l-ut.r,ut.h=Math.round(Q)-ut.t-ut.b,!ot._replotting&&(y.didMarginChange(it,ut)||F(K))){"_redrawFromAutoMarginCount"in ot?ot._redrawFromAutoMarginCount++:ot._redrawFromAutoMarginCount=1;var ar=3*(1+Object.keys(Ct).length);if(ot._redrawFromAutoMarginCount<ar)return e.call("_doPlot",K);ot._size=it,n.warn("Too many auto-margin redraws.")}N(K)};function N(K){var ot=s.list(K,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(X){for(var Q=0;Q<ot.length;Q++){var ut=ot[Q][X];ut&&ut()}})}var j=["l","r","t","b","p","w","h"];y.didMarginChange=function(K,ot){for(var X=0;X<j.length;X++){var Q=j[X],ut=K[Q],J=ot[Q];if(!A(ut)||Math.abs(J-ut)>1)return!0}return!1},y.graphJson=function(K,ot,X,Q,ut,J){(ut&&ot&&!K._fullData||ut&&!ot&&!K._fullLayout)&&y.supplyDefaults(K);var q=ut?K._fullData:K.data,it=ut?K._fullLayout:K.layout,nt=(K._transitionData||{})._frames;function dt(It,Ct){if(typeof It=="function")return Ct?"_function_":null;if(n.isPlainObject(It)){var Nt={},ee;return Object.keys(It).sort().forEach(function(mt){if(["_","["].indexOf(mt.charAt(0))===-1){if(typeof It[mt]=="function"){Ct&&(Nt[mt]="_function");return}if(X==="keepdata"){if(mt.substr(mt.length-3)==="src")return}else if(X==="keepstream"){if(ee=It[mt+"src"],typeof ee=="string"&&ee.indexOf(":")>0&&!n.isPlainObject(It.stream))return}else if(X!=="keepall"&&(ee=It[mt+"src"],typeof ee=="string"&&ee.indexOf(":")>0))return;Nt[mt]=dt(It[mt],Ct)}}),Nt}var Jt=Array.isArray(It),te=n.isTypedArray(It);if((Jt||te)&&It.dtype&&It.shape){var Kt=It.bdata;return dt({dtype:It.dtype,shape:It.shape,bdata:n.isArrayBuffer(Kt)?t.encode(Kt):Kt},Ct)}return Jt?It.map(function(mt){return dt(mt,Ct)}):te?n.simpleMap(It,n.identity):n.isJSDate(It)?n.ms2DateTimeLocal(+It):It}var Tt={data:(q||[]).map(function(It){var Ct=dt(It);return ot&&delete Ct.fit,Ct})};if(!ot&&(Tt.layout=dt(it),ut)){var wt=it._size;Tt.layout.computed={margin:{b:wt.b,l:wt.l,r:wt.r,t:wt.t}}}return nt&&(Tt.frames=dt(nt)),J&&(Tt.config=dt(K._context,!0)),Q==="object"?Tt:JSON.stringify(Tt)},y.modifyFrames=function(K,ot){var X,Q,ut,J=K._transitionData._frames,q=K._transitionData._frameHash;for(X=0;X<ot.length;X++)switch(Q=ot[X],Q.type){case"replace":ut=Q.value;var it=(J[Q.index]||{}).name,nt=ut.name;J[Q.index]=q[nt]=ut,nt!==it&&(delete q[it],q[nt]=ut);break;case"insert":ut=Q.value,q[ut.name]=ut,J.splice(Q.index,0,ut);break;case"delete":ut=J[Q.index],delete q[ut.name],J.splice(Q.index,1);break}return Promise.resolve()},y.computeFrame=function(K,ot){var X=K._transitionData._frameHash,Q,ut,J,q;if(!ot)throw new Error("computeFrame must be given a string frame name");var it=X[ot.toString()];if(!it)return!1;for(var nt=[it],dt=[it.name];it.baseframe&&(it=X[it.baseframe.toString()])&&dt.indexOf(it.name)===-1;)nt.push(it),dt.push(it.name);for(var Tt={};it=nt.pop();)if(it.layout&&(Tt.layout=y.extendLayout(Tt.layout,it.layout)),it.data){if(Tt.data||(Tt.data=[]),ut=it.traces,!ut)for(ut=[],Q=0;Q<it.data.length;Q++)ut[Q]=Q;for(Tt.traces||(Tt.traces=[]),Q=0;Q<it.data.length;Q++)J=ut[Q],J!=null&&(q=Tt.traces.indexOf(J),q===-1&&(q=Tt.data.length,Tt.traces[q]=J),Tt.data[q]=y.extendTrace(Tt.data[q],it.data[Q]))}return Tt},y.recomputeFrameHash=function(K){for(var ot=K._transitionData._frameHash={},X=K._transitionData._frames,Q=0;Q<X.length;Q++){var ut=X[Q];ut&&ut.name&&(ot[ut.name]=ut)}},y.extendObjectWithContainers=function(K,ot,X){var Q,ut,J,q,it,nt,dt,Tt,wt=n.extendDeepNoArrays({},ot||{}),It=n.expandObjectPaths(wt),Ct={};if(X&&X.length)for(J=0;J<X.length;J++)Q=n.nestedProperty(It,X[J]),ut=Q.get(),ut===void 0?n.nestedProperty(Ct,X[J]).set(null):(Q.set(null),n.nestedProperty(Ct,X[J]).set(ut));if(K=n.extendDeepNoArrays(K||{},It),X&&X.length){for(J=0;J<X.length;J++)if(it=n.nestedProperty(Ct,X[J]),dt=it.get(),!!dt){for(nt=n.nestedProperty(K,X[J]),Tt=nt.get(),Array.isArray(Tt)||(Tt=[],nt.set(Tt)),q=0;q<dt.length;q++){var Nt=dt[q];Nt===null?Tt[q]=null:Tt[q]=y.extendObjectWithContainers(Tt[q],Nt)}nt.set(Tt)}}return K},y.dataArrayContainers=["transforms","dimensions"],y.layoutArrayContainers=e.layoutArrayContainers,y.extendTrace=function(K,ot){return y.extendObjectWithContainers(K,ot,y.dataArrayContainers)},y.extendLayout=function(K,ot){return y.extendObjectWithContainers(K,ot,y.layoutArrayContainers)},y.transition=function(K,ot,X,Q,ut,J){var q={redraw:ut.redraw},it={},nt=[];return q.prepareFn=function(){for(var dt=Array.isArray(ot)?ot.length:0,Tt=Q.slice(0,dt),wt=0;wt<Tt.length;wt++){var It=Tt[wt],Ct=K._fullData[It],Nt=Ct._module;if(Nt){if(Nt.animatable){var ee=Nt.basePlotModule.name;it[ee]||(it[ee]=[]),it[ee].push(It)}K.data[Tt[wt]]=y.extendTrace(K.data[Tt[wt]],ot[wt])}}var Jt=n.expandObjectPaths(n.extendDeepNoArrays({},X)),te=/^[xy]axis[0-9]*$/;for(var Kt in Jt)te.test(Kt)&&delete Jt[Kt].range;y.extendLayout(K.layout,Jt),delete K.calcdata,y.supplyDefaults(K),y.doCalcdata(K);var mt=n.expandObjectPaths(X);if(mt){var bt=K._fullLayout._plots;for(var vt in bt){var Ut=bt[vt],re=Ut.xaxis,Zt=Ut.yaxis,ue=re.range.slice(),Me=Zt.range.slice(),Ce=null,We=null,qe=null,vr=null;Array.isArray(mt[re._name+".range"])?Ce=mt[re._name+".range"].slice():Array.isArray((mt[re._name]||{}).range)&&(Ce=mt[re._name].range.slice()),Array.isArray(mt[Zt._name+".range"])?We=mt[Zt._name+".range"].slice():Array.isArray((mt[Zt._name]||{}).range)&&(We=mt[Zt._name].range.slice()),ue&&Ce&&(re.r2l(ue[0])!==re.r2l(Ce[0])||re.r2l(ue[1])!==re.r2l(Ce[1]))&&(qe={xr0:ue,xr1:Ce}),Me&&We&&(Zt.r2l(Me[0])!==Zt.r2l(We[0])||Zt.r2l(Me[1])!==Zt.r2l(We[1]))&&(vr={yr0:Me,yr1:We}),(qe||vr)&&nt.push(n.extendFlat({plotinfo:Ut},qe,vr))}}return Promise.resolve()},q.runFn=function(dt){var Tt,wt=K._fullLayout._basePlotModules,It=nt.length,Ct;if(X)for(Ct=0;Ct<wt.length;Ct++)wt[Ct].transitionAxes&&wt[Ct].transitionAxes(K,nt,J,dt);It?(Tt=n.extendFlat({},J),Tt.duration=0,delete it.cartesian):Tt=J;for(var Nt in it){var ee=it[Nt],Jt=K._fullData[ee[0]]._module;Jt.basePlotModule.plot(K,ee,Tt,dt)}},G(K,J,q)},y.transitionFromReact=function(K,ot,X,Q){var ut=K._fullLayout,J=ut.transition,q={},it=[];return q.prepareFn=function(){var nt=ut._plots;q.redraw=!1,ot.anim==="some"&&(q.redraw=!0),X.anim==="some"&&(q.redraw=!0);for(var dt in nt){var Tt=nt[dt],wt=Tt.xaxis,It=Tt.yaxis,Ct=Q[wt._name].range.slice(),Nt=Q[It._name].range.slice(),ee=wt.range.slice(),Jt=It.range.slice();wt.setScale(),It.setScale();var te=null,Kt=null;(wt.r2l(Ct[0])!==wt.r2l(ee[0])||wt.r2l(Ct[1])!==wt.r2l(ee[1]))&&(te={xr0:Ct,xr1:ee}),(It.r2l(Nt[0])!==It.r2l(Jt[0])||It.r2l(Nt[1])!==It.r2l(Jt[1]))&&(Kt={yr0:Nt,yr1:Jt}),(te||Kt)&&it.push(n.extendFlat({plotinfo:Tt},te,Kt))}return Promise.resolve()},q.runFn=function(nt){for(var dt=K._fullData,Tt=K._fullLayout,wt=Tt._basePlotModules,It,Ct,Nt,ee=[],Jt=0;Jt<dt.length;Jt++)ee.push(Jt);function te(){if(K._fullLayout)for(var mt=0;mt<wt.length;mt++)wt[mt].transitionAxes&&wt[mt].transitionAxes(K,it,It,nt)}function Kt(){if(K._fullLayout)for(var mt=0;mt<wt.length;mt++)wt[mt].plot(K,Nt,Ct,nt)}it.length&&ot.anim?J.ordering==="traces first"?(It=n.extendFlat({},J,{duration:0}),Nt=ee,Ct=J,setTimeout(te,J.duration),Kt()):(It=J,Nt=null,Ct=n.extendFlat({},J,{duration:0}),setTimeout(Kt,It.duration),te()):it.length?(It=J,te()):ot.anim&&(Nt=ee,Ct=J,Kt())},G(K,J,q)};function G(K,ot,X){var Q=!1;function ut(wt){var It=Promise.resolve();if(!wt)return It;for(;wt.length;)It=It.then(wt.shift());return It}function J(wt){if(wt)for(;wt.length;)wt.shift()}function q(){return K.emit("plotly_transitioning",[]),new Promise(function(wt){K._transitioning=!0,ot.duration>0&&(K._transitioningWithDuration=!0),K._transitionData._interruptCallbacks.push(function(){Q=!0}),X.redraw&&K._transitionData._interruptCallbacks.push(function(){return e.call("redraw",K)}),K._transitionData._interruptCallbacks.push(function(){K.emit("plotly_transitioninterrupted",[])});var It=0,Ct=0;function Nt(){return It++,function(){Ct++,!Q&&Ct===It&&it(wt)}}X.runFn(Nt),setTimeout(Nt())})}function it(wt){if(K._transitionData)return J(K._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(X.redraw)return e.call("redraw",K)}).then(function(){K._transitioning=!1,K._transitioningWithDuration=!1,K.emit("plotly_transitioned",[])}).then(wt)}function nt(){if(K._transitionData)return K._transitioning=!1,ut(K._transitionData._interruptCallbacks)}var dt=[y.previousPromises,nt,X.prepareFn,y.rehover,y.reselect,q],Tt=n.syncOrAsync(dt,K);return(!Tt||!Tt.then)&&(Tt=Promise.resolve()),Tt.then(function(){return K})}y.doCalcdata=function(K,ot){var X=s.list(K),Q=K._fullData,ut=K._fullLayout,J,q,it,nt,dt=new Array(Q.length),Tt=(K.calcdata||[]).slice();for(K.calcdata=dt,ut._numBoxes=0,ut._numViolins=0,ut._violinScaleGroupStats={},K._hmpixcount=0,K._hmlumcount=0,ut._piecolormap={},ut._sunburstcolormap={},ut._treemapcolormap={},ut._iciclecolormap={},ut._funnelareacolormap={},it=0;it<Q.length;it++)if(Array.isArray(ot)&&ot.indexOf(it)===-1){dt[it]=Tt[it];continue}for(it=0;it<Q.length;it++)J=Q[it],J._arrayAttrs=r.findArrayAttributes(J),J._extremes={};var wt=ut._subplots.polar||[];for(it=0;it<wt.length;it++)X.push(ut[wt[it]].radialaxis,ut[wt[it]].angularaxis);for(var It in ut._colorAxes){var Ct=ut[It];Ct.cauto!==!1&&(delete Ct.cmin,delete Ct.cmax)}var Nt=!1;function ee(Kt){if(J=Q[Kt],q=J._module,J.visible===!0&&J.transforms){if(q&&q.calc){var mt=q.calc(K,J);mt[0]&&mt[0].t&&mt[0].t._scene&&delete mt[0].t._scene.dirty}for(nt=0;nt<J.transforms.length;nt++){var bt=J.transforms[nt];q=transformsRegistry[bt.type],q&&q.calcTransform&&(J._hasCalcTransform=!0,Nt=!0,q.calcTransform(K,J,bt))}}}function Jt(Kt,mt){if(J=Q[Kt],q=J._module,!!q.isContainer===mt){var bt=[];if(J.visible===!0&&J._length!==0){delete J._indexToPoints;var vt=J.transforms||[];for(nt=vt.length-1;nt>=0;nt--)if(vt[nt].enabled){J._indexToPoints=vt[nt]._indexToPoints;break}q&&q.calc&&(bt=q.calc(K,J))}(!Array.isArray(bt)||!bt[0])&&(bt=[{x:a,y:a}]),bt[0].t||(bt[0].t={}),bt[0].trace=J,dt[Kt]=bt}}for(st(X,Q,ut),it=0;it<Q.length;it++)Jt(it,!0);for(it=0;it<Q.length;it++)ee(it);for(Nt&&st(X,Q,ut),it=0;it<Q.length;it++)Jt(it,!0);for(it=0;it<Q.length;it++)Jt(it,!1);et(K);var te=ct(X,K);if(te.length){for(ut._numBoxes=0,ut._numViolins=0,it=0;it<te.length;it++)Jt(te[it],!0);for(it=0;it<te.length;it++)Jt(te[it],!1);et(K)}e.getComponentMethod("fx","calc")(K),e.getComponentMethod("errorbars","calc")(K)};var rt=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function ct(K,ot){var X=[],Q,ut,J,q,it;function nt(Ir,de,Dt){var qt=de._id.charAt(0);if(Ir==="histogram2dcontour"){var _t=de._counterAxes[0],lt=s.getFromId(ot,_t),yt=qt==="x"||_t==="x"&&lt.type==="category",St=qt==="y"||_t==="y"&&lt.type==="category";return function(Ht,Yt){return Ht===0||Yt===0||yt&&Ht===Dt[Yt].length-1||St&&Yt===Dt.length-1?-1:(qt==="y"?Yt:Ht)-1}}else return function(Ht,Yt){return qt==="y"?Yt:Ht}}var dt={min:function(Ir){return n.aggNums(Math.min,null,Ir)},max:function(Ir){return n.aggNums(Math.max,null,Ir)},sum:function(Ir){return n.aggNums(function(de,Dt){return de+Dt},null,Ir)},total:function(Ir){return n.aggNums(function(de,Dt){return de+Dt},null,Ir)},mean:function(Ir){return n.mean(Ir)},"geometric mean":function(Ir){return n.geometricMean(Ir)},median:function(Ir){return n.median(Ir)}};function Tt(Ir,de){return Ir[1]-de[1]}function wt(Ir,de){return de[1]-Ir[1]}for(Q=0;Q<K.length;Q++){var It=K[Q];if(It.type==="category"){var Ct=It.categoryorder.match(rt);if(Ct){var Nt=Ct[1],ee=Ct[2],Jt=It._id.charAt(0),te=Jt==="x",Kt=[];for(ut=0;ut<It._categories.length;ut++)Kt.push([It._categories[ut],[]]);for(ut=0;ut<It._traceIndices.length;ut++){var mt=It._traceIndices[ut],bt=ot._fullData[mt];if(bt.visible===!0){var vt=bt.type;e.traceIs(bt,"histogram")&&(delete bt._xautoBinFinished,delete bt._yautoBinFinished);var Ut=vt==="splom",re=vt==="scattergl",Zt=ot.calcdata[mt];for(J=0;J<Zt.length;J++){var ue=Zt[J],Me,Ce;if(Ut){var We=bt._axesDim[It._id];if(!te){var qe=bt._diag[We][0];qe&&(It=ot._fullLayout[s.id2name(qe)])}var vr=ue.trace.dimensions[We].values;for(q=0;q<vr.length;q++)for(Me=It._categoriesMap[vr[q]],it=0;it<ue.trace.dimensions.length;it++)if(it!==We){var _r=ue.trace.dimensions[it];Kt[Me][1].push(_r.values[q])}}else if(re){for(q=0;q<ue.t.x.length;q++)te?(Me=ue.t.x[q],Ce=ue.t.y[q]):(Me=ue.t.y[q],Ce=ue.t.x[q]),Kt[Me][1].push(Ce);ue.t&&ue.t._scene&&delete ue.t._scene.dirty}else if(ue.hasOwnProperty("z")){Ce=ue.z;var er=nt(bt.type,It,Ce);for(q=0;q<Ce.length;q++)for(it=0;it<Ce[q].length;it++)Me=er(it,q),Me+1&&Kt[Me][1].push(Ce[q][it])}else for(Me=ue.p,Me===void 0&&(Me=ue[Jt]),Ce=ue.s,Ce===void 0&&(Ce=ue.v),Ce===void 0&&(Ce=te?ue.y:ue.x),Array.isArray(Ce)||(Ce===void 0?Ce=[]:Ce=[Ce]),q=0;q<Ce.length;q++)Kt[Me][1].push(Ce[q])}}}It._categoriesValue=Kt;var Mr=[];for(ut=0;ut<Kt.length;ut++)Mr.push([Kt[ut][0],dt[Nt](Kt[ut][1])]);Mr.sort(ee==="descending"?wt:Tt),It._categoriesAggregatedValue=Mr,It._initialCategories=Mr.map(function(Ir){return Ir[0]}),X=X.concat(It.sortByInitialCategories())}}}return X}function st(K,ot,X){var Q={};function ut(nt){nt.clearCalc(),nt.type==="multicategory"&&nt.setupMultiCategory(ot),Q[nt._id]=1}n.simpleMap(K,ut);for(var J=X._axisMatchGroups||[],q=0;q<J.length;q++)for(var it in J[q])Q[it]||ut(X[s.id2name(it)])}function et(K){var ot=K._fullLayout,X=ot._visibleModules,Q={},ut,J,q;for(J=0;J<X.length;J++){var it=X[J],nt=it.crossTraceCalc;if(nt){var dt=it.basePlotModule.name;Q[dt]?n.pushUnique(Q[dt],nt):Q[dt]=[nt]}}for(q in Q){var Tt=Q[q],wt=ot._subplots[q];if(Array.isArray(wt))for(ut=0;ut<wt.length;ut++){var It=wt[ut],Ct=q==="cartesian"?ot._plots[It]:ot[It];for(J=0;J<Tt.length;J++)Tt[J](K,Ct,It)}else for(J=0;J<Tt.length;J++)Tt[J](K)}}y.rehover=function(K){K._fullLayout._rehover&&K._fullLayout._rehover()},y.redrag=function(K){K._fullLayout._redrag&&K._fullLayout._redrag()},y.reselect=function(K){var ot=K._fullLayout,X=(K.layout||{}).selections,Q=ot._previousSelections;ot._previousSelections=X;var ut=ot._reselect||JSON.stringify(X)!==JSON.stringify(Q);e.getComponentMethod("selections","reselect")(K,ut)},y.generalUpdatePerTraceModule=function(K,ot,X,Q){var ut=ot.traceHash,J={},q;for(q=0;q<X.length;q++){var it=X[q],nt=it[0].trace;nt.visible&&(J[nt.type]=J[nt.type]||[],J[nt.type].push(it))}for(var dt in ut)if(!J[dt]){var Tt=ut[dt][0],wt=Tt[0].trace;wt.visible=!1,J[dt]=[Tt]}for(var It in J){var Ct=J[It],Nt=Ct[0][0].trace._module;Nt.plot(K,ot,n.filterVisible(Ct),Q)}ot.traceHash=J},y.plotBasePlot=function(K,ot,X,Q,ut){var J=e.getModule(K),q=w(ot.calcdata,J)[0];J.plot(ot,q,Q,ut)},y.cleanBasePlot=function(K,ot,X,Q,ut){var J=ut._has&&ut._has(K),q=X._has&&X._has(K);J&&!q&&ut["_"+K+"layer"].selectAll("g.trace").remove()}}),Eh=Vt(Z=>{Z.xmlns="http://www.w3.org/2000/xmlns/",Z.svg="http://www.w3.org/2000/svg",Z.xlink="http://www.w3.org/1999/xlink",Z.svgAttrs={xmlns:Z.svg,"xmlns:xlink":Z.xlink}}),mf=Vt((Z,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"}}}),Dl=Vt(Z=>{var V=Ni(),u=Xr(),d=u.strTranslate,E=Eh(),A=mf().LINE_SPACING,t=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;Z.convertToTspans=function(I,F,N){var j=I.text(),G=!I.attr("data-notex")&&F&&F._context.typesetMath&&typeof MathJax<"u"&&j.match(t),rt=V.select(I.node().parentNode);if(rt.empty())return;var ct=I.attr("class")?I.attr("class").split(" ")[0]:"text";ct+="-math",rt.selectAll("svg."+ct).remove(),rt.selectAll("g."+ct+"-group").remove(),I.style("display",null).attr({"data-unformatted":j,"data-math":"N"});function st(){rt.empty()||(ct=I.attr("class")+"-math",rt.select("svg."+ct).remove()),I.text("").style("white-space","pre");var et=L(I.node(),j);et&&I.style("pointer-events","all"),Z.positionText(I),N&&N.call(I)}return G?(F&&F._promises||[]).push(new Promise(function(et){I.style("display","none");var K=parseInt(I.node().style.fontSize,10),ot={fontSize:K};o(G[2],ot,function(X,Q,ut){rt.selectAll("svg."+ct).remove(),rt.selectAll("g."+ct+"-group").remove();var J=X&&X.select("svg");if(!J||!J.node()){st(),et();return}var q=rt.append("g").classed(ct+"-group",!0).attr({"pointer-events":"none","data-unformatted":j,"data-math":"Y"});q.node().appendChild(J.node()),Q&&Q.node()&&J.node().insertBefore(Q.node().cloneNode(!0),J.node().firstChild);var it=ut.width,nt=ut.height;J.attr({class:ct,height:nt,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var dt=I.node().style.fill||"black",Tt=J.select("g");Tt.attr({fill:dt,stroke:dt});var wt=Tt.node().getBoundingClientRect(),It=wt.width,Ct=wt.height;(It>it||Ct>nt)&&(J.style("overflow","hidden"),wt=J.node().getBoundingClientRect(),It=wt.width,Ct=wt.height);var Nt=+I.attr("x"),ee=+I.attr("y"),Jt=K||I.node().getBoundingClientRect().height,te=-Jt/4;if(ct[0]==="y")q.attr({transform:"rotate("+[-90,Nt,ee]+")"+d(-It/2,te-Ct/2)});else if(ct[0]==="l")ee=te-Ct/2;else if(ct[0]==="a"&&ct.indexOf("atitle")!==0)Nt=0,ee=te;else{var Kt=I.attr("text-anchor");Nt=Nt-It*(Kt==="middle"?.5:Kt==="end"?1:0),ee=ee+te-Ct/2}J.attr({x:Nt,y:ee}),N&&N.call(I,q),et(q)})})):st(),I};var e=/(<|&lt;|&#60;)/g,r=/(>|&gt;|&#62;)/g;function i(I){return I.replace(e,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function o(I,F,N){var j=parseInt((MathJax.version||"").split(".")[0]);if(j!==2&&j!==3){u.warn("No MathJax version:",MathJax.version);return}var G,rt,ct,st,et=function(){return rt=u.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"})},K=function(){rt=u.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},ot=function(){if(G=MathJax.Hub.config.menuSettings.renderer,G!=="SVG")return MathJax.Hub.setRenderer("SVG")},X=function(){G=MathJax.config.startup.output,G!=="svg"&&(MathJax.config.startup.output="svg")},Q=function(){var dt="math-output-"+u.randstr({},64);st=V.select("body").append("div").attr({id:dt}).style({visibility:"hidden",position:"absolute","font-size":F.fontSize+"px"}).text(i(I));var Tt=st.node();return j===2?MathJax.Hub.Typeset(Tt):MathJax.typeset([Tt])},ut=function(){var dt=st.select(j===2?".MathJax_SVG":".MathJax"),Tt=!dt.empty()&&st.select("svg").node();if(!Tt)u.log("There was an error in the tex syntax.",I),N();else{var wt=Tt.getBoundingClientRect(),It;j===2?It=V.select("body").select("#MathJax_SVG_glyphs"):It=dt.select("defs"),N(dt,It,wt)}st.remove()},J=function(){if(G!=="SVG")return MathJax.Hub.setRenderer(G)},q=function(){G!=="svg"&&(MathJax.config.startup.output=G)},it=function(){return ct!==void 0&&(MathJax.Hub.processSectionDelay=ct),MathJax.Hub.Config(rt)},nt=function(){MathJax.config=rt};j===2?MathJax.Hub.Queue(et,ot,Q,ut,J,it):j===3&&(K(),X(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Q(),ut(),q(),nt()}))}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"},f={sub:"-0.21em",sup:"0.42em"},v="",g=["http:","https:","mailto:","",void 0,":"],m=Z.NEWLINES=/(\r\n?|\n)/g,w=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;Z.BR_TAG_ALL=/<br(\s+.*)?>/gi;var y=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,k=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(I,F){if(!I)return null;var N=I.match(F),j=N&&(N[3]||N[4]);return j&&_(j)}var c=/(^|;)\s*color:/;Z.plainText=function(I,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=I.split(w),st=[],et="",K=0,ot=0;ot<ct.length;ot++){var X=ct[ot],Q=X.match(l),ut=Q&&Q[2].toLowerCase();if(ut)j.indexOf(ut)!==-1&&(st.push(X),et=ut);else{var J=X.length;if(K+J<N)st.push(X),K+=J;else if(K<N){var q=N-K;et&&(et!=="br"||q<=rt||J<=rt)&&st.pop(),N>rt?st.push(X.substr(0,q-rt)+G):st.push(X.substr(0,q));break}et=""}}return st.join("")};var h={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},b=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function _(I){return I.replace(b,function(F,N){var j;return N.charAt(0)==="#"?j=P(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):j=h[N],j||F})}Z.convertEntities=_;function P(I){if(!(I>1114111)){var F=String.fromCodePoint;if(F)return F(I);var N=String.fromCharCode;return I<=65535?N(I):N((I>>10)+55232,I%1024+56320)}}function L(I,F){F=F.replace(m," ");var N=!1,j=[],G,rt=-1;function ct(){rt++;var Ct=document.createElementNS(E.svg,"tspan");V.select(Ct).attr({class:"line",dy:rt*A+"em"}),I.appendChild(Ct),G=Ct;var Nt=j;if(j=[{node:Ct}],Nt.length>1)for(var ee=1;ee<Nt.length;ee++)st(Nt[ee])}function st(Ct){var Nt=Ct.type,ee={},Jt;if(Nt==="a"){Jt="a";var te=Ct.target,Kt=Ct.href,mt=Ct.popup;Kt&&(ee={"xlink:xlink:show":te==="_blank"||te.charAt(0)!=="_"?"new":"replace",target:te,"xlink:xlink:href":Kt},mt&&(ee.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+mt+'");return false;'))}else Jt="tspan";Ct.style&&(ee.style=Ct.style);var bt=document.createElementNS(E.svg,Jt);if(Nt==="sup"||Nt==="sub"){et(G,v),G.appendChild(bt);var vt=document.createElementNS(E.svg,"tspan");et(vt,v),V.select(vt).attr("dy",f[Nt]),ee.dy=s[Nt],G.appendChild(bt),G.appendChild(vt)}else G.appendChild(bt);V.select(bt).attr(ee),G=Ct.node=bt,j.push(Ct)}function et(Ct,Nt){Ct.appendChild(document.createTextNode(Nt))}function K(Ct){if(j.length===1){u.log("Ignoring unexpected end tag </"+Ct+">.",F);return}var Nt=j.pop();Ct!==Nt.type&&u.log("Start tag <"+Nt.type+"> doesnt match end tag <"+Ct+">. Pretending it did match.",F),G=j[j.length-1].node}var ot=x.test(F);ot?ct():(G=I,j=[{node:I}]);for(var X=F.split(w),Q=0;Q<X.length;Q++){var ut=X[Q],J=ut.match(l),q=J&&J[2].toLowerCase(),it=a[q];if(q==="br")ct();else if(it===void 0)et(G,_(ut));else if(J[1])K(q);else{var nt=J[4],dt={type:q},Tt=T(nt,y);if(Tt?(Tt=Tt.replace(c,"$1 fill:"),it&&(Tt+=";"+it)):it&&(Tt=it),Tt&&(dt.style=Tt),q==="a"){N=!0;var wt=T(nt,S);if(wt){var It=D(wt);It&&(dt.href=It,dt.target=T(nt,k)||"_blank",dt.popup=T(nt,M))}}st(dt)}}return N}function D(I){var F=encodeURI(decodeURI(I)),N=document.createElement("a"),j=document.createElement("a");N.href=I,j.href=F;var G=N.protocol,rt=j.protocol;return g.indexOf(G)!==-1&&g.indexOf(rt)!==-1?F:""}Z.sanitizeHTML=function(I){I=I.replace(m," ");for(var F=document.createElement("p"),N=F,j=[],G=I.split(w),rt=0;rt<G.length;rt++){var ct=G[rt],st=ct.match(l),et=st&&st[2].toLowerCase();if(et in a)if(st[1])j.length&&(N=j.pop());else{var K=st[4],ot=T(K,y),X=ot?{style:ot}:{};if(et==="a"){var Q=T(K,S);if(Q){var ut=D(Q);if(ut){X.href=ut;var J=T(K,k);J&&(X.target=J)}}}var q=document.createElement(et);N.appendChild(q),V.select(q).attr(X),N=q,j.push(q)}else N.appendChild(document.createTextNode(_(ct)))}var it="innerHTML";return F[it]},Z.lineCount=function(I){return I.selectAll("tspan.line").size()||1},Z.positionText=function(I,F,N){return I.each(function(){var j=V.select(this);function G(st,et){return et===void 0?(et=j.attr(st),et===null&&(j.attr(st,0),et=0)):j.attr(st,et),et}var rt=G("x",F),ct=G("y",N);this.nodeName==="text"&&j.selectAll("tspan.line").attr({x:rt,y:ct})})};function B(I,F,N){var j=N.horizontalAlign,G=N.verticalAlign||"top",rt=I.node().getBoundingClientRect(),ct=F.node().getBoundingClientRect(),st,et,K;return G==="bottom"?et=function(){return rt.bottom-st.height}:G==="middle"?et=function(){return rt.top+(rt.height-st.height)/2}:et=function(){return rt.top},j==="right"?K=function(){return rt.right-st.width}:j==="center"?K=function(){return rt.left+(rt.width-st.width)/2}:K=function(){return rt.left},function(){st=this.node().getBoundingClientRect();var ot=K()-ct.left,X=et()-ct.top,Q=N.gd||{};if(N.gd){Q._fullLayout._calcInverseTransform(Q);var ut=u.apply3DTransform(Q._fullLayout._invTransform)(ot,X);ot=ut[0],X=ut[1]}return this.style({top:X+"px",left:ot+"px","z-index":1e3}),this}}var R="1px ";Z.makeTextShadow=function(I){var F=R,N=R,j=R;return F+N+j+I+", -"+F+"-"+N+j+I+", "+F+"-"+N+j+I+", -"+F+N+j+I},Z.makeEditable=function(I,F){var N=F.gd,j=F.delegate,G=V.dispatch("edit","input","cancel"),rt=j||I;if(I.style({"pointer-events":j?"none":"all"}),I.size()!==1)throw new Error("boo");function ct(){et(),I.style({opacity:0});var K=rt.attr("class"),ot;K?ot="."+K.split(" ")[0]+"-math-group":ot="[class*=-math-group]",ot&&V.select(I.node().parentNode).select(ot).style({opacity:0})}function st(K){var ot=K.node(),X=document.createRange();X.selectNodeContents(ot);var Q=window.getSelection();Q.removeAllRanges(),Q.addRange(X),ot.focus()}function et(){var K=V.select(N),ot=K.select(".svg-container"),X=ot.append("div"),Q=I.node().style,ut=parseFloat(Q.fontSize||12),J=F.text;J===void 0&&(J=I.attr("data-unformatted")),X.classed("plugin-editable editable",!0).style({position:"absolute","font-family":Q.fontFamily||"Arial","font-size":ut,color:F.fill||Q.fill||"black",opacity:1,"background-color":F.background||"transparent",outline:"#ffffff33 1px solid",margin:[-ut/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(J).call(B(I,ot,F)).on("blur",function(){N._editing=!1,I.text(this.textContent).style({opacity:1});var q=V.select(this).attr("class"),it;q?it="."+q.split(" ")[0]+"-math-group":it="[class*=-math-group]",it&&V.select(I.node().parentNode).select(it).style({opacity:0});var nt=this.textContent;V.select(this).transition().duration(0).remove(),V.select(document).on("mouseup",null),G.edit.call(I,nt)}).on("focus",function(){var q=this;N._editing=!0,V.select(document).on("mouseup",function(){if(V.event.target===q)return!1;document.activeElement===X.node()&&X.node().blur()})}).on("keyup",function(){V.event.which===27?(N._editing=!1,I.style({opacity:1}),V.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),G.cancel.call(I,this.textContent)):(G.input.call(I,this.textContent),V.select(this).call(B(I,ot,F)))}).on("keydown",function(){V.event.which===13&&this.blur()}).call(st)}return F.immediate?ct():rt.on("click",ct),V.rebind(I,G,"on")}}),nh=Vt((Z,V)=>{var u=Ni(),d=kf(),E=Lo(),A=Xr(),t=Pi(),e=r0().isValid;function r(m,w,l){var x=w?A.nestedProperty(m,w).get()||{}:m,y=x[l||"color"];y&&y._inputArray&&(y=y._inputArray);var S=!1;if(A.isArrayOrTypedArray(y)){for(var k=0;k<y.length;k++)if(E(y[k])){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(m){var w=m._colorAx,l=w||m,x={},y,S,k;for(S=0;S<i.length;S++)k=i[S],x[k]=l[k];if(w)for(y="c",S=0;S<n.length;S++)k=n[S],x[k]=l["c"+k];else{var M;for(S=0;S<n.length;S++){if(k=n[S],M="c"+k,M in l){x[k]=l[M];continue}M="z"+k,M in l&&(x[k]=l[M])}y=M.charAt(0)}return x._sync=function(T,c){var h=n.indexOf(T)!==-1?y+T:T;l[h]=l["_"+h]=c},x}function a(m){for(var w=o(m),l=w.min,x=w.max,y=w.reversescale?s(w.colorscale):w.colorscale,S=y.length,k=new Array(S),M=new Array(S),T=0;T<S;T++){var c=y[T];k[T]=l+c[0]*(x-l),M[T]=c[1]}return{domain:k,range:M}}function s(m){for(var w=m.length,l=new Array(w),x=w-1,y=0;x>=0;x--,y++){var S=m[x];l[y]=[1-S[0],S[1]]}return l}function f(m,w){w=w||{};for(var l=m.domain,x=m.range,y=x.length,S=new Array(y),k=0;k<y;k++){var M=d(x[k]).toRgb();S[k]=[M.r,M.g,M.b,M.a]}var T=u.scale.linear().domain(l).range(S).clamp(!0),c=w.noNumericCheck,h=w.returnArray,b;return c&&h?b=T:c?b=function(_){return g(T(_))}:h?b=function(_){return E(_)?T(_):d(_).isValid()?_:t.defaultLine}:b=function(_){return E(_)?g(T(_)):d(_).isValid()?_:t.defaultLine},b.domain=T.domain,b.range=function(){return x},b}function v(m,w){return f(a(m),w)}function g(m){var w={r:m[0],g:m[1],b:m[2],a:m[3]};return d(w).toRgbString()}V.exports={hasColorscale:r,extractOpts:o,extractScale:a,flipScale:s,makeColorScaleFunc:f,makeColorScaleFuncFromTrace:v}}),fc=Vt((Z,V)=>{var u=Q_(),d=u.FORMAT_LINK,E=u.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: "+d+"."].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}}),Pf=Vt((Z,V)=>{var u=yu(),d=nf(),E=Cf().dash,A=So().extendFlat,t=cl().templatedArray;kl().templateFormatStringDescription;var e=fc().descriptionWithDates,r=ks().ONEDAY,i=Af(),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 f(c){return{valType:"integer",min:0,dflt:c?5:0,editType:"ticks"}}var v={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},m={valType:"data_array",editType:"ticks"},w={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function l(c){var h={valType:"number",min:0,editType:"ticks"};return c||(h.dflt=5),h}function x(c){var h={valType:"number",min:0,editType:"ticks"};return c||(h.dflt=1),h}var y={valType:"color",dflt:d.defaultLine,editType:"ticks"},S={valType:"color",dflt:d.lightLine,editType:"ticks"};function k(c){var h={valType:"number",min:0,editType:"ticks"};return c||(h.dflt=1),h}var M=A({},E,{editType:"ticks"}),T={valType:"boolean",editType:"ticks"};V.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:d.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:u({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"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},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:f(),tick0:v,dtick:g,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:m,ticktext:{valType:"data_array",editType:"ticks"},ticks:w,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:y,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:u({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","SI extended"],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")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:d.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:T,gridcolor:S,gridwidth:k(),griddash:M,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:d.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:d.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:f("minor"),tick0:v,dtick:g,tickvals:m,ticks:w,ticklen:l("minor"),tickwidth:x("minor"),tickcolor:y,gridcolor:S,gridwidth:k("minor"),griddash:M,showgrid:T,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},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"}}),Ny=Vt((Z,V)=>{var u=Pf(),d=yu(),E=So().extendFlat,A=Cu().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:u.linecolor,outlinewidth:u.linewidth,bordercolor:u.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:u.minor.tickmode,nticks:u.nticks,tick0:u.tick0,dtick:u.dtick,tickvals:u.tickvals,ticktext:u.ticktext,ticks:E({},u.ticks,{dflt:""}),ticklabeloverflow:E({},u.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:u.ticklen,tickwidth:u.tickwidth,tickcolor:u.tickcolor,ticklabelstep:u.ticklabelstep,showticklabels:u.showticklabels,labelalias:u.labelalias,tickfont:d({}),tickangle:u.tickangle,tickformat:u.tickformat,tickformatstops:u.tickformatstops,tickprefix:u.tickprefix,showtickprefix:u.showtickprefix,ticksuffix:u.ticksuffix,showticksuffix:u.showticksuffix,separatethousands:u.separatethousands,exponentformat:u.exponentformat,minexponent:u.minexponent,showexponent:u.showexponent,title:{text:{valType:"string"},font:d({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Wl=Vt((Z,V)=>{var u=Ny(),d=pm().counter,E=bd(),A=r0().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||"",f=e?e+".":"",v;"colorAttr"in r?(v=r.colorAttr,r.colorAttr):(v={z:"z",c:"color"}[i],""+t(f+v));var g=i+"auto",m=i+"min",w=i+"max",l=i+"mid",x={};x[m]=x[w]=void 0;var y={};y[g]=!1;var S={};return v==="color"&&(S.color={valType:"color",arrayOk:!0,editType:s||"style"},r.anim&&(S.color.anim=!0)),S[g]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:x},S[m]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:y},S[w]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:y},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=u),r.noColorAxis||(S.coloraxis={valType:"subplotid",regex:d("coloraxis"),dflt:null,editType:"calc"}),S}}),ab=Vt((Z,V)=>{var u=So().extendFlat,d=Wl(),E=r0().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:u({_isSubplotObj:!0,editType:"calc"},d("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),ib=Vt((Z,V)=>{var u=Xr();V.exports=function(d){return u.isPlainObject(d.colorbar)}}),ob=Vt(Z=>{var V=Lo(),u=Xr(),d=ks(),E=d.ONEDAY,A=d.ONEWEEK;Z.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},Z.tick0=function(t,e,r,i){if(e==="date")return u.cleanDate(t,u.dateTick0(r,i%A===0?1:0));if(!(i==="D1"||i==="D2"))return V(t)?Number(t):0}}),i0=Vt((Z,V)=>{var u=ob(),d=Xr().isArrayOrTypedArray,E=rh().isTypedArraySpec,A=rh().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,f=o?"minor.":"";function v(k){var M=a[k];return E(M)&&(M=A(M)),M!==void 0?M:(s._template||{})[k]}var g=v("tick0"),m=v("dtick"),w=v("tickvals"),l=d(w)?"array":m?"linear":"auto",x=r(f+"tickmode",l);if(x==="auto"||x==="sync")r(f+"nticks");else if(x==="linear"){var y=s.dtick=u.dtick(m,i);s.tick0=u.tick0(g,i,e.calendar,y)}else if(i!=="multicategory"){var S=r(f+"tickvals");S===void 0?s.tickmode="auto":o||r("ticktext")}}}),vm=Vt((Z,V)=>{var u=Xr(),d=Pf();V.exports=function(E,A,t,e){var r=e.isMinor,i=r?E.minor||{}:E,n=r?A.minor:A,o=r?d.minor:d,a=r?"minor.":"",s=u.coerce2(i,n,o,"ticklen",r?(A.ticklen||5)*.6:void 0),f=u.coerce2(i,n,o,"tickwidth",r?A.tickwidth||1:void 0),v=u.coerce2(i,n,o,"tickcolor",(r?A.tickcolor:void 0)||n.color),g=t(a+"ticks",!r&&e.outerTicks||s||f||v?"outside":"");g||(delete n.ticklen,delete n.tickwidth,delete n.tickcolor)}}),sb=Vt((Z,V)=>{V.exports=function(u){var d=["showexponent","showtickprefix","showticksuffix"],E=d.filter(function(t){return u[t]!==void 0}),A=function(t){return u[t]===u[E[0]]};if(E.every(A)||E.length===1)return u[E[0]]}}),Wf=Vt((Z,V)=>{var u=Xr(),d=cl();V.exports=function(E,A,t){var e=t.name,r=t.inclusionAttr||"visible",i=A[e],n=u.isArrayOrTypedArray(E[e])?E[e]:[],o=A[e]=[],a=d.arrayTemplater(A,e,r),s,f;for(s=0;s<n.length;s++){var v=n[s];u.isPlainObject(v)?f=a.newItem(v):(f=a.newItem({}),f[r]=!1),f._index=s,f[r]!==!1&&t.handleItemDefaults(v,f,A,t),o.push(f)}var g=a.defaultItems();for(s=0;s<g.length;s++)f=g[s],f._index=o.length,t.handleItemDefaults({},f,A,t,{}),o.push(f);if(u.isArrayOrTypedArray(i)){var m=Math.min(i.length,o.length);for(s=0;s<m;s++)u.relinkPrivateKeys(o[s],i[s])}return o}}),Td=Vt((Z,V)=>{var u=Xr(),d=Pi().contrast,E=Pf(),A=sb(),t=Wf();V.exports=function(r,i,n,o,a){a||(a={});var s=n("labelalias");u.isPlainObject(s)||delete i.labelalias;var f=A(r),v=n("showticklabels");if(v){a.noTicklabelshift||n("ticklabelshift"),a.noTicklabelstandoff||n("ticklabelstandoff");var g=a.font||{},m=i.color,w=i.ticklabelposition||"",l=w.indexOf("inside")!==-1?d(a.bgColor):m&&m!==E.color.dflt?m:g.color;if(u.coerceFont(n,"tickfont",g,{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 y=n("tickformat");t(r,i,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:e}),i.tickformatstops.length||delete i.tickformatstops,!a.noExp&&!y&&o!=="date"&&(n("showexponent",f),n("exponentformat"),n("minexponent"),n("separatethousands"))}!a.noMinorloglabels&&o==="log"&&n("minorloglabels")}};function e(r,i){function n(a,s){return u.coerce(r,i,E.tickformatstops,a,s)}var o=n("enabled");o&&(n("dtickrange"),n("value"))}}),kd=Vt((Z,V)=>{var u=sb();V.exports=function(d,E,A,t,e){e||(e={});var r=e.tickSuffixDflt,i=u(d),n=A("tickprefix");n&&A("showtickprefix",i);var o=A("ticksuffix",r);o&&A("showticksuffix",i)}}),lb=Vt((Z,V)=>{var u=Xr(),d=cl(),E=i0(),A=vm(),t=Td(),e=kd(),r=Ny();V.exports=function(i,n,o){var a=d.newContainer(n,"colorbar"),s=i.colorbar||{};function f(I,F){return u.coerce(s,a,r,I,F)}var v=o.margin||{t:0,b:0,l:0,r:0},g=o.width-v.l-v.r,m=o.height-v.t-v.b,w=f("orientation"),l=w==="v",x=f("thicknessmode");f("thickness",x==="fraction"?30/(l?g:m):30);var y=f("lenmode");f("len",y==="fraction"?1:l?m:g);var S=f("yref"),k=f("xref"),M=S==="paper",T=k==="paper",c,h,b,_="left";l?(b="middle",_=T?"left":"right",c=T?1.02:1,h=.5):(b=M?"bottom":"top",_="center",c=.5,h=M?1.02:1),u.coerce(s,a,{x:{valType:"number",min:T?-2:0,max:T?3:1,dflt:c}},"x"),u.coerce(s,a,{y:{valType:"number",min:M?-2:0,max:M?3:1,dflt:h}},"y"),f("xanchor",_),f("xpad"),f("yanchor",b),f("ypad"),u.noneOrAll(s,a,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var P=u.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");f("ticklabeloverflow",P.indexOf("inside")!==-1?"hide past domain":"hide past div"),E(s,a,f,"linear");var L=o.font,D={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:L};P.indexOf("inside")!==-1&&(D.bgColor="black"),e(s,a,f,"linear",D),t(s,a,f,"linear",D),A(s,a,f,"linear",D),f("title.text",o._dfltTitle.colorbar);var B=a.showticklabels?a.tickfont:L,R=u.extendFlat({},L,{family:B.family,size:u.bigFont(B.size)});u.coerceFont(f,"title.font",R),f("title.side",l?"top":"right")}}),gf=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ib(),A=lb(),t=r0().isValid,e=ji().traceIs;function r(i,n){var o=n.slice(0,n.length-1);return n?d.nestedProperty(i,o).get()||{}:i}V.exports=function i(n,o,a,s,f){var v=f.prefix,g=f.cLetter,m="_module"in o,w=r(n,v),l=r(o,v),x=r(o._template||{},v)||{},y=function(){return delete n.coloraxis,delete o.coloraxis,i(n,o,a,s,f)};if(m){var S=a._colorAxes||{},k=s(v+"coloraxis");if(k){var M=e(o,"contour")&&d.nestedProperty(o,"contours.coloring").get()||"heatmap",T=S[k];T?(T[2].push(y),T[0]!==M&&(T[0]=!1,d.warn(["Ignoring coloraxis:",k,"setting","as it is linked to incompatible colorscales."].join(" ")))):S[k]=[M,o,[y]];return}}var c=w[g+"min"],h=w[g+"max"],b=u(c)&&u(h)&&c<h,_=s(v+g+"auto",!b);_?s(v+g+"mid"):(s(v+g+"min"),s(v+g+"max"));var P=w.colorscale,L=x.colorscale,D;if(P!==void 0&&(D=!t(P)),L!==void 0&&(D=!t(L)),s(v+"autocolorscale",D),s(v+"colorscale"),s(v+"reversescale"),v!=="marker.line."){var B;v&&m&&(B=E(w));var R=s(v+"showscale",B);R&&(v&&x&&(l._template=x),A(w,l,a))}}}),VT=Vt((Z,V)=>{var u=Xr(),d=cl(),E=ab(),A=gf();V.exports=function(t,e){function r(g,m){return u.coerce(t,e,E,g,m)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var i=e._colorAxes,n,o;function a(g,m){return u.coerce(n,o,E.coloraxis,g,m)}for(var s in i){var f=i[s];if(f[0])n=t[s]||{},o=d.newContainer(e,s,"coloraxis"),o._name=s,A(n,o,e,a,{prefix:"",cLetter:"c"});else{for(var v=0;v<f[2].length;v++)f[2][v]();delete e._colorAxes[s]}}}}),HT=Vt((Z,V)=>{var u=Xr(),d=nh().hasColorscale,E=nh().extractOpts;V.exports=function(A,t){function e(f,v){var g=f["_"+v];g!==void 0&&(f[v]=g)}function r(f,v){var g=v.container?u.nestedProperty(f,v.container).get():f;if(g)if(g.coloraxis)g._colorAx=t[g.coloraxis];else{var m=E(g),w=m.auto;(w||m.min===void 0)&&e(g,v.min),(w||m.max===void 0)&&e(g,v.max),m.autocolorscale&&e(g,"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);d(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"})}}),ah=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=nh().extractOpts;V.exports=function(A,t,e){var r=A._fullLayout,i=e.vals,n=e.containerStr,o=n?d.nestedProperty(t,n).get():t,a=E(o),s=a.auto!==!1,f=a.min,v=a.max,g=a.mid,m=function(){return d.aggNums(Math.min,null,i)},w=function(){return d.aggNums(Math.max,null,i)};if(f===void 0?f=m():s&&(o._colorAx&&u(f)?f=Math.min(f,m()):f=m()),v===void 0?v=w():s&&(o._colorAx&&u(v)?v=Math.max(v,w()):v=w()),s&&g!==void 0&&(v-g>g-f?f=g-(v-g):v-g<g-f&&(v=g+(g-f))),f===v&&(f-=.5,v+=.5),a._sync("min",f),a._sync("max",v),a.autocolorscale){var l;f*v<0?l=r.colorscale.diverging:f>=0?l=r.colorscale.sequential:l=r.colorscale.sequentialminus,a._sync("colorscale",l)}}}),xu=Vt((Z,V)=>{var u=r0(),d=nh();V.exports={moduleType:"component",name:"colorscale",attributes:Wl(),layoutAttributes:ab(),supplyLayoutDefaults:VT(),handleDefaults:gf(),crossTraceDefaults:HT(),calc:ah(),scales:u.scales,defaultScale:u.defaultScale,getScale:u.get,isValidScale:u.isValid,hasColorscale:d.hasColorscale,extractOpts:d.extractOpts,extractScale:d.extractScale,flipScale:d.flipScale,makeColorScaleFunc:d.makeColorScaleFunc,makeColorScaleFuncFromTrace:d.makeColorScaleFuncFromTrace}}),nu=Vt((Z,V)=>{var u=Xr(),d=rh().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 u.isPlainObject(A)&&(u.isArrayOrTypedArray(A.size)||d(A.size))}}}),ym=Vt((Z,V)=>{var u=Lo();V.exports=function(d,E){E||(E=2);var A=d.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 u(n)&&n>0?Math.max(n,e):0}}}),dh=Vt(Z=>{var V=Xr();Z.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},Z.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(Z.getSubplot(e))!==-1},Z.flat=function(e,r){for(var i=new Array(e.length),n=0;n<e.length;n++)i[n]=r;return i},Z.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},Z.getDistanceFunction=function(e,r,i,n){return e==="closest"?n||Z.quadrature(r,i):e.charAt(0)==="x"?r:i},Z.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},Z.inbox=function(e,r,i){return e*r<0||e===0?i:1/0},Z.quadrature=function(e,r){return function(i){var n=e(i),o=r(i);return Math.sqrt(n*n+o*o)}},Z.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)),Z.appendArrayPointValue(o,r,n),o},Z.appendArrayPointValue=function(e,r,i){var n=r._arrayAttrs;if(n)for(var o=0;o<n.length;o++){var a=n[o],s=d(a);if(e[s]===void 0){var f=V.nestedProperty(r,a).get(),v=E(f,i);v!==void 0&&(e[s]=v)}}},Z.appendArrayMultiPointValues=function(e,r,i){var n=r._arrayAttrs;if(n)for(var o=0;o<n.length;o++){var a=n[o],s=d(a);if(e[s]===void 0){for(var f=V.nestedProperty(r,a).get(),v=new Array(i.length),g=0;g<i.length;g++)v[g]=E(f,i[g]);e[s]=v}}};var u={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function d(e){return u[e]||e}function E(e,r){if(Array.isArray(r)){if(V.isArrayOrTypedArray(e)&&V.isArrayOrTypedArray(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};Z.isUnifiedHover=function(e){return typeof e!="string"?!1:!!t[e]},Z.isXYhover=function(e){return typeof e!="string"?!1:!!A[e]}}),Pg=Vt((Z,V)=>{V.exports=E;var u={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function E(e){var r=[];return e.replace(d,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==u[a])return o.unshift(n),r.push(o);if(o.length<u[a])throw new Error("malformed path data");r.push([n].concat(o.splice(0,u[a])))}}),r}var A=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function t(e){var r=e.match(A);return r?r.map(Number):[]}}),qT=Vt((Z,V)=>{var u=Pg(),d=function(g,m){return m?Math.round(g*(m=Math.pow(10,m)))/m:Math.round(g)},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(g,m,w){if(n(m))return E;var l=d(g,2),x="M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z";return w?v(m,w,x):x}},square:{n:1,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")}},diamond:{n:2,f:function(g,m,w){if(n(m))return E;var l=d(g*1.3,2);return v(m,w,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"Z")}},cross:{n:3,f:function(g,m,w){if(n(m))return E;var l=d(g*.4,2),x=d(g*1.2,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g*.8/A,2),x="l"+l+","+l,y="l"+l+",-"+l,S="l-"+l+",-"+l,k="l-"+l+","+l;return v(m,w,"M0,"+l+x+y+S+y+S+k+S+k+x+k+x+"Z")}},"triangle-up":{n:5,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M-"+l+","+x+"H"+l+"L0,-"+y+"Z")}},"triangle-down":{n:6,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M-"+l+",-"+x+"H"+l+"L0,"+y+"Z")}},"triangle-left":{n:7,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M"+x+",-"+l+"V"+l+"L-"+y+",0Z")}},"triangle-right":{n:8,f:function(g,m,w){if(n(m))return E;var l=d(g*2/t,2),x=d(g/2,2),y=d(g,2);return v(m,w,"M-"+x+",-"+l+"V"+l+"L"+y+",0Z")}},"triangle-ne":{n:9,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M-"+x+",-"+l+"H"+l+"V"+x+"Z")}},"triangle-se":{n:10,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M"+l+",-"+x+"V"+l+"H-"+x+"Z")}},"triangle-sw":{n:11,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M"+x+","+l+"H-"+l+"V-"+x+"Z")}},"triangle-nw":{n:12,f:function(g,m,w){if(n(m))return E;var l=d(g*.6,2),x=d(g*1.2,2);return v(m,w,"M-"+l+","+x+"V-"+l+"H"+x+"Z")}},pentagon:{n:13,f:function(g,m,w){if(n(m))return E;var l=d(g*.951,2),x=d(g*.588,2),y=d(-g,2),S=d(g*-.309,2),k=d(g*.809,2);return v(m,w,"M"+l+","+S+"L"+x+","+k+"H-"+x+"L-"+l+","+S+"L0,"+y+"Z")}},hexagon:{n:14,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g/2,2),y=d(g*t/2,2);return v(m,w,"M"+y+",-"+x+"V"+x+"L0,"+l+"L-"+y+","+x+"V-"+x+"L0,-"+l+"Z")}},hexagon2:{n:15,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g/2,2),y=d(g*t/2,2);return v(m,w,"M-"+x+","+y+"H"+x+"L"+l+",0L"+x+",-"+y+"H-"+x+"L-"+l+",0Z")}},octagon:{n:16,f:function(g,m,w){if(n(m))return E;var l=d(g*.924,2),x=d(g*.383,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=g*1.4,x=d(l*.225,2),y=d(l*.951,2),S=d(l*.363,2),k=d(l*.588,2),M=d(-l,2),T=d(l*-.309,2),c=d(l*.118,2),h=d(l*.809,2),b=d(l*.382,2);return v(m,w,"M"+x+","+T+"H"+y+"L"+S+","+c+"L"+k+","+h+"L0,"+b+"L-"+k+","+h+"L-"+S+","+c+"L-"+y+","+T+"H-"+x+"L0,"+M+"Z")}},hexagram:{n:18,f:function(g,m,w){if(n(m))return E;var l=d(g*.66,2),x=d(g*.38,2),y=d(g*.76,2);return v(m,w,"M-"+y+",0l-"+x+",-"+l+"h"+y+"l"+x+",-"+l+"l"+x+","+l+"h"+y+"l-"+x+","+l+"l"+x+","+l+"h-"+y+"l-"+x+","+l+"l-"+x+",-"+l+"h-"+y+"Z")}},"star-triangle-up":{n:19,f:function(g,m,w){if(n(m))return E;var l=d(g*t*.8,2),x=d(g*.8,2),y=d(g*1.6,2),S=d(g*4,2),k="A "+S+","+S+" 0 0 1 ";return v(m,w,"M-"+l+","+x+k+l+","+x+k+"0,-"+y+k+"-"+l+","+x+"Z")}},"star-triangle-down":{n:20,f:function(g,m,w){if(n(m))return E;var l=d(g*t*.8,2),x=d(g*.8,2),y=d(g*1.6,2),S=d(g*4,2),k="A "+S+","+S+" 0 0 1 ";return v(m,w,"M"+l+",-"+x+k+"-"+l+",-"+x+k+"0,"+y+k+l+",-"+x+"Z")}},"star-square":{n:21,f:function(g,m,w){if(n(m))return E;var l=d(g*1.1,2),x=d(g*2,2),y="A "+x+","+x+" 0 0 1 ";return v(m,w,"M-"+l+",-"+l+y+"-"+l+","+l+y+l+","+l+y+l+",-"+l+y+"-"+l+",-"+l+"Z")}},"star-diamond":{n:22,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2),x=d(g*1.9,2),y="A "+x+","+x+" 0 0 1 ";return v(m,w,"M-"+l+",0"+y+"0,"+l+y+l+",0"+y+"0,-"+l+y+"-"+l+",0Z")}},"diamond-tall":{n:23,f:function(g,m,w){if(n(m))return E;var l=d(g*.7,2),x=d(g*1.4,2);return v(m,w,"M0,"+x+"L"+l+",0L0,-"+x+"L-"+l+",0Z")}},"diamond-wide":{n:24,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2),x=d(g*.7,2);return v(m,w,"M0,"+x+"L"+l+",0L0,-"+x+"L-"+l+",0Z")}},hourglass:{n:25,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"H-"+l+"L"+l+",-"+l+"H-"+l+"Z")},noDot:!0},bowtie:{n:26,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"V-"+l+"L-"+l+","+l+"V-"+l+"Z")},noDot:!0},"circle-cross":{n:27,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g/A,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g*1.3,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g*1.3,2),x=d(g*.65,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g*1.4,2);return v(m,w,"M0,"+l+"V-"+l+"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*.85,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g/2,2),x=d(g,2);return v(m,w,"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(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M-"+l+","+y+"L0,0M"+l+","+y+"L0,0M0,-"+x+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M-"+l+",-"+y+"L0,0M"+l+",-"+y+"L0,0M0,"+x+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M"+y+","+l+"L0,0M"+y+",-"+l+"L0,0M-"+x+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(g,m,w){if(n(m))return E;var l=d(g*1.2,2),x=d(g*1.6,2),y=d(g*.8,2);return v(m,w,"M-"+y+","+l+"L0,0M-"+y+",-"+l+"L0,0M"+x+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2);return v(m,w,"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(g,m,w){if(n(m))return E;var l=d(g*1.4,2);return v(m,w,"M0,"+l+"V-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(g,m,w){if(n(m))return E;var l=d(g,2);return v(m,w,"M"+l+","+l+"L-"+l+",-"+l)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M0,0L-"+l+","+x+"H"+l+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M0,0L-"+l+",-"+x+"H"+l+"Z")},noDot:!0},"arrow-left":{n:47,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,0L"+l+",-"+x+"V"+x+"Z")},noDot:!0},"arrow-right":{n:48,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,0L-"+l+",-"+x+"V"+x+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M-"+l+",0H"+l+"M0,0L-"+l+","+x+"H"+l+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(g,m,w){if(n(m))return E;var l=d(g,2),x=d(g*2,2);return v(m,w,"M-"+l+",0H"+l+"M0,0L-"+l+",-"+x+"H"+l+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,-"+x+"V"+x+"M0,0L"+l+",-"+x+"V"+x+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(g,m,w){if(n(m))return E;var l=d(g*2,2),x=d(g,2);return v(m,w,"M0,-"+x+"V"+x+"M0,0L-"+l+",-"+x+"V"+x+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(g,m,w){if(n(m))return E;var l=e/2.5,x=2*g*r(l),y=2*g*i(l);return v(m,w,"M0,0L"+-x+","+y+"L"+x+","+y+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(g,m,w){if(n(m))return E;var l=e/4,x=2*g*r(l),y=2*g*i(l);return v(m,w,"M0,0L"+-x+","+y+"A "+2*g+","+2*g+" 0 0 1 "+x+","+y+"Z")},backoff:.4,noDot:!0}};function n(g){return g===null}var o,a,s,f;function v(g,m,w){if((!g||g%360===0)&&!m)return w;if(s===g&&f===m&&o===w)return a;s=g,f=m,o=w;function l(D,B){var R=r(D),I=i(D),F=B[0],N=B[1]+(m||0);return[F*R-N*I,F*I+N*R]}for(var x=g/180*e,y=0,S=0,k=u(w),M="",T=0;T<k.length;T++){var c=k[T],h=c[0],b=y,_=S;if(h==="M"||h==="L")y=+c[1],S=+c[2];else if(h==="m"||h==="l")y+=+c[1],S+=+c[2];else if(h==="H")y=+c[1];else if(h==="h")y+=+c[1];else if(h==="V")S=+c[1];else if(h==="v")S+=+c[1];else if(h==="A"){y=+c[1],S=+c[2];var P=l(x,[+c[6],+c[7]]);c[6]=P[0],c[7]=P[1],c[3]=+c[3]+g}(h==="H"||h==="V")&&(h="L"),(h==="h"||h==="v")&&(h="l"),(h==="m"||h==="l")&&(y-=b,S-=_);var L=l(x,[y,S]);(h==="H"||h==="V")&&(h="L"),(h==="M"||h==="L"||h==="m"||h==="l")&&(c[1]=L[0],c[2]=L[1]),c[0]=h,M+=c[0]+c.slice(1).join(",")}return a=M,M}}),Eo=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=d.numberFormat,A=Lo(),t=kf(),e=ji(),r=Pi(),i=xu(),n=d.strTranslate,o=Dl(),a=Eh(),s=mf(),f=s.LINE_SPACING,v=xd().DESELECTDIM,g=nu(),m=ym(),w=dh().appendArrayPointValue,l=V.exports={};l.font=function(mt,bt){var vt=bt.variant,Ut=bt.style,re=bt.weight,Zt=bt.color,ue=bt.size,Me=bt.family,Ce=bt.shadow,We=bt.lineposition,qe=bt.textcase;Me&&mt.style("font-family",Me),ue+1&&mt.style("font-size",ue+"px"),Zt&&mt.call(r.fill,Zt),re&&mt.style("font-weight",re),Ut&&mt.style("font-style",Ut),vt&&mt.style("font-variant",vt),qe&&mt.style("text-transform",x(S(qe))),Ce&&mt.style("text-shadow",Ce==="auto"?o.makeTextShadow(r.contrast(Zt)):x(Ce)),We&&mt.style("text-decoration-line",x(k(We)))};function x(mt){return mt==="none"?void 0:mt}var y={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function S(mt){return y[mt]}function k(mt){return mt.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}l.setPosition=function(mt,bt,vt){mt.attr("x",bt).attr("y",vt)},l.setSize=function(mt,bt,vt){mt.attr("width",bt).attr("height",vt)},l.setRect=function(mt,bt,vt,Ut,re){mt.call(l.setPosition,bt,vt).call(l.setSize,Ut,re)},l.translatePoint=function(mt,bt,vt,Ut){var re=vt.c2p(mt.x),Zt=Ut.c2p(mt.y);if(A(re)&&A(Zt)&&bt.node())bt.node().nodeName==="text"?bt.attr("x",re).attr("y",Zt):bt.attr("transform",n(re,Zt));else return!1;return!0},l.translatePoints=function(mt,bt,vt){mt.each(function(Ut){var re=u.select(this);l.translatePoint(Ut,re,bt,vt)})},l.hideOutsideRangePoint=function(mt,bt,vt,Ut,re,Zt){bt.attr("display",vt.isPtWithinRange(mt,re)&&Ut.isPtWithinRange(mt,Zt)?null:"none")},l.hideOutsideRangePoints=function(mt,bt){if(bt._hasClipOnAxisFalse){var vt=bt.xaxis,Ut=bt.yaxis;mt.each(function(re){var Zt=re[0].trace,ue=Zt.xcalendar,Me=Zt.ycalendar,Ce=e.traceIs(Zt,"bar-like")?".bartext":".point,.textpoint";mt.selectAll(Ce).each(function(We){l.hideOutsideRangePoint(We,u.select(this),vt,Ut,ue,Me)})})}},l.crispRound=function(mt,bt,vt){return!bt||!A(bt)?vt||0:mt._context.staticPlot?bt:bt<1?1:Math.round(bt)},l.singleLineStyle=function(mt,bt,vt,Ut,re){bt.style("fill","none");var Zt=(((mt||[])[0]||{}).trace||{}).line||{},ue=vt||Zt.width||0,Me=re||Zt.dash||"";r.stroke(bt,Ut||Zt.color),l.dashLine(bt,Me,ue)},l.lineGroupStyle=function(mt,bt,vt,Ut){mt.style("fill","none").each(function(re){var Zt=(((re||[])[0]||{}).trace||{}).line||{},ue=bt||Zt.width||0,Me=Ut||Zt.dash||"";u.select(this).call(r.stroke,vt||Zt.color).call(l.dashLine,Me,ue)})},l.dashLine=function(mt,bt,vt){vt=+vt||0,bt=l.dashStyle(bt,vt),mt.style({"stroke-dasharray":bt,"stroke-width":vt+"px"})},l.dashStyle=function(mt,bt){bt=+bt||1;var vt=Math.max(bt,3);return mt==="solid"?mt="":mt==="dot"?mt=vt+"px,"+vt+"px":mt==="dash"?mt=3*vt+"px,"+3*vt+"px":mt==="longdash"?mt=5*vt+"px,"+5*vt+"px":mt==="dashdot"?mt=3*vt+"px,"+vt+"px,"+vt+"px,"+vt+"px":mt==="longdashdot"&&(mt=5*vt+"px,"+2*vt+"px,"+vt+"px,"+2*vt+"px"),mt};function M(mt,bt,vt,Ut){var re=bt.fillpattern,Zt=bt.fillgradient,ue=l.getPatternAttr,Me=re&&(ue(re.shape,0,"")||ue(re.path,0,""));if(Me){var Ce=ue(re.bgcolor,0,null),We=ue(re.fgcolor,0,null),qe=re.fgopacity,vr=ue(re.size,0,8),_r=ue(re.solidity,0,.3),er=bt.uid;l.pattern(mt,"point",vt,er,Me,vr,_r,void 0,re.fillmode,Ce,We,qe)}else if(Zt&&Zt.type!=="none"){var Mr=Zt.type,Ir="scatterfill-"+bt.uid;if(Ut&&(Ir="legendfill-"+bt.uid),!Ut&&(Zt.start!==void 0||Zt.stop!==void 0)){var de,Dt;Mr==="horizontal"?(de={x:Zt.start,y:0},Dt={x:Zt.stop,y:0}):Mr==="vertical"&&(de={x:0,y:Zt.start},Dt={x:0,y:Zt.stop}),de.x=bt._xA.c2p(de.x===void 0?bt._extremes.x.min[0].val:de.x,!0),de.y=bt._yA.c2p(de.y===void 0?bt._extremes.y.min[0].val:de.y,!0),Dt.x=bt._xA.c2p(Dt.x===void 0?bt._extremes.x.max[0].val:Dt.x,!0),Dt.y=bt._yA.c2p(Dt.y===void 0?bt._extremes.y.max[0].val:Dt.y,!0),mt.call(L,vt,Ir,"linear",Zt.colorscale,"fill",de,Dt,!0,!1)}else Mr==="horizontal"&&(Mr=Mr+"reversed"),mt.call(l.gradient,vt,Ir,Mr,Zt.colorscale,"fill")}else bt.fillcolor&&mt.call(r.fill,bt.fillcolor)}l.singleFillStyle=function(mt,bt){var vt=u.select(mt.node()),Ut=vt.data(),re=((Ut[0]||[])[0]||{}).trace||{};M(mt,re,bt,!1)},l.fillGroupStyle=function(mt,bt,vt){mt.style("stroke-width",0).each(function(Ut){var re=u.select(this);Ut[0].trace&&M(re,Ut[0].trace,bt,vt)})};var T=qT();l.symbolNames=[],l.symbolFuncs=[],l.symbolBackOffs=[],l.symbolNeedLines={},l.symbolNoDot={},l.symbolNoFill={},l.symbolList=[],Object.keys(T).forEach(function(mt){var bt=T[mt],vt=bt.n;l.symbolList.push(vt,String(vt),mt,vt+100,String(vt+100),mt+"-open"),l.symbolNames[vt]=mt,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),mt+"-dot",vt+300,String(vt+300),mt+"-open-dot"),bt.noFill&&(l.symbolNoFill[vt]=!0)});var c=l.symbolNames.length,h="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";l.symbolNumber=function(mt){if(A(mt))mt=+mt;else if(typeof mt=="string"){var bt=0;mt.indexOf("-open")>0&&(bt=100,mt=mt.replace("-open","")),mt.indexOf("-dot")>0&&(bt+=200,mt=mt.replace("-dot","")),mt=l.symbolNames.indexOf(mt),mt>=0&&(mt+=bt)}return mt%100>=c||mt>=400?0:Math.floor(Math.max(mt,0))};function b(mt,bt,vt,Ut){var re=mt%100;return l.symbolFuncs[re](bt,vt,Ut)+(mt>=200?h:"")}var _=E("~f"),P={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(mt,bt,vt,Ut,re,Zt){var ue=P[Ut];return L(mt,bt,vt,ue.type,re,Zt,ue.start,ue.stop,!1,ue.reversed)};function L(mt,bt,vt,Ut,re,Zt,ue,Me,Ce,We){var qe=re.length,vr;Ut==="linear"?vr={node:"linearGradient",attrs:{x1:ue.x,y1:ue.y,x2:Me.x,y2:Me.y,gradientUnits:Ce?"userSpaceOnUse":"objectBoundingBox"},reversed:We}:Ut==="radial"&&(vr={node:"radialGradient",reversed:We});for(var _r=new Array(qe),er=0;er<qe;er++)vr.reversed?_r[qe-1-er]=[_((1-re[er][0])*100),re[er][1]]:_r[er]=[_(re[er][0]*100),re[er][1]];var Mr=bt._fullLayout,Ir="g"+Mr._uid+"-"+vt,de=Mr._defs.select(".gradients").selectAll("#"+Ir).data([Ut+_r.join(";")],d.identity);de.exit().remove(),de.enter().append(vr.node).each(function(){var Dt=u.select(this);vr.attrs&&Dt.attr(vr.attrs),Dt.attr("id",Ir);var qt=Dt.selectAll("stop").data(_r);qt.exit().remove(),qt.enter().append("stop"),qt.each(function(_t){var lt=t(_t[1]);u.select(this).attr({offset:_t[0]+"%","stop-color":r.tinyRGB(lt),"stop-opacity":lt.getAlpha()})})}),mt.style(Zt,ut(Ir,bt)).style(Zt+"-opacity",null),mt.classed("gradient_filled",!0)}l.pattern=function(mt,bt,vt,Ut,re,Zt,ue,Me,Ce,We,qe,vr){var _r=bt==="legend";Me&&(Ce==="overlay"?(We=Me,qe=r.contrast(We)):(We=void 0,qe=Me));var er=vt._fullLayout,Mr="p"+er._uid+"-"+Ut,Ir,de,Dt=function(ir,ar,Ye,Er,pn){return Er+(pn-Er)*(ir-ar)/(Ye-ar)},qt,_t,lt,yt,St={},Ht=t(qe),Yt=r.tinyRGB(Ht),se=Ht.getAlpha(),ke=vr*se;switch(re){case"/":Ir=Zt*Math.sqrt(2),de=Zt*Math.sqrt(2),qt="M-"+Ir/4+","+de/4+"l"+Ir/2+",-"+de/2+"M0,"+de+"L"+Ir+",0M"+Ir/4*3+","+de/4*5+"l"+Ir/2+",-"+de/2,_t=ue*Zt,yt="path",St={d:qt,opacity:ke,stroke:Yt,"stroke-width":_t+"px"};break;case"\\":Ir=Zt*Math.sqrt(2),de=Zt*Math.sqrt(2),qt="M"+Ir/4*3+",-"+de/4+"l"+Ir/2+","+de/2+"M0,0L"+Ir+","+de+"M-"+Ir/4+","+de/4*3+"l"+Ir/2+","+de/2,_t=ue*Zt,yt="path",St={d:qt,opacity:ke,stroke:Yt,"stroke-width":_t+"px"};break;case"x":Ir=Zt*Math.sqrt(2),de=Zt*Math.sqrt(2),qt="M-"+Ir/4+","+de/4+"l"+Ir/2+",-"+de/2+"M0,"+de+"L"+Ir+",0M"+Ir/4*3+","+de/4*5+"l"+Ir/2+",-"+de/2+"M"+Ir/4*3+",-"+de/4+"l"+Ir/2+","+de/2+"M0,0L"+Ir+","+de+"M-"+Ir/4+","+de/4*3+"l"+Ir/2+","+de/2,_t=Zt-Zt*Math.sqrt(1-ue),yt="path",St={d:qt,opacity:ke,stroke:Yt,"stroke-width":_t+"px"};break;case"|":Ir=Zt,de=Zt,yt="path",qt="M"+Ir/2+",0L"+Ir/2+","+de,_t=ue*Zt,yt="path",St={d:qt,opacity:ke,stroke:Yt,"stroke-width":_t+"px"};break;case"-":Ir=Zt,de=Zt,yt="path",qt="M0,"+de/2+"L"+Ir+","+de/2,_t=ue*Zt,yt="path",St={d:qt,opacity:ke,stroke:Yt,"stroke-width":_t+"px"};break;case"+":Ir=Zt,de=Zt,yt="path",qt="M"+Ir/2+",0L"+Ir/2+","+de+"M0,"+de/2+"L"+Ir+","+de/2,_t=Zt-Zt*Math.sqrt(1-ue),yt="path",St={d:qt,opacity:ke,stroke:Yt,"stroke-width":_t+"px"};break;case".":Ir=Zt,de=Zt,ue<Math.PI/4?lt=Math.sqrt(ue*Zt*Zt/Math.PI):lt=Dt(ue,Math.PI/4,1,Zt/2,Zt/Math.sqrt(2)),yt="circle",St={cx:Ir/2,cy:de/2,r:lt,opacity:ke,fill:Yt};break;default:Ir=Zt,de=Zt,yt="path",St={d:re,opacity:ke,fill:Yt};break}var Ee=[re||"noSh",We||"noBg",qe||"noFg",Zt,ue].join(";"),Ue=er._defs.select(".patterns").selectAll("#"+Mr).data([Ee],d.identity);Ue.exit().remove(),Ue.enter().append("pattern").each(function(){var ir=u.select(this);if(ir.attr({id:Mr,width:Ir+"px",height:de+"px",patternUnits:"userSpaceOnUse",patternTransform:_r?"scale(0.8)":""}),We){var ar=t(We),Ye=r.tinyRGB(ar),Er=ar.getAlpha(),pn=ir.selectAll("rect").data([0]);pn.exit().remove(),pn.enter().append("rect").attr({width:Ir+"px",height:de+"px",fill:Ye,"fill-opacity":Er})}var dn=ir.selectAll(yt).data([0]);dn.exit().remove(),dn.enter().append(yt).attr(St)}),mt.style("fill",ut(Mr,vt)).style("fill-opacity",null),mt.classed("pattern_filled",!0)},l.initGradients=function(mt){var bt=mt._fullLayout,vt=d.ensureSingle(bt._defs,"g","gradients");vt.selectAll("linearGradient,radialGradient").remove(),u.select(mt).selectAll(".gradient_filled").classed("gradient_filled",!1)},l.initPatterns=function(mt){var bt=mt._fullLayout,vt=d.ensureSingle(bt._defs,"g","patterns");vt.selectAll("pattern").remove(),u.select(mt).selectAll(".pattern_filled").classed("pattern_filled",!1)},l.getPatternAttr=function(mt,bt,vt){return mt&&d.isArrayOrTypedArray(mt)?bt<mt.length?mt[bt]:vt:mt},l.pointStyle=function(mt,bt,vt,Ut){if(mt.size()){var re=l.makePointStyleFns(bt);mt.each(function(Zt){l.singlePointStyle(Zt,u.select(this),bt,re,vt,Ut)})}},l.singlePointStyle=function(mt,bt,vt,Ut,re,Zt){var ue=vt.marker,Me=ue.line;if(Zt&&Zt.i>=0&&mt.i===void 0&&(mt.i=Zt.i),bt.style("opacity",Ut.selectedOpacityFn?Ut.selectedOpacityFn(mt):mt.mo===void 0?ue.opacity:mt.mo),Ut.ms2mrc){var Ce;mt.ms==="various"||ue.size==="various"?Ce=3:Ce=Ut.ms2mrc(mt.ms),mt.mrc=Ce,Ut.selectedSizeFn&&(Ce=mt.mrc=Ut.selectedSizeFn(mt));var We=l.symbolNumber(mt.mx||ue.symbol)||0;mt.om=We%200>=100;var qe=Kt(mt,vt),vr=it(mt,vt);bt.attr("d",b(We,Ce,qe,vr))}var _r=!1,er,Mr,Ir;if(mt.so)Ir=Me.outlierwidth,Mr=Me.outliercolor,er=ue.outliercolor;else{var de=(Me||{}).width;Ir=(mt.mlw+1||de+1||(mt.trace?(mt.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in mt?Mr=mt.mlcc=Ut.lineScale(mt.mlc):d.isArrayOrTypedArray(Me.color)?Mr=r.defaultLine:Mr=Me.color,d.isArrayOrTypedArray(ue.color)&&(er=r.defaultLine,_r=!0),"mc"in mt?er=mt.mcc=Ut.markerScale(mt.mc):er=ue.color||ue.colors||"rgba(0,0,0,0)",Ut.selectedColorFn&&(er=Ut.selectedColorFn(mt))}if(mt.om)bt.call(r.stroke,er).style({"stroke-width":(Ir||1)+"px",fill:"none"});else{bt.style("stroke-width",(mt.isBlank?0:Ir)+"px");var Dt=ue.gradient,qt=mt.mgt;qt?_r=!0:qt=Dt&&Dt.type,d.isArrayOrTypedArray(qt)&&(qt=qt[0],P[qt]||(qt=0));var _t=ue.pattern,lt=l.getPatternAttr,yt=_t&&(lt(_t.shape,mt.i,"")||lt(_t.path,mt.i,""));if(qt&&qt!=="none"){var St=mt.mgc;St?_r=!0:St=Dt.color;var Ht=vt.uid;_r&&(Ht+="-"+mt.i),l.gradient(bt,re,Ht,qt,[[0,St],[1,er]],"fill")}else if(yt){var Yt=!1,se=_t.fgcolor;!se&&Zt&&Zt.color&&(se=Zt.color,Yt=!0);var ke=lt(se,mt.i,Zt&&Zt.color||null),Ee=lt(_t.bgcolor,mt.i,null),Ue=_t.fgopacity,ir=lt(_t.size,mt.i,8),ar=lt(_t.solidity,mt.i,.3);Yt=Yt||mt.mcc||d.isArrayOrTypedArray(_t.shape)||d.isArrayOrTypedArray(_t.path)||d.isArrayOrTypedArray(_t.bgcolor)||d.isArrayOrTypedArray(_t.fgcolor)||d.isArrayOrTypedArray(_t.size)||d.isArrayOrTypedArray(_t.solidity);var Ye=vt.uid;Yt&&(Ye+="-"+mt.i),l.pattern(bt,"point",re,Ye,yt,ir,ar,mt.mcc,_t.fillmode,Ee,ke,Ue)}else d.isArrayOrTypedArray(er)?r.fill(bt,er[mt.i]):r.fill(bt,er);Ir&&r.stroke(bt,Mr)}},l.makePointStyleFns=function(mt){var bt={},vt=mt.marker;return bt.markerScale=l.tryColorscale(vt,""),bt.lineScale=l.tryColorscale(vt,"line"),e.traceIs(mt,"symbols")&&(bt.ms2mrc=g.isBubble(mt)?m(mt):function(){return(vt.size||6)/2}),mt.selectedpoints&&d.extendFlat(bt,l.makeSelectedPointStyleFns(mt)),bt},l.makeSelectedPointStyleFns=function(mt){var bt={},vt=mt.selected||{},Ut=mt.unselected||{},re=mt.marker||{},Zt=vt.marker||{},ue=Ut.marker||{},Me=re.opacity,Ce=Zt.opacity,We=ue.opacity,qe=Ce!==void 0,vr=We!==void 0;(d.isArrayOrTypedArray(Me)||qe||vr)&&(bt.selectedOpacityFn=function(lt){var yt=lt.mo===void 0?re.opacity:lt.mo;return lt.selected?qe?Ce:yt:vr?We:v*yt});var _r=re.color,er=Zt.color,Mr=ue.color;(er||Mr)&&(bt.selectedColorFn=function(lt){var yt=lt.mcc||_r;return lt.selected?er||yt:Mr||yt});var Ir=re.size,de=Zt.size,Dt=ue.size,qt=de!==void 0,_t=Dt!==void 0;return e.traceIs(mt,"symbols")&&(qt||_t)&&(bt.selectedSizeFn=function(lt){var yt=lt.mrc||Ir/2;return lt.selected?qt?de/2:yt:_t?Dt/2:yt}),bt},l.makeSelectedTextStyleFns=function(mt){var bt={},vt=mt.selected||{},Ut=mt.unselected||{},re=mt.textfont||{},Zt=vt.textfont||{},ue=Ut.textfont||{},Me=re.color,Ce=Zt.color,We=ue.color;return bt.selectedTextColorFn=function(qe){var vr=qe.tc||Me;return qe.selected?Ce||vr:We||(Ce?vr:r.addOpacity(vr,v))},bt},l.selectedPointStyle=function(mt,bt){if(!(!mt.size()||!bt.selectedpoints)){var vt=l.makeSelectedPointStyleFns(bt),Ut=bt.marker||{},re=[];vt.selectedOpacityFn&&re.push(function(Zt,ue){Zt.style("opacity",vt.selectedOpacityFn(ue))}),vt.selectedColorFn&&re.push(function(Zt,ue){r.fill(Zt,vt.selectedColorFn(ue))}),vt.selectedSizeFn&&re.push(function(Zt,ue){var Me=ue.mx||Ut.symbol||0,Ce=vt.selectedSizeFn(ue);Zt.attr("d",b(l.symbolNumber(Me),Ce,Kt(ue,bt),it(ue,bt))),ue.mrc2=Ce}),re.length&&mt.each(function(Zt){for(var ue=u.select(this),Me=0;Me<re.length;Me++)re[Me](ue,Zt)})}},l.tryColorscale=function(mt,bt){var vt=bt?d.nestedProperty(mt,bt).get():mt;if(vt){var Ut=vt.color;if((vt.colorscale||vt._colorAx)&&d.isArrayOrTypedArray(Ut))return i.makeColorScaleFuncFromTrace(vt)}return d.identity};var D={start:1,end:-1,middle:0,bottom:1,top:-1};function B(mt,bt,vt,Ut,re){var Zt=u.select(mt.node().parentNode),ue=bt.indexOf("top")!==-1?"top":bt.indexOf("bottom")!==-1?"bottom":"middle",Me=bt.indexOf("left")!==-1?"end":bt.indexOf("right")!==-1?"start":"middle",Ce=Ut?Ut/.8+1:0,We=(o.lineCount(mt)-1)*f+1,qe=D[Me]*Ce,vr=vt*.75+D[ue]*Ce+(D[ue]-1)*We*vt/2;mt.attr("text-anchor",Me),re||Zt.attr("transform",n(qe,vr))}function R(mt,bt){var vt=mt.ts||bt.textfont.size;return A(vt)&&vt>0?vt:0}l.textPointStyle=function(mt,bt,vt){if(mt.size()){var Ut;if(bt.selectedpoints){var re=l.makeSelectedTextStyleFns(bt);Ut=re.selectedTextColorFn}var Zt=bt.texttemplate,ue=vt._fullLayout;mt.each(function(Me){var Ce=u.select(this),We=Zt?d.extractOption(Me,bt,"txt","texttemplate"):d.extractOption(Me,bt,"tx","text");if(!We&&We!==0){Ce.remove();return}if(Zt){var qe=bt._module.formatLabels,vr=qe?qe(Me,bt,ue):{},_r={};w(_r,bt,Me.i),We=d.texttemplateString({data:[_r,Me,bt._meta],fallback:bt.texttemplatefallback,labels:vr,locale:ue._d3locale,template:We})}var er=Me.tp||bt.textposition,Mr=R(Me,bt),Ir=Ut?Ut(Me):Me.tc||bt.textfont.color;Ce.call(l.font,{family:Me.tf||bt.textfont.family,weight:Me.tw||bt.textfont.weight,style:Me.ty||bt.textfont.style,variant:Me.tv||bt.textfont.variant,textcase:Me.tC||bt.textfont.textcase,lineposition:Me.tE||bt.textfont.lineposition,shadow:Me.tS||bt.textfont.shadow,size:Mr,color:Ir}).text(We).call(o.convertToTspans,vt).call(B,er,Mr,Me.mrc)})}},l.selectedTextStyle=function(mt,bt){if(!(!mt.size()||!bt.selectedpoints)){var vt=l.makeSelectedTextStyleFns(bt);mt.each(function(Ut){var re=u.select(this),Zt=vt.selectedTextColorFn(Ut),ue=Ut.tp||bt.textposition,Me=R(Ut,bt);r.fill(re,Zt);var Ce=e.traceIs(bt,"bar-like");B(re,ue,Me,Ut.mrc2||Ut.mrc,Ce)})}};var I=.5;l.smoothopen=function(mt,bt){if(mt.length<3)return"M"+mt.join("L");var vt="M"+mt[0],Ut=[],re;for(re=1;re<mt.length-1;re++)Ut.push(ct(mt[re-1],mt[re],mt[re+1],bt));for(vt+="Q"+Ut[0][0]+" "+mt[1],re=2;re<mt.length-1;re++)vt+="C"+Ut[re-2][1]+" "+Ut[re-1][0]+" "+mt[re];return vt+="Q"+Ut[mt.length-3][1]+" "+mt[mt.length-1],vt},l.smoothclosed=function(mt,bt){if(mt.length<3)return"M"+mt.join("L")+"Z";var vt="M"+mt[0],Ut=mt.length-1,re=[ct(mt[Ut],mt[0],mt[1],bt)],Zt;for(Zt=1;Zt<Ut;Zt++)re.push(ct(mt[Zt-1],mt[Zt],mt[Zt+1],bt));for(re.push(ct(mt[Ut-1],mt[Ut],mt[0],bt)),Zt=1;Zt<=Ut;Zt++)vt+="C"+re[Zt-1][1]+" "+re[Zt][0]+" "+mt[Zt];return vt+="C"+re[Ut][1]+" "+re[0][0]+" "+mt[0]+"Z",vt};var F,N;function j(mt,bt,vt){return vt&&(mt=K(mt)),bt?rt(mt[1]):G(mt[0])}function G(mt){var bt=u.round(mt,2);return F=bt,bt}function rt(mt){var bt=u.round(mt,2);return N=bt,bt}function ct(mt,bt,vt,Ut){var re=mt[0]-bt[0],Zt=mt[1]-bt[1],ue=vt[0]-bt[0],Me=vt[1]-bt[1],Ce=Math.pow(re*re+Zt*Zt,I/2),We=Math.pow(ue*ue+Me*Me,I/2),qe=(We*We*re-Ce*Ce*ue)*Ut,vr=(We*We*Zt-Ce*Ce*Me)*Ut,_r=3*We*(Ce+We),er=3*Ce*(Ce+We);return[[G(bt[0]+(_r&&qe/_r)),rt(bt[1]+(_r&&vr/_r))],[G(bt[0]-(er&&qe/er)),rt(bt[1]-(er&&vr/er))]]}var st={hv:function(mt,bt,vt){return"H"+G(bt[0])+"V"+j(bt,1,vt)},vh:function(mt,bt,vt){return"V"+rt(bt[1])+"H"+j(bt,0,vt)},hvh:function(mt,bt,vt){return"H"+G((mt[0]+bt[0])/2)+"V"+rt(bt[1])+"H"+j(bt,0,vt)},vhv:function(mt,bt,vt){return"V"+rt((mt[1]+bt[1])/2)+"H"+G(bt[0])+"V"+j(bt,1,vt)}},et=function(mt,bt,vt){return"L"+j(bt,0,vt)+","+j(bt,1,vt)};l.steps=function(mt){var bt=st[mt]||et;return function(vt){for(var Ut="M"+G(vt[0][0])+","+rt(vt[0][1]),re=vt.length,Zt=1;Zt<re;Zt++)Ut+=bt(vt[Zt-1],vt[Zt],Zt===re-1);return Ut}};function K(mt,bt){var vt=mt.backoff,Ut=mt.trace,re=mt.d,Zt=mt.i;if(vt&&Ut&&Ut.marker&&Ut.marker.angle%360===0&&Ut.line&&Ut.line.shape!=="spline"){var ue=d.isArrayOrTypedArray(vt),Me=mt,Ce=bt?bt[0]:F||0,We=bt?bt[1]:N||0,qe=Me[0],vr=Me[1],_r=qe-Ce,er=vr-We,Mr=Math.atan2(er,_r),Ir=ue?vt[Zt]:vt;if(Ir==="auto"){var de=Me.i;Ut.type==="scatter"&&de--;var Dt=Me.marker,qt=Dt.symbol;d.isArrayOrTypedArray(qt)&&(qt=qt[de]);var _t=Dt.size;d.isArrayOrTypedArray(_t)&&(_t=_t[de]),Ir=Dt?l.symbolBackOffs[l.symbolNumber(qt)]*_t:0,Ir+=l.getMarkerStandoff(re[de],Ut)||0}var lt=qe-Ir*Math.cos(Mr),yt=vr-Ir*Math.sin(Mr);(lt<=qe&&lt>=Ce||lt>=qe&&lt<=Ce)&&(yt<=vr&&yt>=We||yt>=vr&&yt<=We)&&(mt=[lt,yt])}return mt}l.applyBackoff=K,l.makeTester=function(){var mt=d.ensureSingleById(u.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=d.ensureSingle(mt,"path","js-reference-point",function(vt){vt.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=mt,l.testref=bt},l.savedBBoxes={};var ot=0,X=1e4;l.bBox=function(mt,bt,vt){vt||(vt=Q(mt));var Ut;if(vt){if(Ut=l.savedBBoxes[vt],Ut)return d.extendFlat({},Ut)}else if(mt.childNodes.length===1){var re=mt.childNodes[0];if(vt=Q(re),vt){var Zt=+re.getAttribute("x")||0,ue=+re.getAttribute("y")||0,Me=re.getAttribute("transform");if(!Me){var Ce=l.bBox(re,!1,vt);return Zt&&(Ce.left+=Zt,Ce.right+=Zt),ue&&(Ce.top+=ue,Ce.bottom+=ue),Ce}if(vt+="~"+Zt+"~"+ue+"~"+Me,Ut=l.savedBBoxes[vt],Ut)return d.extendFlat({},Ut)}}var We,qe;bt?We=mt:(qe=l.tester.node(),We=mt.cloneNode(!0),qe.appendChild(We)),u.select(We).attr("transform",null).call(o.positionText,0,0);var vr=We.getBoundingClientRect(),_r=l.testref.node().getBoundingClientRect();bt||qe.removeChild(We);var er={height:vr.height,width:vr.width,left:vr.left-_r.left,top:vr.top-_r.top,right:vr.right-_r.left,bottom:vr.bottom-_r.top};return ot>=X&&(l.savedBBoxes={},ot=0),vt&&(l.savedBBoxes[vt]=er),ot++,d.extendFlat({},er)};function Q(mt){var bt=mt.getAttribute("data-unformatted");if(bt!==null)return bt+mt.getAttribute("data-math")+mt.getAttribute("text-anchor")+mt.getAttribute("style")}l.setClipUrl=function(mt,bt,vt){mt.attr("clip-path",ut(bt,vt))};function ut(mt,bt){if(!mt)return null;var vt=bt._context,Ut=vt._exportedPlot?"":vt._baseUrl||"";return Ut?"url('"+Ut+"#"+mt+"')":"url(#"+mt+")"}l.getTranslate=function(mt){var bt=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,vt=mt.attr?"attr":"getAttribute",Ut=mt[vt]("transform")||"",re=Ut.replace(bt,function(Zt,ue,Me){return[ue,Me].join(" ")}).split(" ");return{x:+re[0]||0,y:+re[1]||0}},l.setTranslate=function(mt,bt,vt){var Ut=/(\btranslate\(.*?\);?)/,re=mt.attr?"attr":"getAttribute",Zt=mt.attr?"attr":"setAttribute",ue=mt[re]("transform")||"";return bt=bt||0,vt=vt||0,ue=ue.replace(Ut,"").trim(),ue+=n(bt,vt),ue=ue.trim(),mt[Zt]("transform",ue),ue},l.getScale=function(mt){var bt=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,vt=mt.attr?"attr":"getAttribute",Ut=mt[vt]("transform")||"",re=Ut.replace(bt,function(Zt,ue,Me){return[ue,Me].join(" ")}).split(" ");return{x:+re[0]||1,y:+re[1]||1}},l.setScale=function(mt,bt,vt){var Ut=/(\bscale\(.*?\);?)/,re=mt.attr?"attr":"getAttribute",Zt=mt.attr?"attr":"setAttribute",ue=mt[re]("transform")||"";return bt=bt||1,vt=vt||1,ue=ue.replace(Ut,"").trim(),ue+="scale("+bt+","+vt+")",ue=ue.trim(),mt[Zt]("transform",ue),ue};var J=/\s*sc.*/;l.setPointGroupScale=function(mt,bt,vt){if(bt=bt||1,vt=vt||1,!!mt){var Ut=bt===1&&vt===1?"":"scale("+bt+","+vt+")";mt.each(function(){var re=(this.getAttribute("transform")||"").replace(J,"");re+=Ut,re=re.trim(),this.setAttribute("transform",re)})}};var q=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(mt,bt,vt){mt&&mt.each(function(){var Ut,re=u.select(this),Zt=re.select("text");if(Zt.node()){var ue=parseFloat(Zt.attr("x")||0),Me=parseFloat(Zt.attr("y")||0),Ce=(re.attr("transform")||"").match(q);bt===1&&vt===1?Ut=[]:Ut=[n(ue,Me),"scale("+bt+","+vt+")",n(-ue,-Me)],Ce&&Ut.push(Ce),re.attr("transform",Ut.join(""))}})};function it(mt,bt){var vt;return mt&&(vt=mt.mf),vt===void 0&&(vt=bt.marker&&bt.marker.standoff||0),!bt._geo&&!bt._xA?-vt:vt}l.getMarkerStandoff=it;var nt=Math.atan2,dt=Math.cos,Tt=Math.sin;function wt(mt,bt){var vt=bt[0],Ut=bt[1];return[vt*dt(mt)-Ut*Tt(mt),vt*Tt(mt)+Ut*dt(mt)]}var It,Ct,Nt,ee,Jt,te;function Kt(mt,bt){var vt=mt.ma;vt===void 0&&(vt=bt.marker.angle,(!vt||d.isArrayOrTypedArray(vt))&&(vt=0));var Ut,re,Zt=bt.marker.angleref;if(Zt==="previous"||Zt==="north"){if(bt._geo){var ue=bt._geo.project(mt.lonlat);Ut=ue[0],re=ue[1]}else{var Me=bt._xA,Ce=bt._yA;if(Me&&Ce)Ut=Me.c2p(mt.x),re=Ce.c2p(mt.y);else return 90}if(bt._geo){var We=mt.lonlat[0],qe=mt.lonlat[1],vr=bt._geo.project([We,qe+1e-5]),_r=bt._geo.project([We+1e-5,qe]),er=nt(_r[1]-re,_r[0]-Ut),Mr=nt(vr[1]-re,vr[0]-Ut),Ir;if(Zt==="north")Ir=vt/180*Math.PI;else if(Zt==="previous"){var de=We/180*Math.PI,Dt=qe/180*Math.PI,qt=It/180*Math.PI,_t=Ct/180*Math.PI,lt=qt-de,yt=dt(_t)*Tt(lt),St=Tt(_t)*dt(Dt)-dt(_t)*Tt(Dt)*dt(lt);Ir=-nt(yt,St)-Math.PI,It=We,Ct=qe}var Ht=wt(er,[dt(Ir),0]),Yt=wt(Mr,[Tt(Ir),0]);vt=nt(Ht[1]+Yt[1],Ht[0]+Yt[0])/Math.PI*180,Zt==="previous"&&!(te===bt.uid&&mt.i===Jt+1)&&(vt=null)}if(Zt==="previous"&&!bt._geo)if(te===bt.uid&&mt.i===Jt+1&&A(Ut)&&A(re)){var se=Ut-Nt,ke=re-ee,Ee=bt.line&&bt.line.shape||"",Ue=Ee.slice(Ee.length-1);Ue==="h"&&(ke=0),Ue==="v"&&(se=0),vt+=nt(ke,se)/Math.PI*180+90}else vt=null}return Nt=Ut,ee=re,Jt=mt.i,te=bt.uid,vt}l.getMarkerAngle=Kt}),o0=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Uu(),A=ji(),t=Xr(),e=t.strTranslate,r=Eo(),i=Pi(),n=Dl(),o=xd(),a=mf().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,v=1.6;function g(m,w,l){var x=m._fullLayout,y=l.propContainer,S=l.propName,k=l.placeholder,M=l.traceIndex,T=l.avoid||{},c=l.attributes,h=l.transform,b=l.containerGroup,_=1,P=y.title,L=(P&&P.text?P.text:"").trim(),D=!1,B=P&&P.font?P.font:{},R=B.family,I=B.size,F=B.color,N=B.weight,j=B.style,G=B.variant,rt=B.textcase,ct=B.lineposition,st=B.shadow,et=l.subtitlePropName,K=!!et,ot=l.subtitlePlaceholder,X=(y.title||{}).subtitle||{text:"",font:{}},Q=(X.text||"").trim(),ut=!1,J=1,q=X.font,it=q.family,nt=q.size,dt=q.color,Tt=q.weight,wt=q.style,It=q.variant,Ct=q.textcase,Nt=q.lineposition,ee=q.shadow,Jt;S==="title.text"?Jt="titleText":S.indexOf("axis")!==-1?Jt="axisTitleText":S.indexOf("colorbar")!==-1&&(Jt="colorbarTitleText");var te=m._context.edits[Jt];function Kt(_r,er){return _r===void 0||er===void 0?!1:_r.replace(s," % ")===er.replace(s," % ")}L===""?_=0:Kt(L,k)&&(te||(L=""),_=.2,D=!0),K&&(Q===""?J=0:Kt(Q,ot)&&(te||(Q=""),J=.2,ut=!0)),l._meta?L=t.templateString(L,l._meta):x._meta&&(L=t.templateString(L,x._meta));var mt=L||Q||te,bt;b||(b=t.ensureSingle(x._infolayer,"g","g-"+w),bt=x._hColorbarMoveTitle);var vt=b.selectAll("text."+w).data(mt?[0]:[]);vt.enter().append("text"),vt.text(L).attr("class",w),vt.exit().remove();var Ut=null,re=w+"-subtitle",Zt=Q||te;if(K&&(Ut=b.selectAll("text."+re).data(Zt?[0]:[]),Ut.enter().append("text"),Ut.text(Q).attr("class",re),Ut.exit().remove()),!mt)return b;function ue(_r,er){t.syncOrAsync([Me,Ce],{title:_r,subtitle:er})}function Me(_r){var er=_r.title,Mr=_r.subtitle,Ir;!h&&bt&&(h={}),h?(Ir="",h.rotate&&(Ir+="rotate("+[h.rotate,c.x,c.y]+")"),(h.offset||bt)&&(Ir+=e(0,(h.offset||0)-(bt||0)))):Ir=null,er.attr("transform",Ir);function de(St){if(St){var Ht=u.select(St.node().parentNode).select("."+re);if(!Ht.empty()){var Yt=St.node().getBBox();if(Yt.height){var se=Yt.y+Yt.height+f*nt;Ht.attr("y",se)}}}}if(er.style("opacity",_*i.opacity(F)).call(r.font,{color:i.rgb(F),size:u.round(I,2),family:R,weight:N,style:j,variant:G,textcase:rt,shadow:st,lineposition:ct}).attr(c).call(n.convertToTspans,m,de),Mr&&!Mr.empty()){var Dt=b.select("."+w+"-math-group"),qt=er.node().getBBox(),_t=Dt.node()?Dt.node().getBBox():void 0,lt=_t?_t.y+_t.height+f*nt:qt.y+qt.height+v*nt,yt=t.extendFlat({},c,{y:lt});Mr.attr("transform",Ir),Mr.style("opacity",J*i.opacity(dt)).call(r.font,{color:i.rgb(dt),size:u.round(nt,2),family:it,weight:Tt,style:wt,variant:It,textcase:Ct,shadow:ee,lineposition:Nt}).attr(yt).call(n.convertToTspans,m)}return E.previousPromises(m)}function Ce(_r){var er=_r.title,Mr=u.select(er.node().parentNode);if(T&&T.selection&&T.side&&L){Mr.attr("transform",null);var Ir=a[T.side],de=T.side==="left"||T.side==="top"?-1:1,Dt=d(T.pad)?T.pad:2,qt=r.bBox(Mr.node()),_t={t:0,b:0,l:0,r:0},lt=m._fullLayout._reservedMargin;for(var yt in lt)for(var St in lt[yt]){var Ht=lt[yt][St];_t[St]=Math.max(_t[St],Ht)}var Yt={left:_t.l,top:_t.t,right:x.width-_t.r,bottom:x.height-_t.b},se=T.maxShift||de*(Yt[T.side]-qt[T.side]),ke=0;if(se<0)ke=se;else{var Ee=T.offsetLeft||0,Ue=T.offsetTop||0;qt.left-=Ee,qt.right-=Ee,qt.top-=Ue,qt.bottom-=Ue,T.selection.each(function(){var ar=r.bBox(this);t.bBoxIntersect(qt,ar,Dt)&&(ke=Math.max(ke,de*(ar[T.side]-qt[Ir])+Dt))}),ke=Math.min(se,ke),y._titleScoot=Math.abs(ke)}if(ke>0||se<0){var ir={left:[-ke,0],right:[ke,0],top:[0,-ke],bottom:[0,ke]}[T.side];Mr.attr("transform",e(ir[0],ir[1]))}}}vt.call(ue,Ut);function We(_r,er){_r.text(er).on("mouseover.opacity",function(){u.select(this).transition().duration(o.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){u.select(this).transition().duration(o.HIDE_PLACEHOLDER).style("opacity",0)})}if(te&&(L?vt.on(".opacity",null):(We(vt,k),D=!0),vt.call(n.makeEditable,{gd:m}).on("edit",function(_r){M!==void 0?A.call("_guiRestyle",m,S,_r,M):A.call("_guiRelayout",m,S,_r)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ue)}).on("input",function(_r){this.text(_r||" ").call(n.positionText,c.x,c.y)}),K)){if(K&&!L){var qe=vt.node().getBBox(),vr=qe.y+qe.height+v*nt;Ut.attr("y",vr)}Q?Ut.on(".opacity",null):(We(Ut,ot),ut=!0),Ut.call(n.makeEditable,{gd:m}).on("edit",function(_r){A.call("_guiRelayout",m,"title.subtitle.text",_r)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ue)}).on("input",function(_r){this.text(_r||" ").call(n.positionText,Ut.attr("x"),Ut.attr("y"))})}return vt.classed("js-placeholder",D),Ut&&!Ut.empty()&&Ut.classed("js-placeholder",ut),b}V.exports={draw:g,SUBTITLE_PADDING_EM:v,SUBTITLE_PADDING_MATHJAX_EM:f}}),mp=Vt((Z,V)=>{var u=Ni(),d=cm().utcFormat,E=Xr(),A=E.numberFormat,t=Lo(),e=E.cleanNumber,r=E.ms2DateTime,i=E.dateTime2ms,n=E.ensureNumber,o=E.isArrayOrTypedArray,a=ks(),s=a.FP_SAFE,f=a.BADNUM,v=a.LOG_CLIP,g=a.ONEWEEK,m=a.ONEDAY,w=a.ONEHOUR,l=a.ONEMIN,x=a.ONESEC,y=cc(),S=Af(),k=S.HOUR_PATTERN,M=S.WEEKDAY_PATTERN;function T(h){return Math.pow(10,h)}function c(h){return h!=null}V.exports=function(h,b){b=b||{};var _=h._id||"x",P=_.charAt(0);function L(X,Q){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&Q&&h.range&&h.range.length===2){var ut=h.range[0],J=h.range[1];return .5*(ut+J-2*v*Math.abs(ut-J))}else return f}function D(X,Q,ut,J){if((J||{}).msUTC&&t(X))return+X;var q=i(X,ut||h.calendar);if(q===f)if(t(X)){X=+X;var it=Math.floor(E.mod(X+.05,1)*10),nt=Math.round(X-it/10);q=i(new Date(nt))+it/10}else return f;return q}function B(X,Q,ut){return r(X,Q,ut||h.calendar)}function R(X){return h._categories[Math.round(X)]}function I(X){if(c(X)){if(h._categoriesMap===void 0&&(h._categoriesMap={}),h._categoriesMap[X]!==void 0)return h._categoriesMap[X];h._categories.push(typeof X=="number"?String(X):X);var Q=h._categories.length-1;return h._categoriesMap[X]=Q,Q}return f}function F(X,Q){for(var ut=new Array(Q),J=0;J<Q;J++){var q=(X[0]||[])[J],it=(X[1]||[])[J];ut[J]=N([q,it])}return ut}function N(X){if(h._categoriesMap)return h._categoriesMap[X]}function j(X){var Q=N(X);if(Q!==void 0)return Q;if(t(X))return+X}function G(X){return t(X)?+X:N(X)}function rt(X,Q,ut){return u.round(ut+Q*X,2)}function ct(X,Q,ut){return(X-ut)/Q}var st=function(X){return t(X)?rt(X,h._m,h._b):f},et=function(X){return ct(X,h._m,h._b)};if(h.rangebreaks){var K=P==="y";st=function(X){if(!t(X))return f;var Q=h._rangebreaks.length;if(!Q)return rt(X,h._m,h._b);var ut=K;h.range[0]>h.range[1]&&(ut=!ut);for(var J=ut?-1:1,q=J*X,it=0,nt=0;nt<Q;nt++){var dt=J*h._rangebreaks[nt].min,Tt=J*h._rangebreaks[nt].max;if(q<dt)break;if(q>Tt)it=nt+1;else{it=q<(dt+Tt)/2?nt:nt+1;break}}var wt=h._B[it]||0;return isFinite(wt)?rt(X,h._m2,wt):0},et=function(X){var Q=h._rangebreaks.length;if(!Q)return ct(X,h._m,h._b);for(var ut=0,J=0;J<Q&&!(X<h._rangebreaks[J].pmin);J++)X>h._rangebreaks[J].pmax&&(ut=J+1);return ct(X,h._m2,h._B[ut])}}h.c2l=h.type==="log"?L:n,h.l2c=h.type==="log"?T:n,h.l2p=st,h.p2l=et,h.c2p=h.type==="log"?function(X,Q){return st(L(X,Q))}:st,h.p2c=h.type==="log"?function(X){return T(et(X))}:et,["linear","-"].indexOf(h.type)!==-1?(h.d2r=h.r2d=h.d2c=h.r2c=h.d2l=h.r2l=e,h.c2d=h.c2r=h.l2d=h.l2r=n,h.d2p=h.r2p=function(X){return h.l2p(e(X))},h.p2d=h.p2r=et,h.cleanPos=n):h.type==="log"?(h.d2r=h.d2l=function(X,Q){return L(e(X),Q)},h.r2d=h.r2c=function(X){return T(e(X))},h.d2c=h.r2l=e,h.c2d=h.l2r=n,h.c2r=L,h.l2d=T,h.d2p=function(X,Q){return h.l2p(h.d2r(X,Q))},h.p2d=function(X){return T(et(X))},h.r2p=function(X){return h.l2p(e(X))},h.p2r=et,h.cleanPos=n):h.type==="date"?(h.d2r=h.r2d=E.identity,h.d2c=h.r2c=h.d2l=h.r2l=D,h.c2d=h.c2r=h.l2d=h.l2r=B,h.d2p=h.r2p=function(X,Q,ut){return h.l2p(D(X,0,ut))},h.p2d=h.p2r=function(X,Q,ut){return B(et(X),Q,ut)},h.cleanPos=function(X){return E.cleanDate(X,f,h.calendar)}):h.type==="category"?(h.d2c=h.d2l=I,h.r2d=h.c2d=h.l2d=R,h.d2r=h.d2l_noadd=j,h.r2c=function(X){var Q=G(X);return Q!==void 0?Q:h.fraction2r(.5)},h.l2r=h.c2r=n,h.r2l=G,h.d2p=function(X){return h.l2p(h.r2c(X))},h.p2d=function(X){return R(et(X))},h.r2p=h.d2p,h.p2r=et,h.cleanPos=function(X){return typeof X=="string"&&X!==""?X:n(X)}):h.type==="multicategory"&&(h.r2d=h.c2d=h.l2d=R,h.d2r=h.d2l_noadd=j,h.r2c=function(X){var Q=j(X);return Q!==void 0?Q:h.fraction2r(.5)},h.r2c_just_indices=N,h.l2r=h.c2r=n,h.r2l=j,h.d2p=function(X){return h.l2p(h.r2c(X))},h.p2d=function(X){return R(et(X))},h.r2p=h.d2p,h.p2r=et,h.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:n(X)},h.setupMultiCategory=function(X){var Q=h._traceIndices,ut,J,q=h._matchGroup;if(q&&h._categories.length===0){for(var it in q)if(it!==_){var nt=b[y.id2name(it)];Q=Q.concat(nt._traceIndices)}}var dt=[[0,{}],[0,{}]],Tt=[];for(ut=0;ut<Q.length;ut++){var wt=X[Q[ut]];if(P in wt){var It=wt[P],Ct=wt._length||E.minRowLength(It);if(o(It[0])&&o(It[1]))for(J=0;J<Ct;J++){var Nt=It[0][J],ee=It[1][J];c(Nt)&&c(ee)&&(Tt.push([Nt,ee]),Nt in dt[0][1]||(dt[0][1][Nt]=dt[0][0]++),ee in dt[1][1]||(dt[1][1][ee]=dt[1][0]++))}}}for(Tt.sort(function(Jt,te){var Kt=dt[0][1],mt=Kt[Jt[0]]-Kt[te[0]];if(mt)return mt;var bt=dt[1][1];return bt[Jt[1]]-bt[te[1]]}),ut=0;ut<Tt.length;ut++)I(Tt[ut])}),h.fraction2r=function(X){var Q=h.r2l(h.range[0]),ut=h.r2l(h.range[1]);return h.l2r(Q+X*(ut-Q))},h.r2fraction=function(X){var Q=h.r2l(h.range[0]),ut=h.r2l(h.range[1]);return(h.r2l(X)-Q)/(ut-Q)},h.limitRange=function(X){var Q=h.minallowed,ut=h.maxallowed;if(!(Q===void 0&&ut===void 0)){X||(X="range");var J=E.nestedProperty(h,X).get(),q=E.simpleMap(J,h.r2l),it=q[1]<q[0];it&&q.reverse();var nt=E.simpleMap([Q,ut],h.r2l);if(Q!==void 0&&q[0]<nt[0]&&(J[it?1:0]=Q),ut!==void 0&&q[1]>nt[1]&&(J[it?0:1]=ut),J[0]===J[1]){var dt=h.l2r(Q),Tt=h.l2r(ut);if(Q!==void 0){var wt=dt+1;ut!==void 0&&(wt=Math.min(wt,Tt)),J[it?1:0]=wt}if(ut!==void 0){var It=Tt+1;Q!==void 0&&(It=Math.max(It,dt)),J[it?0:1]=It}}}},h.cleanRange=function(X,Q){h._cleanRange(X,Q),h.limitRange(X)},h._cleanRange=function(X,Q){Q||(Q={}),X||(X="range");var ut=E.nestedProperty(h,X).get(),J,q;if(h.type==="date"?q=E.dfltRange(h.calendar):P==="y"?q=S.DFLTRANGEY:h._name==="realaxis"?q=[0,1]:q=Q.dfltRange||S.DFLTRANGEX,q=q.slice(),(h.rangemode==="tozero"||h.rangemode==="nonnegative")&&(q[0]=0),!ut||ut.length!==2){E.nestedProperty(h,X).set(q);return}var it=ut[0]===null,nt=ut[1]===null;for(h.type==="date"&&!h.autorange&&(ut[0]=E.cleanDate(ut[0],f,h.calendar),ut[1]=E.cleanDate(ut[1],f,h.calendar)),J=0;J<2;J++)if(h.type==="date"){if(!E.isDateTime(ut[J],h.calendar)){h[X]=q;break}if(h.r2l(ut[0])===h.r2l(ut[1])){var dt=E.constrain(h.r2l(ut[0]),E.MIN_MS+1e3,E.MAX_MS-1e3);ut[0]=h.l2r(dt-1e3),ut[1]=h.l2r(dt+1e3);break}}else{if(!t(ut[J]))if(!(it||nt)&&t(ut[1-J]))ut[J]=ut[1-J]*(J?10:.1);else{h[X]=q;break}if(ut[J]<-s?ut[J]=-s:ut[J]>s&&(ut[J]=s),ut[0]===ut[1]){var Tt=Math.max(1,Math.abs(ut[0]*1e-6));ut[0]-=Tt,ut[1]+=Tt}}},h.setScale=function(X){var Q=b._size;if(h.overlaying){var ut=y.getFromId({_fullLayout:b},h.overlaying);h.domain=ut.domain}var J=X&&h._r?"_r":"range",q=h.calendar;h.cleanRange(J);var it=h.r2l(h[J][0],q),nt=h.r2l(h[J][1],q),dt=P==="y";if(dt?(h._offset=Q.t+(1-h.domain[1])*Q.h,h._length=Q.h*(h.domain[1]-h.domain[0]),h._m=h._length/(it-nt),h._b=-h._m*nt):(h._offset=Q.l+h.domain[0]*Q.w,h._length=Q.w*(h.domain[1]-h.domain[0]),h._m=h._length/(nt-it),h._b=-h._m*it),h._rangebreaks=[],h._lBreaks=0,h._m2=0,h._B=[],h.rangebreaks){var Tt,wt;if(h._rangebreaks=h.locateBreaks(Math.min(it,nt),Math.max(it,nt)),h._rangebreaks.length){for(Tt=0;Tt<h._rangebreaks.length;Tt++)wt=h._rangebreaks[Tt],h._lBreaks+=Math.abs(wt.max-wt.min);var It=dt;it>nt&&(It=!It),It&&h._rangebreaks.reverse();var Ct=It?-1:1;for(h._m2=Ct*h._length/(Math.abs(nt-it)-h._lBreaks),h._B.push(-h._m2*(dt?nt:it)),Tt=0;Tt<h._rangebreaks.length;Tt++)wt=h._rangebreaks[Tt],h._B.push(h._B[h._B.length-1]-Ct*h._m2*(wt.max-wt.min));for(Tt=0;Tt<h._rangebreaks.length;Tt++)wt=h._rangebreaks[Tt],wt.pmin=st(wt.min),wt.pmax=st(wt.max)}}if(!isFinite(h._m)||!isFinite(h._b)||h._length<0)throw b._replotting=!1,new Error("Something went wrong with axis scaling")},h.maskBreaks=function(X){var Q=h.rangebreaks||[],ut,J,q,it,nt;Q._cachedPatterns||(Q._cachedPatterns=Q.map(function(Kt){return Kt.enabled&&Kt.bounds?E.simpleMap(Kt.bounds,Kt.pattern?e:h.d2c):null})),Q._cachedValues||(Q._cachedValues=Q.map(function(Kt){return Kt.enabled&&Kt.values?E.simpleMap(Kt.values,h.d2c).sort(E.sorterAsc):null}));for(var dt=0;dt<Q.length;dt++){var Tt=Q[dt];if(Tt.enabled){if(Tt.bounds){var wt=Tt.pattern;switch(ut=Q._cachedPatterns[dt],J=ut[0],q=ut[1],wt){case M:nt=new Date(X),it=nt.getUTCDay(),J>q&&(q+=7,it<J&&(it+=7));break;case k:nt=new Date(X);var It=nt.getUTCHours(),Ct=nt.getUTCMinutes(),Nt=nt.getUTCSeconds(),ee=nt.getUTCMilliseconds();it=It+(Ct/60+Nt/3600+ee/36e5),J>q&&(q+=24,it<J&&(it+=24));break;case"":it=X;break}if(it>=J&&it<q)return f}else for(var Jt=Q._cachedValues[dt],te=0;te<Jt.length;te++)if(J=Jt[te],q=J+Tt.dvalue,X>=J&&X<q)return f}}return X},h.locateBreaks=function(X,Q){var ut,J,q,it,nt=[];if(!h.rangebreaks)return nt;var dt=h.rangebreaks.slice().sort(function(bt,vt){return bt.pattern===M&&vt.pattern===k?-1:vt.pattern===M&&bt.pattern===k?1:0}),Tt=function(bt,vt){if(bt=E.constrain(bt,X,Q),vt=E.constrain(vt,X,Q),bt!==vt){for(var Ut=!0,re=0;re<nt.length;re++){var Zt=nt[re];bt<Zt.max&&vt>=Zt.min&&(bt<Zt.min&&(Zt.min=bt),vt>Zt.max&&(Zt.max=vt),Ut=!1)}Ut&&nt.push({min:bt,max:vt})}};for(ut=0;ut<dt.length;ut++){var wt=dt[ut];if(wt.enabled)if(wt.bounds){var It=X,Ct=Q;wt.pattern&&(It=Math.floor(It)),J=E.simpleMap(wt.bounds,wt.pattern?e:h.r2l),q=J[0],it=J[1];var Nt=new Date(It),ee,Jt;switch(wt.pattern){case M:Jt=g,ee=((it<q?7:0)+(it-q))*m,It+=q*m-(Nt.getUTCDay()*m+Nt.getUTCHours()*w+Nt.getUTCMinutes()*l+Nt.getUTCSeconds()*x+Nt.getUTCMilliseconds());break;case k:Jt=m,ee=((it<q?24:0)+(it-q))*w,It+=q*w-(Nt.getUTCHours()*w+Nt.getUTCMinutes()*l+Nt.getUTCSeconds()*x+Nt.getUTCMilliseconds());break;default:It=Math.min(J[0],J[1]),Ct=Math.max(J[0],J[1]),Jt=Ct-It,ee=Jt}for(var te=It;te<Ct;te+=Jt)Tt(te,te+ee)}else for(var Kt=E.simpleMap(wt.values,h.d2c),mt=0;mt<Kt.length;mt++)q=Kt[mt],it=q+wt.dvalue,Tt(q,it)}return nt.sort(function(bt,vt){return bt.min-vt.min}),nt},h.makeCalcdata=function(X,Q,ut){var J,q,it,nt,dt=h.type,Tt=dt==="date"&&X[Q+"calendar"];if(Q in X){if(J=X[Q],nt=X._length||E.minRowLength(J),E.isTypedArray(J)&&(dt==="linear"||dt==="log")){if(nt===J.length)return J;if(J.subarray)return J.subarray(0,nt)}if(dt==="multicategory")return F(J,nt);for(q=new Array(nt),it=0;it<nt;it++)q[it]=h.d2c(J[it],0,Tt,ut)}else{var wt=Q+"0"in X?h.d2c(X[Q+"0"],0,Tt):0,It=X["d"+Q]?Number(X["d"+Q]):1;for(J=X[{x:"y",y:"x"}[Q]],nt=X._length||J.length,q=new Array(nt),it=0;it<nt;it++)q[it]=wt+it*It}if(h.rangebreaks)for(it=0;it<nt;it++)q[it]=h.maskBreaks(q[it]);return q},h.isValidRange=function(X,Q){return Array.isArray(X)&&X.length===2&&(Q&&X[0]===null||t(h.r2l(X[0])))&&(Q&&X[1]===null||t(h.r2l(X[1])))},h.getAutorangeDflt=function(X,Q){var ut=!h.isValidRange(X,"nullOk");return ut&&Q&&Q.reverseDflt?ut="reversed":X&&(X[0]===null&&X[1]===null?ut=!0:X[0]===null&&X[1]!==null?ut="min":X[0]!==null&&X[1]===null&&(ut="max")),ut},h.isReversed=function(){var X=h.autorange;return X==="reversed"||X==="min reversed"||X==="max reversed"},h.isPtWithinRange=function(X,Q){var ut=h.c2l(X[P],null,Q),J=h.r2l(h.range[0]),q=h.r2l(h.range[1]);return J<q?J<=ut&&ut<=q:q<=ut&&ut<=J},h._emptyCategories=function(){h._categories=[],h._categoriesMap={}},h.clearCalc=function(){var X=h._matchGroup;if(X){var Q=null,ut=null;for(var J in X){var q=b[y.id2name(J)];if(q._categories){Q=q._categories,ut=q._categoriesMap;break}}Q&&ut?(h._categories=Q,h._categoriesMap=ut):h._emptyCategories()}else h._emptyCategories();if(h._initialCategories)for(var it=0;it<h._initialCategories.length;it++)I(h._initialCategories[it])},h.sortByInitialCategories=function(){var X=[];if(h._emptyCategories(),h._initialCategories)for(var Q=0;Q<h._initialCategories.length;Q++)I(h._initialCategories[Q]);X=X.concat(h._traceIndices);var ut=h._matchGroup;for(var J in ut)if(_!==J){var q=b[y.id2name(J)];q._categories=h._categories,q._categoriesMap=h._categoriesMap,X=X.concat(q._traceIndices)}return X};var ot=b._d3locale;h.type==="date"&&(h._dateFormat=ot?ot.timeFormat:d,h._extraFormat=b._extraFormat),h._separators=b.separators,h._numFormat=ot?ot.numberFormat:A,delete h._minDtick,delete h._forceTick0}}),xm=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ks().BADNUM,A=d.isArrayOrTypedArray,t=d.isDateTime,e=d.cleanNumber,r=Math.round;V.exports=function(v,g,m){var w=v,l=m.noMultiCategory;if(A(w)&&!w.length)return"-";if(!l&&f(w))return"multicategory";if(l&&Array.isArray(w[0])){for(var x=[],y=0;y<w.length;y++)if(A(w[y]))for(var S=0;S<w[y].length;S++)x.push(w[y][S]);w=x}if(o(w,g))return"date";var k=m.autotypenumbers!=="strict";return s(w,k)?"category":n(w,k)?"linear":"-"};function i(v,g){return g?u(v):typeof v=="number"}function n(v,g){for(var m=v.length,w=0;w<m;w++)if(i(v[w],g))return!0;return!1}function o(v,g){for(var m=v.length,w=a(m),l=0,x=0,y={},S=0;S<m;S+=w){var k=r(S),M=v[k],T=String(M);y[T]||(y[T]=1,t(M,g)&&l++,u(M)&&x++)}return l>x*2}function a(v){return Math.max(1,(v-1)/1e3)}function s(v,g){for(var m=v.length,w=a(m),l=0,x=0,y={},S=0;S<m;S+=w){var k=r(S),M=v[k],T=String(M);if(!y[T]){y[T]=1;var c=typeof M;c==="boolean"?x++:(g?e(M)!==E:c==="number")?l++:c==="string"&&x++}}return x>l*2}function f(v){return A(v[0])&&A(v[1])}}),Xh=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=ks().FP_SAFE,t=ji(),e=Eo(),r=cc(),i=r.getFromId,n=r.isLinked;V.exports={applyAutorangeOptions:b,getAutoRange:o,makePadFn:s,doAutoRange:m,findExtremes:w,concatExtremes:g};function o(_,P){var L,D,B=[],R=_._fullLayout,I=s(R,P,0),F=s(R,P,1),N=g(_,P),j=N.min,G=N.max;if(j.length===0||G.length===0)return E.simpleMap(P.range,P.r2l);var rt=j[0].val,ct=G[0].val;for(L=1;L<j.length&&rt===ct;L++)rt=Math.min(rt,j[L].val);for(L=1;L<G.length&&rt===ct;L++)ct=Math.max(ct,G[L].val);var st=P.autorange,et=st==="reversed"||st==="min reversed"||st==="max reversed";if(!et&&P.range){var K=E.simpleMap(P.range,P.r2l);et=K[1]<K[0]}P.autorange==="reversed"&&(P.autorange=!0);var ot=P.rangemode,X=ot==="tozero",Q=ot==="nonnegative",ut=P._length,J=ut/10,q=0,it,nt,dt,Tt,wt,It;for(L=0;L<j.length;L++)for(it=j[L],D=0;D<G.length;D++)nt=G[D],It=nt.val-it.val-a(P,it.val,nt.val),It>0&&(wt=ut-I(it)-F(nt),wt>J?It/wt>q&&(dt=it,Tt=nt,q=It/wt):It/ut>q&&(dt={val:it.val,nopad:1},Tt={val:nt.val,nopad:1},q=It/ut));function Ct(Kt,mt){return Math.max(Kt,F(mt))}if(rt===ct){var Nt=rt-1,ee=rt+1;if(X)if(rt===0)B=[0,1];else{var Jt=(rt>0?G:j).reduce(Ct,0),te=rt/(1-Math.min(.5,Jt/ut));B=rt>0?[0,te]:[te,0]}else Q?B=[Math.max(0,Nt),Math.max(1,ee)]:B=[Nt,ee]}else X?(dt.val>=0&&(dt={val:0,nopad:1}),Tt.val<=0&&(Tt={val:0,nopad:1})):Q&&(dt.val-q*I(dt)<0&&(dt={val:0,nopad:1}),Tt.val<=0&&(Tt={val:1,nopad:1})),q=(Tt.val-dt.val-a(P,it.val,nt.val))/(ut-I(dt)-F(Tt)),B=[dt.val-q*I(dt),Tt.val+q*F(Tt)];return B=b(B,P),P.limitRange&&P.limitRange(),et&&B.reverse(),E.simpleMap(B,P.l2r||Number)}function a(_,P,L){var D=0;if(_.rangebreaks)for(var B=_.locateBreaks(P,L),R=0;R<B.length;R++){var I=B[R];D+=I.max-I.min}return D}function s(_,P,L){var D=.05*P._length,B=P._anchorAxis||{};if((P.ticklabelposition||"").indexOf("inside")!==-1||(B.ticklabelposition||"").indexOf("inside")!==-1){var R=P.isReversed();if(!R){var I=E.simpleMap(P.range,P.r2l);R=I[1]<I[0]}R&&(L=!L)}var F=0;return n(_,P._id)||(F=v(_,P,L)),D=Math.max(F,D),P.constrain==="domain"&&P._inputDomain&&(D*=(P._inputDomain[1]-P._inputDomain[0])/(P.domain[1]-P.domain[0])),function(N){return N.nopad?0:N.pad+(N.extrapad?D:F)}}var f=3;function v(_,P,L){var D=0,B=P._id.charAt(0)==="x";for(var R in _._plots){var I=_._plots[R];if(!(P._id!==I.xaxis._id&&P._id!==I.yaxis._id)){var F=(B?I.yaxis:I.xaxis)||{};if((F.ticklabelposition||"").indexOf("inside")!==-1&&(!L&&(F.side==="left"||F.side==="bottom")||L&&(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 ut=u.select(this),J=ut.select(".text-math-group");J.empty()&&(Q.bb=e.bBox(ut.node()))})}for(var st=0;st<F._vals.length;st++){var et=F._vals[st],K=et.bb;if(K){var ot=2*f+K.width,X=2*f+K.height;D=Math.max(D,B?Math.max(ot*j,X*G):Math.max(X*j,ot*G))}}}F.ticks==="inside"&&F.ticklabelposition==="inside"&&(D+=F.ticklen||0)}}}return D}function g(_,P,L){var D=P._id,B=_._fullData,R=_._fullLayout,I=[],F=[],N,j,G;function rt(ot,X){for(N=0;N<X.length;N++){var Q=ot[X[N]],ut=(Q._extremes||{})[D];if(Q.visible===!0&&ut){for(j=0;j<ut.min.length;j++)G=ut.min[j],l(I,G.val,G.pad,{extrapad:G.extrapad});for(j=0;j<ut.max.length;j++)G=ut.max[j],x(F,G.val,G.pad,{extrapad:G.extrapad})}}}if(rt(B,P._traceIndices),rt(R.annotations||[],P._annIndices||[]),rt(R.shapes||[],P._shapeIndices||[]),P._matchGroup&&!L){for(var ct in P._matchGroup)if(ct!==P._id){var st=i(_,ct),et=g(_,st,!0),K=P._length/st._length;for(j=0;j<et.min.length;j++)G=et.min[j],l(I,G.val,G.pad*K,{extrapad:G.extrapad});for(j=0;j<et.max.length;j++)G=et.max[j],x(F,G.val,G.pad*K,{extrapad:G.extrapad})}}return{min:I,max:F}}function m(_,P,L){if(P.setScale(),P.autorange){P.range=L?L.slice():o(_,P),P._r=P.range.slice(),P._rl=E.simpleMap(P._r,P.r2l);var D=P._input,B={};B[P._attr+".range"]=P.range,B[P._attr+".autorange"]=P.autorange,t.call("_storeDirectGUIEdit",_.layout,_._fullLayout._preGUI,B),D.range=P.range.slice(),D.autorange=P.autorange}var R=P._anchorAxis;if(R&&R.rangeslider){var I=R.rangeslider[P._name];I&&I.rangemode==="auto"&&(I.range=o(_,P)),R._input.rangeslider[P._name]=E.extendFlat({},I)}}function w(_,P,L){L||(L={}),_._m||_.setScale();var D=[],B=[],R=P.length,I=L.padded||!1,F=L.tozero&&(_.type==="linear"||_.type==="-"),N=_.type==="log",j=!1,G=L.vpadLinearized||!1,rt,ct,st,et,K,ot,X,Q,ut;function J(Ct){if(Array.isArray(Ct))return j=!0,function(ee){return Math.max(Number(Ct[ee]||0),0)};var Nt=Math.max(Number(Ct||0),0);return function(){return Nt}}var q=J((_._m>0?L.ppadplus:L.ppadminus)||L.ppad||0),it=J((_._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),nt=J(L.vpadplus||L.vpad),dt=J(L.vpadminus||L.vpad);if(!j){if(Q=1/0,ut=-1/0,N)for(rt=0;rt<R;rt++)ct=P[rt],ct<Q&&ct>0&&(Q=ct),ct>ut&&ct<A&&(ut=ct);else for(rt=0;rt<R;rt++)ct=P[rt],ct<Q&&ct>-A&&(Q=ct),ct>ut&&ct<A&&(ut=ct);P=[Q,ut],R=2}var Tt={tozero:F,extrapad:I};function wt(Ct){st=P[Ct],d(st)&&(ot=q(Ct),X=it(Ct),G?(et=_.c2l(st)-dt(Ct),K=_.c2l(st)+nt(Ct)):(Q=st-dt(Ct),ut=st+nt(Ct),N&&Q<ut/10&&(Q=ut/10),et=_.c2l(Q),K=_.c2l(ut)),F&&(et=Math.min(0,et),K=Math.max(0,K)),S(et)&&l(D,et,X,Tt),S(K)&&x(B,K,ot,Tt))}var It=Math.min(6,R);for(rt=0;rt<It;rt++)wt(rt);for(rt=R-1;rt>=It;rt--)wt(rt);return{min:D,max:B,opts:L}}function l(_,P,L,D){y(_,P,L,D,k)}function x(_,P,L,D){y(_,P,L,D,M)}function y(_,P,L,D,B){for(var R=D.tozero,I=D.extrapad,F=!0,N=0;N<_.length&&F;N++){var j=_[N];if(B(j.val,P)&&j.pad>=L&&(j.extrapad||!I)){F=!1;break}else B(P,j.val)&&j.pad<=L&&(I||!j.extrapad)&&(_.splice(N,1),N--)}if(F){var G=R&&P===0;_.push({val:P,pad:G?0:L,extrapad:G?!1:I})}}function S(_){return d(_)&&Math.abs(_)<A}function k(_,P){return _<=P}function M(_,P){return _>=P}function T(_,P){var L=P.autorangeoptions;return L&&L.minallowed!==void 0&&h(P,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&h(P,L.clipmin,L.clipmax)?Math.max(_,P.d2l(L.clipmin)):_}function c(_,P){var L=P.autorangeoptions;return L&&L.maxallowed!==void 0&&h(P,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&h(P,L.clipmin,L.clipmax)?Math.min(_,P.d2l(L.clipmax)):_}function h(_,P,L){return P!==void 0&&L!==void 0?(P=_.d2l(P),L=_.d2l(L),P<L):!0}function b(_,P){if(!P||!P.autorangeoptions)return _;var L=_[0],D=_[1],B=P.autorangeoptions.include;if(B!==void 0){var R=P.d2l(L),I=P.d2l(D);E.isArrayOrTypedArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var N=P.d2l(B[F]);R>=N&&(R=N,L=N),I<=N&&(I=N,D=N)}}return L=T(L,P),D=c(D,P),[L,D]}}),yo=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Uu(),A=ji(),t=Xr(),e=t.strTranslate,r=Dl(),i=o0(),n=Pi(),o=Eo(),a=Pf(),s=ob(),f=ks(),v=f.ONEMAXYEAR,g=f.ONEAVGYEAR,m=f.ONEMINYEAR,w=f.ONEMAXQUARTER,l=f.ONEAVGQUARTER,x=f.ONEMINQUARTER,y=f.ONEMAXMONTH,S=f.ONEAVGMONTH,k=f.ONEMINMONTH,M=f.ONEWEEK,T=f.ONEDAY,c=T/2,h=f.ONEHOUR,b=f.ONEMIN,_=f.ONESEC,P=f.ONEMILLI,L=f.ONEMICROSEC,D=f.MINUS_SIGN,B=f.BADNUM,R={K:"zeroline"},I={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=mf(),ct=rt.MID_SHIFT,st=rt.CAP_SHIFT,et=rt.LINE_SPACING,K=rt.OPPOSITE_SIDE,ot=3,X=V.exports={};X.setConvert=mp();var Q=xm(),ut=cc(),J=ut.idSort,q=ut.isLinked;X.id2name=ut.id2name,X.name2id=ut.name2id,X.cleanId=ut.cleanId,X.list=ut.list,X.listIds=ut.listIds,X.getFromId=ut.getFromId,X.getFromTrace=ut.getFromTrace;var it=Xh();X.getAutoRange=it.getAutoRange,X.findExtremes=it.findExtremes;var nt=1e-4;function dt(ve){var ge=(ve[1]-ve[0])*nt;return[ve[0]-ge,ve[1]+ge]}X.coerceRef=function(ve,ge,dr,br,Tr,mr){var kr=br.charAt(br.length-1),Ur=dr._fullLayout._subplots[kr+"axis"],Or=br+"ref",pe={};return Tr||(Tr=Ur[0]||(typeof mr=="string"?mr:mr[0])),mr||(mr=Tr),Ur=Ur.concat(Ur.map(function(Ke){return Ke+" domain"})),pe[Or]={valType:"enumerated",values:Ur.concat(mr?typeof mr=="string"?[mr]:mr:[]),dflt:Tr},t.coerce(ve,ge,pe,Or)},X.getRefType=function(ve){return ve===void 0?ve:ve==="paper"?"paper":ve==="pixel"?"pixel":/( domain)$/.test(ve)?"domain":"range"},X.coercePosition=function(ve,ge,dr,br,Tr,mr){var kr,Ur,Or=X.getRefType(br);if(Or!=="range")kr=t.ensureNumber,Ur=dr(Tr,mr);else{var pe=X.getFromId(ge,br);mr=pe.fraction2r(mr),Ur=dr(Tr,mr),kr=pe.cleanPos}ve[Tr]=kr(Ur)},X.cleanPosition=function(ve,ge,dr){var br=dr==="paper"||dr==="pixel"?t.ensureNumber:X.getFromId(ge,dr).cleanPos;return br(ve)},X.redrawComponents=function(ve,ge){ge=ge||X.listIds(ve);var dr=ve._fullLayout;function br(Tr,mr,kr,Ur){for(var Or=A.getComponentMethod(Tr,mr),pe={},Ke=0;Ke<ge.length;Ke++)for(var xr=dr[X.id2name(ge[Ke])],Gr=xr[kr],ln=0;ln<Gr.length;ln++){var wn=Gr[ln];if(!pe[wn]&&(Or(ve,wn),pe[wn]=1,Ur))return}}br("annotations","drawOne","_annIndices"),br("shapes","drawOne","_shapeIndices"),br("images","draw","_imgIndices",!0),br("selections","drawOne","_selectionIndices")};var Tt=X.getDataConversions=function(ve,ge,dr,br){var Tr,mr=dr==="x"||dr==="y"||dr==="z"?dr:br;if(t.isArrayOrTypedArray(mr)){if(Tr={type:Q(br,void 0,{autotypenumbers:ve._fullLayout.autotypenumbers}),_categories:[]},X.setConvert(Tr),Tr.type==="category")for(var kr=0;kr<br.length;kr++)Tr.d2c(br[kr])}else Tr=X.getFromTrace(ve,ge,mr);return Tr?{d2c:Tr.d2c,c2d:Tr.c2d}:mr==="ids"?{d2c:It,c2d:It}:{d2c:wt,c2d:wt}};function wt(ve){return+ve}function It(ve){return String(ve)}X.getDataToCoordFunc=function(ve,ge,dr,br){return Tt(ve,ge,dr,br).d2c},X.counterLetter=function(ve){var ge=ve.charAt(0);if(ge==="x")return"y";if(ge==="y")return"x"},X.minDtick=function(ve,ge,dr,br){["log","category","multicategory"].indexOf(ve.type)!==-1||!br?ve._minDtick=0:ve._minDtick===void 0?(ve._minDtick=ge,ve._forceTick0=dr):ve._minDtick&&((ve._minDtick/ge+1e-6)%1<2e-6&&((dr-ve._forceTick0)/ge%1+1.000001)%1<2e-6?(ve._minDtick=ge,ve._forceTick0=dr):((ge/ve._minDtick+1e-6)%1>2e-6||((dr-ve._forceTick0)/ve._minDtick%1+1.000001)%1>2e-6)&&(ve._minDtick=0))},X.saveRangeInitial=function(ve,ge){for(var dr=X.list(ve,"",!0),br=!1,Tr=0;Tr<dr.length;Tr++){var mr=dr[Tr],kr=mr._rangeInitial0===void 0&&mr._rangeInitial1===void 0,Ur=kr||mr.range[0]!==mr._rangeInitial0||mr.range[1]!==mr._rangeInitial1,Or=mr.autorange;(kr&&Or!==!0||ge&&Ur)&&(mr._rangeInitial0=Or==="min"||Or==="max reversed"?void 0:mr.range[0],mr._rangeInitial1=Or==="max"||Or==="min reversed"?void 0:mr.range[1],mr._autorangeInitial=Or,br=!0)}return br},X.saveShowSpikeInitial=function(ve,ge){for(var dr=X.list(ve,"",!0),br=!1,Tr="on",mr=0;mr<dr.length;mr++){var kr=dr[mr],Ur=kr._showSpikeInitial===void 0,Or=Ur||kr.showspikes!==kr._showspikes;(Ur||ge&&Or)&&(kr._showSpikeInitial=kr.showspikes,br=!0),Tr==="on"&&!kr.showspikes&&(Tr="off")}return ve._fullLayout._cartesianSpikesEnabled=Tr,br},X.autoBin=function(ve,ge,dr,br,Tr,mr){var kr=t.aggNums(Math.min,null,ve),Ur=t.aggNums(Math.max,null,ve);if(ge.type==="category"||ge.type==="multicategory")return{start:kr-.5,end:Ur+.5,size:Math.max(1,Math.round(mr)||1),_dataSpan:Ur-kr};Tr||(Tr=ge.calendar);var Or;if(ge.type==="log"?Or={type:"linear",range:[kr,Ur]}:Or={type:ge.type,range:t.simpleMap([kr,Ur],ge.c2r,0,Tr),calendar:Tr},X.setConvert(Or),mr=mr&&s.dtick(mr,Or.type),mr)Or.dtick=mr,Or.tick0=s.tick0(void 0,Or.type,Tr);else{var pe;if(dr)pe=(Ur-kr)/dr;else{var Ke=t.distinctVals(ve),xr=Math.pow(10,Math.floor(Math.log(Ke.minDiff)/Math.LN10)),Gr=xr*t.roundUp(Ke.minDiff/xr,[.9,1.9,4.9,9.9],!0);pe=Math.max(Gr,2*t.stdev(ve)/Math.pow(ve.length,br?.25:.4)),d(pe)||(pe=1)}X.autoTicks(Or,pe)}var ln=Or.dtick,wn=X.tickIncrement(X.tickFirst(Or),ln,"reverse",Tr),rn,Qr;if(typeof ln=="number")wn=Ct(wn,ve,Or,kr,Ur),Qr=1+Math.floor((Ur-wn)/ln),rn=wn+Qr*ln;else for(Or.dtick.charAt(0)==="M"&&(wn=Nt(wn,ve,ln,kr,Tr)),rn=wn,Qr=0;rn<=Ur;)rn=X.tickIncrement(rn,ln,!1,Tr),Qr++;return{start:ge.c2r(wn,0,Tr),end:ge.c2r(rn,0,Tr),size:ln,_dataSpan:Ur-kr}};function Ct(ve,ge,dr,br,Tr){var mr=0,kr=0,Ur=0,Or=0;function pe(ln){return(1+(ln-ve)*100/dr.dtick)%100<2}for(var Ke=0;Ke<ge.length;Ke++)ge[Ke]%1===0?Ur++:d(ge[Ke])||Or++,pe(ge[Ke])&&mr++,pe(ge[Ke]+dr.dtick/2)&&kr++;var xr=ge.length-Or;if(Ur===xr&&dr.type!=="date")dr.dtick<1?ve=br-.5*dr.dtick:(ve-=.5,ve+dr.dtick<br&&(ve+=dr.dtick));else if(kr<xr*.1&&(mr>xr*.3||pe(br)||pe(Tr))){var Gr=dr.dtick/2;ve+=ve+Gr<br?Gr:-Gr}return ve}function Nt(ve,ge,dr,br,Tr){var mr=t.findExactDates(ge,Tr),kr=.8;if(mr.exactDays>kr){var Ur=Number(dr.substr(1));mr.exactYears>kr&&Ur%12===0?ve=X.tickIncrement(ve,"M6","reverse")+T*1.5:mr.exactMonths>kr?ve=X.tickIncrement(ve,"M1","reverse")+T*15.5:ve-=c;var Or=X.tickIncrement(ve,dr);if(Or<=br)return Or}return ve}X.prepMinorTicks=function(ve,ge,dr){if(!ge.minor.dtick){delete ve.dtick;var br=ge.dtick&&d(ge._tmin),Tr;if(br){var mr=X.tickIncrement(ge._tmin,ge.dtick,!0);Tr=[ge._tmin,mr*.99+ge._tmin*.01]}else{var kr=t.simpleMap(ge.range,ge.r2l);Tr=[kr[0],.8*kr[0]+.2*kr[1]]}if(ve.range=t.simpleMap(Tr,ge.l2r),ve._isMinor=!0,X.prepTicks(ve,dr),br){var Ur=d(ge.dtick),Or=d(ve.dtick),pe=Ur?ge.dtick:+ge.dtick.substring(1),Ke=Or?ve.dtick:+ve.dtick.substring(1);Ur&&Or?ee(pe,Ke)?pe===2*M&&Ke===2*T&&(ve.dtick=M):pe===2*M&&Ke===3*T?ve.dtick=M:pe===M&&!(ge._input.minor||{}).nticks?ve.dtick=T:Jt(pe/Ke,2.5)?ve.dtick=pe/2:ve.dtick=pe:String(ge.dtick).charAt(0)==="M"?Or?ve.dtick="M1":ee(pe,Ke)?pe>=12&&Ke===2&&(ve.dtick="M3"):ve.dtick=ge.dtick:String(ve.dtick).charAt(0)==="L"?String(ge.dtick).charAt(0)==="L"?ee(pe,Ke)||(ve.dtick=Jt(pe/Ke,2.5)?ge.dtick/2:ge.dtick):ve.dtick="D1":ve.dtick==="D2"&&+ge.dtick>1&&(ve.dtick=1)}ve.range=ge.range}ge.minor._tick0Init===void 0&&(ve.tick0=ge.tick0)};function ee(ve,ge){return Math.abs((ve/ge+.5)%1-.5)<.001}function Jt(ve,ge){return Math.abs(ve/ge-1)<.001}X.prepTicks=function(ve,ge){var dr=t.simpleMap(ve.range,ve.r2l,void 0,void 0,ge);if(ve.tickmode==="auto"||!ve.dtick){var br=ve.nticks,Tr;br||(ve.type==="category"||ve.type==="multicategory"?(Tr=ve.tickfont?t.bigFont(ve.tickfont.size||12):15,br=ve._length/Tr):(Tr=ve._id.charAt(0)==="y"?40:80,br=t.constrain(ve._length/Tr,4,9)+1),ve._name==="radialaxis"&&(br*=2)),ve.minor&&ve.minor.tickmode!=="array"||ve.tickmode==="array"&&(br*=100),ve._roughDTick=Math.abs(dr[1]-dr[0])/br,X.autoTicks(ve,ve._roughDTick),ve._minDtick>0&&ve.dtick<ve._minDtick*2&&(ve.dtick=ve._minDtick,ve.tick0=ve.l2r(ve._forceTick0))}ve.ticklabelmode==="period"&&Kt(ve),ve.tick0||(ve.tick0=ve.type==="date"?"2000-01-01":0),ve.type==="date"&&ve.dtick<.1&&(ve.dtick=.1),_r(ve)};function te(ve){return+ve.substring(1)}function Kt(ve){var ge;function dr(){return!(d(ve.dtick)||ve.dtick.charAt(0)!=="M")}var br=dr(),Tr=X.getTickFormat(ve);if(Tr){var mr=ve._dtickInit!==ve.dtick;/%[fLQsSMX]/.test(Tr)||(/%[HI]/.test(Tr)?(ge=h,mr&&!br&&ve.dtick<h&&(ve.dtick=h)):/%p/.test(Tr)?(ge=c,mr&&!br&&ve.dtick<c&&(ve.dtick=c)):/%[Aadejuwx]/.test(Tr)?(ge=T,mr&&!br&&ve.dtick<T&&(ve.dtick=T)):/%[UVW]/.test(Tr)?(ge=M,mr&&!br&&ve.dtick<M&&(ve.dtick=M)):/%[Bbm]/.test(Tr)?(ge=S,mr&&(br?te(ve.dtick)<1:ve.dtick<k)&&(ve.dtick="M1")):/%[q]/.test(Tr)?(ge=l,mr&&(br?te(ve.dtick)<3:ve.dtick<x)&&(ve.dtick="M3")):/%[Yy]/.test(Tr)&&(ge=g,mr&&(br?te(ve.dtick)<12:ve.dtick<m)&&(ve.dtick="M12")))}br=dr(),br&&ve.tick0===ve._dowTick0&&(ve.tick0=ve._rawTick0),ve._definedDelta=ge}function mt(ve,ge,dr){for(var br=0;br<ve.length;br++){var Tr=ve[br].value,mr=br,kr=br+1;br<ve.length-1?(mr=br,kr=br+1):br>0?(mr=br-1,kr=br):(mr=br,kr=br);var Ur=ve[mr].value,Or=ve[kr].value,pe=Math.abs(Or-Ur),Ke=dr||pe,xr=0;Ke>=m?pe>=m&&pe<=v?xr=pe:xr=g:dr===l&&Ke>=x?pe>=x&&pe<=w?xr=pe:xr=l:Ke>=k?pe>=k&&pe<=y?xr=pe:xr=S:dr===M&&Ke>=M?xr=M:Ke>=T?xr=T:dr===c&&Ke>=c?xr=c:dr===h&&Ke>=h&&(xr=h);var Gr;xr>=pe&&(xr=pe,Gr=!0);var ln=Tr+xr;if(ge.rangebreaks&&xr>0){for(var wn=84,rn=0,Qr=0;Qr<wn;Qr++){var vn=(Qr+.5)/wn;ge.maskBreaks(Tr*(1-vn)+vn*ln)!==B&&rn++}xr*=rn/wn,xr||(ve[br].drop=!0),Gr&&pe>M&&(xr=pe)}(xr>0||br===0)&&(ve[br].periodX=Tr+xr/2)}}X.calcTicks=function(ve,ge){for(var dr=ve.type,br=ve.calendar,Tr=ve.ticklabelstep,mr=ve.ticklabelmode==="period",kr=ve.range[0]>ve.range[1],Ur=!ve.ticklabelindex||t.isArrayOrTypedArray(ve.ticklabelindex)?ve.ticklabelindex:[ve.ticklabelindex],Or=t.simpleMap(ve.range,ve.r2l,void 0,void 0,ge),pe=Or[1]<Or[0],Ke=Math.min(Or[0],Or[1]),xr=Math.max(Or[0],Or[1]),Gr=Math.max(1e3,ve._length||0),ln=[],wn=[],rn=[],Qr=[],vn=[],Oa=ve.minor&&(ve.minor.ticks||ve.minor.showgrid),Qn=1;Qn>=(Oa?0:1);Qn--){var Qa=!Qn;Qn?(ve._dtickInit=ve.dtick,ve._tick0Init=ve.tick0):(ve.minor._dtickInit=ve.minor.dtick,ve.minor._tick0Init=ve.minor.tick0);var Ja=Qn?ve:t.extendFlat({},ve,ve.minor);if(Qa?X.prepMinorTicks(Ja,ve,ge):X.prepTicks(Ja,ge),Ja.tickmode==="array"){Qn?(rn=[],ln=Ut(ve,!Qa)):(Qr=[],wn=Ut(ve,!Qa));continue}if(Ja.tickmode==="sync"){rn=[],ln=vt(ve);continue}var wi=dt(Or),ci=wi[0],Ti=wi[1],Ra=d(Ja.dtick),Qi=dr==="log"&&!(Ra||Ja.dtick.charAt(0)==="L"),Hi=X.tickFirst(Ja,ge);if(Qn){if(ve._tmin=Hi,Hi<ci!==pe)break;(dr==="category"||dr==="multicategory")&&(Ti=pe?Math.max(-.5,Ti):Math.min(ve._categories.length-.5,Ti))}var Ho=null,Ci=Hi,zo;if(Qn){var qi;Ra?qi=ve.dtick:dr==="date"?typeof ve.dtick=="string"&&ve.dtick.charAt(0)==="M"&&(qi=S*ve.dtick.substring(1)):qi=ve._roughDTick,zo=Math.round((ve.r2l(Ci)-ve.r2l(ve.tick0))/qi)-1}var qo=Ja.dtick;for(Ja.rangebreaks&&Ja._tick0Init!==Ja.tick0&&(Ci=Kn(Ci,ve),pe||(Ci=X.tickIncrement(Ci,qo,!pe,br))),Qn&&mr&&(Ci=X.tickIncrement(Ci,qo,!pe,br),zo--);pe?Ci>=Ti:Ci<=Ti;Ci=X.tickIncrement(Ci,qo,pe,br)){if(Qn&&zo++,Ja.rangebreaks&&!pe){if(Ci<ci)continue;if(Ja.maskBreaks(Ci)===B&&Kn(Ci,Ja)>=xr)break}if(rn.length>Gr||Ci===Ho)break;Ho=Ci;var Po={value:Ci};Qn?(Qi&&Ci!==(Ci|0)&&(Po.simpleLabel=!0),Tr>1&&zo%Tr&&(Po.skipLabel=!0),rn.push(Po)):(Po.minor=!0,Qr.push(Po))}}if(!Qr||Qr.length<2)Ur=!1;else{var hs=(Qr[1].value-Qr[0].value)*(kr?-1:1);Ga(hs,ve.tickformat)||(Ur=!1)}if(!Ur)vn=rn;else{var Gi=rn.concat(Qr);mr&&rn.length&&(Gi=Gi.slice(1)),Gi=Gi.sort(function(Wo,Bi){return Wo.value-Bi.value}).filter(function(Wo,Bi,$s){return Bi===0||Wo.value!==$s[Bi-1].value});var uo=Gi.map(function(Wo,Bi){return Wo.minor===void 0&&!Wo.skipLabel?Bi:null}).filter(function(Wo){return Wo!==null});uo.forEach(function(Wo){Ur.map(function(Bi){var $s=Wo+Bi;$s>=0&&$s<Gi.length&&t.pushUnique(vn,Gi[$s])})})}if(Oa){var yi=ve.minor.ticks==="inside"&&ve.ticks==="outside"||ve.minor.ticks==="outside"&&ve.ticks==="inside";if(!yi){for(var ao=rn.map(function(Wo){return Wo.value}),ts=[],vs=0;vs<Qr.length;vs++){var As=Qr[vs],_o=As.value;if(ao.indexOf(_o)===-1){for(var Da=!1,li=0;!Da&&li<rn.length;li++)1e7+rn[li].value===1e7+_o&&(Da=!0);Da||ts.push(As)}}Qr=ts}}mr&&mt(vn,ve,ve._definedDelta);var wo;if(ve.rangebreaks){var Ms=ve._id.charAt(0)==="y",Di=1;ve.tickmode==="auto"&&(Di=ve.tickfont?ve.tickfont.size:12);var _s=NaN;for(wo=rn.length-1;wo>-1;wo--){if(rn[wo].drop){rn.splice(wo,1);continue}rn[wo].value=Kn(rn[wo].value,ve);var No=ve.c2p(rn[wo].value);(Ms?_s>No-Di:_s<No+Di)?rn.splice(pe?wo+1:wo,1):_s=No}}Nn(ve)&&Math.abs(Or[1]-Or[0])===360&&rn.pop(),ve._tmax=(rn[rn.length-1]||{}).value,ve._prevDateHead="",ve._inCalcTicks=!0;var is,al=function(Wo){Wo.text="",ve._prevDateHead=is};rn=rn.concat(Qr);function ii(Wo,Bi){var $s=X.tickText(Wo,Bi.value,!1,Bi.simpleLabel),fl=Bi.periodX;return fl!==void 0&&($s.periodX=fl,(fl>xr||fl<Ke)&&(fl>xr&&($s.periodX=xr),fl<Ke&&($s.periodX=Ke),al($s))),$s}var io;for(wo=0;wo<rn.length;wo++){var co=rn[wo].minor,Is=rn[wo].value;co?(Ur&&vn.indexOf(rn[wo])!==-1?io=ii(ve,rn[wo]):io={x:Is},io.minor=!0,wn.push(io)):(is=ve._prevDateHead,io=ii(ve,rn[wo]),(rn[wo].skipLabel||Ur&&vn.indexOf(rn[wo])===-1)&&al(io),ln.push(io))}return ln=ln.concat(wn),ve._inCalcTicks=!1,mr&&ln.length&&(ln[0].noTick=!0),ln};function bt(ve,ge){return ve.rangebreaks&&(ge=ge.filter(function(dr){return ve.maskBreaks(dr.x)!==B})),ge}function vt(ve){var ge=ve._mainAxis,dr=[];if(ge._vals){for(var br=0;br<ge._vals.length;br++)if(!ge._vals[br].noTick){var Tr=ge.l2p(ge._vals[br].x),mr=ve.p2l(Tr),kr=X.tickText(ve,mr);ge._vals[br].minor&&(kr.minor=!0,kr.text=""),dr.push(kr)}}return dr=bt(ve,dr),dr}function Ut(ve,ge){var dr=t.simpleMap(ve.range,ve.r2l),br=dt(dr),Tr=Math.min(br[0],br[1]),mr=Math.max(br[0],br[1]),kr=ve.type==="category"?ve.d2l_noadd:ve.d2l;ve.type==="log"&&String(ve.dtick).charAt(0)!=="L"&&(ve.dtick="L"+Math.pow(10,Math.floor(Math.min(ve.range[0],ve.range[1]))-1));for(var Ur=[],Or=0;Or<=1;Or++)if(!(ge!==void 0&&(ge&&Or||ge===!1&&!Or))&&!(Or&&!ve.minor)){var pe=Or?ve.minor.tickvals:ve.tickvals,Ke=Or?[]:ve.ticktext;if(pe){t.isArrayOrTypedArray(Ke)||(Ke=[]);for(var xr=0;xr<pe.length;xr++){var Gr=kr(pe[xr]);if(Gr>Tr&&Gr<mr){var ln=X.tickText(ve,Gr,!1,String(Ke[xr]));Or&&(ln.minor=!0,ln.text=""),Ur.push(ln)}}}}return Ur=bt(ve,Ur),Ur}var re=[2,5,10],Zt=[1,2,3,6,12],ue=[1,2,5,10,15,30],Me=[1,2,3,7,14],Ce=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],We=[-.301,0,.301,.699,1],qe=[15,30,45,90,180];function vr(ve,ge,dr){return ge*t.roundUp(ve/ge,dr)}X.autoTicks=function(ve,ge,dr){var br;function Tr(xr){return Math.pow(xr,Math.floor(Math.log(ge)/Math.LN10))}if(ve.type==="date"){ve.tick0=t.dateTick0(ve.calendar,0);var mr=2*ge;if(mr>g)ge/=g,br=Tr(10),ve.dtick="M"+12*vr(ge,br,re);else if(mr>S)ge/=S,ve.dtick="M"+vr(ge,1,Zt);else if(mr>T){if(ve.dtick=vr(ge,T,ve._hasDayOfWeekBreaks?[1,2,7,14]:Me),!dr){var kr=X.getTickFormat(ve),Ur=ve.ticklabelmode==="period";Ur&&(ve._rawTick0=ve.tick0),/%[uVW]/.test(kr)?ve.tick0=t.dateTick0(ve.calendar,2):ve.tick0=t.dateTick0(ve.calendar,1),Ur&&(ve._dowTick0=ve.tick0)}}else mr>h?ve.dtick=vr(ge,h,Zt):mr>b?ve.dtick=vr(ge,b,ue):mr>_?ve.dtick=vr(ge,_,ue):(br=Tr(10),ve.dtick=vr(ge,br,re))}else if(ve.type==="log"){ve.tick0=0;var Or=t.simpleMap(ve.range,ve.r2l);if(ve._isMinor&&(ge*=1.5),ge>.7)ve.dtick=Math.ceil(ge);else if(Math.abs(Or[1]-Or[0])<1){var pe=1.5*Math.abs((Or[1]-Or[0])/ge);ge=Math.abs(Math.pow(10,Or[1])-Math.pow(10,Or[0]))/pe,br=Tr(10),ve.dtick="L"+vr(ge,br,re)}else ve.dtick=ge>.3?"D2":"D1"}else ve.type==="category"||ve.type==="multicategory"?(ve.tick0=0,ve.dtick=Math.ceil(Math.max(ge,1))):Nn(ve)?(ve.tick0=0,br=1,ve.dtick=vr(ge,br,qe)):(ve.tick0=0,br=Tr(10),ve.dtick=vr(ge,br,re));if(ve.dtick===0&&(ve.dtick=1),!d(ve.dtick)&&typeof ve.dtick!="string"){var Ke=ve.dtick;throw ve.dtick=1,"ax.dtick error: "+String(Ke)}};function _r(ve){var ge=ve.dtick;if(ve._tickexponent=0,!d(ge)&&typeof ge!="string"&&(ge=1),(ve.type==="category"||ve.type==="multicategory")&&(ve._tickround=null),ve.type==="date"){var dr=ve.r2l(ve.tick0),br=ve.l2r(dr).replace(/(^-|i)/g,""),Tr=br.length;if(String(ge).charAt(0)==="M")Tr>10||br.substr(5)!=="01-01"?ve._tickround="d":ve._tickround=+ge.substr(1)%12===0?"y":"m";else if(ge>=T&&Tr<=10||ge>=T*15)ve._tickround="d";else if(ge>=b&&Tr<=16||ge>=h)ve._tickround="M";else if(ge>=_&&Tr<=19||ge>=b)ve._tickround="S";else{var mr=ve.l2r(dr+ge).replace(/^-/,"").length;ve._tickround=Math.max(Tr,mr)-20,ve._tickround<0&&(ve._tickround=4)}}else if(d(ge)||ge.charAt(0)==="L"){var kr=ve.range.map(ve.r2d||Number);d(ge)||(ge=Number(ge.substr(1))),ve._tickround=2-Math.floor(Math.log(ge)/Math.LN10+.01);var Ur=Math.max(Math.abs(kr[0]),Math.abs(kr[1])),Or=Math.floor(Math.log(Ur)/Math.LN10+.01),pe=ve.minexponent===void 0?3:ve.minexponent;Math.abs(Or)>pe&&(Ht(ve.exponentformat)&&ve.exponentformat!=="SI extended"&&!Yt(Or)||Ht(ve.exponentformat)&&ve.exponentformat==="SI extended"&&!se(Or)?ve._tickexponent=3*Math.round((Or-1)/3):ve._tickexponent=Or)}else ve._tickround=null}X.tickIncrement=function(ve,ge,dr,br){var Tr=dr?-1:1;if(d(ge))return t.increment(ve,Tr*ge);var mr=ge.charAt(0),kr=Tr*Number(ge.substr(1));if(mr==="M")return t.incrementMonth(ve,kr,br);if(mr==="L")return Math.log(Math.pow(10,ve)+kr)/Math.LN10;if(mr==="D"){var Ur=ge==="D2"?We:Ce,Or=ve+Tr*.01,pe=t.roundUp(t.mod(Or,1),Ur,dr);return Math.floor(Or)+Math.log(u.round(Math.pow(10,pe),1))/Math.LN10}throw"unrecognized dtick "+String(ge)},X.tickFirst=function(ve,ge){var dr=ve.r2l||Number,br=t.simpleMap(ve.range,dr,void 0,void 0,ge),Tr=br[1]<br[0],mr=Tr?Math.floor:Math.ceil,kr=dt(br)[0],Ur=ve.dtick,Or=dr(ve.tick0);if(d(Ur)){var pe=mr((kr-Or)/Ur)*Ur+Or;return(ve.type==="category"||ve.type==="multicategory")&&(pe=t.constrain(pe,0,ve._categories.length-1)),pe}var Ke=Ur.charAt(0),xr=Number(Ur.substr(1));if(Ke==="M"){for(var Gr=0,ln=Or,wn,rn,Qr;Gr<10;){if(wn=X.tickIncrement(ln,Ur,Tr,ve.calendar),(wn-kr)*(ln-kr)<=0)return Tr?Math.min(ln,wn):Math.max(ln,wn);rn=(kr-(ln+wn)/2)/(wn-ln),Qr=Ke+(Math.abs(Math.round(rn))||1)*xr,ln=X.tickIncrement(ln,Qr,rn<0?!Tr:Tr,ve.calendar),Gr++}return t.error("tickFirst did not converge",ve),ln}else{if(Ke==="L")return Math.log(mr((Math.pow(10,kr)-Or)/xr)*xr+Or)/Math.LN10;if(Ke==="D"){var vn=Ur==="D2"?We:Ce,Oa=t.roundUp(t.mod(kr,1),vn,Tr);return Math.floor(kr)+Math.log(u.round(Math.pow(10,Oa),1))/Math.LN10}else throw"unrecognized dtick "+String(Ur)}},X.tickText=function(ve,ge,dr,br){var Tr=er(ve,ge),mr=ve.tickmode==="array",kr=dr||mr,Ur=ve.type,Or=Ur==="category"?ve.d2l_noadd:ve.d2l,pe,Ke=function(Qr){var vn=ve.l2p(Qr);return vn>=0&&vn<=ve._length?Qr:null};if(mr&&t.isArrayOrTypedArray(ve.ticktext)){var xr=t.simpleMap(ve.range,ve.r2l),Gr=(Math.abs(xr[1]-xr[0])-(ve._lBreaks||0))/1e4;for(pe=0;pe<ve.ticktext.length&&!(Math.abs(ge-Or(ve.tickvals[pe]))<Gr);pe++);if(pe<ve.ticktext.length)return Tr.text=String(ve.ticktext[pe]),Tr.xbnd=[Ke(Tr.x-.5),Ke(Tr.x+ve.dtick-.5)],Tr}function ln(Qr){if(Qr===void 0)return!0;if(dr)return Qr==="none";var vn={first:ve._tmin,last:ve._tmax}[Qr];return Qr!=="all"&&ge!==vn}var wn=dr?"never":ve.exponentformat!=="none"&&ln(ve.showexponent)?"hide":"";if(Ur==="date"?Mr(ve,Tr,dr,kr):Ur==="log"?Ir(ve,Tr,dr,kr,wn):Ur==="category"?de(ve,Tr):Ur==="multicategory"?Dt(ve,Tr,dr):Nn(ve)?_t(ve,Tr,dr,kr,wn):qt(ve,Tr,dr,kr,wn),br||(ve.tickprefix&&!ln(ve.showtickprefix)&&(Tr.text=ve.tickprefix+Tr.text),ve.ticksuffix&&!ln(ve.showticksuffix)&&(Tr.text+=ve.ticksuffix)),ve.labelalias&&ve.labelalias.hasOwnProperty(Tr.text)){var rn=ve.labelalias[Tr.text];typeof rn=="string"&&(Tr.text=rn)}return(ve.tickson==="boundaries"||ve.showdividers)&&(Tr.xbnd=[Ke(Tr.x-.5),Ke(Tr.x+ve.dtick-.5)]),Tr},X.hoverLabelText=function(ve,ge,dr){dr&&(ve=t.extendFlat({},ve,{hoverformat:dr}));var br=t.isArrayOrTypedArray(ge)?ge[0]:ge,Tr=t.isArrayOrTypedArray(ge)?ge[1]:void 0;if(Tr!==void 0&&Tr!==br)return X.hoverLabelText(ve,br,dr)+" - "+X.hoverLabelText(ve,Tr,dr);var mr=ve.type==="log"&&br<=0,kr=X.tickText(ve,ve.c2l(mr?-br:br),"hover").text;return mr?br===0?"0":D+kr:kr};function er(ve,ge,dr){var br=ve.tickfont||{};return{x:ge,dx:0,dy:0,text:dr||"",fontSize:br.size,font:br.family,fontWeight:br.weight,fontStyle:br.style,fontVariant:br.variant,fontTextcase:br.textcase,fontLineposition:br.lineposition,fontShadow:br.shadow,fontColor:br.color}}function Mr(ve,ge,dr,br){var Tr=ve._tickround,mr=dr&&ve.hoverformat||X.getTickFormat(ve);br=!mr&&br,br&&(d(Tr)?Tr=4:Tr={y:"m",m:"d",d:"M",M:"S",S:4}[Tr]);var kr=t.formatDate(ge.x,mr,Tr,ve._dateFormat,ve.calendar,ve._extraFormat),Ur,Or=kr.indexOf(`
`);if(Or!==-1&&(Ur=kr.substr(Or+1),kr=kr.substr(0,Or)),br&&(Ur!==void 0&&(kr==="00:00:00"||kr==="00:00")?(kr=Ur,Ur=""):kr.length===8&&(kr=kr.replace(/:00$/,""))),Ur)if(dr)Tr==="d"?kr+=", "+Ur:kr=Ur+(kr?", "+kr:"");else if(!ve._inCalcTicks||ve._prevDateHead!==Ur)ve._prevDateHead=Ur,kr+="<br>"+Ur;else{var pe=$n(ve),Ke=ve._trueSide||ve.side;(!pe&&Ke==="top"||pe&&Ke==="bottom")&&(kr+="<br> ")}ge.text=kr}function Ir(ve,ge,dr,br,Tr){var mr=ve.dtick,kr=ge.x,Ur=ve.tickformat,Or=typeof mr=="string"&&mr.charAt(0);if(Tr==="never"&&(Tr=""),br&&Or!=="L"&&(mr="L3",Or="L"),Ur||Or==="L")ge.text=Ee(Math.pow(10,kr),ve,Tr,br);else if(d(mr)||Or==="D"&&(ve.minorloglabels==="complete"||t.mod(kr+.01,1)<.1)){ve.minorloglabels==="complete"&&!(t.mod(kr+.01,1)<.1)&&(ge.fontSize*=.75);var pe=Math.pow(10,kr).toExponential(0),Ke=pe.split("e"),xr=+Ke[1],Gr=Math.abs(xr),ln=ve.exponentformat;ln==="power"||Ht(ln)&&ln!=="SI extended"&&Yt(xr)||Ht(ln)&&ln==="SI extended"&&se(xr)?(ge.text=Ke[0],Gr>0&&(ge.text+="x10"),ge.text==="1x10"&&(ge.text="10"),xr!==0&&xr!==1&&(ge.text+="<sup>"+(xr>0?"":D)+Gr+"</sup>"),ge.fontSize*=1.25):(ln==="e"||ln==="E")&&Gr>2?ge.text=Ke[0]+ln+(xr>0?"+":D)+Gr:(ge.text=Ee(Math.pow(10,kr),ve,"","fakehover"),mr==="D1"&&ve._id.charAt(0)==="y"&&(ge.dy-=ge.fontSize/6))}else if(Or==="D")ge.text=ve.minorloglabels==="none"?"":String(Math.round(Math.pow(10,t.mod(kr,1)))),ge.fontSize*=.75;else throw"unrecognized dtick "+String(mr);if(ve.dtick==="D1"){var wn=String(ge.text).charAt(0);(wn==="0"||wn==="1")&&(ve._id.charAt(0)==="y"?ge.dx-=ge.fontSize/4:(ge.dy+=ge.fontSize/2,ge.dx+=(ve.range[1]>ve.range[0]?1:-1)*ge.fontSize*(kr<0?.5:.25)))}}function de(ve,ge){var dr=ve._categories[Math.round(ge.x)];dr===void 0&&(dr=""),ge.text=String(dr)}function Dt(ve,ge,dr){var br=Math.round(ge.x),Tr=ve._categories[br]||[],mr=Tr[1]===void 0?"":String(Tr[1]),kr=Tr[0]===void 0?"":String(Tr[0]);dr?ge.text=kr+" - "+mr:(ge.text=mr,ge.text2=kr)}function qt(ve,ge,dr,br,Tr){Tr==="never"?Tr="":ve.showexponent==="all"&&Math.abs(ge.x/ve.dtick)<1e-6&&(Tr="hide"),ge.text=Ee(ge.x,ve,Tr,br)}function _t(ve,ge,dr,br,Tr){if(ve.thetaunit==="radians"&&!dr){var mr=ge.x/180;if(mr===0)ge.text="0";else{var kr=lt(mr);if(kr[1]>=100)ge.text=Ee(t.deg2rad(ge.x),ve,Tr,br);else{var Ur=ge.x<0;kr[1]===1?kr[0]===1?ge.text="π":ge.text=kr[0]+"π":ge.text=["<sup>",kr[0],"</sup>","","<sub>",kr[1],"</sub>","π"].join(""),Ur&&(ge.text=D+ge.text)}}}else ge.text=Ee(ge.x,ve,Tr,br)}function lt(ve){function ge(Ur,Or){return Math.abs(Ur-Or)<=1e-6}function dr(Ur,Or){return ge(Or,0)?Ur:dr(Or,Ur%Or)}function br(Ur){for(var Or=1;!ge(Math.round(Ur*Or)/Or,Ur);)Or*=10;return Or}var Tr=br(ve),mr=ve*Tr,kr=Math.abs(dr(mr,Tr));return[Math.round(mr/kr),Math.round(Tr/kr)]}var yt=["f","p","n","μ","m","","k","M","G","T"],St=["q","r","y","z","a",...yt,"P","E","Z","Y","R","Q"],Ht=ve=>["SI","SI extended","B"].includes(ve);function Yt(ve){return ve>14||ve<-15}function se(ve){return ve>32||ve<-30}function ke(ve,ge){return Ht(ge)?!!(ge==="SI extended"&&se(ve)||ge!=="SI extended"&&Yt(ve)):!1}function Ee(ve,ge,dr,br){var Tr=ve<0,mr=ge._tickround,kr=dr||ge.exponentformat||"B",Ur=ge._tickexponent,Or=X.getTickFormat(ge),pe=ge.separatethousands;if(br){var Ke={exponentformat:kr,minexponent:ge.minexponent,dtick:ge.showexponent==="none"?ge.dtick:d(ve)&&Math.abs(ve)||1,range:ge.showexponent==="none"?ge.range.map(ge.r2d):[0,ve||1]};_r(Ke),mr=(Number(Ke._tickround)||0)+4,Ur=Ke._tickexponent,ge.hoverformat&&(Or=ge.hoverformat)}if(Or)return ge._numFormat(Or)(ve).replace(/-/g,D);var xr=Math.pow(10,-mr)/2;if(kr==="none"&&(Ur=0),ve=Math.abs(ve),ve<xr)ve="0",Tr=!1;else{if(ve+=xr,Ur&&(ve*=Math.pow(10,-Ur),mr+=Ur),mr===0)ve=String(Math.floor(ve));else if(mr<0){ve=String(Math.round(ve)),ve=ve.substr(0,ve.length+mr);for(var Gr=mr;Gr<0;Gr++)ve+="0"}else{ve=String(ve);var ln=ve.indexOf(".")+1;ln&&(ve=ve.substr(0,ln+mr).replace(/\.?0+$/,""))}ve=t.numSeparate(ve,ge._separators,pe)}if(Ur&&kr!=="hide"){ke(Ur,kr)&&(kr="power");var wn;Ur<0?wn=D+-Ur:kr!=="power"?wn="+"+Ur:wn=String(Ur),kr==="e"||kr==="E"?ve+=kr+wn:kr==="power"?ve+="×10<sup>"+wn+"</sup>":kr==="B"&&Ur===9?ve+="B":Ht(kr)&&(ve+=kr==="SI extended"?St[Ur/3+10]:yt[Ur/3+5])}return Tr?D+ve:ve}X.getTickFormat=function(ve){var ge;function dr(Or){return typeof Or!="string"?Or:Number(Or.replace("M",""))*S}function br(Or,pe){var Ke=["L","D"];if(typeof Or==typeof pe){if(typeof Or=="number")return Or-pe;var xr=Ke.indexOf(Or.charAt(0)),Gr=Ke.indexOf(pe.charAt(0));return xr===Gr?Number(Or.replace(/(L|D)/g,""))-Number(pe.replace(/(L|D)/g,"")):xr-Gr}else return typeof Or=="number"?1:-1}function Tr(Or,pe,Ke){var xr=Ke||function(wn){return wn},Gr=pe[0],ln=pe[1];return(!Gr&&typeof Gr!="number"||xr(Gr)<=xr(Or))&&(!ln&&typeof ln!="number"||xr(ln)>=xr(Or))}function mr(Or,pe){var Ke=pe[0]===null,xr=pe[1]===null,Gr=br(Or,pe[0])>=0,ln=br(Or,pe[1])<=0;return(Ke||Gr)&&(xr||ln)}var kr,Ur;if(ve.tickformatstops&&ve.tickformatstops.length>0)switch(ve.type){case"date":case"linear":{for(ge=0;ge<ve.tickformatstops.length;ge++)if(Ur=ve.tickformatstops[ge],Ur.enabled&&Tr(ve.dtick,Ur.dtickrange,dr)){kr=Ur;break}break}case"log":{for(ge=0;ge<ve.tickformatstops.length;ge++)if(Ur=ve.tickformatstops[ge],Ur.enabled&&mr(ve.dtick,Ur.dtickrange)){kr=Ur;break}break}}return kr?kr.value:ve.tickformat},X.getSubplots=function(ve,ge){var dr=ve._fullLayout._subplots,br=dr.cartesian.concat(dr.gl2d||[]),Tr=ge?X.findSubplotsWithAxis(br,ge):br;return Tr.sort(function(mr,kr){var Ur=mr.substr(1).split("y"),Or=kr.substr(1).split("y");return Ur[0]===Or[0]?+Ur[1]-+Or[1]:+Ur[0]-+Or[0]}),Tr},X.findSubplotsWithAxis=function(ve,ge){for(var dr=new RegExp(ge._id.charAt(0)==="x"?"^"+ge._id+"y":ge._id+"$"),br=[],Tr=0;Tr<ve.length;Tr++){var mr=ve[Tr];dr.test(mr)&&br.push(mr)}return br},X.makeClipPaths=function(ve){var ge=ve._fullLayout;if(!ge._hasOnlyLargeSploms){var dr={_offset:0,_length:ge.width,_id:""},br={_offset:0,_length:ge.height,_id:""},Tr=X.list(ve,"x",!0),mr=X.list(ve,"y",!0),kr=[],Ur,Or;for(Ur=0;Ur<Tr.length;Ur++)for(kr.push({x:Tr[Ur],y:br}),Or=0;Or<mr.length;Or++)Ur===0&&kr.push({x:dr,y:mr[Or]}),kr.push({x:Tr[Ur],y:mr[Or]});var pe=ge._clips.selectAll(".axesclip").data(kr,function(Ke){return Ke.x._id+Ke.y._id});pe.enter().append("clipPath").classed("axesclip",!0).attr("id",function(Ke){return"clip"+ge._uid+Ke.x._id+Ke.y._id}).append("rect"),pe.exit().remove(),pe.each(function(Ke){u.select(this).select("rect").attr({x:Ke.x._offset||0,y:Ke.y._offset||0,width:Ke.x._length||1,height:Ke.y._length||1})})}},X.draw=function(ve,ge,dr){var br=ve._fullLayout;ge==="redraw"&&br._paper.selectAll("g.subplot").each(function(Or){var pe=Or[0],Ke=br._plots[pe];if(Ke){var xr=Ke.xaxis,Gr=Ke.yaxis;Ke.xaxislayer.selectAll("."+xr._id+"tick").remove(),Ke.yaxislayer.selectAll("."+Gr._id+"tick").remove(),Ke.xaxislayer.selectAll("."+xr._id+"tick2").remove(),Ke.yaxislayer.selectAll("."+Gr._id+"tick2").remove(),Ke.xaxislayer.selectAll("."+xr._id+"divider").remove(),Ke.yaxislayer.selectAll("."+Gr._id+"divider").remove(),Ke.minorGridlayer&&Ke.minorGridlayer.selectAll("path").remove(),Ke.gridlayer&&Ke.gridlayer.selectAll("path").remove(),Ke.zerolinelayer&&Ke.zerolinelayer.selectAll("path").remove(),Ke.zerolinelayerAbove&&Ke.zerolinelayerAbove.selectAll("path").remove(),br._infolayer.select(".g-"+xr._id+"title").remove(),br._infolayer.select(".g-"+Gr._id+"title").remove()}});var Tr=!ge||ge==="redraw"?X.listIds(ve):ge,mr=X.list(ve),kr=mr.filter(function(Or){return Or.autoshift}).map(function(Or){return Or.overlaying});Tr.map(function(Or){var pe=X.getFromId(ve,Or);if(pe.tickmode==="sync"&&pe.overlaying){var Ke=Tr.findIndex(function(xr){return xr===pe.overlaying});Ke>=0&&Tr.unshift(Tr.splice(Ke,1).shift())}});var Ur={false:{left:0,right:0}};return t.syncOrAsync(Tr.map(function(Or){return function(){if(Or){var pe=X.getFromId(ve,Or);dr||(dr={}),dr.axShifts=Ur,dr.overlayingShiftedAx=kr;var Ke=X.drawOne(ve,pe,dr);return pe._shiftPusher&&Cn(pe,pe._fullDepth||0,Ur,!0),pe._r=pe.range.slice(),pe._rl=t.simpleMap(pe._r,pe.r2l),Ke}}}))},X.drawOne=function(ve,ge,dr){dr=dr||{};var br=dr.axShifts||{},Tr=dr.overlayingShiftedAx||[],mr,kr,Ur;ge.setScale();var Or=ve._fullLayout,pe=ge._id,Ke=pe.charAt(0),xr=X.counterLetter(pe),Gr=Or._plots[ge._mainSubplot],ln=ge.zerolinelayer==="above traces";if(!Gr)return;if(ge._shiftPusher=ge.autoshift||Tr.indexOf(ge._id)!==-1||Tr.indexOf(ge.overlaying)!==-1,ge._shiftPusher&ge.anchor==="free"){var wn=ge.linewidth/2||0;ge.ticks==="inside"&&(wn+=ge.ticklen),Cn(ge,wn,br,!0),Cn(ge,ge.shift||0,br,!1)}(dr.skipTitle!==!0||ge._shift===void 0)&&(ge._shift=Fa(ge,br));var rn=Gr[Ke+"axislayer"],Qr=ge._mainLinePosition,vn=Qr+=ge._shift,Oa=ge._mainMirrorPosition,Qn=ge._vals=X.calcTicks(ge),Qa=[ge.mirror,vn,Oa].join("_");for(mr=0;mr<Qn.length;mr++)Qn[mr].axInfo=Qa;ge._selections={},ge._tickAngles&&(ge._prevTickAngles=ge._tickAngles),ge._tickAngles={},ge._depth=null;var Ja={};function wi(Wo){var Bi=pe+(Wo||"tick");return Ja[Bi]||(Ja[Bi]=Er(ge,Bi,vn)),Ja[Bi]}if(ge.visible){var ci=X.makeTransTickFn(ge),Ti=X.makeTransTickLabelFn(ge),Ra,Qi,Hi=ge.ticks==="inside",Ho=ge.ticks==="outside";if(ge.tickson==="boundaries"){var Ci=ir(ge,Qn);Qi=X.clipEnds(ge,Ci),Ra=Hi?Qi:Ci}else Qi=X.clipEnds(ge,Qn),Ra=Hi&&ge.ticklabelmode!=="period"?Qi:Qn;var zo=ge._gridVals=Qi,qi=Ye(ge,Qn);if(!Or._hasOnlyLargeSploms){var qo=ge._subplotsWith,Po={};for(mr=0;mr<qo.length;mr++){kr=qo[mr],Ur=Or._plots[kr];var hs=Ur[xr+"axis"],Gi=hs._mainAxis._id;if(!Po[Gi]){Po[Gi]=1;var uo=Ke==="x"?"M0,"+hs._offset+"v"+hs._length:"M"+hs._offset+",0h"+hs._length;X.drawGrid(ve,ge,{vals:zo,counterAxis:hs,layer:Ur.gridlayer.select("."+pe),minorLayer:Ur.minorGridlayer.select("."+pe),path:uo,transFn:ci}),X.drawZeroLine(ve,ge,{counterAxis:hs,layer:ln?Ur.zerolinelayerAbove:Ur.zerolinelayer,path:uo,transFn:ci})}}}var yi,ao=X.getTickSigns(ge),ts=X.getTickSigns(ge,"minor");if(ge.ticks||ge.minor&&ge.minor.ticks){var vs=X.makeTickPath(ge,vn,ao[2]),As=X.makeTickPath(ge,vn,ts[2],{minor:!0}),_o,Da,li,wo;if(ge._anchorAxis&&ge.mirror&&ge.mirror!==!0?(_o=X.makeTickPath(ge,Oa,ao[3]),Da=X.makeTickPath(ge,Oa,ts[3],{minor:!0}),li=vs+_o,wo=As+Da):(_o="",Da="",li=vs,wo=As),ge.showdividers&&Ho&&ge.tickson==="boundaries"){var Ms={};for(mr=0;mr<qi.length;mr++)Ms[qi[mr].x]=1;yi=function(Wo){return Ms[Wo.x]?_o:li}}else yi=function(Wo){return Wo.minor?wo:li}}if(X.drawTicks(ve,ge,{vals:Ra,layer:rn,path:yi,transFn:ci}),ge.mirror==="allticks"){var Di=Object.keys(ge._linepositions||{});for(mr=0;mr<Di.length;mr++){kr=Di[mr],Ur=Or._plots[kr];var _s=ge._linepositions[kr]||[],No=_s[0],is=_s[1],al=_s[2],ii=X.makeTickPath(ge,No,al?ao[0]:ts[0],{minor:al})+X.makeTickPath(ge,is,al?ao[1]:ts[1],{minor:al});X.drawTicks(ve,ge,{vals:Ra,layer:Ur[Ke+"axislayer"],path:ii,transFn:ci})}}var io=[];if(io.push(function(){return X.drawLabels(ve,ge,{vals:Qn,layer:rn,plotinfo:Ur,transFn:Ti,labelFns:X.makeLabelFns(ge,vn)})}),ge.type==="multicategory"){var co={x:2,y:10}[Ke];io.push(function(){var Wo={x:"height",y:"width"}[Ke],Bi=wi()[Wo]+co+(ge._tickAngles[pe+"tick"]?ge.tickfont.size*et:0);return X.drawLabels(ve,ge,{vals:ar(ge,Qn),layer:rn,cls:pe+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:ci,labelFns:X.makeLabelFns(ge,vn+Bi*ao[4])})}),io.push(function(){return ge._depth=ao[4]*(wi("tick2")[ge.side]-vn),Zn(ve,ge,{vals:qi,layer:rn,path:X.makeTickPath(ge,vn,ao[4],{len:ge._depth}),transFn:ci})})}else ge.title.hasOwnProperty("standoff")&&io.push(function(){ge._depth=ao[4]*(wi()[ge.side]-vn)});var Is=A.getComponentMethod("rangeslider","isVisible")(ge);return!dr.skipTitle&&!(Is&&ge.side==="bottom")&&io.push(function(){return gn(ve,ge)}),io.push(function(){var Wo=ge.side.charAt(0),Bi=K[ge.side].charAt(0),$s=X.getPxPosition(ve,ge),fl=Ho?ge.ticklen:0,Jo,us,Ss,Ls;(ge.automargin||Is||ge._shiftPusher)&&(ge.type==="multicategory"?Jo=wi("tick2"):(Jo=wi(),Ke==="x"&&Wo==="b"&&(ge._depth=Math.max(Jo.width>0?Jo.bottom-$s:0,fl))));var yl=0,bu=0;if(ge._shiftPusher&&(yl=Math.max(fl,Jo.height>0?Wo==="l"?$s-Jo.left:Jo.right-$s:0),ge.title.text!==Or._dfltTitle[Ke]&&(bu=(ge._titleStandoff||0)+(ge._titleScoot||0),Wo==="l"&&(bu+=En(ge))),ge._fullDepth=Math.max(yl,bu)),ge.automargin){us={x:0,y:0,r:0,l:0,t:0,b:0};var au=[0,1],fu=typeof ge._shift=="number"?ge._shift:0;if(Ke==="x"){if(Wo==="b"?us[Wo]=ge._depth:(us[Wo]=ge._depth=Math.max(Jo.width>0?$s-Jo.top:0,fl),au.reverse()),Jo.width>0){var Ec=Jo.right-(ge._offset+ge._length);Ec>0&&(us.xr=1,us.r=Ec);var xc=ge._offset-Jo.left;xc>0&&(us.xl=0,us.l=xc)}}else if(Wo==="l"?(ge._depth=Math.max(Jo.height>0?$s-Jo.left:0,fl),us[Wo]=ge._depth-fu):(ge._depth=Math.max(Jo.height>0?Jo.right-$s:0,fl),us[Wo]=ge._depth+fu,au.reverse()),Jo.height>0){var cs=Jo.bottom-(ge._offset+ge._length);cs>0&&(us.yb=0,us.b=cs);var Gl=ge._offset-Jo.top;Gl>0&&(us.yt=1,us.t=Gl)}us[xr]=ge.anchor==="free"?ge.position:ge._anchorAxis.domain[au[0]],ge.title.text!==Or._dfltTitle[Ke]&&(us[Wo]+=En(ge)+(ge.title.standoff||0)),ge.mirror&&ge.anchor!=="free"&&(Ss={x:0,y:0,r:0,l:0,t:0,b:0},Ss[Bi]=ge.linewidth,ge.mirror&&ge.mirror!==!0&&(Ss[Bi]+=fl),ge.mirror===!0||ge.mirror==="ticks"?Ss[xr]=ge._anchorAxis.domain[au[1]]:(ge.mirror==="all"||ge.mirror==="allticks")&&(Ss[xr]=[ge._counterDomainMin,ge._counterDomainMax][au[1]]))}Is&&(Ls=A.getComponentMethod("rangeslider","autoMarginOpts")(ve,ge)),typeof ge.automargin=="string"&&(Ue(us,ge.automargin),Ue(Ss,ge.automargin)),E.autoMargin(ve,Ze(ge),us),E.autoMargin(ve,tr(ge),Ss),E.autoMargin(ve,zr(ge),Ls)}),t.syncOrAsync(io)}};function Ue(ve,ge){if(ve){var dr=Object.keys(G).reduce(function(br,Tr){return ge.indexOf(Tr)!==-1&&G[Tr].forEach(function(mr){br[mr]=1}),br},{});Object.keys(ve).forEach(function(br){dr[br]||(br.length===1?ve[br]=0:delete ve[br])})}}function ir(ve,ge){var dr=[],br,Tr=function(mr,kr){var Ur=mr.xbnd[kr];Ur!==null&&dr.push(t.extendFlat({},mr,{x:Ur}))};if(ge.length){for(br=0;br<ge.length;br++)Tr(ge[br],0);Tr(ge[br-1],1)}return dr}function ar(ve,ge){for(var dr=[],br={},Tr=0;Tr<ge.length;Tr++){var mr=ge[Tr];br[mr.text2]?br[mr.text2].push(mr.x):br[mr.text2]=[mr.x]}for(var kr in br)dr.push(er(ve,t.interp(br[kr],.5),kr));return dr}function Ye(ve,ge){var dr=[],br,Tr,mr=ge.length&&ge[ge.length-1].x<ge[0].x,kr=function(Or,pe){var Ke=Or.xbnd[pe];Ke!==null&&dr.push(t.extendFlat({},Or,{x:Ke}))};if(ve.showdividers&&ge.length){for(br=0;br<ge.length;br++){var Ur=ge[br];Ur.text2!==Tr&&kr(Ur,mr?1:0),Tr=Ur.text2}kr(ge[br-1],mr?0:1)}return dr}function Er(ve,ge,dr){var br,Tr,mr,kr;if(ve._selections[ge].size())br=1/0,Tr=-1/0,mr=1/0,kr=-1/0,ve._selections[ge].each(function(){var Or=Re(this);if(Or.node().style.display!=="none"){var pe=o.bBox(Or.node().parentNode);br=Math.min(br,pe.top),Tr=Math.max(Tr,pe.bottom),mr=Math.min(mr,pe.left),kr=Math.max(kr,pe.right)}});else{var Ur=X.makeLabelFns(ve,dr);br=Tr=Ur.yFn({dx:0,dy:0,fontSize:0}),mr=kr=Ur.xFn({dx:0,dy:0,fontSize:0})}return{top:br,bottom:Tr,left:mr,right:kr,height:Tr-br,width:kr-mr}}X.getTickSigns=function(ve,ge){var dr=ve._id.charAt(0),br={x:"top",y:"right"}[dr],Tr=ve.side===br?1:-1,mr=[-1,1,Tr,-Tr],kr=ge?(ve.minor||{}).ticks:ve.ticks;return kr!=="inside"==(dr==="x")&&(mr=mr.map(function(Ur){return-Ur})),ve.side&&mr.push({l:-1,t:-1,r:1,b:1}[ve.side.charAt(0)]),mr},X.makeTransTickFn=function(ve){return ve._id.charAt(0)==="x"?function(ge){return e(ve._offset+ve.l2p(ge.x),0)}:function(ge){return e(0,ve._offset+ve.l2p(ge.x))}},X.makeTransTickLabelFn=function(ve){var ge=dn(ve),dr=ve.ticklabelshift||0,br=ve.ticklabelstandoff||0,Tr=ge[0],mr=ge[1],kr=ve.range[0]>ve.range[1],Ur=ve.ticklabelposition&&ve.ticklabelposition.indexOf("inside")!==-1,Or=!Ur;if(dr){var pe=kr?-1:1;dr=dr*pe}if(br){var Ke=ve.side,xr=Ur&&(Ke==="top"||Ke==="left")||Or&&(Ke==="bottom"||Ke==="right")?1:-1;br=br*xr}return ve._id.charAt(0)==="x"?function(Gr){return e(Tr+ve._offset+ve.l2p(pn(Gr))+dr,mr+br)}:function(Gr){return e(mr+br,Tr+ve._offset+ve.l2p(pn(Gr))+dr)}};function pn(ve){return ve.periodX!==void 0?ve.periodX:ve.x}function dn(ve){var ge=ve.ticklabelposition||"",dr=ve.tickson||"",br=function(wn){return ge.indexOf(wn)!==-1},Tr=br("top"),mr=br("left"),kr=br("right"),Ur=br("bottom"),Or=br("inside"),pe=dr!=="boundaries"&&(Ur||mr||Tr||kr);if(!pe&&!Or)return[0,0];var Ke=ve.side,xr=pe?(ve.tickwidth||0)/2:0,Gr=ot,ln=ve.tickfont?ve.tickfont.size:12;return(Ur||Tr)&&(xr+=ln*st,Gr+=(ve.linewidth||0)/2),(mr||kr)&&(xr+=(ve.linewidth||0)/2,Gr+=ot),Or&&Ke==="top"&&(Gr-=ln*(1-st)),(mr||Tr)&&(xr=-xr),(Ke==="bottom"||Ke==="right")&&(Gr=-Gr),[pe?xr:0,Or?Gr:0]}X.makeTickPath=function(ve,ge,dr,br){br||(br={});var Tr=br.minor;if(Tr&&!ve.minor)return"";var mr=br.len!==void 0?br.len:Tr?ve.minor.ticklen:ve.ticklen,kr=ve._id.charAt(0),Ur=(ve.linewidth||1)/2;return kr==="x"?"M0,"+(ge+Ur*dr)+"v"+mr*dr:"M"+(ge+Ur*dr)+",0h"+mr*dr},X.makeLabelFns=function(ve,ge,dr){var br=ve.ticklabelposition||"",Tr=ve.tickson||"",mr=function(Ci){return br.indexOf(Ci)!==-1},kr=mr("top"),Ur=mr("left"),Or=mr("right"),pe=mr("bottom"),Ke=Tr!=="boundaries"&&(pe||Ur||kr||Or),xr=mr("inside"),Gr=br==="inside"&&ve.ticks==="inside"||!xr&&ve.ticks==="outside"&&Tr!=="boundaries",ln=0,wn=0,rn=Gr?ve.ticklen:0;if(xr?rn*=-1:Ke&&(rn=0),Gr&&(ln+=rn,dr)){var Qr=t.deg2rad(dr);ln=rn*Math.cos(Qr)+1,wn=rn*Math.sin(Qr)}ve.showticklabels&&(Gr||ve.showline)&&(ln+=.2*ve.tickfont.size),ln+=(ve.linewidth||1)/2*(xr?-1:1);var vn={labelStandoff:ln,labelShift:wn},Oa,Qn,Qa,Ja,wi=0,ci=ve.side,Ti=ve._id.charAt(0),Ra=ve.tickangle,Qi;if(Ti==="x")Qi=!xr&&ci==="bottom"||xr&&ci==="top",Ja=Qi?1:-1,xr&&(Ja*=-1),Oa=wn*Ja,Qn=ge+ln*Ja,Qa=Qi?1:-.2,Math.abs(Ra)===90&&(xr?Qa+=ct:Ra===-90&&ci==="bottom"?Qa=st:Ra===90&&ci==="top"?Qa=ct:Qa=.5,wi=ct/2*(Ra/90)),vn.xFn=function(Ci){return Ci.dx+Oa+wi*Ci.fontSize},vn.yFn=function(Ci){return Ci.dy+Qn+Ci.fontSize*Qa},vn.anchorFn=function(Ci,zo){if(Ke){if(Ur)return"end";if(Or)return"start"}return!d(zo)||zo===0||zo===180?"middle":zo*Ja<0!==xr?"end":"start"},vn.heightFn=function(Ci,zo,qi){return zo<-60||zo>60?-.5*qi:ve.side==="top"!==xr?-qi:0};else if(Ti==="y"){if(Qi=!xr&&ci==="left"||xr&&ci==="right",Ja=Qi?1:-1,xr&&(Ja*=-1),Oa=ln,Qn=wn*Ja,Qa=0,!xr&&Math.abs(Ra)===90&&(Ra===-90&&ci==="left"||Ra===90&&ci==="right"?Qa=st:Qa=.5),xr){var Hi=d(Ra)?+Ra:0;if(Hi!==0){var Ho=t.deg2rad(Hi);wi=Math.abs(Math.sin(Ho))*st*Ja,Qa=0}}vn.xFn=function(Ci){return Ci.dx+ge-(Oa+Ci.fontSize*Qa)*Ja+wi*Ci.fontSize},vn.yFn=function(Ci){return Ci.dy+Qn+Ci.fontSize*ct},vn.anchorFn=function(Ci,zo){return d(zo)&&Math.abs(zo)===90?"middle":Qi?"end":"start"},vn.heightFn=function(Ci,zo,qi){return ve.side==="right"&&(zo*=-1),zo<-30?-qi:zo<30?-.5*qi:0}}return vn};function bn(ve){return[ve.text,ve.x,ve.axInfo,ve.font,ve.fontSize,ve.fontColor].join("_")}X.drawTicks=function(ve,ge,dr){dr=dr||{};var br=ge._id+"tick",Tr=[].concat(ge.minor&&ge.minor.ticks?dr.vals.filter(function(kr){return kr.minor&&!kr.noTick}):[]).concat(ge.ticks?dr.vals.filter(function(kr){return!kr.minor&&!kr.noTick}):[]),mr=dr.layer.selectAll("path."+br).data(Tr,bn);mr.exit().remove(),mr.enter().append("path").classed(br,1).classed("ticks",1).classed("crisp",dr.crisp!==!1).each(function(kr){return n.stroke(u.select(this),kr.minor?ge.minor.tickcolor:ge.tickcolor)}).style("stroke-width",function(kr){return o.crispRound(ve,kr.minor?ge.minor.tickwidth:ge.tickwidth,1)+"px"}).attr("d",dr.path).style("display",null),ia(ge,[N]),mr.attr("transform",dr.transFn)},X.drawGrid=function(ve,ge,dr){if(dr=dr||{},ge.tickmode!=="sync"){var br=ge._id+"grid",Tr=ge.minor&&ge.minor.showgrid,mr=Tr?dr.vals.filter(function(vn){return vn.minor}):[],kr=ge.showgrid?dr.vals.filter(function(vn){return!vn.minor}):[],Ur=dr.counterAxis;if(Ur&&X.shouldShowZeroLine(ve,ge,Ur))for(var Or=ge.tickmode==="array",pe=0;pe<kr.length;pe++){var Ke=kr[pe].x;if(Or?!Ke:Math.abs(Ke)<ge.dtick/100)if(kr=kr.slice(0,pe).concat(kr.slice(pe+1)),Or)pe--;else break}ge._gw=o.crispRound(ve,ge.gridwidth,1);for(var xr=Tr?o.crispRound(ve,ge.minor.gridwidth,1):0,Gr=dr.layer,ln=dr.minorLayer,wn=1;wn>=0;wn--){var rn=wn?Gr:ln;if(rn){var Qr=rn.selectAll("path."+br).data(wn?kr:mr,bn);Qr.exit().remove(),Qr.enter().append("path").classed(br,1).classed("crisp",dr.crisp!==!1),Qr.attr("transform",dr.transFn).attr("d",dr.path).each(function(vn){return n.stroke(u.select(this),vn.minor?ge.minor.gridcolor:ge.gridcolor||"#ddd")}).style("stroke-dasharray",function(vn){return o.dashStyle(vn.minor?ge.minor.griddash:ge.griddash,vn.minor?ge.minor.gridwidth:ge.gridwidth)}).style("stroke-width",function(vn){return(vn.minor?xr:ge._gw)+"px"}).style("display",null),typeof dr.path=="function"&&Qr.attr("d",dr.path)}}ia(ge,[I,F])}},X.drawZeroLine=function(ve,ge,dr){dr=dr||dr;var br=ge._id+"zl",Tr=X.shouldShowZeroLine(ve,ge,dr.counterAxis),mr=dr.layer.selectAll("path."+br).data(Tr?[{x:0,id:ge._id}]:[]);mr.exit().remove(),mr.enter().append("path").classed(br,1).classed("zl",1).classed("crisp",dr.crisp!==!1).each(function(){dr.layer.selectAll("path").sort(function(kr,Ur){return J(kr.id,Ur.id)})}),mr.attr("transform",dr.transFn).attr("d",dr.path).call(n.stroke,ge.zerolinecolor||n.defaultLine).style("stroke-width",o.crispRound(ve,ge.zerolinewidth,ge._gw||1)+"px").style("display",null),ia(ge,[R])},X.drawLabels=function(ve,ge,dr){dr=dr||{};var br=ve._fullLayout,Tr=ge._id,mr=ge.zerolinelayer==="above traces",kr=dr.cls||Tr+"tick",Ur=dr.vals.filter(function(Gi){return Gi.text}),Or=dr.labelFns,pe=dr.secondary?0:ge.tickangle,Ke=(ge._prevTickAngles||{})[kr],xr=dr.layer.selectAll("g."+kr).data(ge.showticklabels?Ur:[],bn),Gr=[];xr.enter().append("g").classed(kr,1).append("text").attr("text-anchor","middle").each(function(Gi){var uo=u.select(this),yi=ve._promises.length;uo.call(r.positionText,Or.xFn(Gi),Or.yFn(Gi)).call(o.font,{family:Gi.font,size:Gi.fontSize,color:Gi.fontColor,weight:Gi.fontWeight,style:Gi.fontStyle,variant:Gi.fontVariant,textcase:Gi.fontTextcase,lineposition:Gi.fontLineposition,shadow:Gi.fontShadow}).text(Gi.text).call(r.convertToTspans,ve),ve._promises[yi]?Gr.push(ve._promises.pop().then(function(){ln(uo,pe)})):ln(uo,pe)}),ia(ge,[j]),xr.exit().remove(),dr.repositionOnUpdate&&xr.each(function(Gi){u.select(this).select("text").call(r.positionText,Or.xFn(Gi),Or.yFn(Gi))});function ln(Gi,uo){Gi.each(function(yi){var ao=u.select(this),ts=ao.select(".text-math-group"),vs=Or.anchorFn(yi,uo),As=dr.transFn.call(ao.node(),yi)+(d(uo)&&+uo!=0?" rotate("+uo+","+Or.xFn(yi)+","+(Or.yFn(yi)-yi.fontSize/2)+")":""),_o=r.lineCount(ao),Da=et*yi.fontSize,li=Or.heightFn(yi,d(uo)?+uo:0,(_o-1)*Da);if(li&&(As+=e(0,li)),ts.empty()){var wo=ao.select("text");wo.attr({transform:As,"text-anchor":vs}),wo.style("display",null),ge._adjustTickLabelsOverflow&&ge._adjustTickLabelsOverflow()}else{var Ms=o.bBox(ts.node()).width,Di=Ms*{end:-.5,start:.5}[vs];ts.attr("transform",As+e(Di,0))}})}ge._adjustTickLabelsOverflow=function(){var Gi=ge.ticklabeloverflow;if(!(!Gi||Gi==="allow")){var uo=Gi.indexOf("hide")!==-1,yi=ge._id.charAt(0)==="x",ao=0,ts=yi?ve._fullLayout.width:ve._fullLayout.height;if(Gi.indexOf("domain")!==-1){var vs=t.simpleMap(ge.range,ge.r2l);ao=ge.l2p(vs[0])+ge._offset,ts=ge.l2p(vs[1])+ge._offset}var As=Math.min(ao,ts),_o=Math.max(ao,ts),Da=ge.side,li=1/0,wo=-1/0;xr.each(function(No){var is=u.select(this),al=is.select(".text-math-group");if(al.empty()){var ii=o.bBox(is.node()),io=0;yi?(ii.right>_o||ii.left<As)&&(io=1):(ii.bottom>_o||ii.top+(ge.tickangle?0:No.fontSize/4)<As)&&(io=1);var co=is.select("text");io?uo&&co.style("display","none"):co.node().style.display!=="none"&&(co.style("display",null),Da==="bottom"||Da==="right"?li=Math.min(li,yi?ii.top:ii.left):li=-1/0,Da==="top"||Da==="left"?wo=Math.max(wo,yi?ii.bottom:ii.right):wo=1/0)}});for(var Ms in br._plots){var Di=br._plots[Ms];if(!(ge._id!==Di.xaxis._id&&ge._id!==Di.yaxis._id)){var _s=yi?Di.yaxis:Di.xaxis;_s&&(_s["_visibleLabelMin_"+ge._id]=li,_s["_visibleLabelMax_"+ge._id]=wo)}}}},ge._hideCounterAxisInsideTickLabels=function(Gi){var uo=ge._id.charAt(0)==="x",yi=[];for(var ao in br._plots){var ts=br._plots[ao];ge._id!==ts.xaxis._id&&ge._id!==ts.yaxis._id||yi.push(uo?ts.yaxis:ts.xaxis)}yi.forEach(function(vs,As){vs&&$n(vs)&&(Gi||[R,F,I,N,j]).forEach(function(_o){var Da=_o.K==="tick"&&_o.L==="text"&&ge.ticklabelmode==="period",li=br._plots[ge._mainSubplot],wo;if(_o.K===R.K){var Ms=mr?li.zerolinelayerAbove:li.zerolinelayer;wo=Ms.selectAll("."+ge._id+"zl")}else _o.K===F.K?wo=li.minorGridlayer.selectAll("."+ge._id):_o.K===I.K?wo=li.gridlayer.selectAll("."+ge._id):wo=li[ge._id.charAt(0)+"axislayer"];wo.each(function(){var Di=u.select(this);_o.L&&(Di=Di.selectAll(_o.L)),Di.each(function(_s){var No=ge.l2p(Da?pn(_s):_s.x)+ge._offset,is=u.select(this);No<ge["_visibleLabelMax_"+vs._id]&&No>ge["_visibleLabelMin_"+vs._id]?is.style("display","none"):_o.K==="tick"&&!As&&is.node().style.display!=="none"&&is.style("display",null)})})})})},ln(xr,Ke+1?Ke:pe);function wn(){return Gr.length&&Promise.all(Gr)}var rn=null;function Qr(){if(ln(xr,pe),Ur.length&&ge.autotickangles&&(ge.type!=="log"||String(ge.dtick).charAt(0)!=="D")){rn=ge.autotickangles[0];var Gi=0,uo=[],yi,ao=1;xr.each(function(us){Gi=Math.max(Gi,us.fontSize);var Ss=ge.l2p(us.x),Ls=Re(this),yl=o.bBox(Ls.node());ao=Math.max(ao,r.lineCount(Ls)),uo.push({top:0,bottom:10,height:10,left:Ss-yl.width/2,right:Ss+yl.width/2+2,width:yl.width+2})});var ts=(ge.tickson==="boundaries"||ge.showdividers)&&!dr.secondary,vs=Ur.length,As=Math.abs((Ur[vs-1].x-Ur[0].x)*ge._m)/(vs-1),_o=ts?As/2:As,Da=ts?ge.ticklen:Gi*1.25*ao,li=Math.sqrt(Math.pow(_o,2)+Math.pow(Da,2)),wo=_o/li,Ms=ge.autotickangles.map(function(us){return us*Math.PI/180}),Di=Ms.find(function(us){return Math.abs(Math.cos(us))<=wo});Di===void 0&&(Di=Ms.reduce(function(us,Ss){return Math.abs(Math.cos(us))<Math.abs(Math.cos(Ss))?us:Ss},Ms[0]));var _s=Di*(180/Math.PI);if(ts){var No=2;for(ge.ticks&&(No+=ge.tickwidth/2),yi=0;yi<uo.length;yi++){var is=Ur[yi].xbnd,al=uo[yi];if(is[0]!==null&&al.left-ge.l2p(is[0])<No||is[1]!==null&&ge.l2p(is[1])-al.right<No){rn=_s;break}}}else{var ii=ge.ticklabelposition||"",io=ge.tickson||"",co=function(us){return ii.indexOf(us)!==-1},Is=co("top"),Wo=co("left"),Bi=co("right"),$s=co("bottom"),fl=io!=="boundaries"&&($s||Wo||Is||Bi),Jo=fl?(ge.tickwidth||0)+2*ot:0;for(yi=0;yi<uo.length-1;yi++)if(t.bBoxIntersect(uo[yi],uo[yi+1],Jo)){rn=_s;break}}rn&&ln(xr,rn)}}ge._selections&&(ge._selections[kr]=xr);var vn=[wn];ge.automargin&&br._redrawFromAutoMarginCount&&Ke===90?(rn=Ke,vn.push(function(){ln(xr,Ke)})):vn.push(Qr),ge._tickAngles&&vn.push(function(){ge._tickAngles[kr]=rn===null?d(pe)?pe:0:rn});var Oa=function(){var Gi=0,uo=0;return xr.each(function(yi,ao){var ts=Re(this),vs=ts.select(".text-math-group");if(vs.empty()){var As;ge._vals[ao]&&(As=ge._vals[ao].bb||o.bBox(ts.node()),ge._vals[ao].bb=As),Gi=Math.max(Gi,As.width),uo=Math.max(uo,As.height)}}),{labelsMaxW:Gi,labelsMaxH:uo}},Qn=ge._anchorAxis;if(Qn&&(Qn.autorange||Qn.insiderange)&&$n(ge)&&!q(br,ge._id)&&(br._insideTickLabelsUpdaterange||(br._insideTickLabelsUpdaterange={}),Qn.autorange&&(br._insideTickLabelsUpdaterange[Qn._name+".autorange"]=Qn.autorange,vn.push(Oa)),Qn.insiderange)){var Qa=Oa(),Ja=ge._id.charAt(0)==="y"?Qa.labelsMaxW:Qa.labelsMaxH;Ja+=2*ot,ge.ticklabelposition==="inside"&&(Ja+=ge.ticklen||0);var wi=ge.side==="right"||ge.side==="top"?1:-1,ci=wi===1?1:0,Ti=wi===1?0:1,Ra=[];Ra[Ti]=Qn.range[Ti];var Qi=Qn.range,Hi=Qn.r2p(Qi[ci]),Ho=Qn.r2p(Qi[Ti]),Ci=br._insideTickLabelsUpdaterange[Qn._name+".range"];if(Ci){var zo=Qn.r2p(Ci[ci]),qi=Qn.r2p(Ci[Ti]),qo=wi*(ge._id.charAt(0)==="y"?1:-1);qo*Hi<qo*zo&&(Hi=zo,Ra[ci]=Qi[ci]=Ci[ci]),qo*Ho>qo*qi&&(Ho=qi,Ra[Ti]=Qi[Ti]=Ci[Ti])}var Po=Math.abs(Ho-Hi);Po-Ja>0?(Po-=Ja,Ja*=1+Ja/Po):Ja=0,ge._id.charAt(0)!=="y"&&(Ja=-Ja),Ra[ci]=Qn.p2r(Qn.r2p(Qi[ci])+wi*Ja),Qn.autorange==="min"||Qn.autorange==="max reversed"?(Ra[0]=null,Qn._rangeInitial0=void 0,Qn._rangeInitial1=void 0):(Qn.autorange==="max"||Qn.autorange==="min reversed")&&(Ra[1]=null,Qn._rangeInitial0=void 0,Qn._rangeInitial1=void 0),br._insideTickLabelsUpdaterange[Qn._name+".range"]=Ra}var hs=t.syncOrAsync(vn);return hs&&hs.then&&ve._promises.push(hs),hs};function Zn(ve,ge,dr){var br=ge._id+"divider",Tr=dr.vals,mr=dr.layer.selectAll("path."+br).data(Tr,bn);mr.exit().remove(),mr.enter().insert("path",":first-child").classed(br,1).classed("crisp",1).call(n.stroke,ge.dividercolor).style("stroke-width",o.crispRound(ve,ge.dividerwidth,1)+"px"),mr.attr("transform",dr.transFn).attr("d",dr.path)}X.getPxPosition=function(ve,ge){var dr=ve._fullLayout._size,br=ge._id.charAt(0),Tr=ge.side,mr;if(ge.anchor!=="free"?mr=ge._anchorAxis:br==="x"?mr={_offset:dr.t+(1-(ge.position||0))*dr.h,_length:0}:br==="y"&&(mr={_offset:dr.l+(ge.position||0)*dr.w+ge._shift,_length:0}),Tr==="top"||Tr==="left")return mr._offset;if(Tr==="bottom"||Tr==="right")return mr._offset+mr._length};function En(ve){var ge=ve.title.font.size,dr=(ve.title.text.match(r.BR_TAG_ALL)||[]).length;return ve.title.hasOwnProperty("standoff")?ge*(st+dr*et):dr?ge*(dr+1)*et:ge}function gn(ve,ge){var dr=ve._fullLayout,br=ge._id,Tr=br.charAt(0),mr=ge.title.font.size,kr,Ur=(ge.title.text.match(r.BR_TAG_ALL)||[]).length;if(ge.title.hasOwnProperty("standoff"))ge.side==="bottom"||ge.side==="right"?kr=ge._depth+ge.title.standoff+mr*st:(ge.side==="top"||ge.side==="left")&&(kr=ge._depth+ge.title.standoff+mr*(ct+Ur*et));else{var Or=$n(ge);if(ge.type==="multicategory")kr=ge._depth;else{var pe=1.5*mr;Or&&(pe=.5*mr,ge.ticks==="outside"&&(pe+=ge.ticklen)),kr=10+pe+(ge.linewidth?ge.linewidth-1:0)}Or||(Tr==="x"?kr+=ge.side==="top"?mr*(ge.showticklabels?1:0):mr*(ge.showticklabels?1.5:.5):kr+=ge.side==="right"?mr*(ge.showticklabels?1:.5):mr*(ge.showticklabels?.5:0))}var Ke=X.getPxPosition(ve,ge),xr,Gr,ln;Tr==="x"?(Gr=ge._offset+ge._length/2,ln=ge.side==="top"?Ke-kr:Ke+kr):(ln=ge._offset+ge._length/2,Gr=ge.side==="right"?Ke+kr:Ke-kr,xr={rotate:"-90",offset:0});var wn;if(ge.type!=="multicategory"){var rn=ge._selections[ge._id+"tick"];if(wn={selection:rn,side:ge.side},rn&&rn.node()&&rn.node().parentNode){var Qr=o.getTranslate(rn.node().parentNode);wn.offsetLeft=Qr.x,wn.offsetTop=Qr.y}ge.title.hasOwnProperty("standoff")&&(wn.pad=0)}return ge._titleStandoff=kr,i.draw(ve,br+"title",{propContainer:ge,propName:ge._name+".title.text",placeholder:dr._dfltTitle[Tr],avoid:wn,transform:xr,attributes:{x:Gr,y:ln,"text-anchor":"middle"}})}X.shouldShowZeroLine=function(ve,ge,dr){var br=t.simpleMap(ge.range,ge.r2l);return br[0]*br[1]<=0&&ge.zeroline&&(ge.type==="linear"||ge.type==="-")&&!(ge.rangebreaks&&ge.maskBreaks(0)===B)&&(da(ge,0)||!ra(ve,ge,dr,br)||Se(ve,ge))},X.clipEnds=function(ve,ge){return ge.filter(function(dr){return da(ve,dr.x)})};function da(ve,ge){var dr=ve.l2p(ge);return dr>1&&dr<ve._length-1}function ra(ve,ge,dr,br){var Tr=dr._mainAxis;if(!Tr)return;var mr=ve._fullLayout,kr=ge._id.charAt(0),Ur=X.counterLetter(ge._id),Or=ge._offset+(Math.abs(br[0])<Math.abs(br[1])==(kr==="x")?0:ge._length);function pe(wn){if(!wn.showline||!wn.linewidth)return!1;var rn=Math.max((wn.linewidth+ge.zerolinewidth)/2,1);function Qr(Qn){return typeof Qn=="number"&&Math.abs(Qn-Or)<rn}if(Qr(wn._mainLinePosition)||Qr(wn._mainMirrorPosition))return!0;var vn=wn._linepositions||{};for(var Oa in vn)if(Qr(vn[Oa][0])||Qr(vn[Oa][1]))return!0}var Ke=mr._plots[dr._mainSubplot];if(!(Ke.mainplotinfo||Ke).overlays.length)return pe(dr);for(var xr=X.list(ve,Ur),Gr=0;Gr<xr.length;Gr++){var ln=xr[Gr];if(ln._mainAxis===Tr&&pe(ln))return!0}}function Se(ve,ge){for(var dr=ve._fullData,br=ge._mainSubplot,Tr=ge._id.charAt(0),mr=0;mr<dr.length;mr++){var kr=dr[mr];if(kr.visible===!0&&kr.xaxis+kr.yaxis===br&&(A.traceIs(kr,"bar-like")&&kr.orientation==={x:"h",y:"v"}[Tr]||kr.fill&&kr.fill.charAt(kr.fill.length-1)===Tr))return!0}return!1}function Re(ve){var ge=u.select(ve),dr=ge.select(".text-math-group");return dr.empty()?ge.select("text"):dr}X.allowAutoMargin=function(ve){for(var ge=X.list(ve,"",!0),dr=0;dr<ge.length;dr++){var br=ge[dr];br.automargin&&(E.allowAutoMargin(ve,Ze(br)),br.mirror&&E.allowAutoMargin(ve,tr(br))),A.getComponentMethod("rangeslider","isVisible")(br)&&E.allowAutoMargin(ve,zr(br))}};function Ze(ve){return ve._id+".automargin"}function tr(ve){return Ze(ve)+".mirror"}function zr(ve){return ve._id+".rangeslider"}X.swap=function(ve,ge){for(var dr=tn(ve,ge),br=0;br<dr.length;br++)$r(ve,dr[br].x,dr[br].y)};function tn(ve,ge){var dr=[],br,Tr;for(br=0;br<ge.length;br++){var mr=[],kr=ve._fullData[ge[br]].xaxis,Ur=ve._fullData[ge[br]].yaxis;if(!(!kr||!Ur)){for(Tr=0;Tr<dr.length;Tr++)(dr[Tr].x.indexOf(kr)!==-1||dr[Tr].y.indexOf(Ur)!==-1)&&mr.push(Tr);if(!mr.length){dr.push({x:[kr],y:[Ur]});continue}var Or=dr[mr[0]],pe;if(mr.length>1)for(Tr=1;Tr<mr.length;Tr++)pe=dr[mr[Tr]],Yr(Or.x,pe.x),Yr(Or.y,pe.y);Yr(Or.x,[kr]),Yr(Or.y,[Ur])}}return dr}function Yr(ve,ge){for(var dr=0;dr<ge.length;dr++)ve.indexOf(ge[dr])===-1&&ve.push(ge[dr])}function $r(ve,ge,dr){var br=[],Tr=[],mr=ve.layout,kr,Ur;for(kr=0;kr<ge.length;kr++)br.push(X.getFromId(ve,ge[kr]));for(kr=0;kr<dr.length;kr++)Tr.push(X.getFromId(ve,dr[kr]));var Or=Object.keys(a),pe=["anchor","domain","overlaying","position","side","tickangle","editType"],Ke=["linear","log"];for(kr=0;kr<Or.length;kr++){var xr=Or[kr],Gr=br[0][xr],ln=Tr[0][xr],wn=!0,rn=!1,Qr=!1;if(!(xr.charAt(0)==="_"||typeof Gr=="function"||pe.indexOf(xr)!==-1)){for(Ur=1;Ur<br.length&&wn;Ur++){var vn=br[Ur][xr];xr==="type"&&Ke.indexOf(Gr)!==-1&&Ke.indexOf(vn)!==-1&&Gr!==vn?rn=!0:vn!==Gr&&(wn=!1)}for(Ur=1;Ur<Tr.length&&wn;Ur++){var Oa=Tr[Ur][xr];xr==="type"&&Ke.indexOf(ln)!==-1&&Ke.indexOf(Oa)!==-1&&ln!==Oa?Qr=!0:Tr[Ur][xr]!==ln&&(wn=!1)}wn&&(rn&&(mr[br[0]._name].type="linear"),Qr&&(mr[Tr[0]._name].type="linear"),In(mr,xr,br,Tr,ve._fullLayout._dfltTitle))}}for(kr=0;kr<ve._fullLayout.annotations.length;kr++){var Qn=ve._fullLayout.annotations[kr];ge.indexOf(Qn.xref)!==-1&&dr.indexOf(Qn.yref)!==-1&&t.swapAttrs(mr.annotations[kr],["?"])}}function In(ve,ge,dr,br,Tr){var mr=t.nestedProperty,kr=mr(ve[dr[0]._name],ge).get(),Ur=mr(ve[br[0]._name],ge).get(),Or;for(ge==="title"&&(kr&&kr.text===Tr.x&&(kr.text=Tr.y),Ur&&Ur.text===Tr.y&&(Ur.text=Tr.x)),Or=0;Or<dr.length;Or++)mr(ve,dr[Or]._name+"."+ge).set(Ur);for(Or=0;Or<br.length;Or++)mr(ve,br[Or]._name+"."+ge).set(kr)}function Nn(ve){return ve._id==="angularaxis"}function Kn(ve,ge){for(var dr=ge._rangebreaks.length,br=0;br<dr;br++){var Tr=ge._rangebreaks[br];if(ve>=Tr.min&&ve<Tr.max)return Tr.max}return ve}function $n(ve){return(ve.ticklabelposition||"").indexOf("inside")!==-1}function ia(ve,ge){$n(ve._anchorAxis||{})&&ve._hideCounterAxisInsideTickLabels&&ve._hideCounterAxisInsideTickLabels(ge)}function Cn(ve,ge,dr,br){var Tr=ve.anchor!=="free"&&(ve.overlaying===void 0||ve.overlaying===!1)?ve._id:ve.overlaying,mr;br?mr=ve.side==="right"?ge:-ge:mr=ge,Tr in dr||(dr[Tr]={}),ve.side in dr[Tr]||(dr[Tr][ve.side]=0),dr[Tr][ve.side]+=mr}function Fa(ve,ge){return ve.autoshift?ge[ve.overlaying][ve.side]:ve.shift||0}function Ga(ve,ge){return/%f/.test(ge)?ve>=L:/%L/.test(ge)?ve>=P:/%[SX]/.test(ge)?ve>=_:/%M/.test(ge)?ve>=b:/%[HI]/.test(ge)?ve>=h:/%p/.test(ge)?ve>=c:/%[Aadejuwx]/.test(ge)?ve>=T:/%[UVW]/.test(ge)?ve>=M:/%[Bbm]/.test(ge)?ve>=k:/%[q]/.test(ge)?ve>=x:/%[Yy]/.test(ge)?ve>=m:!0}}),ub=Vt((Z,V)=>{V.exports=function(u,d,E){var A,t;if(E){var e=d==="reversed"||d==="min reversed"||d==="max reversed";A=E[e?1:0],t=E[e?0:1]}var r=u("autorangeoptions.minallowed",t===null?A:void 0),i=u("autorangeoptions.maxallowed",A===null?t:void 0);r===void 0&&u("autorangeoptions.clipmin"),i===void 0&&u("autorangeoptions.clipmax"),u("autorangeoptions.include")}}),cb=Vt((Z,V)=>{var u=ub();V.exports=function(d,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&&(u(A,a,i),(r==="linear"||r==="-")&&A("rangemode")),E.cleanRange()}}),WT=Vt((Z,V)=>{var u={left:0,top:0};V.exports=d;function d(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?u:A.getBoundingClientRect()}}),jy=Vt((Z,V)=>{var u=eb();function d(){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=u&&d()}),GT=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){var e=(u-E)/(A-E),r=e+d/(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}}),ZT=Vt((Z,V)=>{var u=Xr(),d=[["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=u.constrain(Math.floor(E*3),0,2),e==="bottom"?A=0:e==="middle"?A=1:e==="top"?A=2:A=u.constrain(Math.floor(A*3),0,2),d[A][E]}}),KT=Vt((Z,V)=>{var u=mm(),d=By(),E=Lg().getGraphDiv,A=zg(),t=V.exports={};t.wrapped=function(e,r,i){e=E(e),e._fullLayout&&d.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&&u.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}))}}),ih=Vt((Z,V)=>{var u=WT(),d=rb(),E=jy(),A=Xr().removeElement,t=Af(),e=V.exports={};e.align=GT(),e.getCursor=ZT();var r=KT();e.unhover=r.wrapped,e.unhoverRaw=r.raw,e.init=function(o){var a=o.gd,s=1,f=a._context.doubleClickDelay,v=o.element,g,m,w,l,x,y,S,k;a._mouseDownTime||(a._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=c,E?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=c,v.addEventListener("touchstart",c,{passive:!1})):v.ontouchstart=c;function M(_,P,L){return Math.abs(_)<L&&(_=0),Math.abs(P)<L&&(P=0),[_,P]}var T=o.clampFn||M;function c(_){a._dragged=!1,a._dragging=!0;var P=n(_);g=P[0],m=P[1],S=_.target,y=_,k=_.buttons===2||_.ctrlKey,typeof _.clientX>"u"&&typeof _.clientY>"u"&&(_.clientX=g,_.clientY=m),w=new Date().getTime(),w-a._mouseDownTime<f?s+=1:(s=1,a._mouseDownTime=w),o.prepFn&&o.prepFn(_,g,m),d&&!k?(x=i(),x.style.cursor=window.getComputedStyle(v).cursor):d||(x=document,l=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(v).cursor),document.addEventListener("mouseup",b),document.addEventListener("touchend",b),o.dragmode!==!1&&(_.preventDefault(),document.addEventListener("mousemove",h),document.addEventListener("touchmove",h,{passive:!1}))}function h(_){_.preventDefault();var P=n(_),L=o.minDrag||t.MINDRAG,D=T(P[0]-g,P[1]-m,L),B=D[0],R=D[1];(B||R)&&(a._dragged=!0,e.unhover(a,_)),a._dragged&&o.moveFn&&!k&&(a._dragdata={element:v,dx:B,dy:R},o.moveFn(B,R))}function b(_){if(delete a._dragdata,o.dragmode!==!1&&(_.preventDefault(),document.removeEventListener("mousemove",h),document.removeEventListener("touchmove",h)),document.removeEventListener("mouseup",b),document.removeEventListener("touchend",b),d?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>f&&(s=Math.max(s-1,1)),a._dragged)o.doneFn&&o.doneFn();else{var P;y.target===S?P=y:(P={target:S,srcElement:S,toElement:S},Object.keys(y).concat(Object.keys(y.__proto__)).forEach(L=>{var D=y[L];!P[L]&&typeof D!="function"&&(P[L]=D)})),o.clickFn&&o.clickFn(s,P),k||S.dispatchEvent(new MouseEvent("click",_))}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 u(o.changedTouches?o.changedTouches[0]:o,document.body)}}),$h=Vt((Z,V)=>{V.exports=function(u,d){(u.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&u.classed(E,!1)}),d&&u.classed("cursor-"+d,!0)}}),YT=Vt((Z,V)=>{var u=$h(),d="data-savedcursor",E="!!";V.exports=function(A,t){var e=A.attr(d);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(d,n.substr(7)).classed(n,!1)}A.attr(d)||A.attr(d,E)}u(A,t)}else e&&(A.attr(d,null),e===E?u(A):u(A,e))}}),fb=Vt((Z,V)=>{var u=yu(),d=nf();V.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:u({editType:"legend"}),grouptitlefont:u({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:u({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),Uy=Vt(Z=>{Z.isGrouped=function(V){return(V.traceorder||"").indexOf("grouped")!==-1},Z.isVertical=function(V){return V.orientation!=="h"},Z.isReversed=function(V){return(V.traceorder||"").indexOf("reversed")!==-1}}),hb=Vt((Z,V)=>{var u=ji(),d=Xr(),E=cl(),A=Tl(),t=fb(),e=dm(),r=Uy();function i(n,o,a,s){var f=o[n]||{},v=E.newContainer(a,n);function g(et,K){return d.coerce(f,v,t,et,K)}var m=d.coerceFont(g,"font",a.font);g("bgcolor",a.paper_bgcolor),g("bordercolor");var w=g("visible");if(w){for(var l,x=function(et,K){var ot=l._input,X=l;return d.coerce(ot,X,A,et,K)},y=a.font||{},S=d.coerceFont(g,"grouptitlefont",y,{overrideDflt:{size:Math.round(y.size*1.1)}}),k=0,M=!1,T="normal",c=(a.shapes||[]).filter(function(et){return et.showlegend}),h=s.concat(c).filter(function(et){return n===(et.legend||"legend")}),b=0;b<h.length;b++)if(l=h[b],!!l.visible){var _=l._isShape;(l.showlegend||l._dfltShowLegend&&!(l._module&&l._module.attributes&&l._module.attributes.showlegend&&l._module.attributes.showlegend.dflt===!1))&&(k++,l.showlegend&&(M=!0,(!_&&u.traceIs(l,"pie-like")||l._input.showlegend===!0)&&k++),d.coerceFont(x,"legendgrouptitle.font",S)),(!_&&u.traceIs(l,"bar")&&a.barmode==="stack"||["tonextx","tonexty"].indexOf(l.fill)!==-1)&&(T=r.isGrouped({traceorder:T})?"grouped+reversed":"reversed"),l.legendgroup!==void 0&&l.legendgroup!==""&&(T=r.isReversed({traceorder:T})?"reversed+grouped":"grouped")}var P=d.coerce(o,a,e,"showlegend",M&&k>(n==="legend"?1:0));if(P===!1&&(a[n]=void 0),!(P===!1&&!f.uirevision)&&(g("uirevision",a.uirevision),P!==!1)){g("borderwidth");var L=g("orientation"),D=g("yref"),B=g("xref"),R=L==="h",I=D==="paper",F=B==="paper",N,j,G,rt="left";R?(N=0,u.getComponentMethod("rangeslider","isVisible")(o.xaxis)?I?(j=1.1,G="bottom"):(j=1,G="top"):I?(j=-.1,G="top"):(j=0,G="bottom")):(j=1,G="auto",F?N=1.02:(N=1,rt="right")),d.coerce(f,v,{x:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:N}},"x"),d.coerce(f,v,{y:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:j}},"y"),g("traceorder",T),r.isGrouped(a[n])&&g("tracegroupgap"),g("entrywidth"),g("entrywidthmode"),g("indentation"),g("itemsizing"),g("itemwidth"),g("itemclick"),g("itemdoubleclick"),g("groupclick"),g("xanchor",rt),g("yanchor",G),g("maxheight"),g("valign"),d.noneOrAll(f,v,["x","y"]);var ct=g("title.text");if(ct){g("title.side",R?"left":"top");var st=d.extendFlat({},m,{size:d.bigFont(m.size)});d.coerceFont(g,"title.font",st)}}}}V.exports=function(n,o,a){var s,f=a.slice(),v=o.shapes;if(v)for(s=0;s<v.length;s++){var g=v[s];if(g.showlegend){var m={_input:g._input,visible:g.visible,showlegend:g.showlegend,legend:g.legend};f.push(m)}}var w=["legend"];for(s=0;s<f.length;s++)d.pushUnique(w,f[s].legend);for(o._legends=[],s=0;s<w.length;s++){var l=w[s];i(l,n,o,f),o[l]&&(o[l]._id=l),o._legends.push(l)}}}),XT=Vt((Z,V)=>{var u=ji(),d=Xr(),E=d.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&&d.notifier(d._(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 f=a==="togglegroup",v=i.hiddenlabels?i.hiddenlabels.slice():[],g=t.data()[0][0];if(g.groupTitle&&g.noClick)return;var m=e._fullData,w=(i.shapes||[]).filter(function(Kt){return Kt.showlegend}),l=m.concat(w),x=g.trace;x._isShape&&(x=x._fullInput);var y=x.legendgroup,S,k,M,T,c,h,b={},_=[],P=[],L=[];function D(Kt,mt){var bt=_.indexOf(Kt),vt=b.visible;return vt||(vt=b.visible=[]),_.indexOf(Kt)===-1&&(_.push(Kt),bt=_.length-1),vt[bt]=mt,bt}var B=(i.shapes||[]).map(function(Kt){return Kt._input}),R=!1;function I(Kt,mt){B[Kt].visible=mt,R=!0}function F(Kt,mt){if(!(g.groupTitle&&!f)){var bt=Kt._fullInput||Kt,vt=bt._isShape,Ut=bt.index;Ut===void 0&&(Ut=bt._index);var re=bt.visible===!1?!1:mt;vt?I(Ut,re):D(Ut,re)}}var N=x.legend,j=x._fullInput,G=j&&j._isShape;if(!G&&u.traceIs(x,"pie-like")){var rt=g.label,ct=v.indexOf(rt);if(s==="toggle")ct===-1?v.push(rt):v.splice(ct,1);else if(s==="toggleothers"){var st=ct!==-1,et=[];for(S=0;S<e.calcdata.length;S++){var K=e.calcdata[S];for(k=0;k<K.length;k++){var ot=K[k],X=ot.label;N===K[0].trace.legend&&rt!==X&&(v.indexOf(X)===-1&&(st=!0),E(v,X),et.push(X))}}if(!st)for(var Q=0;Q<et.length;Q++){var ut=v.indexOf(et[Q]);ut!==-1&&v.splice(ut,1)}}u.call("_guiRelayout",e,"hiddenlabels",v)}else{var J=y&&y.length,q=[],it;if(J)for(S=0;S<l.length;S++)it=l[S],it.visible&&it.legendgroup===y&&q.push(S);if(s==="toggle"){var nt;switch(x.visible){case!0:nt="legendonly";break;case!1:nt=!1;break;case"legendonly":nt=!0;break}if(J)if(f)for(S=0;S<l.length;S++){var dt=l[S];dt.visible!==!1&&dt.legendgroup===y&&F(dt,nt)}else F(x,nt);else F(x,nt)}else if(s==="toggleothers"){var Tt,wt,It,Ct,Nt,ee=!0;for(S=0;S<l.length;S++)if(Nt=l[S],Tt=Nt===x,It=Nt.showlegend!==!0,!(Tt||It)&&(wt=J&&Nt.legendgroup===y,!wt&&Nt.legend===N&&Nt.visible===!0&&!u.traceIs(Nt,"notLegendIsolatable"))){ee=!1;break}for(S=0;S<l.length;S++)if(Nt=l[S],!(Nt.visible===!1||Nt.legend!==N)&&!u.traceIs(Nt,"notLegendIsolatable"))switch(x.visible){case"legendonly":F(Nt,!0);break;case!0:Ct=ee?!0:"legendonly",Tt=Nt===x,It=Nt.showlegend!==!0&&!Nt.legendgroup,wt=Tt||J&&Nt.legendgroup===y,F(Nt,wt||It?!0:Ct);break}}for(S=0;S<P.length;S++)if(M=P[S],!!M){var Jt=M.constructUpdate(),te=Object.keys(Jt);for(k=0;k<te.length;k++)T=te[k],h=b[T]=b[T]||[],h[L[S]]=Jt[T]}for(c=Object.keys(b),S=0;S<c.length;S++)for(T=c[S],k=0;k<_.length;k++)b[T].hasOwnProperty(k)||(b[T][k]=void 0);R?u.call("_guiUpdate",e,b,{shapes:B},_):u.call("_guiRestyle",e,b,_)}}}),pb=Vt((Z,V)=>{V.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),$T=Vt((Z,V)=>{var u=ji(),d=Uy();V.exports=function(E,A,t){var e=A._inHover,r=d.isGrouped(A),i=d.isReversed(A),n={},o=[],a=!1,s={},f=0,v=0,g,m;function w(F,N,j){if(A.visible!==!1&&!(t&&F!==A._id))if(N===""||!d.isGrouped(A)){var G="~~i"+f;o.push(G),n[G]=[j],f++}else o.indexOf(N)===-1?(o.push(N),a=!0,n[N]=[j]):n[N].push(j)}for(g=0;g<E.length;g++){var l=E[g],x=l[0],y=x.trace,S=y.legend,k=y.legendgroup;if(!(!e&&(!y.visible||!y.showlegend)))if(u.traceIs(y,"pie-like"))for(s[k]||(s[k]={}),m=0;m<l.length;m++){var M=l[m].label;s[k][M]||(w(S,k,{label:M,color:l[m].color,i:l[m].i,trace:y,pts:l[m].pts}),s[k][M]=!0,v=Math.max(v,(M||"").length))}else w(S,k,x),v=Math.max(v,(y.name||"").length)}if(!o.length)return[];var T=!a||!r,c=[];for(g=0;g<o.length;g++){var h=n[o[g]];T?c.push(h[0]):c.push(h)}for(T&&(c=[c]),g=0;g<c.length;g++){var b=1/0;for(m=0;m<c[g].length;m++){var _=c[g][m].trace.legendrank;b>_&&(b=_)}c[g][0]._groupMinRank=b,c[g][0]._preGroupSort=g}var P=function(F,N){return F[0]._groupMinRank-N[0]._groupMinRank||F[0]._preGroupSort-N[0]._preGroupSort},L=function(F,N){return F.trace.legendrank-N.trace.legendrank||F._preSort-N._preSort};for(c.forEach(function(F,N){F[0]._preGroupSort=N}),c.sort(P),g=0;g<c.length;g++){c[g].forEach(function(F,N){F._preSort=N}),c[g].sort(L);var D=c[g][0].trace,B=null;for(m=0;m<c[g].length;m++){var R=c[g][m].trace.legendgrouptitle;if(R&&R.text){B=R,e&&(R.font=A._groupTitleFont);break}}if(i&&c[g].reverse(),B){var I=!1;for(m=0;m<c[g].length;m++)if(u.traceIs(c[g][m].trace,"pie-like")){I=!0;break}c[g].unshift({i:-1,groupTitle:B,noClick:I,trace:{showlegend:D.showlegend,legendgroup:D.legendgroup,visible:A.groupclick==="toggleitem"?!0:D.visible}})}for(m=0;m<c[g].length;m++)c[g][m]=[c[g][m]]}return A._lgroupsLength=c.length,A._maxNameLength=v,c}}),Ad=Vt(Z=>{var V=Xr();function u(d){return d.indexOf("e")!==-1?d.replace(/[.]?0+e/,"e"):d.indexOf(".")!==-1?d.replace(/[.]?0+$/,""):d}Z.formatPiePercent=function(d,E){var A=u((d*100).toPrecision(3));return V.numSeparate(A,E)+"%"},Z.formatPieValue=function(d,E){var A=u(d.toPrecision(10));return V.numSeparate(A,E)},Z.getFirstFilled=function(d,E){if(V.isArrayOrTypedArray(d))for(var A=0;A<E.length;A++){var t=d[E[A]];if(t||t===0||t==="")return t}},Z.castOption=function(d,E){if(V.isArrayOrTypedArray(d))return Z.getFirstFilled(d,E);if(d)return d},Z.getRotationAngle=function(d){return(d==="auto"?0:d)*Math.PI/180}}),JT=Vt((Z,V)=>{var u=Eo(),d=Pi();V.exports=function(E,A,t,e){var r=t.marker.pattern;r&&r.shape?u.pointStyle(E,t,e,A):d.fill(E,A.color)}}),_m=Vt((Z,V)=>{var u=Pi(),d=Ad().castOption,E=JT();V.exports=function(A,t,e,r){var i=e.marker.line,n=d(i.color,t.pts)||u.defaultLine,o=d(i.width,t.pts)||0;A.call(E,t,e,r).style("stroke-width",o).call(u.stroke,n)}}),db=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Xr(),A=E.strTranslate,t=Eo(),e=Pi(),r=nh().extractOpts,i=nu(),n=_m(),o=Ad().castOption,a=pb(),s=12,f=5,v=2,g=10,m=5;V.exports=function(y,S,k){var M=S._fullLayout;k||(k=M.legend);var T=k.itemsizing==="constant",c=k.itemwidth,h=(c+a.itemGap*2)/2,b=A(h,0),_=function(et,K,ot,X){var Q;if(et+1)Q=et;else if(K&&K.width>0)Q=K.width;else return 0;return T?X:Math.min(Q,ot)};y.each(function(et){var K=u.select(this),ot=E.ensureSingle(K,"g","layers");ot.style("opacity",et[0].trace.opacity);var X=k.indentation,Q=k.valign,ut=et[0].lineHeight,J=et[0].height;if(Q==="middle"&&X===0||!ut||!J)ot.attr("transform",null);else{var q={top:1,bottom:-1}[Q],it=q*(.5*(ut-J+3))||0,nt=k.indentation;ot.attr("transform",A(nt,it))}var dt=ot.selectAll("g.legendfill").data([et]);dt.enter().append("g").classed("legendfill",!0);var Tt=ot.selectAll("g.legendlines").data([et]);Tt.enter().append("g").classed("legendlines",!0);var wt=ot.selectAll("g.legendsymbols").data([et]);wt.enter().append("g").classed("legendsymbols",!0),wt.selectAll("g.legendpoints").data([et]).enter().append("g").classed("legendpoints",!0)}).each(st).each(D).each(R).each(B).each(F).each(rt).each(G).each(P).each(L).each(N).each(j);function P(et){var K=l(et),ot=K.showFill,X=K.showLine,Q=K.showGradientLine,ut=K.showGradientFill,J=K.anyFill,q=K.anyLine,it=et[0],nt=it.trace,dt,Tt,wt=r(nt),It=wt.colorscale,Ct=wt.reversescale,Nt=function(vt){if(vt.size())if(ot)t.fillGroupStyle(vt,S,!0);else{var Ut="legendfill-"+nt.uid;t.gradient(vt,S,Ut,w(Ct),It,"fill")}},ee=function(vt){if(vt.size()){var Ut="legendline-"+nt.uid;t.lineGroupStyle(vt),t.gradient(vt,S,Ut,w(Ct),It,"stroke")}},Jt=i.hasMarkers(nt)||!J?"M5,0":q?"M5,-2":"M5,-3",te=u.select(this),Kt=te.select(".legendfill").selectAll("path").data(ot||ut?[et]:[]);if(Kt.enter().append("path").classed("js-fill",!0),Kt.exit().remove(),Kt.attr("d",Jt+"h"+c+"v6h-"+c+"z").call(Nt),X||Q){var mt=_(void 0,nt.line,g,f);Tt=E.minExtend(nt,{line:{width:mt}}),dt=[E.minExtend(it,{trace:Tt})]}var bt=te.select(".legendlines").selectAll("path").data(X||Q?[dt]:[]);bt.enter().append("path").classed("js-line",!0),bt.exit().remove(),bt.attr("d",Jt+(Q?"l"+c+",0.0001":"h"+c)).call(X?t.lineGroupStyle:ee)}function L(et){var K=l(et),ot=K.anyFill,X=K.anyLine,Q=K.showLine,ut=K.showMarker,J=et[0],q=J.trace,it=!ut&&!X&&!ot&&i.hasText(q),nt,dt;function Tt(Kt,mt,bt,vt){var Ut=E.nestedProperty(q,Kt).get(),re=E.isArrayOrTypedArray(Ut)&&mt?mt(Ut):Ut;if(T&&re&&vt!==void 0&&(re=vt),bt){if(re<bt[0])return bt[0];if(re>bt[1])return bt[1]}return re}function wt(Kt){return J._distinct&&J.index&&Kt[J.index]?Kt[J.index]:Kt[0]}if(ut||it||Q){var It={},Ct={};if(ut){It.mc=Tt("marker.color",wt),It.mx=Tt("marker.symbol",wt),It.mo=Tt("marker.opacity",E.mean,[.2,1]),It.mlc=Tt("marker.line.color",wt),It.mlw=Tt("marker.line.width",E.mean,[0,5],v),Ct.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var Nt=Tt("marker.size",E.mean,[2,16],s);It.ms=Nt,Ct.marker.size=Nt}Q&&(Ct.line={width:Tt("line.width",wt,[0,10],f)}),it&&(It.tx="Aa",It.tp=Tt("textposition",wt),It.ts=10,It.tc=Tt("textfont.color",wt),It.tf=Tt("textfont.family",wt),It.tw=Tt("textfont.weight",wt),It.ty=Tt("textfont.style",wt),It.tv=Tt("textfont.variant",wt),It.tC=Tt("textfont.textcase",wt),It.tE=Tt("textfont.lineposition",wt),It.tS=Tt("textfont.shadow",wt)),nt=[E.minExtend(J,It)],dt=E.minExtend(q,Ct),dt.selectedpoints=null,dt.texttemplate=null}var ee=u.select(this).select("g.legendpoints"),Jt=ee.selectAll("path.scatterpts").data(ut?nt:[]);Jt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),Jt.exit().remove(),Jt.call(t.pointStyle,dt,S),ut&&(nt[0].mrc=3);var te=ee.selectAll("g.pointtext").data(it?nt:[]);te.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),te.exit().remove(),te.selectAll("text").call(t.textPointStyle,dt,S)}function D(et){var K=et[0].trace,ot=K.type==="waterfall";if(et[0]._distinct&&ot){var X=et[0].trace[et[0].dir].marker;return et[0].mc=X.color,et[0].mlw=X.line.width,et[0].mlc=X.line.color,I(et,this,"waterfall")}var Q=[];K.visible&&ot&&(Q=et[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 ut=u.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(Q);ut.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),ut.exit().remove(),ut.each(function(J){var q=u.select(this),it=K[J[0]].marker,nt=_(void 0,it.line,m,v);q.attr("d",J[1]).style("stroke-width",nt+"px").call(e.fill,it.color),nt&&q.call(e.stroke,it.line.color)})}function B(et){I(et,this)}function R(et){I(et,this,"funnel")}function I(et,K,ot){var X=et[0].trace,Q=X.marker||{},ut=Q.line||{},J=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=ot?X.visible&&X.type===ot:d.traceIs(X,"bar"),it=u.select(K).select("g.legendpoints").selectAll("path.legend"+ot).data(q?[et]:[]);it.enter().append("path").classed("legend"+ot,!0).attr("d",J).attr("transform",b),it.exit().remove(),it.each(function(nt){var dt=u.select(this),Tt=nt[0],wt=_(Tt.mlw,Q.line,m,v);dt.style("stroke-width",wt+"px");var It=Tt.mcc;if(!k._inHover&&"mc"in Tt){var Ct=r(Q),Nt=Ct.mid;Nt===void 0&&(Nt=(Ct.max+Ct.min)/2),It=t.tryColorscale(Q,"")(Nt)}var ee=It||Tt.mc||Q.color,Jt=Q.pattern,te=t.getPatternAttr,Kt=Jt&&(te(Jt.shape,0,"")||te(Jt.path,0,""));if(Kt){var mt=te(Jt.bgcolor,0,null),bt=te(Jt.fgcolor,0,null),vt=Jt.fgopacity,Ut=x(Jt.size,8,10),re=x(Jt.solidity,.5,1),Zt="legend-"+X.uid;dt.call(t.pattern,"legend",S,Zt,Kt,Ut,re,It,Jt.fillmode,mt,bt,vt)}else dt.call(e.fill,ee);wt&&e.stroke(dt,Tt.mlc||ut.color)})}function F(et){var K=et[0].trace,ot=u.select(this).select("g.legendpoints").selectAll("path.legendbox").data(K.visible&&d.traceIs(K,"box-violin")?[et]:[]);ot.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),ot.exit().remove(),ot.each(function(){var X=u.select(this);if((K.boxpoints==="all"||K.points==="all")&&e.opacity(K.fillcolor)===0&&e.opacity((K.line||{}).color)===0){var Q=E.minExtend(K,{marker:{size:T?s:E.constrain(K.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ot.call(t.pointStyle,Q,S)}else{var ut=_(void 0,K.line,m,v);X.style("stroke-width",ut+"px").call(e.fill,K.fillcolor),ut&&e.stroke(X,K.line.color)}})}function N(et){var K=et[0].trace,ot=u.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(K.visible&&K.type==="candlestick"?[et,et]:[]);ot.enter().append("path").classed("legendcandle",!0).attr("d",function(X,Q){return Q?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",b).style("stroke-miterlimit",1),ot.exit().remove(),ot.each(function(X,Q){var ut=u.select(this),J=K[Q?"increasing":"decreasing"],q=_(void 0,J.line,m,v);ut.style("stroke-width",q+"px").call(e.fill,J.fillcolor),q&&e.stroke(ut,J.line.color)})}function j(et){var K=et[0].trace,ot=u.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(K.visible&&K.type==="ohlc"?[et,et]:[]);ot.enter().append("path").classed("legendohlc",!0).attr("d",function(X,Q){return Q?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",b).style("stroke-miterlimit",1),ot.exit().remove(),ot.each(function(X,Q){var ut=u.select(this),J=K[Q?"increasing":"decreasing"],q=_(void 0,J.line,m,v);ut.style("fill","none").call(t.dashLine,J.line.dash,q),q&&e.stroke(ut,J.line.color)})}function G(et){ct(et,this,"pie")}function rt(et){ct(et,this,"funnelarea")}function ct(et,K,ot){var X=et[0],Q=X.trace,ut=ot?Q.visible&&Q.type===ot:d.traceIs(Q,ot),J=u.select(K).select("g.legendpoints").selectAll("path.legend"+ot).data(ut?[et]:[]);if(J.enter().append("path").classed("legend"+ot,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),J.exit().remove(),J.size()){var q=Q.marker||{},it=_(o(q.line.width,X.pts),q.line,m,v),nt="pieLike",dt=E.minExtend(Q,{marker:{line:{width:it}}},nt),Tt=E.minExtend(X,{trace:dt},nt);n(J,Tt,dt,S)}}function st(et){var K=et[0].trace,ot,X=[];if(K.visible)switch(K.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],ot=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],ot=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ot="radial";break;case"cone":X=[["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"]],ot=!1;break;case"streamtube":X=[["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"]],ot=!1;break;case"surface":X=[["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"]],ot=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ot=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ot=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ot=!1;break}var Q=u.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);Q.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),Q.exit().remove(),Q.each(function(ut,J){var q=u.select(this),it=r(K),nt=it.colorscale,dt=it.reversescale,Tt=function(Nt){if(Nt.size()){var ee="legendfill-"+K.uid;t.gradient(Nt,S,ee,w(dt,ot==="radial"),nt,"fill")}},wt;if(nt){if(!ot){var It=nt.length;wt=J===0?nt[dt?It-1:0][1]:J===1?nt[dt?0:It-1][1]:nt[Math.floor((It-1)/2)][1]}}else{var Ct=K.vertexcolor||K.facecolor||K.color;wt=E.isArrayOrTypedArray(Ct)?Ct[J]||Ct[0]:Ct}q.attr("d",ut[0]),wt?q.call(e.fill,wt):q.call(Tt)})}};function w(y,S){var k=S?"radial":"horizontal";return k+(y?"":"reversed")}function l(y){var S=y[0].trace,k=S.contours,M=i.hasLines(S),T=i.hasMarkers(S),c=S.visible&&S.fill&&S.fill!=="none",h=!1,b=!1;if(k){var _=k.coloring;_==="lines"?h=!0:M=_==="none"||_==="heatmap"||k.showlines,k.type==="constraint"?c=k._operation!=="=":(_==="fill"||_==="heatmap")&&(b=!0)}return{showMarker:T,showLine:M,showFill:c,showGradientLine:h,showGradientFill:b,anyLine:M||h,anyFill:c||b}}function x(y,S,k){return y&&E.isArrayOrTypedArray(y)?S:y>k?k:y}}),mb=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Uu(),A=ji(),t=mm(),e=ih(),r=Eo(),i=Pi(),n=Dl(),o=XT(),a=pb(),s=mf(),f=s.LINE_SPACING,v=s.FROM_TL,g=s.FROM_BR,m=$T(),w=db(),l=Uy(),x=1,y=/^legend[0-9]*$/;V.exports=function(N,j){if(j)k(N,j);else{var G=N._fullLayout,rt=G._legends,ct=G._infolayer.selectAll('[class^="legend"]');ct.each(function(){var ot=u.select(this),X=ot.attr("class"),Q=X.split(" ")[0];Q.match(y)&&rt.indexOf(Q)===-1&&ot.remove()});for(var st=0;st<rt.length;st++){var et=rt[st],K=N._fullLayout[et];k(N,K)}}};function S(N,j,G){if(!(j.title.side!=="top center"&&j.title.side!=="top right")){var rt=j.title.font,ct=rt.size*f,st=0,et=N.node(),K=r.bBox(et).width;j.title.side==="top center"?st=.5*(j._width-2*G-2*a.titlePad-K):j.title.side==="top right"&&(st=j._width-2*G-2*a.titlePad-K),n.positionText(N,G+a.titlePad+st,G+ct)}}function k(N,j){var G=j||{},rt=N._fullLayout,ct=F(G),st,et,K=G._inHover;if(K?(et=G.layer,st="hover"):(et=rt._infolayer,st=ct),!!et){st+=rt._uid,N._legendMouseDownTime||(N._legendMouseDownTime=0);var ot;if(K){if(!G.entries)return;ot=m(G.entries,G)}else{for(var X=(N.calcdata||[]).slice(),Q=rt.shapes,ut=0;ut<Q.length;ut++){var J=Q[ut];if(J.showlegend){var q={_isShape:!0,_fullInput:J,index:J._index,name:J.name||J.label.text||"shape "+J._index,legend:J.legend,legendgroup:J.legendgroup,legendgrouptitle:J.legendgrouptitle,legendrank:J.legendrank,legendwidth:J.legendwidth,showlegend:J.showlegend,visible:J.visible,opacity:J.opacity,mode:J.type==="line"?"lines":"markers",line:J.line,marker:{line:J.line,color:J.fillcolor,size:12,symbol:J.type==="rect"?"square":J.type==="circle"?"circle":"hexagon2"}};X.push([{trace:q}])}}ot=rt.showlegend&&m(X,G,rt._legends.length>1)}var it=rt.hiddenlabels||[];if(!K&&(!rt.showlegend||!ot.length))return et.selectAll("."+ct).remove(),rt._topdefs.select("#"+st).remove(),E.autoMargin(N,ct);var nt=d.ensureSingle(et,"g",ct,function(te){K||te.attr("pointer-events","all")}),dt=d.ensureSingleById(rt._topdefs,"clipPath",st,function(te){te.append("rect")}),Tt=d.ensureSingle(nt,"rect","bg",function(te){te.attr("shape-rendering","crispEdges")});Tt.call(i.stroke,G.bordercolor).call(i.fill,G.bgcolor).style("stroke-width",G.borderwidth+"px");var wt=d.ensureSingle(nt,"g","scrollbox"),It=G.title;G._titleWidth=0,G._titleHeight=0;var Ct;It.text?(Ct=d.ensureSingle(wt,"text",ct+"titletext"),Ct.attr("text-anchor","start").call(r.font,It.font).text(It.text),_(Ct,wt,N,G,x)):wt.selectAll("."+ct+"titletext").remove();var Nt=d.ensureSingle(nt,"rect","scrollbar",function(te){te.attr(a.scrollBarEnterAttrs).call(i.fill,a.scrollBarColor)}),ee=wt.selectAll("g.groups").data(ot);ee.enter().append("g").attr("class","groups"),ee.exit().remove();var Jt=ee.selectAll("g.traces").data(d.identity);Jt.enter().append("g").attr("class","traces"),Jt.exit().remove(),Jt.style("opacity",function(te){var Kt=te[0].trace;return A.traceIs(Kt,"pie-like")?it.indexOf(te[0].label)!==-1?.5:1:Kt.visible==="legendonly"?.5:1}).each(function(){u.select(this).call(c,N,G)}).call(w,N,G).each(function(){K||u.select(this).call(b,N,ct)}),d.syncOrAsync([E.previousPromises,function(){return D(N,ee,Jt,G)},function(){var te=rt._size,Kt=G.borderwidth,mt=G.xref==="paper",bt=G.yref==="paper";if(It.text&&S(Ct,G,Kt),!K){var vt,Ut;mt?vt=te.l+te.w*G.x-v[R(G)]*G._width:vt=rt.width*G.x-v[R(G)]*G._width,bt?Ut=te.t+te.h*(1-G.y)-v[I(G)]*G._effHeight:Ut=rt.height*(1-G.y)-v[I(G)]*G._effHeight;var re=B(N,ct,vt,Ut);if(re)return;if(rt.margin.autoexpand){var Zt=vt,ue=Ut;vt=mt?d.constrain(vt,0,rt.width-G._width):Zt,Ut=bt?d.constrain(Ut,0,rt.height-G._effHeight):ue,vt!==Zt&&d.log("Constrain "+ct+".x to make legend fit inside graph"),Ut!==ue&&d.log("Constrain "+ct+".y to make legend fit inside graph")}r.setTranslate(nt,vt,Ut)}if(Nt.on(".drag",null),nt.on("wheel",null),K||G._height<=G._maxHeight||N._context.staticPlot){var Me=G._effHeight;K&&(Me=G._height),Tt.attr({width:G._width-Kt,height:Me-Kt,x:Kt/2,y:Kt/2}),r.setTranslate(wt,0,0),dt.select("rect").attr({width:G._width-2*Kt,height:Me-2*Kt,x:Kt,y:Kt}),r.setClipUrl(wt,st,N),r.setRect(Nt,0,0,0,0),delete G._scrollY}else{var Ce=Math.max(a.scrollBarMinHeight,G._effHeight*G._effHeight/G._height),We=G._effHeight-Ce-2*a.scrollBarMargin,qe=G._height-G._effHeight,vr=We/qe,_r=Math.min(G._scrollY||0,qe);Tt.attr({width:G._width-2*Kt+a.scrollBarWidth+a.scrollBarMargin,height:G._effHeight-Kt,x:Kt/2,y:Kt/2}),dt.select("rect").attr({width:G._width-2*Kt+a.scrollBarWidth+a.scrollBarMargin,height:G._effHeight-2*Kt,x:Kt,y:Kt+_r}),r.setClipUrl(wt,st,N),lt(_r,Ce,vr),nt.on("wheel",function(){_r=d.constrain(G._scrollY+u.event.deltaY/qe*We,0,qe),lt(_r,Ce,vr),_r!==0&&_r!==qe&&u.event.preventDefault()});var er,Mr,Ir,de=function(se,ke,Ee){var Ue=(Ee-ke)/vr+se;return d.constrain(Ue,0,qe)},Dt=function(se,ke,Ee){var Ue=(ke-Ee)/vr+se;return d.constrain(Ue,0,qe)},qt=u.behavior.drag().on("dragstart",function(){var se=u.event.sourceEvent;se.type==="touchstart"?er=se.changedTouches[0].clientY:er=se.clientY,Ir=_r}).on("drag",function(){var se=u.event.sourceEvent;se.buttons===2||se.ctrlKey||(se.type==="touchmove"?Mr=se.changedTouches[0].clientY:Mr=se.clientY,_r=de(Ir,er,Mr),lt(_r,Ce,vr))});Nt.call(qt);var _t=u.behavior.drag().on("dragstart",function(){var se=u.event.sourceEvent;se.type==="touchstart"&&(er=se.changedTouches[0].clientY,Ir=_r)}).on("drag",function(){var se=u.event.sourceEvent;se.type==="touchmove"&&(Mr=se.changedTouches[0].clientY,_r=Dt(Ir,er,Mr),lt(_r,Ce,vr))});wt.call(_t)}function lt(se,ke,Ee){G._scrollY=N._fullLayout[ct]._scrollY=se,r.setTranslate(wt,0,-se),r.setRect(Nt,G._width,a.scrollBarMargin+se*Ee,a.scrollBarWidth,ke),dt.select("rect").attr("y",Kt+se)}if(N._context.edits.legendPosition){var yt,St,Ht,Yt;nt.classed("cursor-move",!0),e.init({element:nt.node(),gd:N,prepFn:function(se){if(se.target!==Nt.node()){var ke=r.getTranslate(nt);Ht=ke.x,Yt=ke.y}},moveFn:function(se,ke){if(Ht!==void 0&&Yt!==void 0){var Ee=Ht+se,Ue=Yt+ke;r.setTranslate(nt,Ee,Ue),yt=e.align(Ee,G._width,te.l,te.l+te.w,G.xanchor),St=e.align(Ue+G._height,-G._height,te.t+te.h,te.t,G.yanchor)}},doneFn:function(){if(yt!==void 0&&St!==void 0){var se={};se[ct+".x"]=yt,se[ct+".y"]=St,A.call("_guiRelayout",N,se)}},clickFn:function(se,ke){var Ee=et.selectAll("g.traces").filter(function(){var Ue=this.getBoundingClientRect();return ke.clientX>=Ue.left&&ke.clientX<=Ue.right&&ke.clientY>=Ue.top&&ke.clientY<=Ue.bottom});Ee.size()>0&&T(N,nt,Ee,se,ke)}})}}],N)}}function M(N,j,G){var rt=N[0],ct=rt.width,st=j.entrywidthmode,et=rt.trace.legendwidth||j.entrywidth;return st==="fraction"?j._maxWidth*et:G+(et||ct)}function T(N,j,G,rt,ct){var st=G.data()[0][0].trace,et={event:ct,node:G.node(),curveNumber:st.index,expandedIndex:st.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};st._group&&(et.group=st._group),A.traceIs(st,"pie-like")&&(et.label=G.datum()[0].label);var K=t.triggerHandler(N,"plotly_legendclick",et);if(rt===1){if(K===!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 ot=t.triggerHandler(N,"plotly_legenddoubleclick",et);ot!==!1&&K!==!1&&o(G,N,rt)}}function c(N,j,G){var rt=F(G),ct=N.data()[0][0],st=ct.trace,et=A.traceIs(st,"pie-like"),K=!G._inHover&&j._context.edits.legendText&&!et,ot=G._maxNameLength,X,Q;ct.groupTitle?(X=ct.groupTitle.text,Q=ct.groupTitle.font):(Q=G.font,G.entries?X=ct.text:(X=et?ct.label:st.name,st._meta&&(X=d.templateString(X,st._meta))));var ut=d.ensureSingle(N,"text",rt+"text");ut.attr("text-anchor","start").call(r.font,Q).text(K?h(X,ot):X);var J=G.indentation+G.itemwidth+a.itemGap*2;n.positionText(ut,J,0),K?ut.call(n.makeEditable,{gd:j,text:X}).call(_,N,j,G).on("edit",function(q){this.text(h(q,ot)).call(_,N,j,G);var it=ct.trace._fullInput||{},nt={};return nt.name=q,it._isShape?A.call("_guiRelayout",j,"shapes["+st.index+"].name",nt.name):A.call("_guiRestyle",j,nt,st.index)}):_(ut,N,j,G)}function h(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 b(N,j,G){var rt=j._context.doubleClickDelay,ct,st=1,et=d.ensureSingle(N,"rect",G+"toggle",function(K){j._context.staticPlot||K.style("cursor","pointer").attr("pointer-events","all"),K.call(i.fill,"rgba(0,0,0,0)")});j._context.staticPlot||(et.on("mousedown",function(){ct=new Date().getTime(),ct-j._legendMouseDownTime<rt?st+=1:(st=1,j._legendMouseDownTime=ct)}),et.on("mouseup",function(){if(!(j._dragged||j._editing)){var K=j._fullLayout[G];new Date().getTime()-j._legendMouseDownTime>rt&&(st=Math.max(st-1,1)),T(j,K,N,st,u.event)}}))}function _(N,j,G,rt,ct){rt._inHover&&N.attr("data-notex",!0),n.convertToTspans(N,G,function(){P(j,G,rt,ct)})}function P(N,j,G,rt){var ct=N.data()[0][0];if(!G._inHover&&ct&&!ct.trace.showlegend){N.remove();return}var st=N.select("g[class*=math-group]"),et=st.node(),K=F(G);G||(G=j._fullLayout[K]);var ot=G.borderwidth,X;rt===x?X=G.title.font:ct.groupTitle?X=ct.groupTitle.font:X=G.font;var Q=X.size*f,ut,J;if(et){var q=r.bBox(et);ut=q.height,J=q.width,rt===x?r.setTranslate(st,ot,ot+ut*.75):r.setTranslate(st,0,ut*.25)}else{var it="."+K+(rt===x?"title":"")+"text",nt=N.select(it),dt=n.lineCount(nt),Tt=nt.node();if(ut=Q*dt,J=Tt?r.bBox(Tt).width:0,rt===x)G.title.side==="left"&&(J+=a.itemGap*2),n.positionText(nt,ot+a.titlePad,ot+Q);else{var wt=a.itemGap*2+G.indentation+G.itemwidth;ct.groupTitle&&(wt=a.itemGap,J-=G.indentation+G.itemwidth),n.positionText(nt,wt,-Q*((dt-1)/2-.3))}}rt===x?(G._titleWidth=J,G._titleHeight=ut):(ct.lineHeight=Q,ct.height=Math.max(ut,16)+3,ct.width=J)}function L(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 D(N,j,G,rt){var ct=N._fullLayout,st=F(rt);rt||(rt=ct[st]);var et=ct._size,K=l.isVertical(rt),ot=l.isGrouped(rt),X=rt.entrywidthmode==="fraction",Q=rt.borderwidth,ut=2*Q,J=a.itemGap,q=rt.indentation+rt.itemwidth+J*2,it=2*(Q+J),nt=I(rt),dt=rt.y<0||rt.y===0&&nt==="top",Tt=rt.y>1||rt.y===1&&nt==="bottom",wt=rt.tracegroupgap,It={};let{orientation:Ct,yref:Nt}=rt,{maxheight:ee}=rt,Jt=dt||Tt||Ct!=="v"||Nt!=="paper";ee||(ee=Jt?.5:1);let te=Jt?ct.height:et.h;rt._maxHeight=Math.max(ee>1?ee:ee*te,30);var Kt=0;rt._width=0,rt._height=0;var mt=L(rt);if(K)G.each(function(lt){var yt=lt[0].height;r.setTranslate(this,Q+mt[0],Q+mt[1]+rt._height+yt/2+J),rt._height+=yt,rt._width=Math.max(rt._width,lt[0].width)}),Kt=q+rt._width,rt._width+=J+q+ut,rt._height+=it,ot&&(j.each(function(lt,yt){r.setTranslate(this,0,yt*rt.tracegroupgap)}),rt._height+=(rt._lgroupsLength-1)*rt.tracegroupgap);else{var bt=R(rt),vt=rt.x<0||rt.x===0&&bt==="right",Ut=rt.x>1||rt.x===1&&bt==="left",re=Tt||dt,Zt=ct.width/2;rt._maxWidth=Math.max(vt?re&&bt==="left"?et.l+et.w:Zt:Ut?re&&bt==="right"?et.r+et.w:Zt:et.w,2*q);var ue=0,Me=0;G.each(function(lt){var yt=M(lt,rt,q);ue=Math.max(ue,yt),Me+=yt}),Kt=null;var Ce=0;if(ot){var We=0,qe=0,vr=0;j.each(function(){var lt=0,yt=0;u.select(this).selectAll("g.traces").each(function(Ht){var Yt=M(Ht,rt,q),se=Ht[0].height;r.setTranslate(this,mt[0],mt[1]+Q+J+se/2+yt),yt+=se,lt=Math.max(lt,Yt),It[Ht[0].trace.legendgroup]=lt});var St=lt+J;qe>0&&St+Q+qe>rt._maxWidth?(Ce=Math.max(Ce,qe),qe=0,vr+=We+wt,We=yt):We=Math.max(We,yt),r.setTranslate(this,qe,vr),qe+=St}),rt._width=Math.max(Ce,qe)+Q,rt._height=vr+We+it}else{var _r=G.size(),er=Me+ut+(_r-1)*J<rt._maxWidth,Mr=0,Ir=0,de=0,Dt=0;G.each(function(lt){var yt=lt[0].height,St=M(lt,rt,q),Ht=er?St:ue;X||(Ht+=J),Ht+Q+Ir-J>=rt._maxWidth&&(Ce=Math.max(Ce,Dt),Ir=0,de+=Mr,rt._height+=Mr,Mr=0),r.setTranslate(this,mt[0]+Q+Ir,mt[1]+Q+de+yt/2+J),Dt=Ir+St+J,Ir+=Ht,Mr=Math.max(Mr,yt)}),er?(rt._width=Ir+ut,rt._height=Mr+it):(rt._width=Math.max(Ce,Dt)+ut,rt._height+=Mr+it)}}rt._width=Math.ceil(Math.max(rt._width+mt[0],rt._titleWidth+2*(Q+a.titlePad))),rt._height=Math.ceil(Math.max(rt._height+mt[1],rt._titleHeight+2*(Q+a.itemGap))),rt._effHeight=Math.min(rt._height,rt._maxHeight);var qt=N._context.edits,_t=qt.legendText||qt.legendPosition;G.each(function(lt){var yt=u.select(this).select("."+st+"toggle"),St=lt[0].height,Ht=lt[0].trace.legendgroup,Yt=M(lt,rt,q);ot&&Ht!==""&&(Yt=It[Ht]);var se=_t?q:Kt||Yt;!K&&!X&&(se+=J/2),r.setRect(yt,0,-St/2,se,St)})}function B(N,j,G,rt){var ct=N._fullLayout,st=ct[j],et=R(st),K=I(st),ot=st.xref==="paper",X=st.yref==="paper";N._fullLayout._reservedMargin[j]={};var Q=st.y<.5?"b":"t",ut=st.x<.5?"l":"r",J={r:ct.width-G,l:G+st._width,b:ct.height-rt,t:rt+st._effHeight};if(ot&&X)return E.autoMargin(N,j,{x:st.x,y:st.y,l:st._width*v[et],r:st._width*g[et],b:st._effHeight*g[K],t:st._effHeight*v[K]});ot?N._fullLayout._reservedMargin[j][Q]=J[Q]:X||st.orientation==="v"?N._fullLayout._reservedMargin[j][ut]=J[ut]:N._fullLayout._reservedMargin[j][Q]=J[Q]}function R(N){return d.isRightAnchor(N)?"right":d.isCenterAnchor(N)?"center":"left"}function I(N){return d.isBottomAnchor(N)?"bottom":d.isMiddleAnchor(N)?"middle":"top"}function F(N){return N._id||"legend"}}),gb=Vt(Z=>{var V=Ni(),u=Lo(),d=kf(),E=Xr(),A=E.pushUnique,t=E.strTranslate,e=E.strRotate,r=mm(),i=Dl(),n=YT(),o=Eo(),a=Pi(),s=ih(),f=yo(),v=Af().zindexSeparator,g=ji(),m=dh(),w=zg(),l=hb(),x=mb(),y=w.YANGLE,S=Math.PI*y/180,k=1/Math.sin(S),M=Math.cos(S),T=Math.sin(S),c=w.HOVERARROWSIZE,h=w.HOVERTEXTPAD,b={box:!0,ohlc:!0,violin:!0,candlestick:!0},_={scatter:!0,scattergl:!0,splom:!0};function P(q,it){return q.distance-it.distance}Z.hover=function(q,it,nt,dt){q=E.getGraphDiv(q);var Tt=it.target;E.throttle(q._fullLayout._uid+w.HOVERID,w.HOVERMINTIME,function(){L(q,it,nt,dt,Tt)})},Z.loneHover=function(q,it){var nt=!0;Array.isArray(q)||(nt=!1,q=[q]);var dt=it.gd,Tt=Q(dt),wt=ut(dt),It=q.map(function(vt){var Ut=vt._x0||vt.x0||vt.x||0,re=vt._x1||vt.x1||vt.x||0,Zt=vt._y0||vt.y0||vt.y||0,ue=vt._y1||vt.y1||vt.y||0,Me=vt.eventData;if(Me){var Ce=Math.min(Ut,re),We=Math.max(Ut,re),qe=Math.min(Zt,ue),vr=Math.max(Zt,ue),_r=vt.trace;if(g.traceIs(_r,"gl3d")){var er=dt._fullLayout[_r.scene]._scene.container,Mr=er.offsetLeft,Ir=er.offsetTop;Ce+=Mr,We+=Mr,qe+=Ir,vr+=Ir}Me.bbox={x0:Ce+wt,x1:We+wt,y0:qe+Tt,y1:vr+Tt},it.inOut_bbox&&it.inOut_bbox.push(Me.bbox)}else Me=!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:Me}}),Ct=!1,Nt=R(It,{gd:dt,hovermode:"closest",rotateLabels:Ct,bgColor:it.bgColor||a.background,container:V.select(it.container),outerContainer:it.outerContainer||it.container}),ee=Nt.hoverLabels,Jt=5,te=0,Kt=0;ee.sort(function(vt,Ut){return vt.y0-Ut.y0}).each(function(vt,Ut){var re=vt.y0-vt.by/2;re-Jt<te?vt.offset=te-re+Jt:vt.offset=0,te=re+vt.by+vt.offset,Ut===it.anchorIndex&&(Kt=vt.offset)}).each(function(vt){vt.offset-=Kt});var mt=dt._fullLayout._invScaleX,bt=dt._fullLayout._invScaleY;return G(ee,Ct,mt,bt),nt?ee:ee.node()};function L(q,it,nt,dt,Tt){nt||(nt="xy"),typeof nt=="string"&&(nt=nt.split(v)[0]);var wt=Array.isArray(nt)?nt:[nt],It,Ct=q._fullLayout,Nt=Ct.hoversubplots,ee=Ct._plots||[],Jt=ee[nt],te=Ct._has("cartesian"),Kt=it.hovermode||Ct.hovermode,mt=(Kt||"").charAt(0)==="x",bt=(Kt||"").charAt(0)==="y",vt,Ut;if(te&&(mt||bt)&&Nt==="axis"){for(var re=wt.length,Zt=0;Zt<re;Zt++)if(It=wt[Zt],ee[It]){vt=f.getFromId(q,It,"x"),Ut=f.getFromId(q,It,"y");var ue=(mt?vt:Ut)._subplotsWith;if(ue&&ue.length)for(var Me=0;Me<ue.length;Me++)A(wt,ue[Me])}}if(Jt&&Nt!=="single"){var Ce=Jt.overlays.map(function(Ra){return Ra.id});wt=wt.concat(Ce)}for(var We=wt.length,qe=new Array(We),vr=new Array(We),_r=!1,er=0;er<We;er++)if(It=wt[er],ee[It])_r=!0,qe[er]=ee[It].xaxis,vr[er]=ee[It].yaxis;else if(Ct[It]&&Ct[It]._subplot){var Mr=Ct[It]._subplot;qe[er]=Mr.xaxis,vr[er]=Mr.yaxis}else{E.warn("Unrecognized subplot: "+It);return}if(Kt&&!_r&&(Kt="closest"),["x","y","closest","x unified","y unified"].indexOf(Kt)===-1||!q.calcdata||q.querySelector(".zoombox")||q._dragging)return s.unhoverRaw(q,it);var Ir=Ct.hoverdistance;Ir===-1&&(Ir=1/0);var de=Ct.spikedistance;de===-1&&(de=1/0);var Dt=[],qt=[],_t,lt,yt,St,Ht,Yt,se,ke,Ee,Ue,ir,ar,Ye,Er={hLinePoint:null,vLinePoint:null},pn=!1;if(Array.isArray(it))for(Kt="array",yt=0;yt<it.length;yt++)Ht=q.calcdata[it[yt].curveNumber||0],Ht&&(Yt=Ht[0].trace,Ht[0].trace.hoverinfo!=="skip"&&(qt.push(Ht),Yt.orientation==="h"&&(pn=!0)));else{var dn=q.calcdata.slice();for(dn.sort(function(Ra,Qi){var Hi=Ra[0].trace.zorder||0,Ho=Qi[0].trace.zorder||0;return Hi-Ho}),St=0;St<dn.length;St++)Ht=dn[St],Yt=Ht[0].trace,Yt.hoverinfo!=="skip"&&m.isTraceInSubplots(Yt,wt)&&(qt.push(Ht),Yt.orientation==="h"&&(pn=!0));var bn=!Tt,Zn,En;if(bn)"xpx"in it?Zn=it.xpx:Zn=qe[0]._length/2,"ypx"in it?En=it.ypx:En=vr[0]._length/2;else{if(r.triggerHandler(q,"plotly_beforehover",it)===!1)return;var gn=Tt.getBoundingClientRect();Zn=it.clientX-gn.left,En=it.clientY-gn.top,Ct._calcInverseTransform(q);var da=E.apply3DTransform(Ct._invTransform)(Zn,En);if(Zn=da[0],En=da[1],Zn<0||Zn>qe[0]._length||En<0||En>vr[0]._length)return s.unhoverRaw(q,it)}if(it.pointerX=Zn+qe[0]._offset,it.pointerY=En+vr[0]._offset,"xval"in it?_t=m.flat(wt,it.xval):_t=m.p2c(qe,Zn),"yval"in it?lt=m.flat(wt,it.yval):lt=m.p2c(vr,En),!u(_t[0])||!u(lt[0]))return E.warn("Fx.hover failed",it,q),s.unhoverRaw(q,it)}var ra=1/0;function Se(Ra,Qi){for(St=0;St<qt.length;St++)if(Ht=qt[St],!(!Ht||!Ht[0]||!Ht[0].trace)&&(Yt=Ht[0].trace,!(Yt.visible!==!0||Yt._length===0)&&["carpet","contourcarpet"].indexOf(Yt._module.name)===-1)){if(Ee=Kt,m.isUnifiedHover(Ee)&&(Ee=Ee.charAt(0)),Yt.type==="splom"?(ke=0,se=wt[ke]):(se=m.getSubplot(Yt),ke=wt.indexOf(se)),ar={cd:Ht,trace:Yt,xa:qe[ke],ya:vr[ke],maxHoverDistance:Ir,maxSpikeDistance:de,index:!1,distance:Math.min(ra,Ir),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:a.defaultLine,name:Yt.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},Ct[se]&&(ar.subplot=Ct[se]._subplot),Ct._splomScenes&&Ct._splomScenes[Yt.uid]&&(ar.scene=Ct._splomScenes[Yt.uid]),Ee==="array"){var Hi=it[St];"pointNumber"in Hi?(ar.index=Hi.pointNumber,Ee="closest"):(Ee="","xval"in Hi&&(Ue=Hi.xval,Ee="x"),"yval"in Hi&&(ir=Hi.yval,Ee=Ee?"closest":"y"))}else Ra!==void 0&&Qi!==void 0?(Ue=Ra,ir=Qi):(Ue=_t[ke],ir=lt[ke]);if(Ye=Dt.length,Ir!==0)if(Yt._module&&Yt._module.hoverPoints){var Ho=Yt._module.hoverPoints(ar,Ue,ir,Ee,{finiteRange:!0,hoverLayer:Ct._hoverlayer,hoversubplots:Nt,gd:q});if(Ho)for(var Ci,zo=0;zo<Ho.length;zo++)Ci=Ho[zo],u(Ci.x0)&&u(Ci.y0)&&Dt.push(rt(Ci,Kt))}else E.log("Unrecognized trace type in hover:",Yt);if(Kt==="closest"&&Dt.length>Ye&&(Dt.splice(0,Ye),ra=Dt[0].distance),te&&de!==0&&Dt.length===0){ar.distance=de,ar.index=!1;var qi=Yt._module.hoverPoints(ar,Ue,ir,"closest",{hoverLayer:Ct._hoverlayer});if(qi&&(qi=qi.filter(function(yi){return yi.spikeDistance<=de})),qi&&qi.length){var qo,Po=qi.filter(function(yi){return yi.xa.showspikes&&yi.xa.spikesnap!=="hovered data"});if(Po.length){var hs=Po[0];u(hs.x0)&&u(hs.y0)&&(qo=Ze(hs),(!Er.vLinePoint||Er.vLinePoint.spikeDistance>qo.spikeDistance)&&(Er.vLinePoint=qo))}var Gi=qi.filter(function(yi){return yi.ya.showspikes&&yi.ya.spikesnap!=="hovered data"});if(Gi.length){var uo=Gi[0];u(uo.x0)&&u(uo.y0)&&(qo=Ze(uo),(!Er.hLinePoint||Er.hLinePoint.spikeDistance>qo.spikeDistance)&&(Er.hLinePoint=qo))}}}}}Se();function Re(Ra,Qi,Hi){for(var Ho=null,Ci=1/0,zo,qi=0;qi<Ra.length;qi++)vt&&vt._id!==Ra[qi].xa._id||Ut&&Ut._id!==Ra[qi].ya._id||(zo=Ra[qi].spikeDistance,Hi&&qi===0&&(zo=-1/0),zo<=Ci&&zo<=Qi&&(Ho=Ra[qi],Ci=zo));return Ho}function Ze(Ra){return Ra?{xa:Ra.xa,ya:Ra.ya,x:Ra.xSpike!==void 0?Ra.xSpike:(Ra.x0+Ra.x1)/2,y:Ra.ySpike!==void 0?Ra.ySpike:(Ra.y0+Ra.y1)/2,distance:Ra.distance,spikeDistance:Ra.spikeDistance,curveNumber:Ra.trace.index,color:Ra.color,pointNumber:Ra.index}:null}var tr={fullLayout:Ct,container:Ct._hoverlayer,event:it};q._spikepoints;var zr={vLinePoint:Er.vLinePoint,hLinePoint:Er.hLinePoint};q._spikepoints=zr;var tn=function(){var Ra=Dt.filter(function(Hi){return vt&&vt._id===Hi.xa._id&&Ut&&Ut._id===Hi.ya._id}),Qi=Dt.filter(function(Hi){return!(vt&&vt._id===Hi.xa._id&&Ut&&Ut._id===Hi.ya._id)});Ra.sort(P),Qi.sort(P),Dt=Ra.concat(Qi),Dt=ot(Dt,Kt)};tn();var Yr=Kt.charAt(0),$r=(Yr==="x"||Yr==="y")&&Dt[0]&&_[Dt[0].trace.type];if(te&&de!==0&&Dt.length!==0){var In=Dt.filter(function(Ra){return Ra.ya.showspikes}),Nn=Re(In,de,$r);Er.hLinePoint=Ze(Nn);var Kn=Dt.filter(function(Ra){return Ra.xa.showspikes}),$n=Re(Kn,de,$r);Er.vLinePoint=Ze($n)}if(Dt.length===0){var ia=s.unhoverRaw(q,it);return te&&(Er.hLinePoint!==null||Er.vLinePoint!==null)&&et()&&ct(q,Er,tr),ia}if(te&&et()&&ct(q,Er,tr),m.isXYhover(Ee)&&Dt[0].length!==0&&Dt[0].trace.type!=="splom"){var Cn=Dt[0];b[Cn.trace.type]?Dt=Dt.filter(Ra=>Ra.trace.index===Cn.trace.index):Dt=[Cn];var Fa=Dt.length,Ga=X("x",Cn,Ct),ve=X("y",Cn,Ct);Se(Ga,ve);var ge=[],dr={},br=0,Tr=function(Ra){var Qi=b[Ra.trace.type]?D(Ra):Ra.trace.index;if(!dr[Qi])br++,dr[Qi]=br,ge.push(Ra);else{var Hi=dr[Qi]-1,Ho=ge[Hi];Hi>0&&Math.abs(Ra.distance)<Math.abs(Ho.distance)&&(ge[Hi]=Ra)}},mr;for(mr=0;mr<Fa;mr++)Tr(Dt[mr]);for(mr=Dt.length-1;mr>Fa-1;mr--)Tr(Dt[mr]);Dt=ge,tn()}var kr=q._hoverdata,Ur=[],Or=Q(q),pe=ut(q);for(let Ra of Dt){var Ke=m.makeEventData(Ra,Ra.trace,Ra.cd);if(Ra.hovertemplate!==!1){var xr=!1;Ra.cd[Ra.index]&&Ra.cd[Ra.index].ht&&(xr=Ra.cd[Ra.index].ht),Ra.hovertemplate=xr||Ra.trace.hovertemplate||!1}if(Ra.xa&&Ra.ya){var Gr=Ra.x0+Ra.xa._offset,ln=Ra.x1+Ra.xa._offset,wn=Ra.y0+Ra.ya._offset,rn=Ra.y1+Ra.ya._offset,Qr=Math.min(Gr,ln),vn=Math.max(Gr,ln),Oa=Math.min(wn,rn),Qn=Math.max(wn,rn);Ke.bbox={x0:Qr+pe,x1:vn+pe,y0:Oa+Or,y1:Qn+Or}}Ra.eventData=[Ke],Ur.push(Ke)}q._hoverdata=Ur;var Qa=Kt==="y"&&(qt.length>1||Dt.length>1)||Kt==="closest"&&pn&&Dt.length>1,Ja=a.combine(Ct.plot_bgcolor||a.background,Ct.paper_bgcolor),wi=R(Dt,{gd:q,hovermode:Kt,rotateLabels:Qa,bgColor:Ja,container:Ct._hoverlayer,outerContainer:Ct._paper.node(),commonLabelOpts:Ct.hoverlabel,hoverdistance:Ct.hoverdistance}),ci=wi.hoverLabels;if(m.isUnifiedHover(Kt)||(F(ci,Qa,Ct,wi.commonLabelBoundingBox),G(ci,Qa,Ct._invScaleX,Ct._invScaleY)),Tt&&Tt.tagName){var Ti=g.getComponentMethod("annotations","hasClickToShow")(q,Ur);n(V.select(Tt),Ti?"pointer":"")}!Tt||dt||!st(q,it,kr)||(kr&&q.emit("plotly_unhover",{event:it,points:kr}),q.emit("plotly_hover",{event:it,points:q._hoverdata,xaxes:qe,yaxes:vr,xvals:_t,yvals:lt}))}function D(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,it){var nt=it.gd,dt=nt._fullLayout,Tt=it.hovermode,wt=it.rotateLabels,It=it.bgColor,Ct=it.container,Nt=it.outerContainer,ee=it.commonLabelOpts||{};if(q.length===0)return[[]];var Jt=it.fontFamily||w.HOVERFONT,te=it.fontSize||w.HOVERFONTSIZE,Kt=it.fontWeight||dt.font.weight,mt=it.fontStyle||dt.font.style,bt=it.fontVariant||dt.font.variant,vt=it.fontTextcase||dt.font.textcase,Ut=it.fontLineposition||dt.font.lineposition,re=it.fontShadow||dt.font.shadow,Zt=q[0],ue=Zt.xa,Me=Zt.ya,Ce=Tt.charAt(0),We=Ce+"Label",qe=Zt[We];if(qe===void 0&&ue.type==="multicategory")for(var vr=0;vr<q.length&&(qe=q[vr][We],qe===void 0);vr++);var _r=J(nt,Nt),er=_r.top,Mr=_r.width,Ir=_r.height,de=qe!==void 0&&Zt.distance<=it.hoverdistance&&(Tt==="x"||Tt==="y");if(de){var Dt=!0,qt,_t;for(qt=0;qt<q.length;qt++)if(Dt&&q[qt].zLabel===void 0&&(Dt=!1),_t=q[qt].hoverinfo||q[qt].trace.hoverinfo,_t){var lt=Array.isArray(_t)?_t:_t.split("+");if(lt.indexOf("all")===-1&&lt.indexOf(Tt)===-1){de=!1;break}}Dt&&(de=!1)}var yt=Ct.selectAll("g.axistext").data(de?[0]:[]);yt.enter().append("g").classed("axistext",!0),yt.exit().remove();var St={minX:0,maxX:0,minY:0,maxY:0};if(yt.each(function(){var Cn=V.select(this),Fa=E.ensureSingle(Cn,"path","",function(Qa){Qa.style({"stroke-width":"1px"})}),Ga=E.ensureSingle(Cn,"text","",function(Qa){Qa.attr("data-notex",1)}),ve=ee.bgcolor||a.defaultLine,ge=ee.bordercolor||a.contrast(ve),dr=a.contrast(ve),br=ee.font,Tr={weight:br.weight||Kt,style:br.style||mt,variant:br.variant||bt,textcase:br.textcase||vt,lineposition:br.lineposition||Ut,shadow:br.shadow||re,family:br.family||Jt,size:br.size||te,color:br.color||dr};Fa.style({fill:ve,stroke:ge}),Ga.text(qe).call(o.font,Tr).call(i.positionText,0,0).call(i.convertToTspans,nt),Cn.attr("transform","");var mr=J(nt,Ga.node()),kr,Ur;if(Tt==="x"){var Or=ue.side==="top"?"-":"";Ga.attr("text-anchor","middle").call(i.positionText,0,ue.side==="top"?er-mr.bottom-c-h:er-mr.top+c+h),kr=ue._offset+(Zt.x0+Zt.x1)/2,Ur=Me._offset+(ue.side==="top"?0:Me._length);var pe=mr.width/2+h,Ke=kr;kr<pe?Ke=pe:kr>dt.width-pe&&(Ke=dt.width-pe),Fa.attr("d","M"+(kr-Ke)+",0L"+(kr-Ke+c)+","+Or+c+"H"+pe+"v"+Or+(h*2+mr.height)+"H"+-pe+"V"+Or+c+"H"+(kr-Ke-c)+"Z"),kr=Ke,St.minX=kr-pe,St.maxX=kr+pe,ue.side==="top"?(St.minY=Ur-(h*2+mr.height),St.maxY=Ur-h):(St.minY=Ur+h,St.maxY=Ur+(h*2+mr.height))}else{var xr,Gr,ln;Me.side==="right"?(xr="start",Gr=1,ln="",kr=ue._offset+ue._length):(xr="end",Gr=-1,ln="-",kr=ue._offset),Ur=Me._offset+(Zt.y0+Zt.y1)/2,Ga.attr("text-anchor",xr),Fa.attr("d","M0,0L"+ln+c+","+c+"V"+(h+mr.height/2)+"h"+ln+(h*2+mr.width)+"V-"+(h+mr.height/2)+"H"+ln+c+"V-"+c+"Z"),St.minY=Ur-(h+mr.height/2),St.maxY=Ur+(h+mr.height/2),Me.side==="right"?(St.minX=kr+c,St.maxX=kr+c+(h*2+mr.width)):(St.minX=kr-c-(h*2+mr.width),St.maxX=kr-c);var wn=mr.height/2,rn=er-mr.top-wn,Qr="clip"+dt._uid+"commonlabel"+Me._id,vn;if(kr<mr.width+2*h+c){vn="M-"+(c+h)+"-"+wn+"h-"+(mr.width-h)+"V"+wn+"h"+(mr.width-h)+"Z";var Oa=mr.width-kr+h;i.positionText(Ga,Oa,rn),xr==="end"&&Ga.selectAll("tspan").each(function(){var Qa=V.select(this),Ja=o.tester.append("text").text(Qa.text()).call(o.font,Tr),wi=J(nt,Ja.node());Math.round(wi.width)<Math.round(mr.width)&&Qa.attr("x",Oa-wi.width),Ja.remove()})}else i.positionText(Ga,Gr*(h+c),rn),vn=null;var Qn=dt._topclips.selectAll("#"+Qr).data(vn?[0]:[]);Qn.enter().append("clipPath").attr("id",Qr).append("path"),Qn.exit().remove(),Qn.select("path").attr("d",vn),o.setClipUrl(Ga,vn?Qr:null,nt)}Cn.attr("transform",t(kr,Ur))}),m.isUnifiedHover(Tt)){Ct.selectAll("g.hovertext").remove();let Cn=q.filter(Fa=>Fa.hoverinfo!=="none");if(Cn.length===0)return[];var Ht=dt.hoverlabel,Yt=Ht.font,se=Cn[0],ke=((Tt==="x unified"?se.xa:se.ya).unifiedhovertitle||{}).text,Ee=ke?E.hovertemplateString({data:Tt==="x unified"?[{xa:se.xa,x:se.xVal}]:[{ya:se.ya,y:se.yVal}],fallback:se.trace.hovertemplatefallback,locale:dt._d3locale,template:ke}):qe,Ue={showlegend:!0,legend:{title:{text:Ee,font:Yt},font:Yt,bgcolor:Ht.bgcolor,bordercolor:Ht.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:dt.legend?dt.legend.traceorder:void 0,orientation:"v"}},ir={font:Yt};l(Ue,ir,nt._fullData);var ar=ir.legend;ar.entries=[];for(var Ye=0;Ye<Cn.length;Ye++){var Er=Cn[Ye];if(Er.hoverinfo!=="none"){var pn=I(Er,!0,Tt,dt,qe),dn=pn[0],bn=pn[1];Er.name=bn,bn!==""?Er.text=bn+" : "+dn:Er.text=dn;var Zn=Er.cd[Er.index];Zn&&(Zn.mc&&(Er.mc=Zn.mc),Zn.mcc&&(Er.mc=Zn.mcc),Zn.mlc&&(Er.mlc=Zn.mlc),Zn.mlcc&&(Er.mlc=Zn.mlcc),Zn.mlw&&(Er.mlw=Zn.mlw),Zn.mrc&&(Er.mrc=Zn.mrc),Zn.dir&&(Er.dir=Zn.dir)),Er._distinct=!0,ar.entries.push([Er])}}ar.entries.sort(function(Fa,Ga){return Fa[0].trace.index-Ga[0].trace.index}),ar.layer=Ct,ar._inHover=!0,ar._groupTitleFont=Ht.grouptitlefont,x(nt,ar);var En=Ct.select("g.legend"),gn=J(nt,En.node()),da=gn.width+2*h,ra=gn.height+2*h,Se=Cn[0],Re=(Se.x0+Se.x1)/2,Ze=(Se.y0+Se.y1)/2,tr=!(g.traceIs(Se.trace,"bar-like")||g.traceIs(Se.trace,"box-violin")),zr,tn;Ce==="y"?tr?(tn=Ze-h,zr=Ze+h):(tn=Math.min.apply(null,Cn.map(function(Fa){return Math.min(Fa.y0,Fa.y1)})),zr=Math.max.apply(null,Cn.map(function(Fa){return Math.max(Fa.y0,Fa.y1)}))):tn=zr=E.mean(Cn.map(function(Fa){return(Fa.y0+Fa.y1)/2}))-ra/2;var Yr,$r;Ce==="x"?tr?(Yr=Re+h,$r=Re-h):(Yr=Math.max.apply(null,Cn.map(function(Fa){return Math.max(Fa.x0,Fa.x1)})),$r=Math.min.apply(null,Cn.map(function(Fa){return Math.min(Fa.x0,Fa.x1)}))):Yr=$r=E.mean(Cn.map(function(Fa){return(Fa.x0+Fa.x1)/2}))-da/2;var In=ue._offset,Nn=Me._offset;zr+=Nn,Yr+=In,$r+=In-da,tn+=Nn-ra;var Kn,$n;return Yr+da<Mr&&Yr>=0?Kn=Yr:$r+da<Mr&&$r>=0?Kn=$r:In+da<Mr?Kn=In:Yr-Re<Re-$r+da?Kn=Mr-da:Kn=0,Kn+=h,zr+ra<Ir&&zr>=0?$n=zr:tn+ra<Ir&&tn>=0?$n=tn:Nn+ra<Ir?$n=Nn:zr-Ze<Ze-tn+ra?$n=Ir-ra:$n=0,$n+=h,En.attr("transform",t(Kn-1,$n-1)),En}var ia=Ct.selectAll("g.hovertext").data(q,function(Cn){return D(Cn)});return ia.enter().append("g").classed("hovertext",!0).each(function(){var Cn=V.select(this);Cn.append("rect").call(a.fill,a.addOpacity(It,.8)),Cn.append("text").classed("name",!0),Cn.append("path").style("stroke-width","1px"),Cn.append("text").classed("nums",!0).call(o.font,{weight:Kt,style:mt,variant:bt,textcase:vt,lineposition:Ut,shadow:re,family:Jt,size:te})}),ia.exit().remove(),ia.each(function(Cn){var Fa=V.select(this).attr("transform",""),Ga=Cn.color;Array.isArray(Ga)&&(Ga=Ga[Cn.eventData[0].pointNumber]);var ve=Cn.bgcolor||Ga,ge=a.combine(a.opacity(ve)?ve:a.defaultLine,It),dr=a.combine(a.opacity(Ga)?Ga:a.defaultLine,It),br=Cn.borderColor||a.contrast(ge),Tr=I(Cn,de,Tt,dt,qe,Fa),mr=Tr[0],kr=Tr[1],Ur=Fa.select("text.nums").call(o.font,{family:Cn.fontFamily||Jt,size:Cn.fontSize||te,color:Cn.fontColor||br,weight:Cn.fontWeight||Kt,style:Cn.fontStyle||mt,variant:Cn.fontVariant||bt,textcase:Cn.fontTextcase||vt,lineposition:Cn.fontLineposition||Ut,shadow:Cn.fontShadow||re}).text(mr).attr("data-notex",1).call(i.positionText,0,0).call(i.convertToTspans,nt),Or=Fa.select("text.name"),pe=0,Ke=0;if(kr&&kr!==mr){Or.call(o.font,{family:Cn.fontFamily||Jt,size:Cn.fontSize||te,color:dr,weight:Cn.fontWeight||Kt,style:Cn.fontStyle||mt,variant:Cn.fontVariant||bt,textcase:Cn.fontTextcase||vt,lineposition:Cn.fontLineposition||Ut,shadow:Cn.fontShadow||re}).text(kr).attr("data-notex",1).call(i.positionText,0,0).call(i.convertToTspans,nt);var xr=J(nt,Or.node());pe=xr.width+2*h,Ke=xr.height+2*h}else Or.remove(),Fa.select("rect").remove();Fa.select("path").style({fill:ge,stroke:br});var Gr=Cn.xa._offset+(Cn.x0+Cn.x1)/2,ln=Cn.ya._offset+(Cn.y0+Cn.y1)/2,wn=Math.abs(Cn.x1-Cn.x0),rn=Math.abs(Cn.y1-Cn.y0),Qr=J(nt,Ur.node()),vn=Qr.width/dt._invScaleX,Oa=Qr.height/dt._invScaleY;Cn.ty0=(er-Qr.top)/dt._invScaleY,Cn.bx=vn+2*h,Cn.by=Math.max(Oa+2*h,Ke),Cn.anchor="start",Cn.txwidth=vn,Cn.tx2width=pe,Cn.offset=0;var Qn=(vn+c+h+pe)*dt._invScaleX,Qa,Ja;if(wt)Cn.pos=Gr,Qa=ln+rn/2+Qn<=Ir,Ja=ln-rn/2-Qn>=0,(Cn.idealAlign==="top"||!Qa)&&Ja?(ln-=rn/2,Cn.anchor="end"):Qa?(ln+=rn/2,Cn.anchor="start"):Cn.anchor="middle",Cn.crossPos=ln;else{if(Cn.pos=ln,Qa=Gr+wn/2+Qn<=Mr,Ja=Gr-wn/2-Qn>=0,(Cn.idealAlign==="left"||!Qa)&&Ja)Gr-=wn/2,Cn.anchor="end";else if(Qa)Gr+=wn/2,Cn.anchor="start";else{Cn.anchor="middle";var wi=Qn/2,ci=Gr+wi-Mr,Ti=Gr-wi;ci>0&&(Gr-=ci),Ti<0&&(Gr+=-Ti)}Cn.crossPos=Gr}Ur.attr("text-anchor",Cn.anchor),pe&&Or.attr("text-anchor",Cn.anchor),Fa.attr("transform",t(Gr,ln)+(wt?e(y):""))}),{hoverLabels:ia,commonLabelBoundingBox:St}}function I(q,it,nt,dt,Tt,wt){var It="",Ct="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=E.templateString(q.name,q.trace._meta)),It=K(q.name,q.nameLength));var Nt=nt.charAt(0),ee=Nt==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(Ct+="x: "+q.xLabel+"<br>"),q.yLabel!==void 0&&(Ct+="y: "+q.yLabel+"<br>"),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&q.trace.type!=="choroplethmap"&&(Ct+=(Ct?"z: ":"")+q.zLabel)):it&&q[Nt+"Label"]===Tt?Ct=q[ee+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(Ct=q.yLabel):q.yLabel===void 0?Ct=q.xLabel:Ct="("+q.xLabel+", "+q.yLabel+")",(q.text||q.text===0)&&!Array.isArray(q.text)&&(Ct+=(Ct?"<br>":"")+q.text),q.extraText!==void 0&&(Ct+=(Ct?"<br>":"")+q.extraText),wt&&Ct===""&&!q.hovertemplate&&(It===""&&wt.remove(),Ct=It);let{hovertemplate:Jt=!1}=q;if(Jt){let te=q.hovertemplateLabels||q;q[Nt+"Label"]!==Tt&&(te[Nt+"other"]=te[Nt+"Val"],te[Nt+"otherLabel"]=te[Nt+"Label"]),Ct=E.hovertemplateString({data:[q.eventData[0]||{},q.trace._meta],fallback:q.trace.hovertemplatefallback,labels:te,locale:dt._d3locale,template:Jt}),Ct=Ct.replace(B,(Kt,mt)=>(It=K(mt,q.nameLength),""))}return[Ct,It]}function F(q,it,nt,dt){var Tt=it?"xa":"ya",wt=it?"ya":"xa",It=0,Ct=1,Nt=q.size(),ee=new Array(Nt),Jt=0,te=dt.minX,Kt=dt.maxX,mt=dt.minY,bt=dt.maxY,vt=function(_t){return _t*nt._invScaleX},Ut=function(_t){return _t*nt._invScaleY};q.each(function(_t){var lt=_t[Tt],yt=_t[wt],St=lt._id.charAt(0)==="x",Ht=lt.range;Jt===0&&Ht&&Ht[0]>Ht[1]!==St&&(Ct=-1);var Yt=0,se=St?nt.width:nt.height;if(nt.hovermode==="x"||nt.hovermode==="y"){var ke=N(_t,it),Ee=_t.anchor,Ue=Ee==="end"?-1:1,ir,ar;if(Ee==="middle")ir=_t.crossPos+(St?Ut(ke.y-_t.by/2):vt(_t.bx/2+_t.tx2width/2)),ar=ir+(St?Ut(_t.by):vt(_t.bx));else if(St)ir=_t.crossPos+Ut(c+ke.y)-Ut(_t.by/2-c),ar=ir+Ut(_t.by);else{var Ye=vt(Ue*c+ke.x),Er=Ye+vt(Ue*_t.bx);ir=_t.crossPos+Math.min(Ye,Er),ar=_t.crossPos+Math.max(Ye,Er)}St?mt!==void 0&&bt!==void 0&&Math.min(ar,bt)-Math.max(ir,mt)>1&&(yt.side==="left"?(Yt=yt._mainLinePosition,se=nt.width):se=yt._mainLinePosition):te!==void 0&&Kt!==void 0&&Math.min(ar,Kt)-Math.max(ir,te)>1&&(yt.side==="top"?(Yt=yt._mainLinePosition,se=nt.height):se=yt._mainLinePosition)}ee[Jt++]=[{datum:_t,traceIndex:_t.trace.index,dp:0,pos:_t.pos,posref:_t.posref,size:_t.by*(St?k:1)/2,pmin:Yt,pmax:se}]}),ee.sort(function(_t,lt){return _t[0].posref-lt[0].posref||Ct*(lt[0].traceIndex-_t[0].traceIndex)});var re,Zt,ue,Me,Ce,We,qe;function vr(_t){var lt=_t[0],yt=_t[_t.length-1];if(Zt=lt.pmin-lt.pos-lt.dp+lt.size,ue=yt.pos+yt.dp+yt.size-lt.pmax,Zt>.01){for(Ce=_t.length-1;Ce>=0;Ce--)_t[Ce].dp+=Zt;re=!1}if(!(ue<.01)){if(Zt<-.01){for(Ce=_t.length-1;Ce>=0;Ce--)_t[Ce].dp-=ue;re=!1}if(re){var St=0;for(Me=0;Me<_t.length;Me++)We=_t[Me],We.pos+We.dp+We.size>lt.pmax&&St++;for(Me=_t.length-1;Me>=0&&!(St<=0);Me--)We=_t[Me],We.pos>lt.pmax-1&&(We.del=!0,St--);for(Me=0;Me<_t.length&&!(St<=0);Me++)if(We=_t[Me],We.pos<lt.pmin+1)for(We.del=!0,St--,ue=We.size*2,Ce=_t.length-1;Ce>=0;Ce--)_t[Ce].dp-=ue;for(Me=_t.length-1;Me>=0&&!(St<=0);Me--)We=_t[Me],We.pos+We.dp+We.size>lt.pmax&&(We.del=!0,St--)}}}for(;!re&&It<=Nt;){for(It++,re=!0,Me=0;Me<ee.length-1;){var _r=ee[Me],er=ee[Me+1],Mr=_r[_r.length-1],Ir=er[0];if(Zt=Mr.pos+Mr.dp+Mr.size-Ir.pos-Ir.dp+Ir.size,Zt>.01){for(Ce=er.length-1;Ce>=0;Ce--)er[Ce].dp+=Zt;for(_r.push.apply(_r,er),ee.splice(Me+1,1),qe=0,Ce=_r.length-1;Ce>=0;Ce--)qe+=_r[Ce].dp;for(ue=qe/_r.length,Ce=_r.length-1;Ce>=0;Ce--)_r[Ce].dp-=ue;re=!1}else Me++}ee.forEach(vr)}for(Me=ee.length-1;Me>=0;Me--){var de=ee[Me];for(Ce=de.length-1;Ce>=0;Ce--){var Dt=de[Ce],qt=Dt.datum;qt.offset=Dt.dp,qt.del=Dt.del}}}function N(q,it){var nt=0,dt=q.offset;return it&&(dt*=-T,nt=q.offset*M),{x:nt,y:dt}}function j(q){var it={start:1,end:-1,middle:0}[q.anchor],nt=it*(c+h),dt=nt+it*(q.txwidth+h),Tt=q.anchor==="middle";return Tt&&(nt-=q.tx2width/2,dt+=q.txwidth/2+h),{alignShift:it,textShiftX:nt,text2ShiftX:dt}}function G(q,it,nt,dt){var Tt=function(It){return It*nt},wt=function(It){return It*dt};q.each(function(It){var Ct=V.select(this);if(It.del)return Ct.remove();var Nt=Ct.select("text.nums"),ee=It.anchor,Jt=ee==="end"?-1:1,te=j(It),Kt=N(It,it),mt=Kt.x,bt=Kt.y,vt=ee==="middle",Ut="hoverlabel"in It.trace?It.trace.hoverlabel.showarrow:!0,re;vt?re="M-"+Tt(It.bx/2+It.tx2width/2)+","+wt(bt-It.by/2)+"h"+Tt(It.bx)+"v"+wt(It.by)+"h-"+Tt(It.bx)+"Z":Ut?re="M0,0L"+Tt(Jt*c+mt)+","+wt(c+bt)+"v"+wt(It.by/2-c)+"h"+Tt(Jt*It.bx)+"v-"+wt(It.by)+"H"+Tt(Jt*c+mt)+"V"+wt(bt-c)+"Z":re="M"+Tt(Jt*c+mt)+","+wt(bt-It.by/2)+"h"+Tt(Jt*It.bx)+"v"+wt(It.by)+"h"+Tt(-Jt*It.bx)+"Z",Ct.select("path").attr("d",re);var Zt=mt+te.textShiftX,ue=bt+It.ty0-It.by/2+h,Me=It.textAlign||"auto";Me!=="auto"&&(Me==="left"&&ee!=="start"?(Nt.attr("text-anchor","start"),Zt=vt?-It.bx/2-It.tx2width/2+h:-It.bx-h):Me==="right"&&ee!=="end"&&(Nt.attr("text-anchor","end"),Zt=vt?It.bx/2-It.tx2width/2-h:It.bx+h)),Nt.call(i.positionText,Tt(Zt),wt(ue)),It.tx2width&&(Ct.select("text.name").call(i.positionText,Tt(te.text2ShiftX+te.alignShift*h+mt),wt(bt+It.ty0-It.by/2+h)),Ct.select("rect").call(o.setRect,Tt(te.text2ShiftX+(te.alignShift-1)*It.tx2width/2+mt),wt(bt-It.by/2-1),Tt(It.tx2width),wt(It.by+2)))})}function rt(q,it){var nt=q.index,dt=q.trace||{},Tt=q.cd[0],wt=q.cd[nt]||{};function It(Kt){return Kt||u(Kt)&&Kt===0}var Ct=Array.isArray(nt)?function(Kt,mt){var bt=E.castOption(Tt,nt,Kt);return It(bt)?bt:E.extractOption({},dt,"",mt)}:function(Kt,mt){return E.extractOption(wt,dt,Kt,mt)};function Nt(Kt,mt,bt){var vt=Ct(mt,bt);It(vt)&&(q[Kt]=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=it==="y"||it==="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:f.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:f.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 ee=f.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+ee+" / -"+f.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" ± "+ee,it==="x"&&(q.distance+=1)}if(!isNaN(q.yerr)&&!(q.ya.type==="log"&&q.yerr<=0)){var Jt=f.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+Jt+" / -"+f.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" ± "+Jt,it==="y"&&(q.distance+=1)}var te=q.hoverinfo||q.trace.hoverinfo;return te&&te!=="all"&&(te=Array.isArray(te)?te:te.split("+"),te.indexOf("x")===-1&&(q.xLabel=void 0),te.indexOf("y")===-1&&(q.yLabel=void 0),te.indexOf("z")===-1&&(q.zLabel=void 0),te.indexOf("text")===-1&&(q.text=void 0),te.indexOf("name")===-1&&(q.name=void 0)),q}function ct(q,it,nt){var dt=nt.container,Tt=nt.fullLayout,wt=Tt._size,It=nt.event,Ct=!!it.hLinePoint,Nt=!!it.vLinePoint,ee,Jt;if(dt.selectAll(".spikeline").remove(),!!(Nt||Ct)){var te=a.combine(Tt.plot_bgcolor,Tt.paper_bgcolor);if(Ct){var Kt=it.hLinePoint,mt,bt;ee=Kt&&Kt.xa,Jt=Kt&&Kt.ya;var vt=Jt.spikesnap;vt==="cursor"?(mt=It.pointerX,bt=It.pointerY):(mt=ee._offset+Kt.x,bt=Jt._offset+Kt.y);var Ut=d.readability(Kt.color,te)<1.5?a.contrast(te):Kt.color,re=Jt.spikemode,Zt=Jt.spikethickness,ue=Jt.spikecolor||Ut,Me=f.getPxPosition(q,Jt),Ce,We;if(re.indexOf("toaxis")!==-1||re.indexOf("across")!==-1){if(re.indexOf("toaxis")!==-1&&(Ce=Me,We=mt),re.indexOf("across")!==-1){var qe=Jt._counterDomainMin,vr=Jt._counterDomainMax;Jt.anchor==="free"&&(qe=Math.min(qe,Jt.position),vr=Math.max(vr,Jt.position)),Ce=wt.l+qe*wt.w,We=wt.l+vr*wt.w}dt.insert("line",":first-child").attr({x1:Ce,x2:We,y1:bt,y2:bt,"stroke-width":Zt,stroke:ue,"stroke-dasharray":o.dashStyle(Jt.spikedash,Zt)}).classed("spikeline",!0).classed("crisp",!0),dt.insert("line",":first-child").attr({x1:Ce,x2:We,y1:bt,y2:bt,"stroke-width":Zt+2,stroke:te}).classed("spikeline",!0).classed("crisp",!0)}re.indexOf("marker")!==-1&&dt.insert("circle",":first-child").attr({cx:Me+(Jt.side!=="right"?Zt:-Zt),cy:bt,r:Zt,fill:ue}).classed("spikeline",!0)}if(Nt){var _r=it.vLinePoint,er,Mr;ee=_r&&_r.xa,Jt=_r&&_r.ya;var Ir=ee.spikesnap;Ir==="cursor"?(er=It.pointerX,Mr=It.pointerY):(er=ee._offset+_r.x,Mr=Jt._offset+_r.y);var de=d.readability(_r.color,te)<1.5?a.contrast(te):_r.color,Dt=ee.spikemode,qt=ee.spikethickness,_t=ee.spikecolor||de,lt=f.getPxPosition(q,ee),yt,St;if(Dt.indexOf("toaxis")!==-1||Dt.indexOf("across")!==-1){if(Dt.indexOf("toaxis")!==-1&&(yt=lt,St=Mr),Dt.indexOf("across")!==-1){var Ht=ee._counterDomainMin,Yt=ee._counterDomainMax;ee.anchor==="free"&&(Ht=Math.min(Ht,ee.position),Yt=Math.max(Yt,ee.position)),yt=wt.t+(1-Yt)*wt.h,St=wt.t+(1-Ht)*wt.h}dt.insert("line",":first-child").attr({x1:er,x2:er,y1:yt,y2:St,"stroke-width":qt,stroke:_t,"stroke-dasharray":o.dashStyle(ee.spikedash,qt)}).classed("spikeline",!0).classed("crisp",!0),dt.insert("line",":first-child").attr({x1:er,x2:er,y1:yt,y2:St,"stroke-width":qt+2,stroke:te}).classed("spikeline",!0).classed("crisp",!0)}Dt.indexOf("marker")!==-1&&dt.insert("circle",":first-child").attr({cx:er,cy:lt-(ee.side!=="top"?qt:-qt),r:qt,fill:_t}).classed("spikeline",!0)}}}function st(q,it,nt){if(!nt||nt.length!==q._hoverdata.length)return!0;for(var dt=nt.length-1;dt>=0;dt--){var Tt=nt[dt],wt=q._hoverdata[dt];if(Tt.curveNumber!==wt.curveNumber||String(Tt.pointNumber)!==String(wt.pointNumber)||String(Tt.pointNumbers)!==String(wt.pointNumbers)||Tt.binNumber!==wt.binNumber)return!0}return!1}function et(q,it){return!0}function K(q,it){return i.plainText(q||"",{len:it,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ot(q,it){for(var nt=it.charAt(0),dt=[],Tt=[],wt=[],It=0;It<q.length;It++){var Ct=q[It];g.traceIs(Ct.trace,"bar-like")||g.traceIs(Ct.trace,"box-violin")?wt.push(Ct):Ct.trace[nt+"period"]?Tt.push(Ct):dt.push(Ct)}return dt.concat(Tt).concat(wt)}function X(q,it,nt){var dt=it[q+"a"],Tt=it[q+"Val"],wt=it.cd[0];if(dt.type==="category"||dt.type==="multicategory")Tt=dt._categoriesMap[Tt];else if(dt.type==="date"){var It=it.trace[q+"periodalignment"];if(It){var Ct=it.cd[it.index],Nt=Ct[q+"Start"];Nt===void 0&&(Nt=Ct[q]);var ee=Ct[q+"End"];ee===void 0&&(ee=Ct[q]);var Jt=ee-Nt;It==="end"?Tt+=Jt:It==="middle"&&(Tt+=Jt/2)}Tt=dt.d2c(Tt)}return wt&&wt.t&&wt.t.posLetter===dt._id&&(nt.boxmode==="group"||nt.violinmode==="group")&&(Tt+=wt.t.dPos),Tt}var Q=q=>q.offsetTop+q.clientTop,ut=q=>q.offsetLeft+q.clientLeft;function J(q,it){var nt=q._fullLayout,dt=it.getBoundingClientRect(),Tt=dt.left,wt=dt.top,It=Tt+dt.width,Ct=wt+dt.height,Nt=E.apply3DTransform(nt._invTransform)(Tt,wt),ee=E.apply3DTransform(nt._invTransform)(It,Ct),Jt=Nt[0],te=Nt[1],Kt=ee[0],mt=ee[1];return{x:Jt,y:te,width:Kt-Jt,height:mt-te,top:Math.min(te,mt),left:Math.min(Jt,Kt),right:Math.max(Jt,Kt),bottom:Math.max(te,mt)}}}),Og=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=dh().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=d.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),e("hoverlabel.showarrow",r.showarrow),u.coerceFont(e,"hoverlabel.font",r.font),e("hoverlabel.align",r.align)}}),QT=Vt((Z,V)=>{var u=Xr(),d=Og(),E=yd();V.exports=function(A,t){function e(r,i){return u.coerce(A,t,E,r,i)}d(A,t,e)}}),tk=Vt((Z,V)=>{var u=Xr(),d=hm(),E=Og();V.exports=function(A,t,e,r){function i(o,a){return u.coerce(A,t,d,o,a)}var n=u.extendFlat({},r.hoverlabel);t.hovertemplate&&(n.namelength=-1),E(A,t,i,n)}}),vb=Vt((Z,V)=>{var u=Xr(),d=yd();V.exports=function(E,A){function t(e,r){return A[e]!==void 0?A[e]:u.coerce(E,A,d,e,r)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}),ek=Vt((Z,V)=>{var u=Xr(),d=yd(),E=vb(),A=Og();V.exports=function(t,e){function r(v,g){return u.coerce(t,e,d,v,g)}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"),f=e._basePlotModules.length;e.dragmode==="zoom"&&((o||a||s)&&f===1||(o||a)&&s&&f===2)&&(e.dragmode="pan"),A(t,e,r),u.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}),rk=Vt((Z,V)=>{var u=Xr(),d=ji();V.exports=function(A){var t=A.calcdata,e=A._fullLayout;function r(s){return function(f){return u.coerceHoverinfo({hoverinfo:f},{_module:s._module},e)}}for(var i=0;i<t.length;i++){var n=t[i],o=n[0].trace;if(!d.traceIs(o,"pie-like")){var a=d.traceIs(o,"2dMap")?E:u.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"),a(o.hoverlabel.showarrow,n,"htsa"))}}};function E(A,t,e,r){r=r||u.identity,Array.isArray(A)&&(t[0][e]=r(A))}}),nk=Vt((Z,V)=>{var u=ji(),d=gb().hover;V.exports=function(E,A,t){var e=u.getComponentMethod("annotations","onClick")(E,E._hoverdata);t!==void 0&&d(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())}}),hc=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=ih(),A=dh(),t=yd(),e=gb();V.exports={moduleType:"component",name:"fx",constants:zg(),schema:{layout:t},attributes:hm(),layoutAttributes:t,supplyLayoutGlobalDefaults:QT(),supplyDefaults:tk(),supplyLayoutDefaults:ek(),calc:rk(),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:nk()};function r(o){var a=d.isD3Selection(o)?o:u.select(o);a.selectAll("g.hovertext").remove(),a.selectAll(".spikeline").remove()}function i(o,a,s){return d.castOption(o,a,"hoverlabel."+s)}function n(o,a,s){function f(v){return d.coerceHoverinfo({hoverinfo:v},{_module:o._module},a)}return d.castOption(o,s,"hoverinfo",f)}}),Jh=Vt(Z=>{Z.selectMode=function(V){return V==="lasso"||V==="select"},Z.drawMode=function(V){return V==="drawclosedpath"||V==="drawopenpath"||V==="drawline"||V==="drawrect"||V==="drawcircle"},Z.openMode=function(V){return V==="drawline"||V==="drawopenpath"},Z.rectMode=function(V){return V==="select"||V==="drawline"||V==="drawrect"||V==="drawcircle"},Z.freeMode=function(V){return V==="lasso"||V==="drawclosedpath"||V==="drawopenpath"},Z.selectingOrDrawing=function(V){return Z.freeMode(V)||Z.rectMode(V)}}),Dg=Vt((Z,V)=>{V.exports=function(u){var d=u._fullLayout;d._glcanvas&&d._glcanvas.size()&&d._glcanvas.each(function(E){E.regl&&E.regl.clear({color:!0,depth:!0})})}}),Vy=Vt((Z,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("")}}}),Hy=Vt((Z,V)=>{var u=32;V.exports={CIRCLE_SIDES:u,i000:0,i090:u/4,i180:u/2,i270:u/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),qy=Vt((Z,V)=>{var u=Xr().strTranslate;function d(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 d(e,i[r])}}function t(e){return u(e.xaxis._offset,e.yaxis._offset)}V.exports={p2r:d,r2p:E,axValue:A,getTransform:t}}),Md=Vt(Z=>{var V=Pg(),u=Hy(),d=u.CIRCLE_SIDES,E=u.SQRT2,A=qy(),t=A.p2r,e=A.r2p,r=[0,3,4,5,6,1,2],i=[0,3,4,1,2];Z.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var f="",v=0;v<s;v++)for(var g=a[v].length,m=0;m<g;m++){var w=a[v][m][0];if(w==="Z")f+="Z";else for(var l=a[v][m].length,x=0;x<l;x++){var y=x;w==="Q"||w==="S"?y=i[x]:w==="C"&&(y=r[x]),f+=a[v][m][y],x>0&&x<l-1&&(f+=",")}}return f},Z.readPaths=function(a,s,f,v){var g=V(a),m=[],w=-1,l=function(){w++,m[w]=[]},x,y=0,S=0,k,M,T=function(){k=y,M=S};T();for(var c=0;c<g.length;c++){var h=[],b,_,P,L,D=g[c][0],B=D;switch(D){case"M":l(),y=+g[c][1],S=+g[c][2],h.push([B,y,S]),T();break;case"Q":case"S":b=+g[c][1],P=+g[c][2],y=+g[c][3],S=+g[c][4],h.push([B,y,S,b,P]);break;case"C":b=+g[c][1],P=+g[c][2],_=+g[c][3],L=+g[c][4],y=+g[c][5],S=+g[c][6],h.push([B,y,S,b,P,_,L]);break;case"T":case"L":y=+g[c][1],S=+g[c][2],h.push([B,y,S]);break;case"H":B="L",y=+g[c][1],h.push([B,y,S]);break;case"V":B="L",S=+g[c][1],h.push([B,y,S]);break;case"A":B="L";var R=+g[c][1],I=+g[c][2];+g[c][4]||(R=-R,I=-I);var F=y-R,N=S;for(x=1;x<=d/2;x++){var j=2*Math.PI*x/d;h.push([B,F+R*Math.cos(j),N+I*Math.sin(j)])}break;case"Z":(y!==k||S!==M)&&(y=k,S=M,h.push([B,y,S]));break}for(var G=(f||{}).domain,rt=s._fullLayout._size,ct=f&&f.xsizemode==="pixel",st=f&&f.ysizemode==="pixel",et=v===!1,K=0;K<h.length;K++){for(x=0;x+2<7;x+=2){var ot=h[K][x+1],X=h[K][x+2];ot===void 0||X===void 0||(y=ot,S=X,f&&(f.xaxis&&f.xaxis.p2r?(et&&(ot-=f.xaxis._offset),ct?ot=e(f.xaxis,f.xanchor)+ot:ot=t(f.xaxis,ot)):(et&&(ot-=rt.l),G?ot=G.x[0]+ot/rt.w:ot=ot/rt.w),f.yaxis&&f.yaxis.p2r?(et&&(X-=f.yaxis._offset),st?X=e(f.yaxis,f.yanchor)-X:X=t(f.yaxis,X)):(et&&(X-=rt.t),G?X=G.y[1]-X/rt.h:X=1-X/rt.h)),h[K][x+1]=ot,h[K][x+2]=X)}m[w].push(h[K].slice())}}return m};function n(a,s){return Math.abs(a-s)<=1e-6}function o(a,s){var f=s[1]-a[1],v=s[2]-a[2];return Math.sqrt(f*f+v*v)}Z.pointsOnRectangle=function(a){var s=a.length;if(s!==5)return!1;for(var f=1;f<3;f++){var v=a[0][f]-a[1][f],g=a[3][f]-a[2][f];if(!n(v,g))return!1;var m=a[0][f]-a[3][f],w=a[1][f]-a[2][f];if(!n(m,w))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]))},Z.pointsOnEllipse=function(a){var s=a.length;if(s!==d+1)return!1;s=d;for(var f=0;f<s;f++){var v=(s*2-f)%s,g=(s/2+v)%s,m=(s/2+f)%s;if(!n(o(a[f],a[m]),o(a[v],a[g])))return!1}return!0},Z.handleEllipse=function(a,s,f){if(!a)return[s,f];var v=Z.ellipseOver({x0:s[0],y0:s[1],x1:f[0],y1:f[1]}),g=(v.x1+v.x0)/2,m=(v.y1+v.y0)/2,w=(v.x1-v.x0)/2,l=(v.y1-v.y0)/2;w||(w=l=l/E),l||(l=w=w/E);for(var x=[],y=0;y<d;y++){var S=y*2*Math.PI/d;x.push([g+w*Math.cos(S),m+l*Math.sin(S)])}return x},Z.ellipseOver=function(a){var s=a.x0,f=a.y0,v=a.x1,g=a.y1,m=v-s,w=g-f;s-=m,f-=w;var l=(s+v)/2,x=(f+g)/2,y=E;return m*=y,w*=y,{x0:l-m,y0:x-w,x1:l+m,y1:x+w}},Z.fixDatesForPaths=function(a,s,f){var v=s.type==="date",g=f.type==="date";if(!v&&!g)return a;for(var m=0;m<a.length;m++)for(var w=0;w<a[m].length;w++)for(var l=0;l+2<a[m][w].length;l+=2)v&&(a[m][w][l+1]=a[m][w][l+1].replace(" ","_")),g&&(a[m][w][l+2]=a[m][w][l+2].replace(" ","_"));return a}}),Wy=Vt((Z,V)=>{var u=cc(),d=Jh(),E=d.drawMode,A=d.openMode,t=Hy(),e=t.i000,r=t.i090,i=t.i180,n=t.i270,o=t.cos45,a=t.sin45,s=qy(),f=s.p2r,v=s.r2p,g=wd(),m=g.clearOutline,w=Md(),l=w.readPaths,x=w.writePaths,y=w.ellipseOver,S=w.fixDatesForPaths;function k(T,c){if(T.length){var h=T[0][0];if(h){var b=c.gd,_=c.isActiveShape,P=c.dragmode,L=(b.layout||{}).shapes||[];if(!E(P)&&_!==void 0){var D=b._fullLayout._activeShapeIndex;if(D<L.length)switch(b._fullLayout.shapes[D].type){case"rect":P="drawrect";break;case"circle":P="drawcircle";break;case"line":P="drawline";break;case"path":var B=L[D].path||"";B[B.length-1]==="Z"?P="drawclosedpath":P="drawopenpath";break}}var R=M(T,c,P);m(b);for(var I=c.editHelpers,F=(I||{}).modifyItem,N=[],j=0;j<L.length;j++){var G=b._fullLayout.shapes[j];if(N[j]=G._input,_!==void 0&&j===b._fullLayout._activeShapeIndex){var rt=R;switch(G.type){case"line":case"rect":case"circle":var ct=u.getFromId(b,G.xref);G.xref.charAt(0)==="x"&&ct.type.includes("category")?(F("x0",rt.x0-(G.x0shift||0)),F("x1",rt.x1-(G.x1shift||0))):(F("x0",rt.x0),F("x1",rt.x1));var st=u.getFromId(b,G.yref);G.yref.charAt(0)==="y"&&st.type.includes("category")?(F("y0",rt.y0-(G.y0shift||0)),F("y1",rt.y1-(G.y1shift||0))):(F("y0",rt.y0),F("y1",rt.y1));break;case"path":F("path",rt.path);break}}}return _===void 0?(N.push(R),N):I?I.getUpdateObj():{}}}}function M(T,c,h){var b=T[0][0],_=c.gd,P=b.getAttribute("d"),L=_._fullLayout.newshape,D=c.plotinfo,B=c.isActiveShape,R=D.xaxis,I=D.yaxis,F=!!D.domain||!D.xaxis,N=!!D.domain||!D.yaxis,j=A(h),G=l(P,_,D,B),rt={editable:!0,visible:L.visible,name:L.name,showlegend:L.showlegend,legend:L.legend,legendwidth:L.legendwidth,legendgroup:L.legendgroup,legendgrouptitle:{text:L.legendgrouptitle.text,font:L.legendgrouptitle.font},legendrank:L.legendrank,label:L.label,xref:F?"paper":R._id,yref:N?"paper":I._id,layer:L.layer,opacity:L.opacity,line:{color:L.line.color,width:L.line.width,dash:L.line.dash}};j||(rt.fillcolor=L.fillcolor,rt.fillrule=L.fillrule);var ct;if(G.length===1&&(ct=G[0]),ct&&ct.length===5&&h==="drawrect")rt.type="rect",rt.x0=ct[0][1],rt.y0=ct[0][2],rt.x1=ct[2][1],rt.y1=ct[2][2];else if(ct&&h==="drawline")rt.type="line",rt.x0=ct[0][1],rt.y0=ct[0][2],rt.x1=ct[1][1],rt.y1=ct[1][2];else if(ct&&h==="drawcircle"){rt.type="circle";var st=ct[e][1],et=ct[r][1],K=ct[i][1],ot=ct[n][1],X=ct[e][2],Q=ct[r][2],ut=ct[i][2],J=ct[n][2],q=D.xaxis&&(D.xaxis.type==="date"||D.xaxis.type==="log"),it=D.yaxis&&(D.yaxis.type==="date"||D.yaxis.type==="log");q&&(st=v(D.xaxis,st),et=v(D.xaxis,et),K=v(D.xaxis,K),ot=v(D.xaxis,ot)),it&&(X=v(D.yaxis,X),Q=v(D.yaxis,Q),ut=v(D.yaxis,ut),J=v(D.yaxis,J));var nt=(et+ot)/2,dt=(X+ut)/2,Tt=(ot-et+K-st)/2,wt=(J-Q+ut-X)/2,It=y({x0:nt,y0:dt,x1:nt+Tt*o,y1:dt+wt*a});q&&(It.x0=f(D.xaxis,It.x0),It.x1=f(D.xaxis,It.x1)),it&&(It.y0=f(D.yaxis,It.y0),It.y1=f(D.yaxis,It.y1)),rt.x0=It.x0,rt.y0=It.y0,rt.x1=It.x1,rt.y1=It.y1}else rt.type="path",R&&I&&S(G,R,I),rt.path=x(G),ct=null;return rt}V.exports={newShapes:k,createShapeObj:M}}),yb=Vt((Z,V)=>{var u=Jh(),d=u.selectMode,E=wd(),A=E.clearOutline,t=Md(),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"),f=o.gd,v=f._fullLayout.newselection,g=o.plotinfo,m=g.xaxis,w=g.yaxis,l=o.isActiveSelection,x=o.dragmode,y=(f.layout||{}).selections||[];if(!d(x)&&l!==void 0){var S=f._fullLayout._activeSelectionIndex;if(S<y.length)switch(f._fullLayout.selections[S].type){case"rect":x="select";break;case"path":x="lasso";break}}var k=e(s,f,g,l),M={xref:m._id,yref:w._id,opacity:v.opacity,line:{color:v.line.color,width:v.line.width,dash:v.line.dash}},T;k.length===1&&(T=k[0]),T&&T.length===5&&x==="select"?(M.type="rect",M.x0=T[0][1],M.y0=T[0][2],M.x1=T[2][1],M.y1=T[2][2]):(M.type="path",m&&w&&i(k,m,w),M.path=r(k),T=null),A(f);for(var c=o.editHelpers,h=(c||{}).modifyItem,b=[],_=0;_<y.length;_++){var P=f._fullLayout.selections[_];if(!P){b[_]=P;continue}if(b[_]=P._input,l!==void 0&&_===f._fullLayout._activeSelectionIndex){var L=M;switch(P.type){case"rect":h("x0",L.x0),h("x1",L.x1),h("y0",L.y0),h("y1",L.y1);break;case"path":h("path",L.path);break}}}return l===void 0?(b.push(M),b):c?c.getUpdateObj():{}}}}}),Fg=Vt((Z,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}}}),Sd=Vt(Z=>{var V=Fg(),u=Xr(),d=yo();Z.rangeToShapePosition=function(t){return t.type==="log"?t.r2d:function(e){return e}},Z.shapePositionToRange=function(t){return t.type==="log"?t.d2r:function(e){return e}},Z.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},Z.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},Z.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 f=s[a],v=r?f:u.cleanNumber(f);i.push(v)}}}),i},Z.getDataToPixel=function(t,e,r,i,n){var o=t._fullLayout._size,a;if(e)if(n==="domain")a=function(f){return e._length*(i?1-f:f)+e._offset};else{var s=Z.shapePositionToRange(e);a=function(f){var v=A(e,r);return e._offset+e.r2p(s(f,!0))+v},e.type==="date"&&(a=Z.decodeDate(a))}else i?a=function(f){return o.t+o.h*(1-f)}:a=function(f){return o.l+o.w*f};return a},Z.getPixelToData=function(t,e,r,i){var n=t._fullLayout._size,o;if(e)if(i==="domain")o=function(s){var f=(s-e._offset)/e._length;return r?1-f:f};else{var a=Z.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},Z.roundPositionForSharpStrokeRendering=function(t,e){var r=Math.round(e%2)===1,i=Math.round(t);return r?i+.5:i},Z.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}},Z.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}},Z.getPathString=function(t,e){var r=e.type,i=d.getRefType(e.xref),n=d.getRefType(e.yref),o=d.getFromId(t,e.xref),a=d.getFromId(t,e.yref),s=t._fullLayout._size,f,v,g,m,w=A(o,e.x0shift),l=A(o,e.x1shift),x=A(a,e.y0shift),y=A(a,e.y1shift),S,k,M,T;if(o?i==="domain"?v=function(I){return o._offset+o._length*I}:(f=Z.shapePositionToRange(o),v=function(I){return o._offset+o.r2p(f(I,!0))}):v=function(I){return s.l+s.w*I},a?n==="domain"?m=function(I){return a._offset+a._length*(1-I)}:(g=Z.shapePositionToRange(a),m=function(I){return a._offset+a.r2p(g(I,!0))}):m=function(I){return s.t+s.h*(1-I)},r==="path")return o&&o.type==="date"&&(v=Z.decodeDate(v)),a&&a.type==="date"&&(m=Z.decodeDate(m)),E(e,v,m);if(e.xsizemode==="pixel"){var c=v(e.xanchor);S=c+e.x0+w,k=c+e.x1+l}else S=v(e.x0)+w,k=v(e.x1)+l;if(e.ysizemode==="pixel"){var h=m(e.yanchor);M=h-e.y0+x,T=h-e.y1+y}else M=m(e.y0)+x,T=m(e.y1)+y;if(r==="line")return"M"+S+","+M+"L"+k+","+T;if(r==="rect")return"M"+S+","+M+"H"+k+"V"+T+"H"+S+"Z";var b=(S+k)/2,_=(M+T)/2,P=Math.abs(b-S),L=Math.abs(_-M),D="A"+P+","+L,B=b+P+","+_,R=b+","+(_-L);return"M"+B+D+" 0 1,1 "+R+D+" 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(f){var v=0,g=f.charAt(0),m=V.paramIsX[g],w=V.paramIsY[g],l=V.numParams[g],x=f.substr(1).replace(V.paramRE,function(y){return m[v]?n==="pixel"?y=e(a)+Number(y):y=e(y):w[v]&&(o==="pixel"?y=r(s)-Number(y):y=r(y)),v++,v>l&&(y="X"),y});return v>l&&(x=x.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+f)),g+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}}),xb=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Dl(),A=Eo(),t=Md().readPaths,e=Sd(),r=e.getPathString,i=Oy(),n=mf().FROM_TL;V.exports=function(s,f,v,g){if(g.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var m;if(v.label.texttemplate){var w={};if(v.type!=="path"){var l=d.getFromId(s,v.xref),x=d.getFromId(s,v.yref);for(var y in i){var S=i[y](v,l,x);S!==void 0&&(w[y]=S)}}m=u.texttemplateStringForShapes({data:[w],fallback:v.label.texttemplatefallback,locale:s._fullLayout._d3locale,template:v.label.texttemplate})}else m=v.label.text;var k={"data-index":f},M=v.label.font,T={"data-notex":1},c=g.append("g").attr(k).classed("shape-label",!0),h=c.append("text").attr(T).classed("shape-label-text",!0).text(m),b,_,P,L;if(v.path){var D=r(s,v),B=t(D,s);b=1/0,P=1/0,_=-1/0,L=-1/0;for(var R=0;R<B.length;R++)for(var I=0;I<B[R].length;I++)for(var F=B[R][I],N=1;N<F.length;N+=2){var j=F[N],G=F[N+1];b=Math.min(b,j),_=Math.max(_,j),P=Math.min(P,G),L=Math.max(L,G)}}else{var rt=d.getFromId(s,v.xref),ct=v.x0shift,st=v.x1shift,et=d.getRefType(v.xref),K=d.getFromId(s,v.yref),ot=v.y0shift,X=v.y1shift,Q=d.getRefType(v.yref),ut=function(It,Ct){var Nt=e.getDataToPixel(s,rt,Ct,!1,et);return Nt(It)},J=function(It,Ct){var Nt=e.getDataToPixel(s,K,Ct,!0,Q);return Nt(It)};b=ut(v.x0,ct),_=ut(v.x1,st),P=J(v.y0,ot),L=J(v.y1,X)}var q=v.label.textangle;q==="auto"&&(v.type==="line"?q=o(b,P,_,L):q=0),h.call(function(It){return It.call(A.font,M).attr({}),E.convertToTspans(It,s),It});var it=A.bBox(h.node()),nt=a(b,P,_,L,v,q,it),dt=nt.textx,Tt=nt.texty,wt=nt.xanchor;h.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[wt],y:Tt,x:dt,transform:"rotate("+q+","+dt+","+Tt+")"}).call(E.positionText,dt,Tt)}};function o(s,f,v,g){var m,w;return w=Math.abs(v-s),v>=s?m=f-g:m=g-f,-180/Math.PI*Math.atan2(m,w)}function a(s,f,v,g,m,w,l){var x=m.label.textposition,y=m.label.textangle,S=m.label.padding,k=m.type,M=Math.PI/180*w,T=Math.sin(M),c=Math.cos(M),h=m.label.xanchor,b=m.label.yanchor,_,P,L,D;if(k==="line"){x==="start"?(_=s,P=f):x==="end"?(_=v,P=g):(_=(s+v)/2,P=(f+g)/2),h==="auto"&&(x==="start"?y==="auto"?v>s?h="left":v<s?h="right":h="center":v>s?h="right":v<s?h="left":h="center":x==="end"?y==="auto"?v>s?h="right":v<s?h="left":h="center":v>s?h="left":v<s?h="right":h="center":h="center");var B={left:1,center:0,right:-1},R={bottom:-1,middle:0,top:1};if(y==="auto"){var I=R[b];L=-S*T*I,D=S*c*I}else{var F=B[h],N=R[b];L=S*F,D=S*N}_=_+L,P=P+D}else L=S+3,x.indexOf("right")!==-1?(_=Math.max(s,v)-L,h==="auto"&&(h="right")):x.indexOf("left")!==-1?(_=Math.min(s,v)+L,h==="auto"&&(h="left")):(_=(s+v)/2,h==="auto"&&(h="center")),x.indexOf("top")!==-1?P=Math.min(f,g):x.indexOf("bottom")!==-1?P=Math.max(f,g):P=(f+g)/2,D=S,b==="bottom"?P=P-D:b==="top"&&(P=P+D);var j=n[b],G=m.label.font.size,rt=l.height,ct=(rt*j-G)*T,st=-(rt*j-G)*c;return{textx:_+ct,texty:P+st,xanchor:h}}}),Gy=Vt((Z,V)=>{var u=Xr(),d=u.strTranslate,E=ih(),A=Jh(),t=A.drawMode,e=A.selectMode,r=ji(),i=Pi(),n=Hy(),o=n.i000,a=n.i090,s=n.i180,f=n.i270,v=wd(),g=v.clearOutlineControllers,m=Md(),w=m.pointsOnRectangle,l=m.pointsOnEllipse,x=m.writePaths,y=Wy().newShapes,S=Wy().createShapeObj,k=yb(),M=xb();V.exports=function b(_,P,L,D){D||(D=0);var B=L.gd;function R(){b(_,P,L,D++),(l(_[0])||L.hasText)&&I({redrawing:!0})}function I(te){var Kt={};L.isActiveShape!==void 0&&(L.isActiveShape=!1,Kt=y(P,L)),L.isActiveSelection!==void 0&&(L.isActiveSelection=!1,Kt=k(P,L),B._fullLayout._reselect=!0),Object.keys(Kt).length&&r.call((te||{}).redrawing?"relayout":"_guiRelayout",B,Kt)}var F=B._fullLayout,N=F._zoomlayer,j=L.dragmode,G=t(j),rt=e(j);(G||rt)&&(B._fullLayout._outlining=!0),g(B),P.attr("d",x(_));var ct,st,et,K,ot;if(!D&&(L.isActiveShape||L.isActiveSelection)){ot=T([],_);var X=N.append("g").attr("class","outline-controllers");Tt(X),Jt()}if(G&&L.hasText){var Q=N.select(".label-temp"),ut=S(P,L,L.dragmode);M(B,"label-temp",ut,Q)}function J(te){et=+te.srcElement.getAttribute("data-i"),K=+te.srcElement.getAttribute("data-j"),ct[et][K].moveFn=q}function q(te,Kt){if(_.length){var mt=ot[et][K][1],bt=ot[et][K][2],vt=_[et],Ut=vt.length;if(w(vt)){var re=te,Zt=Kt;if(L.isActiveSelection){var ue=c(vt,K);ue[1]===vt[K][1]?Zt=0:re=0}for(var Me=0;Me<Ut;Me++)if(Me!==K){var Ce=vt[Me];Ce[1]===vt[K][1]&&(Ce[1]=mt+re),Ce[2]===vt[K][2]&&(Ce[2]=bt+Zt)}if(vt[K][1]=mt+re,vt[K][2]=bt+Zt,!w(vt))for(var We=0;We<Ut;We++)for(var qe=0;qe<vt[We].length;qe++)vt[We][qe]=ot[et][We][qe]}else vt[K][1]=mt+te,vt[K][2]=bt+Kt;R()}}function it(){I()}function nt(){if(_.length&&_[et]&&_[et].length){for(var te=[],Kt=0;Kt<_[et].length;Kt++)Kt!==K&&te.push(_[et][Kt]);te.length>1&&!(te.length===2&&te[1][0]==="Z")&&(K===0&&(te[0][0]="M"),_[et]=te,R(),I())}}function dt(te,Kt){if(te===2){et=+Kt.srcElement.getAttribute("data-i"),K=+Kt.srcElement.getAttribute("data-j");var mt=_[et];!w(mt)&&!l(mt)&&nt()}}function Tt(te){ct=[];for(var Kt=0;Kt<_.length;Kt++){var mt=_[Kt],bt=w(mt),vt=!bt&&l(mt);ct[Kt]=[];for(var Ut=mt.length,re=0;re<Ut;re++)if(mt[re][0]!=="Z"&&!(vt&&re!==o&&re!==a&&re!==s&&re!==f)){var Zt=bt&&L.isActiveSelection,ue;Zt&&(ue=c(mt,re));var Me=mt[re][1],Ce=mt[re][2],We=te.append(Zt?"rect":"circle").attr("data-i",Kt).attr("data-j",re).style({fill:i.background,stroke:i.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(Zt){var qe=ue[1]-Me,vr=ue[2]-Ce,_r=vr?5:Math.max(Math.min(25,Math.abs(qe)-5),5),er=qe?5:Math.max(Math.min(25,Math.abs(vr)-5),5);We.classed(vr?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",_r).attr("height",er).attr("x",Me-_r/2).attr("y",Ce-er/2).attr("transform",d(qe/2,vr/2))}else We.classed("cursor-grab",!0).attr("r",5).attr("cx",Me).attr("cy",Ce);ct[Kt][re]={element:We.node(),gd:B,prepFn:J,doneFn:it,clickFn:dt},E.init(ct[Kt][re])}}}function wt(te,Kt){if(_.length)for(var mt=0;mt<_.length;mt++)for(var bt=0;bt<_[mt].length;bt++)for(var vt=0;vt+2<_[mt][bt].length;vt+=2)_[mt][bt][vt+1]=ot[mt][bt][vt+1]+te,_[mt][bt][vt+2]=ot[mt][bt][vt+2]+Kt}function It(te,Kt){wt(te,Kt),R()}function Ct(te){et=+te.srcElement.getAttribute("data-i"),et||(et=0),st[et].moveFn=It}function Nt(){I()}function ee(te){te===2&&h(B)}function Jt(){if(st=[],!!_.length){var te=0;st[te]={element:P[0][0],gd:B,prepFn:Ct,doneFn:Nt,clickFn:ee},E.init(st[te])}}};function T(b,_){for(var P=0;P<_.length;P++){var L=_[P];b[P]=[];for(var D=0;D<L.length;D++){b[P][D]=[];for(var B=0;B<L[D].length;B++)b[P][D][B]=L[D][B]}}return b}function c(b,_){var P=b[_][1],L=b[_][2],D=b.length,B,R,I;return B=(_+1)%D,R=b[B][1],I=b[B][2],R===P&&I===L&&(B=(_+2)%D,R=b[B][1],I=b[B][2]),[B,R,I]}function h(b){if(e(b._fullLayout.dragmode)){g(b);var _=b._fullLayout._activeSelectionIndex,P=(b.layout||{}).selections||[];if(_<P.length){for(var L=[],D=0;D<P.length;D++)D!==_&&L.push(P[D]);delete b._fullLayout._activeSelectionIndex;var B=b._fullLayout.selections[_];b._fullLayout._deselect={xref:B.xref,yref:B.yref},r.call("_guiRelayout",b,{selections:L})}}}}),Zy=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Xr(),A=yo(),t=Md().readPaths,e=Gy(),r=xb(),i=wd().clearOutlineControllers,n=Pi(),o=Eo(),a=cl().arrayEditor,s=ih(),f=$h(),v=Fg(),g=Sd(),m=g.getPathString;V.exports={draw:w,drawOne:y,eraseActiveShape:h,drawLabel:r};function w(b){var _=b._fullLayout;_._shapeUpperLayer.selectAll("path").remove(),_._shapeLowerLayer.selectAll("path").remove(),_._shapeUpperLayer.selectAll("text").remove(),_._shapeLowerLayer.selectAll("text").remove();for(var P in _._plots){var L=_._plots[P].shapelayer;L&&(L.selectAll("path").remove(),L.selectAll("text").remove())}for(var D=0;D<_.shapes.length;D++)_.shapes[D].visible===!0&&y(b,D)}function l(b){return!!b._fullLayout._outlining}function x(b){return!b._context.edits.shapePosition}function y(b,_){b._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+_+'"]').remove();var P=g.makeShapesOptionsAndPlotinfo(b,_),L=P.options,D=P.plotinfo;if(!L._input||L.visible!==!0)return;if(L.layer==="above")R(b._fullLayout._shapeUpperLayer);else if(L.xref==="paper"||L.yref==="paper")R(b._fullLayout._shapeLowerLayer);else if(L.layer==="between")R(D.shapelayerBetween);else if(D._hadPlotinfo){var B=D.mainplotinfo||D;R(B.shapelayer)}else R(b._fullLayout._shapeLowerLayer);function R(I){var F=m(b,L),N={"data-index":_,"fill-rule":L.fillrule,d:F},j=L.opacity,G=L.fillcolor,rt=L.line.width?L.line.color:"rgba(0,0,0,0)",ct=L.line.width,st=L.line.dash;!ct&&L.editable===!0&&(ct=5,st="solid");var et=F[F.length-1]!=="Z",K=x(b)&&L.editable&&b._fullLayout._activeShapeIndex===_;K&&(G=et?"rgba(0,0,0,0)":b._fullLayout.activeshape.fillcolor,j=b._fullLayout.activeshape.opacity);var ot=I.append("g").classed("shape-group",!0).attr({"data-index":_}),X=ot.append("path").attr(N).style("opacity",j).call(n.stroke,rt).call(n.fill,G).call(o.dashLine,st,ct);S(ot,b,L),r(b,_,L,ot);var Q;if((K||b._context.edits.shapePosition)&&(Q=a(b.layout,"shapes",L)),K){X.style({cursor:"move"});var ut={element:X.node(),plotinfo:D,gd:b,editHelpers:Q,hasText:L.label.text||L.label.texttemplate,isActiveShape:!0},J=t(F,b);e(J,X,ut)}else b._context.edits.shapePosition?k(b,X,L,_,I,Q):L.editable===!0&&X.style("pointer-events",et||n.opacity(G)*j<=.5?"stroke":"all");X.node().addEventListener("click",function(){return T(b,X)})}}function S(b,_,P){var L=(P.xref+P.yref).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");o.setClipUrl(b,L?"clip"+_._fullLayout._uid+L:null,_)}function k(b,_,P,L,D,B){var R=10,I=10,F=P.xsizemode==="pixel",N=P.ysizemode==="pixel",j=P.type==="line",G=P.type==="path",rt=B.modifyItem,ct,st,et,K,ot,X,Q,ut,J,q,it,nt,dt,Tt,wt,It=u.select(_.node().parentNode),Ct=A.getFromId(b,P.xref),Nt=A.getRefType(P.xref),ee=A.getFromId(b,P.yref),Jt=A.getRefType(P.yref),te=P.x0shift,Kt=P.x1shift,mt=P.y0shift,bt=P.y1shift,vt=function(lt,yt){var St=g.getDataToPixel(b,Ct,yt,!1,Nt);return St(lt)},Ut=function(lt,yt){var St=g.getDataToPixel(b,ee,yt,!0,Jt);return St(lt)},re=g.getPixelToData(b,Ct,!1,Nt),Zt=g.getPixelToData(b,ee,!0,Jt),ue=We(),Me={element:ue.node(),gd:b,prepFn:_r,doneFn:er,clickFn:Mr},Ce;s.init(Me),ue.node().onmousemove=vr;function We(){return j?qe():_}function qe(){var lt=10,yt=Math.max(P.line.width,lt),St=D.append("g").attr("data-index",L).attr("drag-helper",!0);St.append("path").attr("d",_.attr("d")).style({cursor:"move","stroke-width":yt,"stroke-opacity":"0"});var Ht={"fill-opacity":"0"},Yt=Math.max(yt/2,lt);return St.append("circle").attr({"data-line-point":"start-point",cx:F?vt(P.xanchor)+P.x0:vt(P.x0,te),cy:N?Ut(P.yanchor)-P.y0:Ut(P.y0,mt),r:Yt}).style(Ht).classed("cursor-grab",!0),St.append("circle").attr({"data-line-point":"end-point",cx:F?vt(P.xanchor)+P.x1:vt(P.x1,Kt),cy:N?Ut(P.yanchor)-P.y1:Ut(P.y1,bt),r:Yt}).style(Ht).classed("cursor-grab",!0),St}function vr(lt){if(l(b)){Ce=null;return}if(j)lt.target.tagName==="path"?Ce="move":Ce=lt.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var yt=Me.element.getBoundingClientRect(),St=yt.right-yt.left,Ht=yt.bottom-yt.top,Yt=lt.clientX-yt.left,se=lt.clientY-yt.top,ke=!G&&St>R&&Ht>I&&!lt.shiftKey?s.getCursor(Yt/St,1-se/Ht):"move";f(_,ke),Ce=ke.split("-")[0]}}function _r(lt){l(b)||(F&&(ot=vt(P.xanchor)),N&&(X=Ut(P.yanchor)),P.type==="path"?wt=P.path:(ct=F?P.x0:vt(P.x0),st=N?P.y0:Ut(P.y0),et=F?P.x1:vt(P.x1),K=N?P.y1:Ut(P.y1)),ct<et?(J=ct,dt="x0",q=et,Tt="x1"):(J=et,dt="x1",q=ct,Tt="x0"),!N&&st<K||N&&st>K?(Q=st,it="y0",ut=K,nt="y1"):(Q=K,it="y1",ut=st,nt="y0"),vr(lt),Dt(D,P),_t(_,P,b),Me.moveFn=Ce==="move"?Ir:de,Me.altKey=lt.altKey)}function er(){l(b)||(f(_),qt(D),S(_,b,P),d.call("_guiRelayout",b,B.getUpdateObj()))}function Mr(){l(b)||qt(D)}function Ir(lt,yt){if(P.type==="path"){var St=function(se){return se},Ht=St,Yt=St;F?rt("xanchor",P.xanchor=re(ot+lt)):(Ht=function(se){return re(vt(se)+lt)},Ct&&Ct.type==="date"&&(Ht=g.encodeDate(Ht))),N?rt("yanchor",P.yanchor=Zt(X+yt)):(Yt=function(se){return Zt(Ut(se)+yt)},ee&&ee.type==="date"&&(Yt=g.encodeDate(Yt))),rt("path",P.path=M(wt,Ht,Yt))}else F?rt("xanchor",P.xanchor=re(ot+lt)):(rt("x0",P.x0=re(ct+lt)),rt("x1",P.x1=re(et+lt))),N?rt("yanchor",P.yanchor=Zt(X+yt)):(rt("y0",P.y0=Zt(st+yt)),rt("y1",P.y1=Zt(K+yt)));_.attr("d",m(b,P)),Dt(D,P),r(b,L,P,It)}function de(lt,yt){if(G){var St=function(gn){return gn},Ht=St,Yt=St;F?rt("xanchor",P.xanchor=re(ot+lt)):(Ht=function(gn){return re(vt(gn)+lt)},Ct&&Ct.type==="date"&&(Ht=g.encodeDate(Ht))),N?rt("yanchor",P.yanchor=Zt(X+yt)):(Yt=function(gn){return Zt(Ut(gn)+yt)},ee&&ee.type==="date"&&(Yt=g.encodeDate(Yt))),rt("path",P.path=M(wt,Ht,Yt))}else if(j){if(Ce==="resize-over-start-point"){var se=ct+lt,ke=N?st-yt:st+yt;rt("x0",P.x0=F?se:re(se)),rt("y0",P.y0=N?ke:Zt(ke))}else if(Ce==="resize-over-end-point"){var Ee=et+lt,Ue=N?K-yt:K+yt;rt("x1",P.x1=F?Ee:re(Ee)),rt("y1",P.y1=N?Ue:Zt(Ue))}}else{var ir=function(gn){return Ce.indexOf(gn)!==-1},ar=ir("n"),Ye=ir("s"),Er=ir("w"),pn=ir("e"),dn=ar?Q+yt:Q,bn=Ye?ut+yt:ut,Zn=Er?J+lt:J,En=pn?q+lt:q;N&&(ar&&(dn=Q-yt),Ye&&(bn=ut-yt)),(!N&&bn-dn>I||N&&dn-bn>I)&&(rt(it,P[it]=N?dn:Zt(dn)),rt(nt,P[nt]=N?bn:Zt(bn))),En-Zn>R&&(rt(dt,P[dt]=F?Zn:re(Zn)),rt(Tt,P[Tt]=F?En:re(En)))}_.attr("d",m(b,P)),Dt(D,P),r(b,L,P,It)}function Dt(lt,yt){(F||N)&&St();function St(){var Ht=yt.type!=="path",Yt=lt.selectAll(".visual-cue").data([0]),se=1;Yt.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":se}).classed("visual-cue",!0);var ke=vt(F?yt.xanchor:E.midRange(Ht?[yt.x0,yt.x1]:g.extractPathCoords(yt.path,v.paramIsX))),Ee=Ut(N?yt.yanchor:E.midRange(Ht?[yt.y0,yt.y1]:g.extractPathCoords(yt.path,v.paramIsY)));if(ke=g.roundPositionForSharpStrokeRendering(ke,se),Ee=g.roundPositionForSharpStrokeRendering(Ee,se),F&&N){var Ue="M"+(ke-1-se)+","+(Ee-1-se)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Yt.attr("d",Ue)}else if(F){var ir="M"+(ke-1-se)+","+(Ee-9-se)+"v18 h2 v-18 Z";Yt.attr("d",ir)}else{var ar="M"+(ke-9-se)+","+(Ee-1-se)+"h18 v2 h-18 Z";Yt.attr("d",ar)}}}function qt(lt){lt.selectAll(".visual-cue").remove()}function _t(lt,yt,St){var Ht=yt.xref,Yt=yt.yref,se=A.getFromId(St,Ht),ke=A.getFromId(St,Yt),Ee="";Ht!=="paper"&&!se.autorange&&(Ee+=Ht),Yt!=="paper"&&!ke.autorange&&(Ee+=Yt),o.setClipUrl(lt,Ee?"clip"+St._fullLayout._uid+Ee:null,St)}}function M(b,_,P){return b.replace(v.segmentRE,function(L){var D=0,B=L.charAt(0),R=v.paramIsX[B],I=v.paramIsY[B],F=v.numParams[B],N=L.substr(1).replace(v.paramRE,function(j){return D>=F||(R[D]?j=_(j):I[D]&&(j=P(j)),D++),j});return B+N})}function T(b,_){if(x(b)){var P=_.node(),L=+P.getAttribute("data-index");if(L>=0){if(L===b._fullLayout._activeShapeIndex){c(b);return}b._fullLayout._activeShapeIndex=L,b._fullLayout._deactivateShape=c,w(b)}}}function c(b){if(x(b)){var _=b._fullLayout._activeShapeIndex;_>=0&&(i(b),delete b._fullLayout._activeShapeIndex,w(b))}}function h(b){if(x(b)){i(b);var _=b._fullLayout._activeShapeIndex,P=(b.layout||{}).shapes||[];if(_<P.length){for(var L=[],D=0;D<P.length;D++)D!==_&&L.push(P[D]);return delete b._fullLayout._activeShapeIndex,d.call("_guiRelayout",b,{shapes:L})}}}}),_b=Vt((Z,V)=>{var u=ji(),d=Uu(),E=cc(),A=Vy(),t=Zy().eraseActiveShape,e=Xr(),r=e._,i=V.exports={};i.toImage={name:"toImage",title:function(k){var M=k._context.toImageButtonOptions||{},T=M.format||"png";return T==="png"?r(k,"Download plot as a PNG"):r(k,"Download plot")},icon:A.camera,click:function(k){var M=k._context.toImageButtonOptions,T={format:M.format||"png"};e.notifier(r(k,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(c){c in M&&(T[c]=M[c])}),u.call("downloadImage",k,T).then(function(c){e.notifier(r(k,"Snapshot succeeded")+" - "+c,"long")}).catch(function(){e.notifier(r(k,"Sorry, there was a problem downloading your snapshot!"),"long")})}},i.sendDataToCloud={name:"sendDataToCloud",title:function(k){return r(k,"Edit in Chart Studio")},icon:A.disk,click:function(k){d.sendDataToCloud(k)}},i.editInChartStudio={name:"editInChartStudio",title:function(k){return r(k,"Edit in Chart Studio")},icon:A.pencil,click:function(k){d.sendDataToCloud(k)}},i.zoom2d={name:"zoom2d",_cat:"zoom",title:function(k){return r(k,"Zoom")},attr:"dragmode",val:"zoom",icon:A.zoombox,click:n},i.pan2d={name:"pan2d",_cat:"pan",title:function(k){return r(k,"Pan")},attr:"dragmode",val:"pan",icon:A.pan,click:n},i.select2d={name:"select2d",_cat:"select",title:function(k){return r(k,"Box Select")},attr:"dragmode",val:"select",icon:A.selectbox,click:n},i.lasso2d={name:"lasso2d",_cat:"lasso",title:function(k){return r(k,"Lasso Select")},attr:"dragmode",val:"lasso",icon:A.lasso,click:n},i.drawclosedpath={name:"drawclosedpath",title:function(k){return r(k,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:A.drawclosedpath,click:n},i.drawopenpath={name:"drawopenpath",title:function(k){return r(k,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:A.drawopenpath,click:n},i.drawline={name:"drawline",title:function(k){return r(k,"Draw line")},attr:"dragmode",val:"drawline",icon:A.drawline,click:n},i.drawrect={name:"drawrect",title:function(k){return r(k,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:A.drawrect,click:n},i.drawcircle={name:"drawcircle",title:function(k){return r(k,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:A.drawcircle,click:n},i.eraseshape={name:"eraseshape",title:function(k){return r(k,"Erase active shape")},icon:A.eraseshape,click:t},i.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(k){return r(k,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:n},i.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(k){return r(k,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:n},i.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(k){return r(k,"Autoscale")},attr:"zoom",val:"auto",icon:A.autoscale,click:n},i.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(k){return r(k,"Reset axes")},attr:"zoom",val:"reset",icon:A.home,click:n},i.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(k){return r(k,"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(k){return r(k,"Compare data on hover")},attr:"hovermode",val:function(k){return k._fullLayout._isHoriz?"y":"x"},icon:A.tooltip_compare,gravity:"ne",click:n};function n(k,M){var T=M.currentTarget,c=T.getAttribute("data-attr"),h=T.getAttribute("data-val")||!0,b=k._fullLayout,_={},P=E.list(k,null,!0),L=b._cartesianSpikesEnabled,D,B;if(c==="zoom"){var R=h==="in"?.5:2,I=(1+R)/2,F=(1-R)/2,N,j;for(B=0;B<P.length;B++)if(D=P[B],j=D.modebardisable==="none"||D.modebardisable.indexOf(h==="auto"||h==="reset"?"autoscale":"zoominout")===-1,j&&!D.fixedrange)if(N=D._name,h==="auto")_[N+".autorange"]=!0;else if(h==="reset")D._rangeInitial0===void 0&&D._rangeInitial1===void 0?_[N+".autorange"]=!0:D._rangeInitial0===void 0?(_[N+".autorange"]=D._autorangeInitial,_[N+".range"]=[null,D._rangeInitial1]):D._rangeInitial1===void 0?(_[N+".range"]=[D._rangeInitial0,null],_[N+".autorange"]=D._autorangeInitial):_[N+".range"]=[D._rangeInitial0,D._rangeInitial1],D._showSpikeInitial!==void 0&&(_[N+".showspikes"]=D._showSpikeInitial,L==="on"&&!D._showSpikeInitial&&(L="off"));else{var G=[D.r2l(D.range[0]),D.r2l(D.range[1])],rt=[I*G[0]+F*G[1],I*G[1]+F*G[0]];_[N+".range[0]"]=D.l2r(rt[0]),_[N+".range[1]"]=D.l2r(rt[1])}}else c==="hovermode"&&(h==="x"||h==="y")&&(h=b._isHoriz?"y":"x",T.setAttribute("data-val",h)),_[c]=h;b._cartesianSpikesEnabled=L,u.call("_guiRelayout",k,_)}i.zoom3d={name:"zoom3d",_cat:"zoom",title:function(k){return r(k,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:A.zoombox,click:o},i.pan3d={name:"pan3d",_cat:"pan",title:function(k){return r(k,"Pan")},attr:"scene.dragmode",val:"pan",icon:A.pan,click:o},i.orbitRotation={name:"orbitRotation",title:function(k){return r(k,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:A["3d_rotate"],click:o},i.tableRotation={name:"tableRotation",title:function(k){return r(k,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:A["z-axis"],click:o};function o(k,M){for(var T=M.currentTarget,c=T.getAttribute("data-attr"),h=T.getAttribute("data-val")||!0,b=k._fullLayout._subplots.gl3d||[],_={},P=c.split("."),L=0;L<b.length;L++)_[b[L]+"."+P[1]]=h;var D=h==="pan"?h:"zoom";_.dragmode=D,u.call("_guiRelayout",k,_)}i.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(k){return r(k,"Reset camera to default")},attr:"resetDefault",icon:A.home,click:a},i.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(k){return r(k,"Reset camera to last save")},attr:"resetLastSave",icon:A.movie,click:a};function a(k,M){for(var T=M.currentTarget,c=T.getAttribute("data-attr"),h=c==="resetLastSave",b=c==="resetDefault",_=k._fullLayout,P=_._subplots.gl3d||[],L={},D=0;D<P.length;D++){var B=P[D],R=B+".camera",I=B+".aspectratio",F=B+".aspectmode",N=_[B]._scene,j;h?(L[R+".up"]=N.viewInitial.up,L[R+".eye"]=N.viewInitial.eye,L[R+".center"]=N.viewInitial.center,j=!0):b&&(L[R+".up"]=null,L[R+".eye"]=null,L[R+".center"]=null,j=!0),j&&(L[I+".x"]=N.viewInitial.aspectratio.x,L[I+".y"]=N.viewInitial.aspectratio.y,L[I+".z"]=N.viewInitial.aspectratio.z,L[F]=N.viewInitial.aspectmode)}u.call("_guiRelayout",k,L)}i.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(k){return r(k,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:A.tooltip_basic,gravity:"ne",click:f};function s(k,M){var T=M.currentTarget,c=T._previousVal,h=k._fullLayout,b=h._subplots.gl3d||[],_=["xaxis","yaxis","zaxis"],P={},L={};if(c)L=c,T._previousVal=null;else{for(var D=0;D<b.length;D++){var B=b[D],R=h[B],I=B+".hovermode";P[I]=R.hovermode,L[I]=!1;for(var F=0;F<3;F++){var N=_[F],j=B+"."+N+".showspikes";L[j]=!1,P[j]=R[N].showspikes}}T._previousVal=P}return L}function f(k,M){var T=s(k,M);u.call("_guiRelayout",k,T)}i.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(k){return r(k,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:v},i.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(k){return r(k,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:v},i.resetGeo={name:"resetGeo",_cat:"reset",title:function(k){return r(k,"Reset")},attr:"reset",val:null,icon:A.autoscale,click:v},i.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(k){return r(k,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:A.tooltip_basic,gravity:"ne",click:m};function v(k,M){for(var T=M.currentTarget,c=T.getAttribute("data-attr"),h=T.getAttribute("data-val")||!0,b=k._fullLayout,_=b._subplots.geo||[],P=0;P<_.length;P++){var L=_[P],D=b[L];if(c==="zoom"){var B=D.projection.scale,R=h==="in"?2*B:.5*B;u.call("_guiRelayout",k,L+".projection.scale",R)}}c==="reset"&&S(k,"geo")}i.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(k){return r(k,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:A.tooltip_basic,gravity:"ne",click:m};function g(k){var M=k._fullLayout;return M.hovermode?!1:M._has("cartesian")?M._isHoriz?"y":"x":"closest"}function m(k){var M=g(k);u.call("_guiRelayout",k,"hovermode",M)}i.resetViewSankey={name:"resetSankeyGroup",title:function(k){return r(k,"Reset view")},icon:A.home,click:function(k){for(var M={"node.groups":[],"node.x":[],"node.y":[]},T=0;T<k._fullData.length;T++){var c=k._fullData[T]._viewInitial;M["node.groups"].push(c.node.groups.slice()),M["node.x"].push(c.node.x.slice()),M["node.y"].push(c.node.y.slice())}u.call("restyle",k,M)}},i.toggleHover={name:"toggleHover",title:function(k){return r(k,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:A.tooltip_basic,gravity:"ne",click:function(k,M){var T=s(k,M);T.hovermode=g(k),u.call("_guiRelayout",k,T)}},i.resetViews={name:"resetViews",title:function(k){return r(k,"Reset views")},icon:A.home,click:function(k,M){var T=M.currentTarget;T.setAttribute("data-attr","zoom"),T.setAttribute("data-val","reset"),n(k,M),T.setAttribute("data-attr","resetLastSave"),a(k,M),S(k,"geo"),S(k,"mapbox"),S(k,"map")}},i.toggleSpikelines={name:"toggleSpikelines",title:function(k){return r(k,"Toggle Spike Lines")},icon:A.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(k){var M=k._fullLayout,T=M._cartesianSpikesEnabled;M._cartesianSpikesEnabled=T==="on"?"off":"on",u.call("_guiRelayout",k,w(k))}};function w(k){for(var M=k._fullLayout,T=M._cartesianSpikesEnabled==="on",c=E.list(k,null,!0),h={},b=0;b<c.length;b++){var _=c[b];h[_._name+".showspikes"]=T?!0:_._showSpikeInitial}return h}i.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(k){return r(k,"Reset view")},attr:"reset",icon:A.home,click:function(k){S(k,"mapbox")}},i.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(k){return r(k,"Reset view")},attr:"reset",icon:A.home,click:function(k){S(k,"map")}},i.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(k){return r(k,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:l},i.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(k){return r(k,"Zoom in")},attr:"zoom",val:"in",icon:A.zoom_plus,click:x},i.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(k){return r(k,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:l},i.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(k){return r(k,"Zoom out")},attr:"zoom",val:"out",icon:A.zoom_minus,click:x};function l(k,M){y(k,M,"mapbox")}function x(k,M){y(k,M,"map")}function y(k,M,T){for(var c=M.currentTarget,h=c.getAttribute("data-val"),b=k._fullLayout,_=b._subplots[T]||[],P=1.05,L={},D=0;D<_.length;D++){var B=_[D],R=b[B].zoom,I=h==="in"?P*R:R/P;L[B+".zoom"]=I}u.call("_guiRelayout",k,L)}function S(k,M){for(var T=k._fullLayout,c=T._subplots[M]||[],h={},b=0;b<c.length;b++)for(var _=c[b],P=T[_]._subplot,L=P.viewInitial,D=Object.keys(L),B=0;B<D.length;B++){var R=D[B];h[_+"."+R]=L[R]}u.call("_guiRelayout",k,h)}}),bb=Vt((Z,V)=>{var u=_b(),d=Object.keys(u),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)}};d.forEach(function(r){e(u[r])}),t.sort(),V.exports={DRAW_MODES:E,backButtons:A,foreButtons:t}}),wb=Vt((Z,V)=>{bb(),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"}}}),ak=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=cl(),A=wb();V.exports=function(t,e){var r=t.modebar||{},i=E.newContainer(e,"modebar");function n(a,s){return u.coerce(r,i,A,a,s)}n("orientation"),n("bgcolor",d.addOpacity(e.paper_bgcolor,.5));var o=d.contrast(d.rgb(e.modebar.bgcolor));n("color",d.addOpacity(o,.3)),n("activecolor",d.addOpacity(o,.7)),n("uirevision",e.uirevision),n("add"),n("remove")}}),ik=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=Vy(),t=Ly().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 f=this.graphInfo._context,v=this.graphInfo._fullLayout,g="modebar-"+v._uid;this.element.setAttribute("id",g),this.element.setAttribute("role","toolbar"),this._uid=g,this.element.className="modebar modebar--custom",f.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),v.modebar.orientation==="v"&&(this.element.className+=" vertical",s=s.reverse());var m=v.modebar,w="#"+g+" .modebar-group";document.querySelectorAll(w).forEach(function(k){k.style.backgroundColor=m.bgcolor});var l=!this.hasButtons(s),x=this.hasLogo!==f.displaylogo,y=this.locale!==f.locale;if(this.locale=f.locale,(l||x||y)&&(this.removeAllButtons(),this.updateButtons(s),f.watermark||f.displaylogo)){var S=this.getLogo();f.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("#"+g+" .modebar-btn",".active",".icon path","fill: "+m.activecolor,"fill: "+m.color,this.element)},i.updateButtons=function(a){var s=this;this.buttons=a,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(f){var v=s.createGroup();f.forEach(function(g){var m=g.name;if(!m)throw new Error("must provide button 'name' in button config");if(s.buttonsNames.indexOf(m)!==-1)throw new Error("button name '"+m+"' is taken");s.buttonsNames.push(m);var w=s.createButton(g);s.buttonElements.push(w),v.appendChild(w)}),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,f=document.createElement("button");f.setAttribute("type","button"),f.setAttribute("rel","tooltip"),f.className="modebar-btn";var v=a.title;v===void 0?v=a.name:typeof v=="function"&&(v=v(this.graphInfo)),(v||v===0)&&(f.setAttribute("data-title",v),f.setAttribute("aria-label",v)),a.attr!==void 0&&f.setAttribute("data-attr",a.attr);var g=a.val;g!==void 0&&(typeof g=="function"&&(g=g(this.graphInfo)),f.setAttribute("data-val",g));var m=a.click;if(typeof m!="function")throw new Error("must provide button 'click' function in button config");f.addEventListener("click",function(l){a.click(s.graphInfo,l),s.updateActiveButton(l.currentTarget)}),f.setAttribute("data-toggle",a.toggle||!1),a.toggle&&u.select(f).classed("active",!0);var w=a.icon;return typeof w=="function"?f.appendChild(w()):f.appendChild(this.createIcon(w||A.question)),f.setAttribute("data-gravity",a.gravity||"n"),f},i.createIcon=function(a){var s=d(a.height)?Number(a.height):a.ascent-a.descent,f="http://www.w3.org/2000/svg",v;if(a.path){v=document.createElementNS(f,"svg"),v.setAttribute("viewBox",[0,0,a.width,s].join(" ")),v.setAttribute("class","icon");var g=document.createElementNS(f,"path");g.setAttribute("d",a.path),a.transform?g.setAttribute("transform",a.transform):a.ascent!==void 0&&g.setAttribute("transform","matrix(1 0 0 -1 0 "+a.ascent+")"),v.appendChild(g)}if(a.svg){var m=e.parseFromString(a.svg,"application/xml");v=m.childNodes[0]}return v.setAttribute("height","1em"),v.setAttribute("width","1em"),v},i.updateActiveButton=function(a){var s=this.graphInfo._fullLayout,f=a!==void 0?a.getAttribute("data-attr"):null;this.buttonElements.forEach(function(v){var g=v.getAttribute("data-val")||!0,m=v.getAttribute("data-attr"),w=v.getAttribute("data-toggle")==="true",l=u.select(v),x=function(k,M){var T=s.modebar,c=k.querySelector(".icon path");c&&(M||k.matches(":hover")?c.style.fill=T.activecolor:c.style.fill=T.color)};if(w){if(m===f){var y=!l.classed("active");l.classed("active",y),x(v,y)}}else{var S=m===null?m:E.nestedProperty(s,m).get();l.classed("active",S===g),x(v,S===g)}})},i.hasButtons=function(a){var s=this.buttons;if(!s||a.length!==s.length)return!1;for(var f=0;f<a.length;++f){if(a[f].length!==s[f].length)return!1;for(var v=0;v<a[f].length;v++)if(a[f][v].name!==s[f][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 f=a._fullLayout,v=new r({graphInfo:a,container:f._modebardiv.node(),buttons:s});return f._privateplot&&u.select(v.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),v}V.exports=o}),ok=Vt((Z,V)=>{var u=cc(),d=nu(),E=ji(),A=dh().isUnifiedHover,t=ik(),e=_b(),r=bb().DRAW_MODES,i=Xr().extendDeep;V.exports=function(g){var m=g._fullLayout,w=g._context,l=m._modeBar;if(!w.displayModeBar&&!w.watermark){l&&(l.destroy(),delete m._modeBar);return}if(!Array.isArray(w.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(w.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var x=w.modeBarButtons,y;Array.isArray(x)&&x.length?y=v(x):!w.displayModeBar&&w.watermark?y=[]:y=n(g),l?l.update(g,y):m._modeBar=t(g,y)};function n(g){var m=g._fullLayout,w=g._fullData,l=g._context;function x(q,it){if(typeof it=="string"){if(it.toLowerCase()===q.toLowerCase())return!0}else{var nt=it.name,dt=it._cat||it.name;if(nt===q||dt===q.toLowerCase())return!0}return!1}var y=m.modebar.add;typeof y=="string"&&(y=[y]);var S=m.modebar.remove;typeof S=="string"&&(S=[S]);var k=l.modeBarButtonsToAdd.concat(y.filter(function(q){for(var it=0;it<l.modeBarButtonsToRemove.length;it++)if(x(q,l.modeBarButtonsToRemove[it]))return!1;return!0})),M=l.modeBarButtonsToRemove.concat(S.filter(function(q){for(var it=0;it<l.modeBarButtonsToAdd.length;it++)if(x(q,l.modeBarButtonsToAdd[it]))return!1;return!0})),T=m._has("cartesian"),c=m._has("gl3d"),h=m._has("geo"),b=m._has("pie"),_=m._has("funnelarea"),P=m._has("ternary"),L=m._has("mapbox"),D=m._has("map"),B=m._has("polar"),R=m._has("smith"),I=m._has("sankey"),F=o(m),N=A(m.hovermode),j=[];function G(q){if(q.length){for(var it=[],nt=0;nt<q.length;nt++){for(var dt=q[nt],Tt=e[dt],wt=Tt.name.toLowerCase(),It=(Tt._cat||Tt.name).toLowerCase(),Ct=!1,Nt=0;Nt<M.length;Nt++){var ee=M[Nt].toLowerCase();if(ee===wt||ee===It){Ct=!0;break}}Ct||it.push(e[dt])}j.push(it)}}var rt=["toImage"];l.showEditInChartStudio?rt.push("editInChartStudio"):l.showSendToCloud&&rt.push("sendDataToCloud"),G(rt);var ct=[],st=[],et=[],K=[];(T||b||_||P)+h+c+L+D+B+R>1?(st=["toggleHover"],et=["resetViews"]):h?(ct=["zoomInGeo","zoomOutGeo"],st=["hoverClosestGeo"],et=["resetGeo"]):c?(st=["hoverClosest3d"],et=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(ct=["zoomInMapbox","zoomOutMapbox"],st=["toggleHover"],et=["resetViewMapbox"]):D?(ct=["zoomInMap","zoomOutMap"],st=["toggleHover"],et=["resetViewMap"]):b?st=["hoverClosestPie"]:I?(st=["hoverClosestCartesian","hoverCompareCartesian"],et=["resetViewSankey"]):st=["toggleHover"],T&&st.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(w)||N)&&(st=[]),T&&!F&&(ct=["zoomIn2d","zoomOut2d","autoScale2d"],et[0]!=="resetViews"&&(et=["resetScale2d"])),c?K=["zoom3d","pan3d","orbitRotation","tableRotation"]:T&&!F||P?K=["zoom2d","pan2d"]:L||D||h?K=["pan2d"]:B&&(K=["zoom2d"]),a(w)&&K.push("select2d","lasso2d");var ot=[],X=function(q){ot.indexOf(q)===-1&&st.indexOf(q)!==-1&&ot.push(q)};if(Array.isArray(k)){for(var Q=[],ut=0;ut<k.length;ut++){var J=k[ut];typeof J=="string"?(J=J.toLowerCase(),r.indexOf(J)!==-1?(m._has("mapbox")||m._has("map")||m._has("cartesian"))&&K.push(J):J==="togglespikelines"?X("toggleSpikelines"):J==="togglehover"?X("toggleHover"):J==="hovercompare"?X("hoverCompareCartesian"):J==="hoverclosest"?(X("hoverClosestCartesian"),X("hoverClosestGeo"),X("hoverClosest3d"),X("hoverClosestPie")):J==="v1hovermode"&&(X("hoverClosestCartesian"),X("hoverCompareCartesian"),X("hoverClosestGeo"),X("hoverClosest3d"),X("hoverClosestPie"))):Q.push(J)}k=Q}return G(K),G(ct.concat(et)),G(ot),f(j,k)}function o(g){for(var m=u.list({_fullLayout:g},null,!0),w=0;w<m.length;w++){var l=m[w].modebardisable;if(!m[w].fixedrange&&l!=="autoscale+zoominout"&&l!=="zoominout+autoscale")return!1}return!0}function a(g){for(var m=!1,w=0;w<g.length&&!m;w++){var l=g[w];!l._module||!l._module.selectPoints||(E.traceIs(l,"scatter-like")?(d.hasMarkers(l)||d.hasText(l))&&(m=!0):E.traceIs(l,"box-violin")?(l.boxpoints==="all"||l.points==="all")&&(m=!0):m=!0)}return m}function s(g){for(var m=0;m<g.length;m++)if(!E.traceIs(g[m],"noHover"))return!1;return!0}function f(g,m){if(m.length)if(Array.isArray(m[0]))for(var w=0;w<m.length;w++)g.push(m[w]);else g.push(m);return g}function v(g){for(var m=i([],g),w=0;w<m.length;w++)for(var l=m[w],x=0;x<l.length;x++){var y=l[x];if(typeof y=="string")if(e[y]!==void 0)m[w][x]=e[y];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return m}}),Tb=Vt((Z,V)=>{V.exports={moduleType:"component",name:"modebar",layoutAttributes:wb(),supplyLayoutDefaults:ak(),manage:ok()}}),kb=Vt((Z,V)=>{var u=mf().FROM_BL;V.exports=function(d,E,A){A===void 0&&(A=u[d.constraintoward||"center"]);var t=[d.r2l(d.range[0]),d.r2l(d.range[1])],e=t[0]+(t[1]-t[0])*A;d.range=d._input.range=[d.l2r(e+(t[0]-e)*E),d.l2r(e+(t[1]-e)*E)],d.setScale()}}),s0=Vt(Z=>{var V=Xr(),u=Xh(),d=cc().id2name,E=Pf(),A=kb(),t=mp(),e=ks().ALMOST_EQUAL,r=mf().FROM_BL;Z.handleDefaults=function(g,m,w){var l=w.axIds,x=w.axHasImage,y=m._axisConstraintGroups=[],S=m._axisMatchGroups=[],k,M,T,c,h,b,_,P;for(k=0;k<l.length;k++)c=d(l[k]),h=g[c],b=m[c],i(h,b,{axIds:l,layoutOut:m,hasImage:x[c]});function L(rt,ct){for(k=0;k<rt.length;k++){M=rt[k];for(T in M)m[d(T)][ct]=M}}for(L(S,"_matchGroup"),k=0;k<y.length;k++){M=y[k];for(T in M)if(b=m[d(T)],b.fixedrange){for(var D in M){var B=d(D);(g[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"),m[B].fixedrange=!0}break}}for(k=0;k<y.length;){M=y[k];for(T in M){b=m[d(T)],b._matchGroup&&Object.keys(b._matchGroup).length===Object.keys(M).length&&(y.splice(k,1),k--);break}k++}L(y,"_constraintGroup");var R=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],I=!1,F=!1;function N(){P=b[_],_==="rangebreaks"&&(F=b._hasDayOfWeekBreaks)}for(k=0;k<S.length;k++){M=S[k];for(var j=0;j<R.length;j++){_=R[j],P=null;var G;for(T in M)if(c=d(T),h=g[c],b=m[c],_ in b){if(!b.matches&&(G=b,_ in h)){N();break}P===null&&_ in h&&N()}if(_==="range"&&P&&h.range&&h.range.length===2&&h.range[0]!==null&&h.range[1]!==null&&(I=!0),_==="autorange"&&P===null&&I&&(P=!1),P===null&&_ in G&&(P=G[_]),P!==null)for(T in M)b=m[d(T)],b[_]=_==="range"?P.slice():P,_==="rangebreaks"&&(b._hasDayOfWeekBreaks=F,t(b,m))}}};function i(g,m,w){var l=w.axIds,x=w.layoutOut,y=w.hasImage,S=x._axisConstraintGroups,k=x._axisMatchGroups,M=m._id,T=M.charAt(0),c=((x._splomAxes||{})[T]||{})[M]||{},h=m._id,b=h.charAt(0)==="x";m._matchGroup=null,m._constraintGroup=null;function _(K,ot){return V.coerce(g,m,E,K,ot)}_("constrain",y?"domain":"range"),V.coerce(g,m,{constraintoward:{valType:"enumerated",values:b?["left","center","right"]:["bottom","middle","top"],dflt:b?"center":"middle"}},"constraintoward");var P=m.type,L,D,B=[];for(L=0;L<l.length;L++)if(D=l[L],D!==h){var R=x[d(D)];R.type===P&&B.push(D)}var I=o(S,h);if(I){var F=[];for(L=0;L<B.length;L++)D=B[L],I[D]||F.push(D);B=F}var N=B.length,j,G;N&&(g.matches||c.matches)&&(j=V.coerce(g,m,{matches:{valType:"enumerated",values:B,dflt:B.indexOf(c.matches)!==-1?c.matches:void 0}},"matches"));var rt=y&&!b?m.anchor:void 0;if(N&&!j&&(g.scaleanchor||rt)&&(G=V.coerce(g,m,{scaleanchor:{valType:"enumerated",values:B.concat([!1])}},"scaleanchor",rt)),j){m._matchGroup=a(k,h,j,1);var ct=x[d(j)],st=n(x,m)/n(x,ct);b!==(j.charAt(0)==="x")&&(st=(b?"x":"y")+st),a(S,h,j,st)}else g.matches&&l.indexOf(g.matches)!==-1&&V.warn("ignored "+m._name+'.matches: "'+g.matches+'" to avoid an infinite loop');if(G){var et=_("scaleratio");et||(et=m.scaleratio=1),a(S,h,G,et)}else g.scaleanchor&&l.indexOf(g.scaleanchor)!==-1&&V.warn("ignored "+m._name+'.scaleanchor: "'+g.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function n(g,m){var w=m.domain;return w||(w=g[d(m.overlaying)].domain),w[1]-w[0]}function o(g,m){for(var w=0;w<g.length;w++)if(g[w][m])return g[w];return null}function a(g,m,w,l){var x,y,S,k,M,T=o(g,m);T===null?(T={},T[m]=1,M=g.length,g.push(T)):M=g.indexOf(T);var c=Object.keys(T);for(x=0;x<g.length;x++)if(S=g[x],x!==M&&S[w]){var h=S[w];for(y=0;y<c.length;y++)k=c[y],S[k]=s(h,s(l,T[k]));g.splice(M,1);return}if(l!==1)for(y=0;y<c.length;y++){var b=c[y];T[b]=s(l,T[b])}T[w]=1}function s(g,m){var w="",l="",x,y;typeof g=="string"&&(w=g.match(/^[xy]*/)[0],x=w.length,g=+g.substr(x)),typeof m=="string"&&(l=m.match(/^[xy]*/)[0],y=l.length,m=+m.substr(y));var S=g*m;return!x&&!y?S:!x||!y||w.charAt(0)===l.charAt(0)?w+l+g*m:x===y?S:(x>y?w.substr(y):l.substr(x))+S}function f(g,m){for(var w=m._size,l=w.h/w.w,x={},y=Object.keys(g),S=0;S<y.length;S++){var k=y[S],M=g[k];if(typeof M=="string"){var T=M.match(/^[xy]*/)[0],c=T.length;M=+M.substr(c);for(var h=T.charAt(0)==="y"?l:1/l,b=0;b<c;b++)M*=h}x[k]=M}return x}Z.enforce=function(g){var m=g._fullLayout,w=m._axisConstraintGroups||[],l,x,y,S,k,M,T,c;for(l=0;l<w.length;l++){y=f(w[l],m);var h=Object.keys(y),b=1/0,_=0,P=1/0,L={},D={},B=!1;for(x=0;x<h.length;x++)S=h[x],D[S]=k=m[d(S)],k._inputDomain?k.domain=k._inputDomain.slice():k._inputDomain=k.domain.slice(),k._inputRange||(k._inputRange=k.range.slice()),k.setScale(),L[S]=M=Math.abs(k._m)/y[S],b=Math.min(b,M),(k.constrain==="domain"||!k._constraintShrinkable)&&(P=Math.min(P,M)),delete k._constraintShrinkable,_=Math.max(_,M),k.constrain==="domain"&&(B=!0);if(!(b>e*_&&!B)){for(x=0;x<h.length;x++)if(S=h[x],M=L[S],k=D[S],T=k.constrain,M!==P||T==="domain")if(c=M/P,T==="range")A(k,c);else{var R=k._inputDomain,I=(k.domain[1]-k.domain[0])/(R[1]-R[0]),F=(k.r2l(k.range[1])-k.r2l(k.range[0]))/(k.r2l(k._inputRange[1])-k.r2l(k._inputRange[0]));if(c/=I,c*F<1){k.domain=k._input.domain=R.slice(),A(k,c);continue}if(F<1&&(k.range=k._input.range=k._inputRange.slice(),c*=F),k.autorange){var N=k.r2l(k.range[0]),j=k.r2l(k.range[1]),G=(N+j)/2,rt=G,ct=G,st=Math.abs(j-G),et=G-st*c*1.0001,K=G+st*c*1.0001,ot=u.makePadFn(m,k,0),X=u.makePadFn(m,k,1);v(k,c);var Q=Math.abs(k._m),ut=u.concatExtremes(g,k),J=ut.min,q=ut.max,it,nt;for(nt=0;nt<J.length;nt++)it=J[nt].val-ot(J[nt])/Q,it>et&&it<rt&&(rt=it);for(nt=0;nt<q.length;nt++)it=q[nt].val+X(q[nt])/Q,it<K&&it>ct&&(ct=it);var dt=(ct-rt)/(2*st);c/=dt,rt=k.l2r(rt),ct=k.l2r(ct),k.range=k._input.range=N<j?[rt,ct]:[ct,rt]}v(k,c)}}}},Z.getAxisGroup=function(g,m){for(var w=g._axisMatchGroups,l=0;l<w.length;l++){var x=w[l];if(x[m])return"g"+l}return m},Z.clean=function(g,m){if(m._inputDomain){for(var w=!1,l=m._id,x=g._fullLayout._axisConstraintGroups,y=0;y<x.length;y++)if(x[y][l]){w=!0;break}(!w||m.constrain!=="domain")&&(m._input.domain=m.domain=m._inputDomain,delete m._inputDomain)}};function v(g,m){var w=g._inputDomain,l=r[g.constraintoward],x=w[0]+(w[1]-w[0])*l;g.domain=g._input.domain=[x+(w[0]-x)/m,x+(w[1]-x)/m],g.setScale()}}),Bg=Vt(Z=>{var V=Ni(),u=ji(),d=Uu(),E=Xr(),A=Dl(),t=Dg(),e=Pi(),r=Eo(),i=o0(),n=Tb(),o=yo(),a=mf(),s=s0(),f=s.enforce,v=s.clean,g=Xh().doAutoRange,m="start",w="middle",l="end",x=Af().zindexSeparator;Z.layoutStyles=function(I){return E.syncOrAsync([d.doAutoMargin,S],I)};function y(I,F,N){for(var j=0;j<N.length;j++){var G=N[j][0],rt=N[j][1];if(!(G[0]>=I[1]||G[1]<=I[0])&&rt[0]<F[1]&&rt[1]>F[0])return!0}return!1}function S(I){var F=I._fullLayout,N=F._size,j=N.p,G=o.list(I,"",!0),rt,ct,st,et,K,ot;if(F._paperdiv.style({width:I._context.responsive&&F.autosize&&!I._context._hasZeroWidth&&!I.layout.width?"100%":F.width+"px",height:I._context.responsive&&F.autosize&&!I._context._hasZeroHeight&&!I.layout.height?"100%":F.height+"px"}).selectAll(".main-svg").call(r.setSize,F.width,F.height),I._context.setBackground(I,F.paper_bgcolor),Z.drawMainTitle(I),n.manage(I),!F._has("cartesian"))return d.previousPromises(I);function X(_t,lt,yt){var St=_t._lw/2;if(_t._id.charAt(0)==="x"){if(lt){if(yt==="top")return lt._offset-j-St}else return N.t+N.h*(1-(_t.position||0))+St%1;return lt._offset+lt._length+j+St}if(lt){if(yt==="right")return lt._offset+lt._length+j+St}else return N.l+N.w*(_t.position||0)+St%1;return lt._offset-j-St}for(rt=0;rt<G.length;rt++){et=G[rt];var Q=et._anchorAxis;et._linepositions={},et._lw=r.crispRound(I,et.linewidth,1),et._mainLinePosition=X(et,Q,et.side),et._mainMirrorPosition=et.mirror&&Q?X(et,Q,a.OPPOSITE_SIDE[et.side]):null}var ut=[],J=[],q=[],it=e.opacity(F.paper_bgcolor)===1&&e.opacity(F.plot_bgcolor)===1&&F.paper_bgcolor===F.plot_bgcolor;for(ct in F._plots)if(st=F._plots[ct],st.mainplot)st.bg&&st.bg.remove(),st.bg=void 0;else{var nt=st.xaxis.domain,dt=st.yaxis.domain,Tt=st.plotgroup;if(y(nt,dt,q)&&ct.indexOf(x)===-1){var wt=Tt.node(),It=st.bg=E.ensureSingle(Tt,"rect","bg");wt.insertBefore(It.node(),wt.childNodes[0]),J.push(ct)}else Tt.select("rect.bg").remove(),q.push([nt,dt]),it||(ut.push(ct),J.push(ct))}var Ct=F._bgLayer.selectAll(".bg").data(ut);for(Ct.enter().append("rect").classed("bg",!0),Ct.exit().remove(),Ct.each(function(_t){F._plots[_t].bg=V.select(this)}),rt=0;rt<J.length;rt++)st=F._plots[J[rt]],K=st.xaxis,ot=st.yaxis,st.bg&&K._offset!==void 0&&ot._offset!==void 0&&st.bg.call(r.setRect,K._offset-j,ot._offset-j,K._length+2*j,ot._length+2*j).call(e.fill,F.plot_bgcolor).style("stroke-width",0);if(!F._hasOnlyLargeSploms)for(ct in F._plots){st=F._plots[ct],K=st.xaxis,ot=st.yaxis;var Nt=st.clipId="clip"+F._uid+ct+"plot",ee=E.ensureSingleById(F._clips,"clipPath",Nt,function(_t){_t.classed("plotclip",!0).append("rect")});st.clipRect=ee.select("rect").attr({width:K._length,height:ot._length}),r.setTranslate(st.plot,K._offset,ot._offset);var Jt,te;st._hasClipOnAxisFalse?(Jt=null,te=Nt):(Jt=Nt,te=null),r.setClipUrl(st.plot,Jt,I),st.layerClipId=te}var Kt,mt,bt,vt,Ut,re,Zt,ue,Me,Ce,We,qe,vr;function _r(_t){return"M"+Kt+","+_t+"H"+mt}function er(_t){return"M"+K._offset+","+_t+"h"+K._length}function Mr(_t){return"M"+_t+","+ue+"V"+Zt}function Ir(_t){return ot._shift!==void 0&&(_t+=ot._shift),"M"+_t+","+ot._offset+"v"+ot._length}function de(_t,lt,yt){if(!_t.showline||ct!==_t._mainSubplot)return"";if(!_t._anchorAxis)return yt(_t._mainLinePosition);var St=lt(_t._mainLinePosition);return _t.mirror&&(St+=lt(_t._mainMirrorPosition)),St}for(ct in F._plots){st=F._plots[ct],K=st.xaxis,ot=st.yaxis;var Dt="M0,0";k(K,ct)&&(Ut=T(K,"left",ot,G),Kt=K._offset-(Ut?j+Ut:0),re=T(K,"right",ot,G),mt=K._offset+K._length+(re?j+re:0),bt=X(K,ot,"bottom"),vt=X(K,ot,"top"),vr=!K._anchorAxis||ct!==K._mainSubplot,vr&&(K.mirror==="allticks"||K.mirror==="all")&&(K._linepositions[ct]=[bt,vt]),Dt=de(K,_r,er),vr&&K.showline&&(K.mirror==="all"||K.mirror==="allticks")&&(Dt+=_r(bt)+_r(vt)),st.xlines.style("stroke-width",K._lw+"px").call(e.stroke,K.showline?K.linecolor:"rgba(0,0,0,0)")),st.xlines.attr("d",Dt);var qt="M0,0";k(ot,ct)&&(We=T(ot,"bottom",K,G),Zt=ot._offset+ot._length+(We?j:0),qe=T(ot,"top",K,G),ue=ot._offset-(qe?j:0),Me=X(ot,K,"left"),Ce=X(ot,K,"right"),vr=!ot._anchorAxis||ct!==ot._mainSubplot,vr&&(ot.mirror==="allticks"||ot.mirror==="all")&&(ot._linepositions[ct]=[Me,Ce]),qt=de(ot,Mr,Ir),vr&&ot.showline&&(ot.mirror==="all"||ot.mirror==="allticks")&&(qt+=Mr(Me)+Mr(Ce)),st.ylines.style("stroke-width",ot._lw+"px").call(e.stroke,ot.showline?ot.linecolor:"rgba(0,0,0,0)")),st.ylines.attr("d",qt)}return o.makeClipPaths(I),d.previousPromises(I)}function k(I,F){return(I.ticks||I.showline)&&(F===I._mainSubplot||I.mirror==="all"||I.mirror==="allticks")}function M(I,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]===I.domain[G]:N.mirror&&j.domain[1-G]===I.domain[1-G]}function T(I,F,N,j){if(M(I,F,N))return N._lw;for(var G=0;G<j.length;G++){var rt=j[G];if(rt._mainAxis===N._mainAxis&&M(I,F,rt))return rt._lw}return 0}Z.drawMainTitle=function(I){var F=I._fullLayout.title,N=I._fullLayout,j=B(N),G=R(N),rt=L(N,G),ct=P(N,j);if(i.draw(I,"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 st=V.select(I).selectAll(".gtitle"),et=r.bBox(V.select(I).selectAll(".g-gtitle").node()).height,K=b(I,F,et);if(K>0){_(I,rt,K,et),st.attr({x:ct,y:rt,"text-anchor":j,dy:D(F.yanchor)}).call(A.positionText,ct,rt);var ot=(F.text.match(A.BR_TAG_ALL)||[]).length;if(ot){var X=a.LINE_SPACING*ot+a.MID_SHIFT;F.y===0&&(X=-X),st.selectAll(".line").each(function(){var it=+this.getAttribute("dy").slice(0,-2)-X+"em";this.setAttribute("dy",it)})}var Q=V.select(I).selectAll(".gtitle-subtitle");if(Q.node()){var ut=st.node().getBBox(),J=ut.y+ut.height,q=J+i.SUBTITLE_PADDING_EM*F.subtitle.font.size;Q.attr({x:ct,y:q,"text-anchor":j,dy:D(F.yanchor)}).call(A.positionText,ct,q)}}}};function c(I,F,N,j,G){var rt=F.yref==="paper"?I._fullLayout._size.h:I._fullLayout.height,ct=E.isTopAnchor(F)?j:j-G,st=N==="b"?rt-ct:ct;return E.isTopAnchor(F)&&N==="t"||E.isBottomAnchor(F)&&N==="b"?!1:st<G}function h(I,F,N,j,G){var rt=0;return N==="middle"&&(rt+=G/2),I==="t"?(N==="top"&&(rt+=G),rt+=j-F*j):(N==="bottom"&&(rt+=G),rt+=F*j),rt}function b(I,F,N){var j=F.y,G=F.yanchor,rt=j>.5?"t":"b",ct=I._fullLayout.margin[rt],st=0;return F.yref==="paper"?st=N+F.pad.t+F.pad.b:F.yref==="container"&&(st=h(rt,j,G,I._fullLayout.height,N)+F.pad.t+F.pad.b),st>ct?st:0}function _(I,F,N,j){var G="title.automargin",rt=I._fullLayout.title,ct=rt.y>.5?"t":"b",st={x:rt.x,y:rt.y,t:0,b:0},et={};rt.yref==="paper"&&c(I,rt,ct,F,j)?st[ct]=N:rt.yref==="container"&&(et[ct]=N,I._fullLayout._reservedMargin[G]=et),d.allowAutoMargin(I,G),d.autoMargin(I,G,st)}function P(I,F){var N=I.title,j=I._size,G=0;switch(F===m?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 I.width*N.x+G}}function L(I,F){var N=I.title,j=I._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 I.height-I.height*N.y+G}}function D(I){return I==="top"?a.CAP_SHIFT+.3+"em":I==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function B(I){var F=I.title,N=w;return E.isRightAnchor(F)?N=l:E.isLeftAnchor(F)&&(N=m),N}function R(I){var F=I.title,N="0em";return E.isTopAnchor(F)?N=a.CAP_SHIFT+"em":E.isMiddleAnchor(F)&&(N=a.MID_SHIFT+"em"),N}Z.doTraceStyle=function(I){var F=I.calcdata,N=[],j;for(j=0;j<F.length;j++){var G=F[j],rt=G[0]||{},ct=rt.trace||{},st=ct._module||{},et=st.arraysToCalcdata;et&&et(G,ct);var K=st.editStyle;K&&N.push({fn:K,cd0:rt})}if(N.length){for(j=0;j<N.length;j++){var ot=N[j];ot.fn(I,ot.cd0)}t(I),Z.redrawReglTraces(I)}return d.style(I),u.getComponentMethod("legend","draw")(I),d.previousPromises(I)},Z.doColorBars=function(I){return u.getComponentMethod("colorbar","draw")(I),d.previousPromises(I)},Z.layoutReplot=function(I){var F=I.layout;return I.layout=void 0,u.call("_doPlot",I,"",F)},Z.doLegend=function(I){return u.getComponentMethod("legend","draw")(I),d.previousPromises(I)},Z.doTicksRelayout=function(I){return o.draw(I,"redraw"),I._fullLayout._hasOnlyLargeSploms&&(u.subplotsRegistry.splom.updateGrid(I),t(I),Z.redrawReglTraces(I)),Z.drawMainTitle(I),d.previousPromises(I)},Z.doModeBar=function(I){var F=I._fullLayout;n.manage(I);for(var N=0;N<F._basePlotModules.length;N++){var j=F._basePlotModules[N].updateFx;j&&j(I)}return d.previousPromises(I)},Z.doCamera=function(I){for(var F=I._fullLayout,N=F._subplots.gl3d,j=0;j<N.length;j++){var G=F[N[j]],rt=G._scene;rt.setViewport(G)}},Z.drawData=function(I){var F=I._fullLayout;t(I);for(var N=F._basePlotModules,j=0;j<N.length;j++)N[j].plot(I);return Z.redrawReglTraces(I),d.style(I),u.getComponentMethod("selections","draw")(I),u.getComponentMethod("shapes","draw")(I),u.getComponentMethod("annotations","draw")(I),u.getComponentMethod("images","draw")(I),F._replotting=!1,d.previousPromises(I)},Z.redrawReglTraces=function(I){var F=I._fullLayout;if(F._has("regl")){var N=I._fullData,j=[],G=[],rt,ct;for(F._hasOnlyLargeSploms&&F._splomGrid.draw(),rt=0;rt<N.length;rt++){var st=N[rt];st.visible===!0&&st._length!==0&&(st.type==="splom"?F._splomScenes[st.uid].draw():st.type==="scattergl"?E.pushUnique(j,st.xaxis+st.yaxis):st.type==="scatterpolargl"&&E.pushUnique(G,st.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()}},Z.doAutoRangeAndConstraints=function(I){for(var F=o.list(I,"",!0),N,j={},G=0;G<F.length;G++)if(N=F[G],!j[N._id]){j[N._id]=1,v(I,N),g(I,N);var rt=N._matchGroup;if(rt)for(var ct in rt){var st=o.getFromId(I,ct);g(I,st,N.range),j[ct]=1}}f(I)},Z.finalDraw=function(I){u.getComponentMethod("rangeslider","draw")(I),u.getComponentMethod("rangeselector","draw")(I)},Z.drawMarginPushers=function(I){u.getComponentMethod("legend","draw")(I),u.getComponentMethod("rangeselector","draw")(I),u.getComponentMethod("sliders","draw")(I),u.getComponentMethod("updatemenus","draw")(I),u.getComponentMethod("colorbar","draw")(I)}}),Ab=Vt((Z,V)=>{var u=Md().readPaths,d=Gy(),E=wd().clearOutlineControllers,A=Pi(),t=Eo(),e=cl().arrayEditor,r=Sd(),i=r.getPathString;V.exports={draw:n,drawOne:a,activateLastSelection:v};function n(m){var w=m._fullLayout;E(m),w._selectionLayer.selectAll("path").remove();for(var l in w._plots){var x=w._plots[l].selectionLayer;x&&x.selectAll("path").remove()}for(var y=0;y<w.selections.length;y++)a(m,y)}function o(m){return m._context.editSelection}function a(m,w){m._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+w+'"]').remove();var l=r.makeSelectionsOptionsAndPlotinfo(m,w),x=l.options,y=l.plotinfo;if(!x._input)return;S(m._fullLayout._selectionLayer);function S(k){var M=i(m,x),T={"data-index":w,"fill-rule":"evenodd",d:M},c=x.opacity,h="rgba(0,0,0,0)",b=x.line.color||A.contrast(m._fullLayout.plot_bgcolor),_=x.line.width,P=x.line.dash;_||(_=5,P="solid");var L=o(m)&&m._fullLayout._activeSelectionIndex===w;L&&(h=m._fullLayout.activeselection.fillcolor,c=m._fullLayout.activeselection.opacity);for(var D=[],B=1;B>=0;B--){var R=k.append("path").attr(T).style("opacity",B?.1:c).call(A.stroke,b).call(A.fill,h).call(t.dashLine,B?"solid":P,B?4+_:_);if(s(R,m,x),L){var I=e(m.layout,"selections",x);R.style({cursor:"move"});var F={element:R.node(),plotinfo:y,gd:m,editHelpers:I,isActiveSelection:!0},N=u(M,m);d(N,R,F)}else R.style("pointer-events",B?"all":"none");D[B]=R}var j=D[0],G=D[1];G.node().addEventListener("click",function(){return f(m,j)})}}function s(m,w,l){var x=l.xref+l.yref;t.setClipUrl(m,"clip"+w._fullLayout._uid+x,w)}function f(m,w){if(o(m)){var l=w.node(),x=+l.getAttribute("data-index");if(x>=0){if(x===m._fullLayout._activeSelectionIndex){g(m);return}m._fullLayout._activeSelectionIndex=x,m._fullLayout._deactivateSelection=g,n(m)}}}function v(m){if(o(m)){var w=m._fullLayout.selections.length-1;m._fullLayout._activeSelectionIndex=w,m._fullLayout._deactivateSelection=g,n(m)}}function g(m){if(o(m)){var w=m._fullLayout._activeSelectionIndex;w>=0&&(E(m),delete m._fullLayout._activeSelectionIndex,n(m))}}}),sk=Vt((Z,V)=>{function u(){var d,E=0,A=!1;function t(e,r){return d.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),d}return d={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?d:(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")}},d}V.exports=u}),lk=Vt((Z,V)=>{function u(d){typeof d!="number"&&(d=1e-10);var E={epsilon:function(A){return typeof A=="number"&&(d=A),d},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)>=-d},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<d)return!1;var s=i*i+o*o;return!(a-s>-d)},pointsSameX:function(A,t){return Math.abs(A[0]-t[0])<d},pointsSameY:function(A,t){return Math.abs(A[1]-t[1])<d},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)<d},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)<d)return!1;var f=A[0]-e[0],v=A[1]-e[1],g=(o*v-a*f)/s,m=(i*v-n*f)/s,w={alongA:0,alongB:0,pt:[A[0]+g*i,A[1]+g*n]};return g<=-d?w.alongA=-2:g<d?w.alongA=-1:g-1<=-d?w.alongA=0:g-1<d?w.alongA=1:w.alongA=2,m<=-d?w.alongB=-2:m<d?w.alongB=-1:m-1<=-d?w.alongB=0:m-1<d?w.alongB=1:w.alongB=2,w},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],f=t[a][1];f-r>d!=n-r>d&&(i-s)*(r-f)/(n-f)+s-e>d&&(o=!o),i=s,n=f}return o}};return E}V.exports=u}),uk=Vt((Z,V)=>{var u={create:function(){var d={root:{root:!0,next:null},exists:function(E){return!(E===null||E===d.root)},isEmpty:function(){return d.root.next===null},getHead:function(){return d.root.next},insertBefore:function(E,A){for(var t=d.root,e=d.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=d.root,t=d.root.next;t!==null&&!E(t);)A=t,t=t.next;return{before:A===d.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 d},node:function(d){return d.prev=null,d.next=null,d.remove=function(){d.prev.next=d.next,d.next&&(d.next.prev=d.prev),d.prev=null,d.next=null},d}};V.exports=u}),ck=Vt((Z,V)=>{var u=uk();function d(E,A,t){function e(w,l){return{id:t?t.segmentId():-1,start:w,end:l,myFill:{above:null,below:null},otherFill:null}}function r(w,l,x){return{id:t?t.segmentId():-1,start:w,end:l,myFill:{above:x.myFill.above,below:x.myFill.below},otherFill:null}}var i=u.create();function n(w,l,x,y,S,k){var M=A.pointsCompare(l,S);return M!==0?M:A.pointsSame(x,k)?0:w!==y?w?1:-1:A.pointAboveOrOnLine(x,y?S:k,y?k:S)?1:-1}function o(w,l){i.insertBefore(w,function(x){var y=n(w.isStart,w.pt,l,x.isStart,x.pt,x.other.pt);return y<0})}function a(w,l){var x=u.node({isStart:!0,pt:w.start,seg:w,primary:l,other:null,status:null});return o(x,w.end),x}function s(w,l,x){var y=u.node({isStart:!1,pt:l.end,seg:l,primary:x,other:w,status:null});w.other=y,o(y,w.pt)}function f(w,l){var x=a(w,l);return s(x,w,l),x}function v(w,l){t&&t.segmentChop(w.seg,l),w.other.remove(),w.seg.end=l,w.other.pt=l,o(w.other,w.pt)}function g(w,l){var x=r(l,w.seg.end,w.seg);return v(w,l),f(x,w.primary)}function m(w,l){var x=u.create();function y(R,I){var F=R.seg.start,N=R.seg.end,j=I.seg.start,G=I.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(I){var F=y(R,I.ev);return F>0})}function k(R,I){var F=R.seg,N=I.seg,j=F.start,G=F.end,rt=N.start,ct=N.end;t&&t.checkIntersection(F,N);var st=A.linesIntersect(j,G,rt,ct);if(st===!1){if(!A.pointsCollinear(j,G,rt)||A.pointsSame(j,ct)||A.pointsSame(G,rt))return!1;var et=A.pointsSame(j,rt),K=A.pointsSame(G,ct);if(et&&K)return I;var ot=!et&&A.pointBetween(j,rt,ct),X=!K&&A.pointBetween(G,rt,ct);if(et)return X?g(I,G):g(R,ct),I;ot&&(K||(X?g(I,G):g(R,ct)),g(I,j))}else st.alongA===0&&(st.alongB===-1?g(R,rt):st.alongB===0?g(R,st.pt):st.alongB===1&&g(R,ct)),st.alongB===0&&(st.alongA===-1?g(I,j):st.alongA===0?g(I,st.pt):st.alongA===1&&g(I,G));return!1}for(var M=[];!i.isEmpty();){var T=i.getHead();if(t&&t.vert(T.pt[0]),T.isStart){let R=function(){if(h){var I=k(T,h);if(I)return I}return b?k(T,b):!1};t&&t.segmentNew(T.seg,T.primary);var c=S(T),h=c.before?c.before.ev:null,b=c.after?c.after.ev:null;t&&t.tempStatus(T.seg,h?h.seg:!1,b?b.seg:!1);var _=R();if(_){if(E){var P;T.seg.myFill.below===null?P=!0:P=T.seg.myFill.above!==T.seg.myFill.below,P&&(_.seg.myFill.above=!_.seg.myFill.above)}else _.seg.otherFill=T.seg.myFill;t&&t.segmentUpdate(_.seg),T.other.remove(),T.remove()}if(i.getHead()!==T){t&&t.rewind(T.seg);continue}if(E){var P;T.seg.myFill.below===null?P=!0:P=T.seg.myFill.above!==T.seg.myFill.below,b?T.seg.myFill.below=b.seg.myFill.above:T.seg.myFill.below=w,P?T.seg.myFill.above=!T.seg.myFill.below:T.seg.myFill.above=T.seg.myFill.below}else if(T.seg.otherFill===null){var L;b?T.primary===b.primary?L=b.seg.otherFill.above:L=b.seg.myFill.above:L=T.primary?l:w,T.seg.otherFill={above:L,below:L}}t&&t.status(T.seg,h?h.seg:!1,b?b.seg:!1),T.other.status=c.insert(u.node({ev:T}))}else{var D=T.status;if(D===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(x.exists(D.prev)&&x.exists(D.next)&&k(D.prev.ev,D.next.ev),t&&t.statusRemove(D.ev.seg),D.remove(),!T.primary){var B=T.seg.myFill;T.seg.myFill=T.seg.otherFill,T.seg.otherFill=B}M.push(T.seg)}i.getHead().remove()}return t&&t.done(),M}return E?{addRegion:function(w){for(var l,x=w[w.length-1],y=0;y<w.length;y++){l=x,x=w[y];var S=A.pointsCompare(l,x);S!==0&&f(e(S<0?l:x,S<0?x:l),!0)}},calculate:function(w){return m(w,!1)}}:{calculate:function(w,l,x,y){return w.forEach(function(S){f(r(S.start,S.end,S),!0)}),x.forEach(function(S){f(r(S.start,S.end,S),!1)}),m(l,y)}}}V.exports=d}),fk=Vt((Z,V)=>{function u(d,E,A){var t=[],e=[];return d.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 f(L,D,B){return s.index=L,s.matches_head=D,s.matches_pt1=B,s===o?(s=a,!1):(s=null,!0)}for(var v=0;v<t.length;v++){var g=t[v],m=g[0];g[1];var w=g[g.length-1];if(g[g.length-2],E.pointsSame(m,i)){if(f(v,!0,!0))break}else if(E.pointsSame(m,n)){if(f(v,!0,!1))break}else if(E.pointsSame(w,i)){if(f(v,!1,!0))break}else if(E.pointsSame(w,n)&&f(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,y=o.matches_head,g=t[l],S=y?g[0]:g[g.length-1],k=y?g[1]:g[g.length-2],M=y?g[g.length-1]:g[0],T=y?g[g.length-2]:g[1];if(E.pointsCollinear(k,S,x)&&(y?(A&&A.chainRemoveHead(o.index,x),g.shift()):(A&&A.chainRemoveTail(o.index,x),g.pop()),S=k),E.pointsSame(M,x)){t.splice(l,1),E.pointsCollinear(T,M,S)&&(y?(A&&A.chainRemoveTail(o.index,S),g.pop()):(A&&A.chainRemoveHead(o.index,S),g.shift())),A&&A.chainClose(o.index),e.push(g);return}y?(A&&A.chainAddHead(o.index,x),g.unshift(x)):(A&&A.chainAddTail(o.index,x),g.push(x));return}function c(L){A&&A.chainReverse(L),t[L].reverse()}function h(L,D){var B=t[L],R=t[D],I=B[B.length-1],F=B[B.length-2],N=R[0],j=R[1];E.pointsCollinear(F,I,N)&&(A&&A.chainRemoveTail(L,I),B.pop(),I=F),E.pointsCollinear(I,N,j)&&(A&&A.chainRemoveHead(D,N),R.shift()),A&&A.chainJoin(L,D),t[L]=B.concat(R),t.splice(D,1)}var b=o.index,_=a.index;A&&A.chainConnect(b,_);var P=t[b].length<t[_].length;o.matches_head?a.matches_head?P?(c(b),h(b,_)):(c(_),h(_,b)):h(_,b):a.matches_head?h(b,_):P?(c(b),h(_,b)):(c(_),h(b,_))}),e}V.exports=u}),hk=Vt((Z,V)=>{function u(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 d={union:function(E,A){return u(E,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],A)},intersect:function(E,A){return u(E,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],A)},difference:function(E,A){return u(E,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],A)},differenceRev:function(E,A){return u(E,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],A)},xor:function(E,A){return u(E,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],A)}};V.exports=d}),pk=Vt((Z,V)=>{var u={toPolygon:function(d,E){function A(r){if(r.length<=0)return d.segments({inverted:!1,regions:[]});function i(a){var s=a.slice(0,a.length-1);return d.segments({inverted:!1,regions:[s]})}for(var n=i(r[0]),o=1;o<r.length;o++)n=d.selectDifference(d.combine(n,i(r[o])));return n}if(E.type==="Polygon")return d.polygon(A(E.coordinates));if(E.type==="MultiPolygon"){for(var t=d.segments({inverted:!1,regions:[]}),e=0;e<E.coordinates.length;e++)t=d.selectUnion(d.combine(t,A(E.coordinates[e])));return d.polygon(t)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(d,E,A){A=d.polygon(d.segments(A));function t(g,m){return E.pointInsideRegion([(g[0][0]+g[1][0])*.5,(g[0][1]+g[1][1])*.5],m)}function e(g){return{region:g,children:[]}}var r=e(null);function i(g,m){for(var w=0;w<g.children.length;w++){var l=g.children[w];if(t(m,l.region)){i(l,m);return}}for(var x=e(m),w=0;w<g.children.length;w++){var l=g.children[w];t(l.region,m)&&(x.children.push(l),g.children.splice(w,1),w--)}g.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(g,m){for(var w=0,l=g[g.length-1][0],x=g[g.length-1][1],y=[],S=0;S<g.length;S++){var k=g[S][0],M=g[S][1];y.push([k,M]),w+=M*l-k*x,l=k,x=M}var T=w<0;return T!==m&&y.reverse(),y.push([y[0][0],y[0][1]]),y}var s=[];function f(g){var m=[a(g.region,!1)];s.push(m);for(var w=0;w<g.children.length;w++)m.push(v(g.children[w]))}function v(g){for(var m=0;m<g.children.length;m++)f(g.children[m]);return a(g.region,!0)}for(var n=0;n<r.children.length;n++)f(r.children[n]);return s.length<=0?{type:"Polygon",coordinates:[]}:s.length==1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s}}};V.exports=u}),dk=Vt((Z,V)=>{var u=sk(),d=lk(),E=ck(),A=fk(),t=hk(),e=pk(),r=!1,i=d(),n;n={buildLog:function(a){return a===!0?r=u():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 f=E(!1,i,r);return{combined:f.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,f){var v=n.segments(a),g=n.segments(s),m=n.combine(v,g),w=f(m);return n.polygon(w)}typeof window=="object"&&(window.PolyBool=n),V.exports=n}),mk=Vt((Z,V)=>{V.exports=function(u,d,E,A){var t=u[0],e=u[1],r=!1;E===void 0&&(E=0),A===void 0&&(A=d.length);for(var i=A-E,n=0,o=i-1;n<i;o=n++){var a=d[n+E][0],s=d[n+E][1],f=d[o+E][0],v=d[o+E][1],g=s>e!=v>e&&t<(f-a)*(e-s)/(v-s)+a;g&&(r=!r)}return r}}),Rg=Vt((Z,V)=>{var u=Py().dot,d=ks().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(w){return w[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(w){return w[1]===t[0][1]}));function f(w,l){var x=w[0],y=w[1];return!(x===d||x<e||x>r||y===d||y<i||y>n||l&&s(w))}function v(w,l){var x=w[0],y=w[1];if(x===d||x<e||x>r||y===d||y<i||y>n)return!1;var S=t.length,k=t[0][0],M=t[0][1],T=0,c,h,b,_,P;for(c=1;c<S;c++)if(h=k,b=M,k=t[c][0],M=t[c][1],_=Math.min(h,k),!(x<_||x>Math.max(h,k)||y>Math.max(b,M)))if(y<Math.min(b,M))x!==_&&T++;else{if(k===h?P=y:P=b+(x-h)*(M-b)/(k-h),y===P)return!(c===1&&l);y<=P&&x!==_&&T++}return T%2===1}var g=!0,m=t[0];for(o=1;o<t.length;o++)if(m[0]!==t[o][0]||m[1]!==t[o][1]){g=!1;break}return{xmin:e,xmax:r,ymin:i,ymax:n,pts:t,contains:a?f:v,isRect:a,degenerate:g}},E.isSegmentBent=function(A,t,e,r){var i=A[t],n=[A[e][0]-i[0],A[e][1]-i[1]],o=u(n,n),a=Math.sqrt(o),s=[-n[1]/a,n[0]/a],f,v,g;for(f=t+1;f<e;f++)if(v=[A[f][0]-i[0],A[f][1]-i[1]],g=u(v,n),g<0||g>o||Math.abs(u(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,f=r;e.splice(i+1);for(var v=f+1;v<A.length;v++)(v===A.length-1||E.isSegmentBent(A,f,v+1,t))&&(e.push(A[v]),e.length<s-2&&(r=v,i=e.length-1),f=v)}if(A.length>1){var o=A.pop();n(o)}return{addPt:n,raw:A,filtered:e}}}),gk=Vt((Z,V)=>{V.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),vk=Vt((Z,V)=>{var u=dk(),d=mk(),E=ji(),A=Eo().dashStyle,t=Pi(),e=hc(),r=dh().makeEventData,i=Jh(),n=i.freeMode,o=i.rectMode,a=i.drawMode,s=i.openMode,f=i.selectMode,v=Sd(),g=Fg(),m=Gy(),w=wd().clearOutline,l=Md(),x=l.handleEllipse,y=l.readPaths,S=Wy().newShapes,k=yb(),M=Ab().activateLastSelection,T=Xr(),c=T.sorterAsc,h=Rg(),b=By(),_=cc().getFromId,P=Dg(),L=Bg().redrawReglTraces,D=gk(),B=D.MINSELECT,R=h.filter,I=h.tester,F=qy(),N=F.p2r,j=F.axValue,G=F.getTransform;function rt(Dt){return Dt.subplot!==void 0}function ct(Dt,qt,_t,lt,yt){var St=!rt(lt),Ht=n(yt),Yt=o(yt),se=s(yt),ke=a(yt),Ee=f(yt),Ue=yt==="drawline",ir=yt==="drawcircle",ar=Ue||ir,Ye=lt.gd,Er=Ye._fullLayout,pn=Ee&&Er.newselection.mode==="immediate"&&St,dn=Er._zoomlayer,bn=lt.element.getBoundingClientRect(),Zn=lt.plotinfo,En=G(Zn),gn=qt-bn.left,da=_t-bn.top;Er._calcInverseTransform(Ye);var ra=T.apply3DTransform(Er._invTransform)(gn,da);gn=ra[0],da=ra[1];var Se=Er._invScaleX,Re=Er._invScaleY,Ze=gn,tr=da,zr="M"+gn+","+da,tn=lt.xaxes[0],Yr=lt.yaxes[0],$r=tn._length,In=Yr._length,Nn=Dt.altKey&&!(a(yt)&&se),Kn,$n,ia,Cn,Fa,Ga,ve;Q(Dt,Ye,lt),Ht&&(Kn=R([[gn,da]],D.BENDPX));var ge=dn.selectAll("path.select-outline-"+Zn.id).data([1]),dr=ke?Er.newshape:Er.newselection;ke&&(lt.hasText=dr.label.text||dr.label.texttemplate);var br=ke&&!se?dr.fillcolor:"rgba(0,0,0,0)",Tr=dr.line.color||(St?t.contrast(Ye._fullLayout.plot_bgcolor):"#7f7f7f");ge.enter().append("path").attr("class","select-outline select-outline-"+Zn.id).style({opacity:ke?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,Tr).call(t.fill,br).attr("fill-rule","evenodd").classed("cursor-move",!!ke).attr("transform",En).attr("d",zr+"Z");var mr=dn.append("path").attr("class","zoombox-corners").style({fill:t.background,stroke:t.defaultLine,"stroke-width":1}).attr("transform",En).attr("d","M0,0Z");if(ke&&lt.hasText){var kr=dn.select(".label-temp");kr.empty()&&(kr=dn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Ur=Er._uid+D.SELECTID,Or=[],pe=nt(Ye,lt.xaxes,lt.yaxes,lt.subplot);pn&&!Dt.shiftKey&&(lt._clearSubplotSelections=function(){if(St){var xr=tn._id,Gr=Yr._id;Zt(Ye,xr,Gr,pe);for(var ln=(Ye.layout||{}).selections||[],wn=[],rn=!1,Qr=0;Qr<ln.length;Qr++){var vn=Er.selections[Qr];!vn||vn.xref!==xr||vn.yref!==Gr?wn.push(ln[Qr]):rn=!0}rn&&(Ye._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",Ye,{selections:wn}))}});var Ke=er(lt);lt.moveFn=function(xr,Gr){lt._clearSubplotSelections&&(lt._clearSubplotSelections(),lt._clearSubplotSelections=void 0),Ze=Math.max(0,Math.min($r,Se*xr+gn)),tr=Math.max(0,Math.min(In,Re*Gr+da));var ln=Math.abs(Ze-gn),wn=Math.abs(tr-da);if(Yt){var rn,Qr,vn;if(Ee){var Oa=Er.selectdirection;switch(Oa==="any"?wn<Math.min(ln*.6,B)?rn="h":ln<Math.min(wn*.6,B)?rn="v":rn="d":rn=Oa,rn){case"h":Qr=ir?In/2:0,vn=In;break;case"v":Qr=ir?$r/2:0,vn=$r;break}}if(ke)switch(Er.newshape.drawdirection){case"vertical":rn="h",Qr=ir?In/2:0,vn=In;break;case"horizontal":rn="v",Qr=ir?$r/2:0,vn=$r;break;case"ortho":ln<wn?(rn="h",Qr=da,vn=tr):(rn="v",Qr=gn,vn=Ze);break;default:rn="d"}rn==="h"?(Cn=ar?x(ir,[Ze,Qr],[Ze,vn]):[[gn,Qr],[gn,vn],[Ze,vn],[Ze,Qr]],Cn.xmin=ar?Ze:Math.min(gn,Ze),Cn.xmax=ar?Ze:Math.max(gn,Ze),Cn.ymin=Math.min(Qr,vn),Cn.ymax=Math.max(Qr,vn),mr.attr("d","M"+Cn.xmin+","+(da-B)+"h-4v"+2*B+"h4ZM"+(Cn.xmax-1)+","+(da-B)+"h4v"+2*B+"h-4Z")):rn==="v"?(Cn=ar?x(ir,[Qr,tr],[vn,tr]):[[Qr,da],[Qr,tr],[vn,tr],[vn,da]],Cn.xmin=Math.min(Qr,vn),Cn.xmax=Math.max(Qr,vn),Cn.ymin=ar?tr:Math.min(da,tr),Cn.ymax=ar?tr:Math.max(da,tr),mr.attr("d","M"+(gn-B)+","+Cn.ymin+"v-4h"+2*B+"v4ZM"+(gn-B)+","+(Cn.ymax-1)+"v4h"+2*B+"v-4Z")):rn==="d"&&(Cn=ar?x(ir,[gn,da],[Ze,tr]):[[gn,da],[gn,tr],[Ze,tr],[Ze,da]],Cn.xmin=Math.min(gn,Ze),Cn.xmax=Math.max(gn,Ze),Cn.ymin=Math.min(da,tr),Cn.ymax=Math.max(da,tr),mr.attr("d","M0,0Z"))}else Ht&&(Kn.addPt([Ze,tr]),Cn=Kn.filtered);if(lt.selectionDefs&&lt.selectionDefs.length?(ia=te(lt.mergedPolygons,Cn,Nn),Cn.subtract=Nn,$n=X(lt.selectionDefs.concat([Cn]))):(ia=[Cn],$n=I(Cn)),m(mt(ia,se),ge,lt),Ee){var Qn=vt(Ye,!1),Qa=Qn.eventData?Qn.eventData.points.slice():[];Qn=vt(Ye,!1,$n,pe,lt),$n=Qn.selectionTesters,ve=Qn.eventData;var Ja;Kn?Ja=Kn.filtered:Ja=qe(ia),b.throttle(Ur,D.SELECTDELAY,function(){Or=bt($n,pe);for(var wi=Or.slice(),ci=0;ci<Qa.length;ci++){for(var Ti=Qa[ci],Ra=!1,Qi=0;Qi<wi.length;Qi++)if(wi[Qi].curveNumber===Ti.curveNumber&&wi[Qi].pointNumber===Ti.pointNumber){Ra=!0;break}Ra||wi.push(Ti)}wi.length&&(ve||(ve={}),ve.points=wi),Ke(ve,Ja),Mr(Ye,ve)})}},lt.clickFn=function(xr,Gr){if(mr.remove(),Ye._fullLayout._activeShapeIndex>=0){Ye._fullLayout._deactivateShape(Ye);return}if(!ke){var ln=Er.clickmode;b.done(Ur).then(function(){if(b.clear(Ur),xr===2){for(ge.remove(),Fa=0;Fa<pe.length;Fa++)Ga=pe[Fa],Ga._module.selectPoints(Ga,!1);if(ee(Ye,pe),q(lt),de(Ye),pe.length){var wn=pe[0].xaxis,rn=pe[0].yaxis;if(wn&&rn){for(var Qr=[],vn=Ye._fullLayout.selections,Oa=0;Oa<vn.length;Oa++){var Qn=vn[Oa];Qn&&(Qn.xref!==wn._id||Qn.yref!==rn._id)&&Qr.push(Qn)}Qr.length<vn.length&&(Ye._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",Ye,{selections:Qr}))}}}else ln.indexOf("select")>-1&&st(Gr,Ye,lt.xaxes,lt.yaxes,lt.subplot,lt,ge),ln==="event"&&Ir(Ye,void 0);e.click(Ye,Gr,Zn.id)}).catch(T.error)}},lt.doneFn=function(){mr.remove(),b.done(Ur).then(function(){b.clear(Ur),!pn&&Cn&&lt.selectionDefs&&(Cn.subtract=Nn,lt.selectionDefs.push(Cn),lt.mergedPolygons.length=0,[].push.apply(lt.mergedPolygons,ia)),(pn||ke)&&q(lt,pn),lt.doneFnCompleted&&lt.doneFnCompleted(Or),Ee&&Ir(Ye,ve)}).catch(T.error)}}function st(Dt,qt,_t,lt,yt,St,Ht){var Yt=qt._hoverdata,se=qt._fullLayout,ke=se.clickmode,Ee=ke.indexOf("event")>-1,Ue=[],ir,ar,Ye,Er,pn,dn,bn,Zn,En,gn;if(Tt(Yt)){Q(Dt,qt,St),ir=nt(qt,_t,lt,yt);var da=wt(Yt,ir),ra=da.pointNumbers.length>0;if(ra?Ct(ir,da):Nt(ir)&&(bn=It(da))){for(Ht&&Ht.remove(),gn=0;gn<ir.length;gn++)ar=ir[gn],ar._module.selectPoints(ar,!1);ee(qt,ir),q(St),Ee&&de(qt)}else{Zn=Dt.shiftKey&&(bn!==void 0?bn:It(da)),Ye=et(da.pointNumber,da.searchInfo,Zn);var Se=St.selectionDefs.concat([Ye]);for(Er=X(Se),gn=0;gn<ir.length;gn++)if(pn=ir[gn]._module.selectPoints(ir[gn],Er),dn=Kt(pn,ir[gn]),Ue.length)for(var Re=0;Re<dn.length;Re++)Ue.push(dn[Re]);else Ue=dn;if(En={points:Ue},ee(qt,ir,En),Ye&&St&&St.selectionDefs.push(Ye),Ht){var Ze=St.mergedPolygons,tr=s(St.dragmode);m(mt(Ze,tr),Ht,St)}Ee&&Ir(qt,En)}}}function et(Dt,qt,_t){return{pointNumber:Dt,searchInfo:qt,subtract:!!_t}}function K(Dt){return"pointNumber"in Dt&&"searchInfo"in Dt}function ot(Dt){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(qt,_t,lt,yt){var St=Dt.searchInfo.cd[0].trace.index,Ht=yt.cd[0].trace.index;return Ht===St&&lt===Dt.pointNumber},isRect:!1,degenerate:!1,subtract:!!Dt.subtract}}function X(Dt){if(!Dt.length)return;for(var qt=[],_t=K(Dt[0])?0:Dt[0][0][0],lt=_t,yt=K(Dt[0])?0:Dt[0][0][1],St=yt,Ht=0;Ht<Dt.length;Ht++)if(K(Dt[Ht]))qt.push(ot(Dt[Ht]));else{var Yt=I(Dt[Ht]);Yt.subtract=!!Dt[Ht].subtract,qt.push(Yt),_t=Math.min(_t,Yt.xmin),lt=Math.max(lt,Yt.xmax),yt=Math.min(yt,Yt.ymin),St=Math.max(St,Yt.ymax)}function se(ke,Ee,Ue,ir){for(var ar=!1,Ye=0;Ye<qt.length;Ye++)qt[Ye].contains(ke,Ee,Ue,ir)&&(ar=!qt[Ye].subtract);return ar}return{xmin:_t,xmax:lt,ymin:yt,ymax:St,pts:[],contains:se,isRect:!1,degenerate:!1}}function Q(Dt,qt,_t){var lt=qt._fullLayout,yt=_t.plotinfo,St=_t.dragmode,Ht=lt._lastSelectedSubplot&&lt._lastSelectedSubplot===yt.id,Yt=(Dt.shiftKey||Dt.altKey)&&!(a(St)&&s(St));Ht&&Yt&&yt.selection&&yt.selection.selectionDefs&&!_t.selectionDefs?(_t.selectionDefs=yt.selection.selectionDefs,_t.mergedPolygons=yt.selection.mergedPolygons):(!Yt||!yt.selection)&&q(_t),Ht||(w(qt),lt._lastSelectedSubplot=yt.id)}function ut(Dt){return Dt._fullLayout._activeShapeIndex>=0}function J(Dt){return Dt._fullLayout._activeSelectionIndex>=0}function q(Dt,qt){var _t=Dt.dragmode,lt=Dt.plotinfo,yt=Dt.gd;ut(yt)&&yt._fullLayout._deactivateShape(yt),J(yt)&&yt._fullLayout._deactivateSelection(yt);var St=yt._fullLayout,Ht=St._zoomlayer,Yt=a(_t),se=f(_t);if(Yt||se){var ke=Ht.selectAll(".select-outline-"+lt.id);if(ke&&yt._fullLayout._outlining){var Ee;Yt&&(Ee=S(ke,Dt)),Ee&&E.call("_guiRelayout",yt,{shapes:Ee});var Ue;se&&!rt(Dt)&&(Ue=k(ke,Dt)),Ue&&(yt._fullLayout._noEmitSelectedAtStart=!0,E.call("_guiRelayout",yt,{selections:Ue}).then(function(){qt&&M(yt)})),yt._fullLayout._outlining=!1}}lt.selection={},lt.selection.selectionDefs=Dt.selectionDefs=[],lt.selection.mergedPolygons=Dt.mergedPolygons=[]}function it(Dt){return Dt._id}function nt(Dt,qt,_t,lt){if(!Dt.calcdata)return[];var yt=[],St=qt.map(it),Ht=_t.map(it),Yt,se,ke;for(ke=0;ke<Dt.calcdata.length;ke++)if(Yt=Dt.calcdata[ke],se=Yt[0].trace,!(se.visible!==!0||!se._module||!se._module.selectPoints))if(rt({subplot:lt})&&(se.subplot===lt||se.geo===lt))yt.push(dt(se._module,Yt,qt[0],_t[0]));else if(se.type==="splom"){if(se._xaxes[St[0]]&&se._yaxes[Ht[0]]){var Ee=dt(se._module,Yt,qt[0],_t[0]);Ee.scene=Dt._fullLayout._splomScenes[se.uid],yt.push(Ee)}}else if(se.type==="sankey"){var Ue=dt(se._module,Yt,qt[0],_t[0]);yt.push(Ue)}else{if(St.indexOf(se.xaxis)===-1&&(!se._xA||!se._xA.overlaying)||Ht.indexOf(se.yaxis)===-1&&(!se._yA||!se._yA.overlaying))continue;yt.push(dt(se._module,Yt,_(Dt,se.xaxis),_(Dt,se.yaxis)))}return yt}function dt(Dt,qt,_t,lt){return{_module:Dt,cd:qt,xaxis:_t,yaxis:lt}}function Tt(Dt){return Dt&&Array.isArray(Dt)&&Dt[0].hoverOnBox!==!0}function wt(Dt,qt){var _t=Dt[0],lt=-1,yt=[],St,Ht;for(Ht=0;Ht<qt.length;Ht++)if(St=qt[Ht],_t.fullData.index===St.cd[0].trace.index){if(_t.hoverOnBox===!0)break;_t.pointNumber!==void 0?lt=_t.pointNumber:_t.binNumber!==void 0&&(lt=_t.binNumber,yt=_t.pointNumbers);break}return{pointNumber:lt,pointNumbers:yt,searchInfo:St}}function It(Dt){var qt=Dt.searchInfo.cd[0].trace,_t=Dt.pointNumber,lt=Dt.pointNumbers,yt=lt.length>0,St=yt?lt[0]:_t;return qt.selectedpoints?qt.selectedpoints.indexOf(St)>-1:!1}function Ct(Dt,qt){var _t=[],lt,yt,St,Ht;for(Ht=0;Ht<Dt.length;Ht++)lt=Dt[Ht],lt.cd[0].trace.selectedpoints&&lt.cd[0].trace.selectedpoints.length>0&&_t.push(lt);if(_t.length===1&&(St=_t[0]===qt.searchInfo,St&&(yt=qt.searchInfo.cd[0].trace,yt.selectedpoints.length===qt.pointNumbers.length))){for(Ht=0;Ht<qt.pointNumbers.length;Ht++)if(yt.selectedpoints.indexOf(qt.pointNumbers[Ht])<0)return!1;return!0}return!1}function Nt(Dt){var qt=0,_t,lt,yt;for(yt=0;yt<Dt.length;yt++)if(_t=Dt[yt],lt=_t.cd[0].trace,lt.selectedpoints&&(lt.selectedpoints.length>1||(qt+=lt.selectedpoints.length,qt>1)))return!1;return qt===1}function ee(Dt,qt,_t){var lt;for(lt=0;lt<qt.length;lt++){var yt=qt[lt].cd[0].trace._fullInput,St=Dt._fullLayout._tracePreGUI[yt.uid]||{};St.selectedpoints===void 0&&(St.selectedpoints=yt._input.selectedpoints||null)}var Ht;if(_t){var Yt=_t.points||[];for(lt=0;lt<qt.length;lt++)Ht=qt[lt].cd[0].trace,Ht._input.selectedpoints=Ht._fullInput.selectedpoints=[],Ht._fullInput!==Ht&&(Ht.selectedpoints=[]);for(var se=0;se<Yt.length;se++){var ke=Yt[se],Ee=ke.data,Ue=ke.fullData,ir=ke.pointIndex,ar=ke.pointIndices;ar?([].push.apply(Ee.selectedpoints,ar),Ht._fullInput!==Ht&&[].push.apply(Ue.selectedpoints,ar)):(Ee.selectedpoints.push(ir),Ht._fullInput!==Ht&&Ue.selectedpoints.push(ir))}}else for(lt=0;lt<qt.length;lt++)Ht=qt[lt].cd[0].trace,delete Ht.selectedpoints,delete Ht._input.selectedpoints,Ht._fullInput!==Ht&&delete Ht._fullInput.selectedpoints;Jt(Dt,qt)}function Jt(Dt,qt){for(var _t=!1,lt=0;lt<qt.length;lt++){var yt=qt[lt],St=yt.cd;E.traceIs(St[0].trace,"regl")&&(_t=!0);var Ht=yt._module,Yt=Ht.styleOnSelect||Ht.style;Yt&&(Yt(Dt,St,St[0].node3),St[0].nodeRangePlot3&&Yt(Dt,St,St[0].nodeRangePlot3))}_t&&(P(Dt),L(Dt))}function te(Dt,qt,_t){for(var lt=_t?u.difference:u.union,yt=lt({regions:Dt},{regions:[qt]}),St=yt.regions.reverse(),Ht=0;Ht<St.length;Ht++){var Yt=St[Ht];Yt.subtract=Ce(Yt,St.slice(0,Ht))}return St}function Kt(Dt,qt){if(Array.isArray(Dt))for(var _t=qt.cd,lt=qt.cd[0].trace,yt=0;yt<Dt.length;yt++)Dt[yt]=r(Dt[yt],lt,_t);return Dt}function mt(Dt,qt){for(var _t=[],lt=0;lt<Dt.length;lt++){_t[lt]=[];for(var yt=0;yt<Dt[lt].length;yt++){_t[lt][yt]=[],_t[lt][yt][0]=yt?"L":"M";for(var St=0;St<Dt[lt][yt].length;St++)_t[lt][yt].push(Dt[lt][yt][St])}qt||_t[lt].push(["Z",_t[lt][0][1],_t[lt][0][2]])}return _t}function bt(Dt,qt){for(var _t=[],lt,yt=[],St,Ht=0;Ht<qt.length;Ht++){var Yt=qt[Ht];St=Yt._module.selectPoints(Yt,Dt),yt.push(St),lt=Kt(St,Yt),_t=_t.concat(lt)}return _t}function vt(Dt,qt,_t,lt,yt){var St=!!lt,Ht,Yt,se;yt&&(Ht=yt.plotinfo,Yt=yt.xaxes[0]._id,se=yt.yaxes[0]._id);var ke=[],Ee=[],Ue=Me(Dt),ir=Dt._fullLayout;if(Ht){var ar=ir._zoomlayer,Ye=ir.dragmode,Er=a(Ye),pn=f(Ye);if(Er||pn){var dn=_(Dt,Yt,"x"),bn=_(Dt,se,"y");if(dn&&bn){var Zn=ar.selectAll(".select-outline-"+Ht.id);if(Zn&&Dt._fullLayout._outlining&&Zn.length){for(var En=Zn[0][0],gn=En.getAttribute("d"),da=y(gn,Dt,Ht),ra=[],Se=0;Se<da.length;Se++){for(var Re=da[Se],Ze=[],tr=0;tr<Re.length;tr++)Ze.push([We(dn,Re[tr][1]),We(bn,Re[tr][2])]);Ze.xref=Yt,Ze.yref=se,Ze.subtract=Ce(Ze,ra),ra.push(Ze)}Ue=Ue.concat(ra)}}}}var zr=Yt&&se?[Yt+se]:ir._subplots.cartesian;Ut(Dt);for(var tn={},Yr=0;Yr<zr.length;Yr++){var $r=zr[Yr],In=$r.indexOf("y"),Nn=$r.slice(0,In),Kn=$r.slice(In),$n=Yt&&se?_t:void 0;if($n=ue(Ue,Nn,Kn,$n),$n){var ia=lt;if(!St){var Cn=_(Dt,Nn,"x"),Fa=_(Dt,Kn,"y");ia=nt(Dt,[Cn],[Fa],$r);for(var Ga=0;Ga<ia.length;Ga++){var ve=ia[Ga],ge=ve.cd[0],dr=ge.trace;if(ve._module.name==="scattergl"&&!ge.t.xpx){var br=dr.x,Tr=dr.y,mr=dr._length;ge.t.xpx=[],ge.t.ypx=[];for(var kr=0;kr<mr;kr++)ge.t.xpx[kr]=Cn.c2p(br[kr]),ge.t.ypx[kr]=Fa.c2p(Tr[kr])}ve._module.name==="splom"&&(tn[dr.uid]||(tn[dr.uid]=!0))}}var Ur=bt($n,ia);ke=ke.concat(Ur),Ee=Ee.concat(ia)}}var Or={points:ke};ee(Dt,Ee,Or);var pe=ir.clickmode,Ke=pe.indexOf("event")>-1&&qt;if(!Ht&&qt){var xr=Me(Dt,!0);if(xr.length){var Gr=xr[0].xref,ln=xr[0].yref;if(Gr&&ln){var wn=qe(xr),rn=_r([_(Dt,Gr,"x"),_(Dt,ln,"y")]);rn(Or,wn)}}Dt._fullLayout._noEmitSelectedAtStart?Dt._fullLayout._noEmitSelectedAtStart=!1:Ke&&Ir(Dt,Or),ir._reselect=!1}if(!Ht&&ir._deselect){var Qr=ir._deselect;Yt=Qr.xref,se=Qr.yref,re(Yt,se,Ee)||Zt(Dt,Yt,se,lt),Ke&&(Or.points.length?Ir(Dt,Or):de(Dt)),ir._deselect=!1}return{eventData:Or,selectionTesters:_t}}function Ut(Dt){var qt=Dt.calcdata;if(qt)for(var _t=0;_t<qt.length;_t++){var lt=qt[_t][0],yt=lt.trace,St=Dt._fullLayout._splomScenes;if(St){var Ht=St[yt.uid];Ht&&(Ht.selectBatch=[])}}}function re(Dt,qt,_t){for(var lt=0;lt<_t.length;lt++){var yt=_t[lt];if(yt.xaxis&&yt.xaxis._id===Dt&&yt.yaxis&&yt.yaxis._id===qt)return!0}return!1}function Zt(Dt,qt,_t,lt){lt=nt(Dt,[_(Dt,qt,"x")],[_(Dt,_t,"y")],qt+_t);for(var yt=0;yt<lt.length;yt++){var St=lt[yt];St._module.selectPoints(St,!1)}ee(Dt,lt)}function ue(Dt,qt,_t,lt){for(var yt,St=0;St<Dt.length;St++){var Ht=Dt[St];if(!(qt!==Ht.xref||_t!==Ht.yref))if(yt){var Yt=!!Ht.subtract;yt=te(yt,Ht,Yt),lt=X(yt)}else yt=[Ht],lt=I(Ht)}return lt}function Me(Dt,qt){for(var _t=[],lt=Dt._fullLayout,yt=lt.selections,St=yt.length,Ht=0;Ht<St;Ht++)if(!(qt&&Ht!==lt._activeSelectionIndex)){var Yt=yt[Ht];if(Yt){var se=Yt.xref,ke=Yt.yref,Ee=_(Dt,se,"x"),Ue=_(Dt,ke,"y"),ir,ar,Ye,Er,pn;if(Yt.type==="rect"){pn=[];var dn=We(Ee,Yt.x0),bn=We(Ee,Yt.x1),Zn=We(Ue,Yt.y0),En=We(Ue,Yt.y1);pn=[[dn,Zn],[dn,En],[bn,En],[bn,Zn]],ir=Math.min(dn,bn),ar=Math.max(dn,bn),Ye=Math.min(Zn,En),Er=Math.max(Zn,En),pn.xmin=ir,pn.xmax=ar,pn.ymin=Ye,pn.ymax=Er,pn.xref=se,pn.yref=ke,pn.subtract=!1,pn.isRect=!0,_t.push(pn)}else if(Yt.type==="path")for(var gn=Yt.path.split("Z"),da=[],ra=0;ra<gn.length;ra++){var Se=gn[ra];if(Se){Se+="Z";var Re=v.extractPathCoords(Se,g.paramIsX,"raw"),Ze=v.extractPathCoords(Se,g.paramIsY,"raw");ir=1/0,ar=-1/0,Ye=1/0,Er=-1/0,pn=[];for(var tr=0;tr<Re.length;tr++){var zr=We(Ee,Re[tr]),tn=We(Ue,Ze[tr]);pn.push([zr,tn]),ir=Math.min(zr,ir),ar=Math.max(zr,ar),Ye=Math.min(tn,Ye),Er=Math.max(tn,Er)}pn.xmin=ir,pn.xmax=ar,pn.ymin=Ye,pn.ymax=Er,pn.xref=se,pn.yref=ke,pn.subtract=Ce(pn,da),da.push(pn),_t.push(pn)}}}}return _t}function Ce(Dt,qt){for(var _t=!1,lt=0;lt<qt.length;lt++)for(var yt=qt[lt],St=0;St<Dt.length;St++)if(d(Dt[St],yt)){_t=!_t;break}return _t}function We(Dt,qt){return Dt.type==="date"&&(qt=qt.replace("_"," ")),Dt.type==="log"?Dt.c2p(qt):Dt.r2p(qt,null,Dt.calendar)}function qe(Dt){for(var qt=Dt.length,_t=[],lt=0;lt<qt;lt++){var yt=Dt[lt];_t=_t.concat(yt),_t=_t.concat([yt[0]])}return vr(_t)}function vr(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 _r(Dt){return function(qt,_t){for(var lt,yt,St=0;St<Dt.length;St++){var Ht=Dt[St],Yt=Ht._id,se=Yt.charAt(0);if(_t.isRect){lt||(lt={});var ke=_t[se+"min"],Ee=_t[se+"max"];ke!==void 0&&Ee!==void 0&&(lt[Yt]=[N(Ht,ke),N(Ht,Ee)].sort(c))}else yt||(yt={}),yt[Yt]=_t.map(j(Ht))}lt&&(qt.range=lt),yt&&(qt.lassoPoints=yt)}}function er(Dt){var qt=Dt.plotinfo;return qt.fillRangeItems||_r(Dt.xaxes.concat(Dt.yaxes))}function Mr(Dt,qt){Dt.emit("plotly_selecting",qt)}function Ir(Dt,qt){qt&&(qt.selections=(Dt.layout||{}).selections||[]),Dt.emit("plotly_selected",qt)}function de(Dt){Dt.emit("plotly_deselect",null)}V.exports={reselect:vt,prepSelect:ct,clearOutline:w,clearSelectionsCache:q,selectOnClick:st}}),Mb=Vt((Z,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}]}),Ng=Vt((Z,V)=>{V.exports={axisRefDescription:function(u,d,E){return["If set to a",u,"axis id (e.g. *"+u+"* or","*"+u+"2*), the `"+u+"` position refers to a",u,"coordinate. If set to *paper*, the `"+u+"`","position refers to the distance from the",d,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",d,"("+E+"). If set to a",u,"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",d,"of the domain of that axis: e.g.,","*"+u+"2 domain* refers to the domain of the second",u," axis and a",u,"position of 0.5 refers to the","point between the",d,"and the",E,"of the domain of the","second",u,"axis."].join(" ")}}}),l0=Vt((Z,V)=>{var u=Mb(),d=yu(),E=Af(),A=cl().templatedArray;Ng(),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:d({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:u.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:u.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:d({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),gp=Vt((Z,V)=>{V.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),Qh=Vt((Z,V)=>{V.exports=function(u){return{valType:"color",editType:"style",anim:!0}}}),pc=Vt((Z,V)=>{var u=fc().axisHoverFormat,{hovertemplateAttrs:d,texttemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Wl(),e=yu(),r=Cf().dash,i=Cf().pattern,n=Eo(),o=gp(),a=So().extendFlat,s=Qh();function f(m){return{valType:"any",dflt:0,editType:"calc"}}function v(m){return{valType:"any",editType:"calc"}}function g(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:f(),yperiod:f(),xperiod0:v(),yperiod0:v(),xperiodalignment:g(),yperiodalignment:g(),xhoverformat:u("x"),yhoverformat:u("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:E(),texttemplatefallback:A({editType:"calc"}),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:d({},{keys:o.eventDataKeys}),hovertemplatefallback:A(),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:a({},r,{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:s(!0),fillgradient:a({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:i,marker:a({symbol:{valType:"enumerated",values:n.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:a({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},t("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"},t("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:e({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),Sb=Vt((Z,V)=>{var u=l0(),d=pc().line,E=Cf().dash,A=So().extendFlat,t=Cu().overrideAll,e=cl().templatedArray;Ng(),V.exports=t(e("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:A({},u.xref,{}),yref:A({},u.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:d.color,width:A({},d.width,{min:1,dflt:1}),dash:A({},E,{dflt:"dot"})}}),"arraydraw","from-root")}),yk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Wf(),A=Sb(),t=Sd();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(P,L){return u.coerce(r,i,A,P,L)}var a=o("path"),s=a?"path":"rect",f=o("type",s),v=f!=="path";v&&delete i.path,o("opacity"),o("line.color"),o("line.width"),o("line.dash");for(var g=["x","y"],m=0;m<2;m++){var w=g[m],l={_fullLayout:n},x,y,S,k=d.coerceRef(r,i,l,w);if(x=d.getFromId(l,k),x._selectionIndices.push(i._index),S=t.rangeToShapePosition(x),y=t.shapePositionToRange(x),v){var M=w+"0",T=w+"1",c=r[M],h=r[T];r[M]=y(r[M],!0),r[T]=y(r[T],!0),d.coercePosition(i,l,o,k,M),d.coercePosition(i,l,o,k,T);var b=i[M],_=i[T];b!==void 0&&_!==void 0&&(i[M]=S(b),i[T]=S(_),r[M]=c,r[T]=h)}}v&&u.noneOrAll(r,i,["x0","x1","y0","y1"])}}),xk=Vt((Z,V)=>{V.exports=function(u,d,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")}}),jg=Vt((Z,V)=>{var u=ji(),d=Xr(),E=cc();V.exports=function(A){return function(t,e){var r=t[A];if(Array.isArray(r))for(var i=u.subplotsRegistry.cartesian,n=i.idRegex,o=e._subplots,a=o.xaxis,s=o.yaxis,f=o.cartesian,v=e._has("cartesian"),g=0;g<r.length;g++){var m=r[g];if(d.isPlainObject(m)){var w=E.cleanId(m.xref,"x",!1),l=E.cleanId(m.yref,"y",!1),x=n.x.test(w),y=n.y.test(l);if(x||y){v||d.pushUnique(e._basePlotModules,i);var S=!1;x&&a.indexOf(w)===-1&&(a.push(w),S=!0),y&&s.indexOf(l)===-1&&(s.push(l),S=!0),S&&x&&y&&f.push(w+l)}}}}}}),Sc=Vt((Z,V)=>{var u=Ab(),d=vk();V.exports={moduleType:"component",name:"selections",layoutAttributes:Sb(),supplyLayoutDefaults:yk(),supplyDrawNewSelectionDefaults:xk(),includeBasePlot:jg()("selections"),draw:u.draw,drawOne:u.drawOne,reselect:d.reselect,prepSelect:d.prepSelect,clearOutline:d.clearOutline,clearSelectionsCache:d.clearSelectionsCache,selectOnClick:d.selectOnClick}}),Eb=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=d.numberFormat,A=kf(),t=jy(),e=ji(),r=d.strTranslate,i=Dl(),n=Pi(),o=Eo(),a=hc(),s=yo(),f=$h(),v=ih(),g=Jh(),m=g.selectingOrDrawing,w=g.freeMode,l=mf().FROM_TL,x=Dg(),y=Bg().redrawReglTraces,S=Uu(),k=cc().getFromId,M=Sc().prepSelect,T=Sc().clearOutline,c=Sc().selectOnClick,h=kb(),b=Af(),_=b.MINDRAG,P=b.MINZOOM,L=!0;function D(dt,Tt,wt,It,Ct,Nt,ee,Jt){var te=dt._fullLayout._zoomlayer,Kt=ee+Jt==="nsew",mt=(ee+Jt).length===1,bt,vt,Ut,re,Zt,ue,Me,Ce,We,qe,vr,_r,er,Mr,Ir,de,Dt,qt,_t,lt,yt,St,Ht;wt+=Tt.yaxis._shift;function Yt(){if(bt=Tt.xaxis,vt=Tt.yaxis,We=bt._length,qe=vt._length,Me=bt._offset,Ce=vt._offset,Ut={},Ut[bt._id]=bt,re={},re[vt._id]=vt,ee&&Jt)for(var ge=Tt.overlays,dr=0;dr<ge.length;dr++){var br=ge[dr].xaxis;Ut[br._id]=br;var Tr=ge[dr].yaxis;re[Tr._id]=Tr}Zt=nt(Ut),ue=nt(re),er=I(Zt,Jt),Mr=I(ue,ee),Ir=!Mr&&!er,_r=q(dt,dt._fullLayout._axisMatchGroups,Ut,re),vr=q(dt,dt._fullLayout._axisConstraintGroups,Ut,re,_r);var mr=vr.isSubplotConstrained||_r.isSubplotConstrained;de=Jt||mr,Dt=ee||mr;var kr=dt._fullLayout;qt=kr._has("scattergl"),_t=kr._has("splom"),lt=kr._has("svg")}Yt();var se=rt(Mr+er,dt._fullLayout.dragmode,Kt),ke=R(Tt,ee+Jt+"drag",se,wt,It,Ct,Nt);if(Ir&&!Kt)return ke.onmousedown=null,ke.style.pointerEvents="none",ke;var Ee={element:ke,gd:dt,plotinfo:Tt};Ee.prepFn=function(ge,dr,br){var Tr=Ee.dragmode,mr=dt._fullLayout.dragmode;mr!==Tr&&(Ee.dragmode=mr),Yt(),St=dt._fullLayout._invScaleX,Ht=dt._fullLayout._invScaleY,Ir||(Kt?ge.shiftKey?mr==="pan"?mr="zoom":m(mr)||(mr="pan"):ge.ctrlKey&&(mr="pan"):mr="pan"),w(mr)?Ee.minDrag=1:Ee.minDrag=void 0,m(mr)?(Ee.xaxes=Zt,Ee.yaxes=ue,M(ge,dr,br,Ee,mr)):(Ee.clickFn=ir,m(Tr)&&Ue(),Ir||(mr==="zoom"?(Ee.moveFn=Se,Ee.doneFn=Ze,Ee.minDrag=1,ra(ge,dr,br)):mr==="pan"&&(Ee.moveFn=In,Ee.doneFn=ia))),dt._fullLayout._redrag=function(){var kr=dt._dragdata;if(kr&&kr.element===ke){var Ur=dt._fullLayout.dragmode;m(Ur)||(Yt(),Cn([0,0,We,qe]),Ee.moveFn(kr.dx,kr.dy))}}};function Ue(){Ee.plotinfo.selection=!1,T(dt)}function ir(ge,dr){var br=Ee.gd;if(br._fullLayout._activeShapeIndex>=0){br._fullLayout._deactivateShape(br);return}var Tr=br._fullLayout.clickmode;if(ot(br),ge===2&&!mt&&$n(),Kt)Tr.indexOf("select")>-1&&c(dr,br,Zt,ue,Tt.id,Ee),Tr.indexOf("event")>-1&&a.click(br,dr,Tt.id);else if(ge===1&&mt){var mr=ee?vt:bt,kr=ee==="s"||Jt==="w"?0:1,Ur=mr._name+".range["+kr+"]",Or=F(mr,kr),pe="left",Ke="middle";if(mr.fixedrange)return;ee?(Ke=ee==="n"?"top":"bottom",mr.side==="right"&&(pe="right")):Jt==="e"&&(pe="right"),br._context.showAxisRangeEntryBoxes&&u.select(ke).call(i.makeEditable,{gd:br,immediate:!0,background:br._fullLayout.paper_bgcolor,text:String(Or),fill:mr.tickfont?mr.tickfont.color:"#444",horizontalAlign:pe,verticalAlign:Ke}).on("edit",function(xr){var Gr=mr.d2r(xr);Gr!==void 0&&e.call("_guiRelayout",br,Ur,Gr)})}}v.init(Ee);var ar,Ye,Er,pn,dn,bn,Zn,En,gn,da;function ra(ge,dr,br){var Tr=ke.getBoundingClientRect();ar=dr-Tr.left,Ye=br-Tr.top,dt._fullLayout._calcInverseTransform(dt);var mr=d.apply3DTransform(dt._fullLayout._invTransform)(ar,Ye);ar=mr[0],Ye=mr[1],Er={l:ar,r:ar,w:0,t:Ye,b:Ye,h:0},pn=dt._hmpixcount?dt._hmlumcount/dt._hmpixcount:A(dt._fullLayout.plot_bgcolor).getLuminance(),dn="M0,0H"+We+"V"+qe+"H0V0",bn=!1,Zn="xy",da=!1,En=ct(te,pn,Me,Ce,dn),gn=st(te,Me,Ce)}function Se(ge,dr){if(dt._transitioningWithDuration)return!1;var br=Math.max(0,Math.min(We,St*ge+ar)),Tr=Math.max(0,Math.min(qe,Ht*dr+Ye)),mr=Math.abs(br-ar),kr=Math.abs(Tr-Ye);Er.l=Math.min(ar,br),Er.r=Math.max(ar,br),Er.t=Math.min(Ye,Tr),Er.b=Math.max(Ye,Tr);function Ur(){Zn="",Er.r=Er.l,Er.t=Er.b,gn.attr("d","M0,0Z")}if(vr.isSubplotConstrained)mr>P||kr>P?(Zn="xy",mr/We>kr/qe?(kr=mr*qe/We,Ye>Tr?Er.t=Ye-kr:Er.b=Ye+kr):(mr=kr*We/qe,ar>br?Er.l=ar-mr:Er.r=ar+mr),gn.attr("d",J(Er))):Ur();else if(_r.isSubplotConstrained)if(mr>P||kr>P){Zn="xy";var Or=Math.min(Er.l/We,(qe-Er.b)/qe),pe=Math.max(Er.r/We,(qe-Er.t)/qe);Er.l=Or*We,Er.r=pe*We,Er.b=(1-Or)*qe,Er.t=(1-pe)*qe,gn.attr("d",J(Er))}else Ur();else!Mr||kr<Math.min(Math.max(mr*.6,_),P)?mr<_||!er?Ur():(Er.t=0,Er.b=qe,Zn="x",gn.attr("d",Q(Er,Ye))):!er||mr<Math.min(kr*.6,P)?(Er.l=0,Er.r=We,Zn="y",gn.attr("d",ut(Er,ar))):(Zn="xy",gn.attr("d",J(Er)));Er.w=Er.r-Er.l,Er.h=Er.b-Er.t,Zn&&(da=!0),dt._dragged=da,et(En,gn,Er,dn,bn,pn),Re(),dt.emit("plotly_relayouting",yt),bn=!0}function Re(){yt={},(Zn==="xy"||Zn==="x")&&(N(Zt,Er.l/We,Er.r/We,yt,vr.xaxes),Nn("x",yt)),(Zn==="xy"||Zn==="y")&&(N(ue,(qe-Er.b)/qe,(qe-Er.t)/qe,yt,vr.yaxes),Nn("y",yt))}function Ze(){Re(),ot(dt),ia(),X(dt)}var tr=[0,0,We,qe],zr=null,tn=b.REDRAWDELAY,Yr=Tt.mainplot?dt._fullLayout._plots[Tt.mainplot]:Tt;function $r(ge){if(!dt._context._scrollZoom.cartesian&&!dt._fullLayout._enablescrollzoom)return;if(Ue(),dt._transitioningWithDuration){ge.preventDefault(),ge.stopPropagation();return}Yt(),clearTimeout(zr);var dr=-ge.deltaY;if(isFinite(dr)||(dr=ge.wheelDelta/10),!isFinite(dr)){d.log("Did not find wheel motion attributes: ",ge);return}var br=Math.exp(-Math.min(Math.max(dr,-20),20)/200),Tr=Yr.draglayer.select(".nsewdrag").node().getBoundingClientRect(),mr=(ge.clientX-Tr.left)/Tr.width,kr=(Tr.bottom-ge.clientY)/Tr.height,Ur;function Or(pe,Ke,xr){if(pe.fixedrange)return;var Gr=d.simpleMap(pe.range,pe.r2l),ln=Gr[0]+(Gr[1]-Gr[0])*Ke;function wn(rn){return pe.l2r(ln+(rn-ln)*xr)}pe.range=Gr.map(wn)}if(de){for(Jt||(mr=.5),Ur=0;Ur<Zt.length;Ur++)Or(Zt[Ur],mr,br);Nn("x"),tr[2]*=br,tr[0]+=tr[2]*mr*(1/br-1)}if(Dt){for(ee||(kr=.5),Ur=0;Ur<ue.length;Ur++)Or(ue[Ur],kr,br);Nn("y"),tr[3]*=br,tr[1]+=tr[3]*(1-kr)*(1/br-1)}Cn(tr),Kn(),dt.emit("plotly_relayouting",yt),zr=setTimeout(function(){dt._fullLayout&&(tr=[0,0,We,qe],ia())},tn),ge.preventDefault()}ee.length*Jt.length!==1&&it(ke,$r);function In(ge,dr){if(ge=ge*St,dr=dr*Ht,dt._transitioningWithDuration)return;if(dt._fullLayout._replotting=!0,er==="ew"||Mr==="ns"){var br=er?-ge:0,Tr=Mr?-dr:0;if(_r.isSubplotConstrained){if(er&&Mr){var mr=(ge/We-dr/qe)/2;ge=mr*We,dr=-mr*qe,br=-ge,Tr=-dr}Mr?br=-Tr*We/qe:Tr=-br*qe/We}er&&(j(Zt,ge),Nn("x")),Mr&&(j(ue,dr),Nn("y")),Cn([br,Tr,We,qe]),Kn(),dt.emit("plotly_relayouting",yt);return}function kr(wn,rn,Qr){for(var vn=1-rn,Oa,Qn,Qa=0;Qa<wn.length;Qa++){var Ja=wn[Qa];if(!Ja.fixedrange){Oa=Ja,Qn=Ja._rl[vn]+(Ja._rl[rn]-Ja._rl[vn])/G(Qr/Ja._length);var wi=Ja.l2r(Qn);wi!==!1&&wi!==void 0&&(Ja.range[rn]=wi)}}return Oa._length*(Oa._rl[rn]-Qn)/(Oa._rl[rn]-Oa._rl[vn])}var Ur=er==="w"==(Mr==="n")?1:-1;if(er&&Mr&&(vr.isSubplotConstrained||_r.isSubplotConstrained)){var Or=(ge/We+Ur*dr/qe)/2;ge=Or*We,dr=Ur*Or*qe}var pe,Ke;if(er==="w"?ge=kr(Zt,0,ge):er==="e"?ge=kr(Zt,1,-ge):er||(ge=0),Mr==="n"?dr=kr(ue,1,dr):Mr==="s"?dr=kr(ue,0,-dr):Mr||(dr=0),pe=er==="w"?ge:0,Ke=Mr==="n"?dr:0,vr.isSubplotConstrained&&!_r.isSubplotConstrained||_r.isSubplotConstrained&&er&&Mr&&Ur>0){var xr;if(_r.isSubplotConstrained||!er&&Mr.length===1){for(xr=0;xr<Zt.length;xr++)Zt[xr].range=Zt[xr]._r.slice(),h(Zt[xr],1-dr/qe);ge=dr*We/qe,pe=ge/2}if(_r.isSubplotConstrained||!Mr&&er.length===1){for(xr=0;xr<ue.length;xr++)ue[xr].range=ue[xr]._r.slice(),h(ue[xr],1-ge/We);dr=ge*qe/We,Ke=dr/2}}(!_r.isSubplotConstrained||!Mr)&&Nn("x"),(!_r.isSubplotConstrained||!er)&&Nn("y");var Gr=We-ge,ln=qe-dr;_r.isSubplotConstrained&&!(er&&Mr)&&(er?(Ke=pe?0:ge*qe/We,ln=Gr*qe/We):(pe=Ke?0:dr*We/qe,Gr=ln*We/qe)),Cn([pe,Ke,Gr,ln]),Kn(),dt.emit("plotly_relayouting",yt)}function Nn(ge,dr){for(var br=_r.isSubplotConstrained?{x:ue,y:Zt}[ge]:_r[ge+"axes"],Tr=_r.isSubplotConstrained?{x:Zt,y:ue}[ge]:[],mr=0;mr<br.length;mr++){var kr=br[mr],Ur=kr._id,Or=_r.xLinks[Ur]||_r.yLinks[Ur],pe=Tr[0]||Ut[Or]||re[Or];pe&&(dr?(dr[kr._name+".range[0]"]=dr[pe._name+".range[0]"],dr[kr._name+".range[1]"]=dr[pe._name+".range[1]"]):kr.range=pe.range.slice())}}function Kn(){var ge=[],dr;function br(Ur){for(dr=0;dr<Ur.length;dr++)Ur[dr].fixedrange||ge.push(Ur[dr]._id)}function Tr(Ur,Or){for(dr=0;dr<Ur.length;dr++){var pe=Ur[dr],Ke=pe[Or];!pe.fixedrange&&Ke.tickmode==="sync"&&ge.push(Ke._id)}}for(de&&(br(Zt),br(vr.xaxes),br(_r.xaxes),Tr(Tt.overlays,"xaxis")),Dt&&(br(ue),br(vr.yaxes),br(_r.yaxes),Tr(Tt.overlays,"yaxis")),yt={},dr=0;dr<ge.length;dr++){var mr=ge[dr],kr=k(dt,mr);s.drawOne(dt,kr,{skipTitle:!0}),yt[kr._name+".range[0]"]=kr.range[0],yt[kr._name+".range[1]"]=kr.range[1]}s.redrawComponents(dt,ge)}function $n(){if(!dt._transitioningWithDuration){var ge=dt._context.doubleClick,dr=[];er&&(dr=dr.concat(Zt)),Mr&&(dr=dr.concat(ue)),_r.xaxes&&(dr=dr.concat(_r.xaxes)),_r.yaxes&&(dr=dr.concat(_r.yaxes));var br={},Tr,mr;if(ge==="reset+autosize")for(ge="autosize",mr=0;mr<dr.length;mr++){Tr=dr[mr];var kr=Tr._rangeInitial0,Ur=Tr._rangeInitial1,Or=kr!==void 0||Ur!==void 0;if(Or&&(kr!==void 0&&kr!==Tr.range[0]||Ur!==void 0&&Ur!==Tr.range[1])||!Or&&Tr.autorange!==!0){ge="reset";break}}if(ge==="autosize")for(mr=0;mr<dr.length;mr++)Tr=dr[mr],Tr.fixedrange||(br[Tr._name+".autorange"]=!0);else if(ge==="reset"){for((er||vr.isSubplotConstrained)&&(dr=dr.concat(vr.xaxes)),Mr&&!vr.isSubplotConstrained&&(dr=dr.concat(vr.yaxes)),vr.isSubplotConstrained&&(er?Mr||(dr=dr.concat(ue)):dr=dr.concat(Zt)),mr=0;mr<dr.length;mr++)if(Tr=dr[mr],!Tr.fixedrange){var pe=Tr._name,Ke=Tr._autorangeInitial;Tr._rangeInitial0===void 0&&Tr._rangeInitial1===void 0?br[pe+".autorange"]=!0:Tr._rangeInitial0===void 0?(br[pe+".autorange"]=Ke,br[pe+".range"]=[null,Tr._rangeInitial1]):Tr._rangeInitial1===void 0?(br[pe+".range"]=[Tr._rangeInitial0,null],br[pe+".autorange"]=Ke):br[pe+".range"]=[Tr._rangeInitial0,Tr._rangeInitial1]}}dt.emit("plotly_doubleclick",null),e.call("_guiRelayout",dt,br)}}function ia(){Cn([0,0,We,qe]),d.syncOrAsync([S.previousPromises,function(){dt._fullLayout._replotting=!1,e.call("_guiRelayout",dt,yt)}],dt)}function Cn(ge){var dr=dt._fullLayout,br=dr._plots,Tr=dr._subplots.cartesian,mr,kr,Ur,Or;if(_t&&e.subplotsRegistry.splom.drag(dt),qt){for(mr=0;mr<Tr.length;mr++)if(kr=br[Tr[mr]],Ur=kr.xaxis,Or=kr.yaxis,kr._scene){Ur.limitRange&&Ur.limitRange(),Or.limitRange&&Or.limitRange();var pe=d.simpleMap(Ur.range,Ur.r2l),Ke=d.simpleMap(Or.range,Or.r2l);kr._scene.update({range:[pe[0],Ke[0],pe[1],Ke[1]]})}}if((_t||qt)&&(x(dt),y(dt)),lt){var xr=ge[2]/bt._length,Gr=ge[3]/vt._length;for(mr=0;mr<Tr.length;mr++){kr=br[Tr[mr]],Ur=kr.xaxis,Or=kr.yaxis;var ln=(de||_r.isSubplotConstrained)&&!Ur.fixedrange&&Ut[Ur._id],wn=(Dt||_r.isSubplotConstrained)&&!Or.fixedrange&&re[Or._id],rn,Qr,vn,Oa;if(ln?(rn=xr,vn=Jt||_r.isSubplotConstrained?ge[0]:ve(Ur,rn)):_r.xaHash[Ur._id]?(rn=xr,vn=ge[0]*Ur._length/bt._length):_r.yaHash[Ur._id]?(rn=Gr,vn=Mr==="ns"?-ge[1]*Ur._length/vt._length:ve(Ur,rn,{n:"top",s:"bottom"}[Mr])):(rn=Fa(Ur,xr,Gr),vn=Ga(Ur,rn)),rn>1&&(Ur.maxallowed!==void 0&&de===(Ur.range[0]<Ur.range[1]?"e":"w")||Ur.minallowed!==void 0&&de===(Ur.range[0]<Ur.range[1]?"w":"e"))&&(rn=1,vn=0),wn?(Qr=Gr,Oa=ee||_r.isSubplotConstrained?ge[1]:ve(Or,Qr)):_r.yaHash[Or._id]?(Qr=Gr,Oa=ge[1]*Or._length/vt._length):_r.xaHash[Or._id]?(Qr=xr,Oa=er==="ew"?-ge[0]*Or._length/bt._length:ve(Or,Qr,{e:"right",w:"left"}[er])):(Qr=Fa(Or,xr,Gr),Oa=Ga(Or,Qr)),Qr>1&&(Or.maxallowed!==void 0&&Dt===(Or.range[0]<Or.range[1]?"n":"s")||Or.minallowed!==void 0&&Dt===(Or.range[0]<Or.range[1]?"s":"n"))&&(Qr=1,Oa=0),!(!rn&&!Qr)){rn||(rn=1),Qr||(Qr=1);var Qn=Ur._offset-vn/rn,Qa=Or._offset-Oa/Qr;kr.clipRect.call(o.setTranslate,vn,Oa).call(o.setScale,rn,Qr),kr.plot.call(o.setTranslate,Qn,Qa).call(o.setScale,1/rn,1/Qr),(rn!==kr.xScaleFactor||Qr!==kr.yScaleFactor)&&(o.setPointGroupScale(kr.zoomScalePts,rn,Qr),o.setTextPointsScale(kr.zoomScaleTxt,rn,Qr)),o.hideOutsideRangePoints(kr.clipOnAxisFalseTraces,kr),kr.xScaleFactor=rn,kr.yScaleFactor=Qr}}}}function Fa(ge,dr,br){return ge.fixedrange?0:de&&vr.xaHash[ge._id]?dr:Dt&&(vr.isSubplotConstrained?vr.xaHash:vr.yaHash)[ge._id]?br:0}function Ga(ge,dr){return dr?(ge.range=ge._r.slice(),h(ge,dr),ve(ge,dr)):0}function ve(ge,dr,br){return ge._length*(1-dr)*l[br||ge.constraintoward||"middle"]}return ke}function B(dt,Tt,wt,It){var Ct=d.ensureSingle(dt.draglayer,Tt,wt,function(Nt){Nt.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",dt.id)});return Ct.call(f,It),Ct.node()}function R(dt,Tt,wt,It,Ct,Nt,ee){var Jt=B(dt,"rect",Tt,wt);return u.select(Jt).call(o.setRect,It,Ct,Nt,ee),Jt}function I(dt,Tt){for(var wt=0;wt<dt.length;wt++)if(!dt[wt].fixedrange)return Tt;return""}function F(dt,Tt){var wt=dt.range[Tt],It=Math.abs(wt-dt.range[1-Tt]),Ct;return dt.type==="date"?wt:dt.type==="log"?(Ct=Math.ceil(Math.max(0,-Math.log(It)/Math.LN10))+3,E("."+Ct+"g")(Math.pow(10,wt))):(Ct=Math.floor(Math.log(Math.abs(wt))/Math.LN10)-Math.floor(Math.log(It)/Math.LN10)+4,E("."+String(Ct)+"g")(wt))}function N(dt,Tt,wt,It,Ct){for(var Nt=0;Nt<dt.length;Nt++){var ee=dt[Nt];if(!ee.fixedrange)if(ee.rangebreaks){var Jt=ee._id.charAt(0)==="y",te=Jt?1-Tt:Tt,Kt=Jt?1-wt:wt;It[ee._name+".range[0]"]=ee.l2r(ee.p2l(te*ee._length)),It[ee._name+".range[1]"]=ee.l2r(ee.p2l(Kt*ee._length))}else{var mt=ee._rl[0],bt=ee._rl[1]-mt;It[ee._name+".range[0]"]=ee.l2r(mt+bt*Tt),It[ee._name+".range[1]"]=ee.l2r(mt+bt*wt)}}if(Ct&&Ct.length){var vt=(Tt+(1-wt))/2;N(Ct,vt,1-vt,It,[])}}function j(dt,Tt){for(var wt=0;wt<dt.length;wt++){var It=dt[wt];if(!It.fixedrange){if(It.rangebreaks){var Ct=0,Nt=It._length,ee=It.p2l(Ct+Tt)-It.p2l(Ct),Jt=It.p2l(Nt+Tt)-It.p2l(Nt),te=(ee+Jt)/2;It.range=[It.l2r(It._rl[0]-te),It.l2r(It._rl[1]-te)]}else It.range=[It.l2r(It._rl[0]-Tt/It._m),It.l2r(It._rl[1]-Tt/It._m)];It.limitRange&&It.limitRange()}}}function G(dt){return 1-(dt>=0?Math.min(dt,.9):1/(1/Math.max(dt,-.3)+3.222))}function rt(dt,Tt,wt){return dt?dt==="nsew"?wt?"":Tt==="pan"?"move":"crosshair":dt.toLowerCase()+"-resize":"pointer"}function ct(dt,Tt,wt,It,Ct){return dt.append("path").attr("class","zoombox").style({fill:Tt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(wt,It)).attr("d",Ct+"Z")}function st(dt,Tt,wt){return dt.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(Tt,wt)).attr("d","M0,0Z")}function et(dt,Tt,wt,It,Ct,Nt){dt.attr("d",It+"M"+wt.l+","+wt.t+"v"+wt.h+"h"+wt.w+"v-"+wt.h+"h-"+wt.w+"Z"),K(dt,Tt,Ct,Nt)}function K(dt,Tt,wt,It){wt||(dt.transition().style("fill",It>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Tt.transition().style("opacity",1).duration(200))}function ot(dt){u.select(dt).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function X(dt){L&&dt.data&&dt._context.showTips&&(d.notifier(d._(dt,"Double-click to zoom back out"),"long"),L=!1)}function Q(dt,Tt){return"M"+(dt.l-.5)+","+(Tt-P-.5)+"h-3v"+(2*P+1)+"h3ZM"+(dt.r+.5)+","+(Tt-P-.5)+"h3v"+(2*P+1)+"h-3Z"}function ut(dt,Tt){return"M"+(Tt-P-.5)+","+(dt.t-.5)+"v-3h"+(2*P+1)+"v3ZM"+(Tt-P-.5)+","+(dt.b+.5)+"v3h"+(2*P+1)+"v-3Z"}function J(dt){var Tt=Math.floor(Math.min(dt.b-dt.t,dt.r-dt.l,P)/2);return"M"+(dt.l-3.5)+","+(dt.t-.5+Tt)+"h3v"+-Tt+"h"+Tt+"v-3h-"+(Tt+3)+"ZM"+(dt.r+3.5)+","+(dt.t-.5+Tt)+"h-3v"+-Tt+"h"+-Tt+"v-3h"+(Tt+3)+"ZM"+(dt.r+3.5)+","+(dt.b+.5-Tt)+"h-3v"+Tt+"h"+-Tt+"v3h"+(Tt+3)+"ZM"+(dt.l-3.5)+","+(dt.b+.5-Tt)+"h3v"+Tt+"h"+Tt+"v3h-"+(Tt+3)+"Z"}function q(dt,Tt,wt,It,Ct){for(var Nt=!1,ee={},Jt={},te,Kt,mt,bt,vt=(Ct||{}).xaHash,Ut=(Ct||{}).yaHash,re=0;re<Tt.length;re++){var Zt=Tt[re];for(te in wt)if(Zt[te]){for(mt in Zt)!(Ct&&(vt[mt]||Ut[mt]))&&!(mt.charAt(0)==="x"?wt:It)[mt]&&(ee[mt]=te);for(Kt in It)!(Ct&&(vt[Kt]||Ut[Kt]))&&Zt[Kt]&&(Nt=!0)}for(Kt in It)if(Zt[Kt])for(bt in Zt)!(Ct&&(vt[bt]||Ut[bt]))&&!(bt.charAt(0)==="x"?wt:It)[bt]&&(Jt[bt]=Kt)}Nt&&(d.extendFlat(ee,Jt),Jt={});var ue={},Me=[];for(mt in ee){var Ce=k(dt,mt);Me.push(Ce),ue[Ce._id]=Ce}var We={},qe=[];for(bt in Jt){var vr=k(dt,bt);qe.push(vr),We[vr._id]=vr}return{xaHash:ue,yaHash:We,xaxes:Me,yaxes:qe,xLinks:ee,yLinks:Jt,isSubplotConstrained:Nt}}function it(dt,Tt){if(!t)dt.onwheel!==void 0?dt.onwheel=Tt:dt.onmousewheel!==void 0?dt.onmousewheel=Tt:dt.isAddedWheelEvent||(dt.isAddedWheelEvent=!0,dt.addEventListener("wheel",Tt,{passive:!1}));else{var wt=dt.onwheel!==void 0?"wheel":"mousewheel";dt._onwheel&&dt.removeEventListener(wt,dt._onwheel),dt._onwheel=Tt,dt.addEventListener(wt,Tt,{passive:!1})}}function nt(dt){var Tt=[];for(var wt in dt)Tt.push(dt[wt]);return Tt}V.exports={makeDragBox:D,makeDragger:B,makeRectDragger:R,makeZoombox:ct,makeCorners:st,updateZoombox:et,xyCorners:J,transitionZoombox:K,removeZoombox:ot,showDoubleClickNotifier:X,attachWheelEventHandler:it}}),zb=Vt(Z=>{var V=Ni(),u=hc(),d=ih(),E=$h(),A=Eb().makeDragBox,t=Af().DRAGGERSIZE;Z.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"),f=a.split("y");return s[0]===f[0]?Number(s[1]||1)-Number(f[1]||1):Number(s[0]||1)-Number(f[0]||1)}return r._plots[o].mainplot?1:-1});i.forEach(function(o){var a=r._plots[o],s=a.xaxis,f=a.yaxis;if(!a.mainplot){var v=A(e,a,s._offset,f._offset,s._length,f._length,"ns","ew");v.onmousemove=function(w){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===o&&e._fullLayout._plots[o]&&u.hover(e,w,o)},u.hover(e,w,o),e._fullLayout._lasthover=v,e._fullLayout._hoversubplot=o},v.onmouseout=function(w){e._dragging||(e._fullLayout._hoversubplot=null,d.unhover(e,w))},e._context.showAxisDragHandles&&(A(e,a,s._offset-t,f._offset-t,t,t,"n","w"),A(e,a,s._offset+s._length,f._offset-t,t,t,"n","e"),A(e,a,s._offset-t,f._offset+f._length,t,t,"s","w"),A(e,a,s._offset+s._length,f._offset+f._length,t,t,"s","e"))}if(e._context.showAxisDragHandles){if(o===s._mainSubplot){var g=s._mainLinePosition;s.side==="top"&&(g-=t),A(e,a,s._offset+s._length*.1,g,s._length*.8,t,"","ew"),A(e,a,s._offset,g,s._length*.1,t,"","w"),A(e,a,s._offset+s._length*.9,g,s._length*.1,t,"","e")}if(o===f._mainSubplot){var m=f._mainLinePosition;f.side!=="right"&&(m-=t),A(e,a,m,f._offset+f._length*.1,t,f._length*.8,"ns",""),A(e,a,m,f._offset+f._length*.9,t,f._length*.1,"s",""),A(e,a,m,f._offset,t,f._length*.1,"n","")}}});var n=r._hoverlayer.node();n.onmousemove=function(o){o.target=e._fullLayout._lasthover,u.hover(e,o,r._hoversubplot)},n.onclick=function(o){o.target=e._fullLayout._lasthover,u.click(e,o)},n.onmousedown=function(o){e._fullLayout._lasthover.onmousedown(o)},Z.updateFx(e)}},Z.updateFx=function(e){var r=e._fullLayout,i=r.dragmode==="pan"?"move":"crosshair";E(r._draggers,i)}}),_k=Vt((Z,V)=>{var u=ji();V.exports=function(d){for(var E=u.layoutArrayContainers,A=u.layoutArrayRegexes,t=d.split("[")[0],e,r,i=0;i<A.length;i++)if(r=d.match(A[i]),r&&r.index===0){e=r[0];break}if(e||(e=E[E.indexOf(t)]),!e)return!1;var n=d.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:""}}}),bk=Vt(Z=>{var V=Fp(),u=Iy(),d=_d(),E=Fy().sorterAsc,A=ji();Z.containerArrayMatch=_k();var t=Z.isAddVal=function(r){return r==="add"||V(r)},e=Z.isRemoveVal=function(r){return r===null||r==="remove"};Z.applyContainerArrayChanges=function(r,i,n,o,a){var s=i.astr,f=A.getComponentMethod(s,"supplyLayoutDefaults"),v=A.getComponentMethod(s,"draw"),g=A.getComponentMethod(s,"drawOne"),m=o.replot||o.recalc||f===u||v===u,w=r.layout,l=r._fullLayout;if(n[""]){Object.keys(n).length>1&&d.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 d.warn("Unrecognized full array edit value",s,x),!0;return m?!1:(f(w,l),v(r),!0)}var y=Object.keys(n).map(Number).sort(E),S=i.get(),k=S||[],M=a(l,s).get(),T=[],c=-1,h=k.length,b,_,P,L,D,B,R,I;for(b=0;b<y.length;b++){if(P=y[b],L=n[P],D=Object.keys(L),B=L[""],R=t(B),P<0||P>k.length-(R?0:1)){d.warn("index out of range",s,P);continue}if(B!==void 0)D.length>1&&d.warn("Insertion & removal are incompatible with edits to the same index.",s,P),e(B)?T.push(P):R?(B==="add"&&(B={}),k.splice(P,0,B),M&&M.splice(P,0,{})):d.warn("Unrecognized full object edit value",s,P,B),c===-1&&(c=P);else for(_=0;_<D.length;_++)I=s+"["+P+"].",a(k[P],D[_],I).set(L[D[_]])}for(b=T.length-1;b>=0;b--)k.splice(T[b],1),M&&M.splice(T[b],1);if(k.length?S||i.set(k):i.set(null),m)return!1;if(f(w,l),g!==u){var F;if(c===-1)F=y;else{for(h=Math.max(k.length,h),F=[],b=0;b<y.length&&(P=y[b],!(P>=c));b++)F.push(P);for(b=c;b<h;b++)F.push(b)}for(b=0;b<F.length;b++)g(r,F[b])}else v(r);return!0}}),wk=Vt(Z=>{var V=Lo(),u=ji(),d=Xr(),E=Uu(),A=cc(),t=Pi(),e=A.cleanId,r=A.getFromTrace,i=u.traceIs,n=["x","y","z"];Z.clearPromiseQueue=function(l){Array.isArray(l._promises)&&l._promises.length>0&&d.log("Clearing previous rejected promises from queue."),l._promises=[]},Z.cleanLayout=function(l){var x;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var y=(E.subplotsRegistry.cartesian||{}).attrRegex;(E.subplotsRegistry.polar||{}).attrRegex,(E.subplotsRegistry.ternary||{}).attrRegex,(E.subplotsRegistry.gl3d||{}).attrRegex;var S=Object.keys(l);for(x=0;x<S.length;x++){var k=S[x];if(y&&y.test(k)){var M=l[k];M.anchor&&M.anchor!=="free"&&(M.anchor=e(M.anchor)),M.overlaying&&(M.overlaying=e(M.overlaying)),M.type||(M.isdate?M.type="date":M.islog?M.type="log":M.isdate===!1&&M.islog===!1&&(M.type="linear")),(M.autorange==="withzero"||M.autorange==="tozero")&&(M.autorange=!0,M.rangemode="tozero"),M.insiderange&&delete M.range,delete M.islog,delete M.isdate,delete M.categories,v(M,"domain")&&delete M.domain}}var T=Array.isArray(l.annotations)?l.annotations.length:0;for(x=0;x<T;x++){var c=l.annotations[x];d.isPlainObject(c)&&(o(c,"xref"),o(c,"yref"))}var h=Array.isArray(l.shapes)?l.shapes.length:0;for(x=0;x<h;x++){var b=l.shapes[x];d.isPlainObject(b)&&(o(b,"xref"),o(b,"yref"))}var _=Array.isArray(l.images)?l.images.length:0;for(x=0;x<_;x++){var P=l.images[x];d.isPlainObject(P)&&(o(P,"xref"),o(P,"yref"))}var L=l.legend;return L&&(L.x>3?(L.x=1.02,L.xanchor="left"):L.x<-2&&(L.x=-.02,L.xanchor="right"),L.y>3?(L.y=1.02,L.yanchor="bottom"):L.y<-2&&(L.y=-.02,L.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),t.clean(l),l.template&&l.template.layout&&Z.cleanLayout(l.template.layout),l};function o(l,x){var y=l[x],S=x.charAt(0);y&&y!=="paper"&&(l[x]=e(y,S,!0))}Z.cleanData=function(l){for(var x=0;x<l.length;x++){var y=l[x],S;if(y.type==="histogramy"&&"xbins"in y&&!("ybins"in y)&&(y.ybins=y.xbins,delete y.xbins),y.type==="histogramy"&&Z.swapXYData(y),(y.type==="histogramx"||y.type==="histogramy")&&(y.type="histogram"),"scl"in y&&!("colorscale"in y)&&(y.colorscale=y.scl,delete y.scl),"reversescl"in y&&!("reversescale"in y)&&(y.reversescale=y.reversescl,delete y.reversescl),y.xaxis&&(y.xaxis=e(y.xaxis,"x")),y.yaxis&&(y.yaxis=e(y.yaxis,"y")),i(y,"gl3d")&&y.scene&&(y.scene=E.subplotsRegistry.gl3d.cleanId(y.scene)),!i(y,"pie-like")&&!i(y,"bar-like"))if(Array.isArray(y.textposition))for(S=0;S<y.textposition.length;S++)y.textposition[S]=f(y.textposition[S]);else y.textposition&&(y.textposition=f(y.textposition));var k=u.getModule(y);if(k&&k.colorbar){var M=k.colorbar.container,T=M?y[M]:y;T&&T.colorscale&&(T.colorscale==="YIGnBu"&&(T.colorscale="YlGnBu"),T.colorscale==="YIOrRd"&&(T.colorscale="YlOrRd"))}if(y.type==="surface"&&d.isPlainObject(y.contours)){var c=["x","y","z"];for(S=0;S<c.length;S++){var h=y.contours[c[S]];d.isPlainObject(h)&&(h.highlightColor&&(h.highlightcolor=h.highlightColor,delete h.highlightColor),h.highlightWidth&&(h.highlightwidth=h.highlightWidth,delete h.highlightWidth))}}if(y.type==="candlestick"||y.type==="ohlc"){var b=(y.increasing||{}).showlegend!==!1,_=(y.decreasing||{}).showlegend!==!1,P=a(y.increasing),L=a(y.decreasing);if(P!==!1&&L!==!1){var D=s(P,L,b,_);D&&(y.name=D)}else(P||L)&&!y.name&&(y.name=P||L)}v(y,"line")&&delete y.line,"marker"in y&&(v(y.marker,"line")&&delete y.marker.line,v(y,"marker")&&delete y.marker),t.clean(y),y.autobinx&&(delete y.autobinx,delete y.xbins),y.autobiny&&(delete y.autobiny,delete y.ybins)}};function a(l){if(!d.isPlainObject(l))return!1;var x=l.name;return delete l.name,delete l.showlegend,(typeof x=="string"||typeof x=="number")&&String(x)}function s(l,x,y,S){if(y&&!S)return l;if(S&&!y||!l.trim())return x;if(!x.trim())return l;var k=Math.min(l.length,x.length),M;for(M=0;M<k&&l.charAt(M)===x.charAt(M);M++);var T=l.substr(0,M);return T.trim()}function f(l){var x="middle",y="center";return typeof l=="string"&&(l.indexOf("top")!==-1?x="top":l.indexOf("bottom")!==-1&&(x="bottom"),l.indexOf("left")!==-1?y="left":l.indexOf("right")!==-1&&(y="right")),x+" "+y}function v(l,x){return x in l&&typeof l[x]=="object"&&Object.keys(l[x]).length===0}Z.swapXYData=function(l){var x;if(d.swapAttrs(l,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(l.z)&&Array.isArray(l.z[0])&&(l.transpose?delete l.transpose:l.transpose=!0),l.error_x&&l.error_y){var y=l.error_y,S="copy_ystyle"in y?y.copy_ystyle:!(y.color||y.thickness||y.width);d.swapAttrs(l,["error_?.copy_ystyle"]),S&&d.swapAttrs(l,["error_?.color","error_?.thickness","error_?.width"])}if(typeof l.hoverinfo=="string"){var k=l.hoverinfo.split("+");for(x=0;x<k.length;x++)k[x]==="x"?k[x]="y":k[x]==="y"&&(k[x]="x");l.hoverinfo=k.join("+")}},Z.coerceTraceIndices=function(l,x){if(V(x))return[x];if(!Array.isArray(x)||!x.length)return l.data.map(function(k,M){return M});if(Array.isArray(x)){for(var y=[],S=0;S<x.length;S++)d.isIndex(x[S],l.data.length)?y.push(x[S]):d.warn("trace index (",x[S],") is not a number or is out of bounds");return y}return x},Z.manageArrayContainers=function(l,x,y){var S=l.obj,k=l.parts,M=k.length,T=k[M-1],c=V(T);if(c&&x===null){var h=k.slice(0,M-1).join("."),b=d.nestedProperty(S,h).get();b.splice(T,1)}else c&&l.get()===void 0&&l.get()===void 0&&(y[l.astr]=null),l.set(x)};var g=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function m(l){var x=l.search(g);if(x>0)return l.substr(0,x)}Z.hasParent=function(l,x){for(var y=m(x);y;){if(y in l)return!0;y=m(y)}return!1},Z.clearAxisTypes=function(l,x,y){for(var S=0;S<x.length;S++)for(var k=l._fullData[S],M=0;M<3;M++){var T=r(l,k,n[M]);if(T&&T.type!=="log"){var c=T._name,h=T._id.substr(1);if(h.substr(0,5)==="scene"){if(y[h]!==void 0)continue;c=h+"."+c}var b=c+".type";y[c]===void 0&&y[b]===void 0&&d.nestedProperty(l.layout,b).set(null)}}};var w=(l,x)=>{let y=(...S)=>S.every(k=>d.isPlainObject(k))||S.every(k=>Array.isArray(k));if([l,x].every(S=>Array.isArray(S))){if(l.length!==x.length)return!1;for(let S=0;S<l.length;S++){let k=l[S],M=x[S];if(k!==M&&!(y(k,M)&&w(k,M)))return!1}return!0}else if([l,x].every(S=>d.isPlainObject(S))){if(Object.keys(l).length!==Object.keys(x).length)return!1;for(let S in l){if(S.startsWith("_"))continue;let k=l[S],M=x[S];if(k!==M&&!(y(k,M)&&w(k,M)))return!1}return!0}return!1};Z.collectionsAreEqual=w}),Ky=Vt(Z=>{var V=Ni(),u=Lo(),d=rb(),E=Xr(),A=E.nestedProperty,t=mm(),e=jT(),r=ji(),i=gm(),n=Uu(),o=yo(),a=cb(),s=Pf(),f=Eo(),v=Pi(),g=zb().initInteractions,m=Eh(),w=Sc().clearOutline,l=n0().dfltConfig,x=bk(),y=wk(),S=Bg(),k=Cu(),M=Af().AX_NAME_PATTERN,T=0,c=5;function h(_t,lt,yt,St){var Ht;if(_t=E.getGraphDiv(_t),t.init(_t),E.isPlainObject(lt)){var Yt=lt;lt=Yt.data,yt=Yt.layout,St=Yt.config,Ht=Yt.frames}var se=t.triggerHandler(_t,"plotly_beforeplot",[lt,yt,St]);if(se===!1)return Promise.reject();!lt&&!yt&&!E.isPlotDiv(_t)&&E.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",_t);function ke(){if(Ht)return Z.addFrames(_t,Ht)}D(_t,St),yt||(yt={}),V.select(_t).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(_t._promises)||(_t._promises=[]);var Ee=(_t.data||[]).length===0&&Array.isArray(lt);Array.isArray(lt)&&(y.cleanData(lt),Ee?_t.data=lt:_t.data.push.apply(_t.data,lt),_t.empty=!1),(!_t.layout||Ee)&&(_t.layout=y.cleanLayout(yt)),n.supplyDefaults(_t);var Ue=_t._fullLayout,ir=Ue._has("cartesian");Ue._replotting=!0,(Ee||Ue._shouldCreateBgLayer)&&(qt(_t),Ue._shouldCreateBgLayer&&delete Ue._shouldCreateBgLayer),f.initGradients(_t),f.initPatterns(_t),Ee&&o.saveShowSpikeInitial(_t);var ar=!_t.calcdata||_t.calcdata.length!==(_t._fullData||[]).length;ar&&n.doCalcdata(_t);for(var Ye=0;Ye<_t.calcdata.length;Ye++)_t.calcdata[Ye][0].trace=_t._fullData[Ye];_t._context.responsive?_t._responsiveChartHandler||(_t._responsiveChartHandler=function(){E.isHidden(_t)||n.resize(_t)},window.addEventListener("resize",_t._responsiveChartHandler)):E.clearResponsive(_t);var Er=E.extendFlat({},Ue._size),pn=0;function dn(){for(var Re=Ue._basePlotModules,Ze=0;Ze<Re.length;Ze++)Re[Ze].drawFramework&&Re[Ze].drawFramework(_t);!Ue._glcanvas&&Ue._has("gl")&&(Ue._glcanvas=Ue._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(Yr){return Yr.key}),Ue._glcanvas.enter().append("canvas").attr("class",function(Yr){return"gl-canvas gl-canvas-"+Yr.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var tr=_t._context.plotGlPixelRatio;if(Ue._glcanvas){Ue._glcanvas.attr("width",Ue.width*tr).attr("height",Ue.height*tr).style("width",Ue.width+"px").style("height",Ue.height+"px");var zr=Ue._glcanvas.data()[0].regl;if(zr&&(Math.floor(Ue.width*tr)!==zr._gl.drawingBufferWidth||Math.floor(Ue.height*tr)!==zr._gl.drawingBufferHeight)){var tn="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(pn)E.error(tn);else return E.log(tn+" Clearing graph and plotting again."),n.cleanPlot([],{},_t._fullData,Ue),n.supplyDefaults(_t),Ue=_t._fullLayout,n.doCalcdata(_t),pn++,dn()}}return Ue.modebar.orientation==="h"?Ue._modebardiv.style("height",null).style("width","100%"):Ue._modebardiv.style("width",null).style("height",Ue.height+"px"),n.previousPromises(_t)}function bn(){if(n.clearAutoMarginIds(_t),S.drawMarginPushers(_t),o.allowAutoMargin(_t),_t._fullLayout.title.text&&_t._fullLayout.title.automargin&&n.allowAutoMargin(_t,"title.automargin"),Ue._has("pie"))for(var Re=_t._fullData,Ze=0;Ze<Re.length;Ze++){var tr=Re[Ze];tr.type==="pie"&&tr.automargin&&n.allowAutoMargin(_t,"pie."+tr.uid+".automargin")}return n.doAutoMargin(_t),n.previousPromises(_t)}function Zn(){if(n.didMarginChange(Er,Ue._size))return E.syncOrAsync([bn,S.layoutStyles],_t)}function En(){if(!ar){gn();return}return E.syncOrAsync([r.getComponentMethod("shapes","calcAutorange"),r.getComponentMethod("annotations","calcAutorange"),gn],_t)}function gn(){_t._transitioning||(S.doAutoRangeAndConstraints(_t),Ee&&o.saveRangeInitial(_t),r.getComponentMethod("rangeslider","calcAutorange")(_t))}function da(){return o.draw(_t,Ee?"":"redraw")}var ra=[n.previousPromises,ke,dn,bn,Zn];ir&&ra.push(En),ra.push(S.layoutStyles),ir&&ra.push(da,function(Re){var Ze=Re._fullLayout._insideTickLabelsUpdaterange;if(Ze)return Re._fullLayout._insideTickLabelsUpdaterange=void 0,Tt(Re,Ze).then(function(){o.saveRangeInitial(Re,!0)})}),ra.push(S.drawData,S.finalDraw,g,n.addLinks,n.rehover,n.redrag,n.reselect,n.doAutoMargin,n.previousPromises);var Se=E.syncOrAsync(ra,_t);return(!Se||!Se.then)&&(Se=Promise.resolve()),Se.then(function(){return b(_t),_t})}function b(_t){var lt=_t._fullLayout;lt._redrawFromAutoMarginCount?lt._redrawFromAutoMarginCount--:_t.emit("plotly_afterplot")}function _(_t){return E.extendFlat(l,_t)}function P(_t,lt){try{_t._fullLayout._paper.style("background",lt)}catch(yt){E.error(yt)}}function L(_t,lt){var yt=v.combine(lt,"white");P(_t,yt)}function D(_t,lt){if(!_t._context){_t._context=E.extendDeep({},l);var yt=V.select("base");_t._context._baseUrl=yt.size()&&yt.attr("href")?window.location.href.split("#")[0]:""}var St=_t._context,Ht,Yt,se;if(lt){for(Yt=Object.keys(lt),Ht=0;Ht<Yt.length;Ht++)se=Yt[Ht],!(se==="editable"||se==="edits")&&se in St&&(se==="setBackground"&&lt[se]==="opaque"?St[se]=L:St[se]=lt[se]);var ke=lt.editable;if(ke!==void 0)for(St.editable=ke,Yt=Object.keys(St.edits),Ht=0;Ht<Yt.length;Ht++)St.edits[Yt[Ht]]=ke;if(lt.edits)for(Yt=Object.keys(lt.edits),Ht=0;Ht<Yt.length;Ht++)se=Yt[Ht],se in St.edits&&(St.edits[se]=lt.edits[se]);St._exportedPlot=lt._exportedPlot}St.staticPlot&&(St.editable=!1,St.edits={},St.autosizable=!1,St.scrollZoom=!1,St.doubleClick=!1,St.showTips=!1,St.showLink=!1,St.displayModeBar=!1),St.displayModeBar==="hover"&&!d&&(St.displayModeBar=!0),(St.setBackground==="transparent"||typeof St.setBackground!="function")&&(St.setBackground=P),St._hasZeroHeight=St._hasZeroHeight||_t.clientHeight===0,St._hasZeroWidth=St._hasZeroWidth||_t.clientWidth===0;var Ee=St.scrollZoom,Ue=St._scrollZoom={};if(Ee===!0)Ue.cartesian=1,Ue.gl3d=1,Ue.geo=1,Ue.mapbox=1,Ue.map=1;else if(typeof Ee=="string"){var ir=Ee.split("+");for(Ht=0;Ht<ir.length;Ht++)Ue[ir[Ht]]=1}else Ee!==!1&&(Ue.gl3d=1,Ue.geo=1,Ue.mapbox=1,Ue.map=1)}function B(_t){if(_t=E.getGraphDiv(_t),!E.isPlotDiv(_t))throw new Error("This element is not a Plotly plot: "+_t);return y.cleanData(_t.data),y.cleanLayout(_t.layout),_t.calcdata=void 0,Z._doPlot(_t).then(function(){return _t.emit("plotly_redraw"),_t})}function R(_t,lt,yt,St){return _t=E.getGraphDiv(_t),n.cleanPlot([],{},_t._fullData||[],_t._fullLayout||{}),n.purge(_t),Z._doPlot(_t,lt,yt,St)}function I(_t,lt){var yt=lt+1,St=[],Ht,Yt;for(Ht=0;Ht<_t.length;Ht++)Yt=_t[Ht],Yt<0?St.push(yt+Yt):St.push(Yt);return St}function F(_t,lt,yt){var St,Ht;for(St=0;St<lt.length;St++){if(Ht=lt[St],Ht!==parseInt(Ht,10))throw new Error("all values in "+yt+" must be integers");if(Ht>=_t.data.length||Ht<-_t.data.length)throw new Error(yt+" must be valid indices for gd.data.");if(lt.indexOf(Ht,St+1)>-1||Ht>=0&&lt.indexOf(-_t.data.length+Ht)>-1||Ht<0&&lt.indexOf(_t.data.length+Ht)>-1)throw new Error("each index in "+yt+" must be unique.")}}function N(_t,lt,yt){if(!Array.isArray(_t.data))throw new Error("gd.data must be an array.");if(typeof lt>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(lt)||(lt=[lt]),F(_t,lt,"currentIndices"),typeof yt<"u"&&!Array.isArray(yt)&&(yt=[yt]),typeof yt<"u"&&F(_t,yt,"newIndices"),typeof yt<"u"&&lt.length!==yt.length)throw new Error("current and new indices must be of equal length.")}function j(_t,lt,yt){var St,Ht;if(!Array.isArray(_t.data))throw new Error("gd.data must be an array.");if(typeof lt>"u")throw new Error("traces must be defined.");for(Array.isArray(lt)||(lt=[lt]),St=0;St<lt.length;St++)if(Ht=lt[St],typeof Ht!="object"||Array.isArray(Ht)||Ht===null)throw new Error("all values in traces array must be non-array objects");if(typeof yt<"u"&&!Array.isArray(yt)&&(yt=[yt]),typeof yt<"u"&&yt.length!==lt.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function G(_t,lt,yt,St){var Ht=E.isPlainObject(St);if(!Array.isArray(_t.data))throw new Error("gd.data must be an array");if(!E.isPlainObject(lt))throw new Error("update must be a key:value object");if(typeof yt>"u")throw new Error("indices must be an integer or array of integers");F(_t,yt,"indices");for(var Yt in lt){if(!Array.isArray(lt[Yt])||lt[Yt].length!==yt.length)throw new Error("attribute "+Yt+" must be an array of length equal to indices array length");if(Ht&&(!(Yt in St)||!Array.isArray(St[Yt])||St[Yt].length!==lt[Yt].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function rt(_t,lt,yt,St){var Ht=E.isPlainObject(St),Yt=[],se,ke,Ee,Ue,ir;Array.isArray(yt)||(yt=[yt]),yt=I(yt,_t.data.length-1);for(var ar in lt)for(var Ye=0;Ye<yt.length;Ye++){if(se=_t.data[yt[Ye]],Ee=A(se,ar),ke=Ee.get(),Ue=lt[ar][Ye],!E.isArrayOrTypedArray(Ue))throw new Error("attribute: "+ar+" index: "+Ye+" must be an array");if(!E.isArrayOrTypedArray(ke))throw new Error("cannot extend missing or non-array attribute: "+ar);if(ke.constructor!==Ue.constructor)throw new Error("cannot extend array with an array of a different type: "+ar);ir=Ht?St[ar][Ye]:St,u(ir)||(ir=-1),Yt.push({prop:Ee,target:ke,insert:Ue,maxp:Math.floor(ir)})}return Yt}function ct(_t,lt,yt,St,Ht){G(_t,lt,yt,St);for(var Yt=rt(_t,lt,yt,St),se={},ke={},Ee=0;Ee<Yt.length;Ee++){var Ue=Yt[Ee].prop,ir=Yt[Ee].maxp,ar=Ht(Yt[Ee].target,Yt[Ee].insert,ir);Ue.set(ar[0]),Array.isArray(se[Ue.astr])||(se[Ue.astr]=[]),se[Ue.astr].push(ar[1]),Array.isArray(ke[Ue.astr])||(ke[Ue.astr]=[]),ke[Ue.astr].push(Yt[Ee].target.length)}return{update:se,maxPoints:ke}}function st(_t,lt){var yt=new _t.constructor(_t.length+lt.length);return yt.set(_t),yt.set(lt,_t.length),yt}function et(_t,lt,yt,St){_t=E.getGraphDiv(_t);function Ht(Ee,Ue,ir){var ar,Ye;if(E.isTypedArray(Ee))if(ir<0){var Er=new Ee.constructor(0),pn=st(Ee,Ue);ir<0?(ar=pn,Ye=Er):(ar=Er,Ye=pn)}else if(ar=new Ee.constructor(ir),Ye=new Ee.constructor(Ee.length+Ue.length-ir),ir===Ue.length)ar.set(Ue),Ye.set(Ee);else if(ir<Ue.length){var dn=Ue.length-ir;ar.set(Ue.subarray(dn)),Ye.set(Ee),Ye.set(Ue.subarray(0,dn),Ee.length)}else{var bn=ir-Ue.length,Zn=Ee.length-bn;ar.set(Ee.subarray(Zn)),ar.set(Ue,bn),Ye.set(Ee.subarray(0,Zn))}else ar=Ee.concat(Ue),Ye=ir>=0&&ir<ar.length?ar.splice(0,ar.length-ir):[];return[ar,Ye]}var Yt=ct(_t,lt,yt,St,Ht),se=Z.redraw(_t),ke=[_t,Yt.update,yt,Yt.maxPoints];return e.add(_t,Z.prependTraces,ke,et,arguments),se}function K(_t,lt,yt,St){_t=E.getGraphDiv(_t);function Ht(Ee,Ue,ir){var ar,Ye;if(E.isTypedArray(Ee))if(ir<=0){var Er=new Ee.constructor(0),pn=st(Ue,Ee);ir<0?(ar=pn,Ye=Er):(ar=Er,Ye=pn)}else if(ar=new Ee.constructor(ir),Ye=new Ee.constructor(Ee.length+Ue.length-ir),ir===Ue.length)ar.set(Ue),Ye.set(Ee);else if(ir<Ue.length){var dn=Ue.length-ir;ar.set(Ue.subarray(0,dn)),Ye.set(Ue.subarray(dn)),Ye.set(Ee,dn)}else{var bn=ir-Ue.length;ar.set(Ue),ar.set(Ee.subarray(0,bn),Ue.length),Ye.set(Ee.subarray(bn))}else ar=Ue.concat(Ee),Ye=ir>=0&&ir<ar.length?ar.splice(ir,ar.length):[];return[ar,Ye]}var Yt=ct(_t,lt,yt,St,Ht),se=Z.redraw(_t),ke=[_t,Yt.update,yt,Yt.maxPoints];return e.add(_t,Z.extendTraces,ke,K,arguments),se}function ot(_t,lt,yt){_t=E.getGraphDiv(_t);var St=[],Ht=Z.deleteTraces,Yt=ot,se=[_t,St],ke=[_t,lt],Ee,Ue;for(j(_t,lt,yt),Array.isArray(lt)||(lt=[lt]),lt=lt.map(function(ir){return E.extendFlat({},ir)}),y.cleanData(lt),Ee=0;Ee<lt.length;Ee++)_t.data.push(lt[Ee]);for(Ee=0;Ee<lt.length;Ee++)St.push(-lt.length+Ee);if(typeof yt>"u")return Ue=Z.redraw(_t),e.add(_t,Ht,se,Yt,ke),Ue;Array.isArray(yt)||(yt=[yt]);try{N(_t,St,yt)}catch(ir){throw _t.data.splice(_t.data.length-lt.length,lt.length),ir}return e.startSequence(_t),e.add(_t,Ht,se,Yt,ke),Ue=Z.moveTraces(_t,St,yt),e.stopSequence(_t),Ue}function X(_t,lt){_t=E.getGraphDiv(_t);var yt=[],St=Z.addTraces,Ht=X,Yt=[_t,yt,lt],se=[_t,lt],ke,Ee;if(typeof lt>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(lt)||(lt=[lt]),F(_t,lt,"indices"),lt=I(lt,_t.data.length-1),lt.sort(E.sorterDes),ke=0;ke<lt.length;ke+=1)Ee=_t.data.splice(lt[ke],1)[0],yt.push(Ee);var Ue=Z.redraw(_t);return e.add(_t,St,Yt,Ht,se),Ue}function Q(_t,lt,yt){_t=E.getGraphDiv(_t);var St=[],Ht=[],Yt=Q,se=Q,ke=[_t,yt,lt],Ee=[_t,lt,yt],Ue;if(N(_t,lt,yt),lt=Array.isArray(lt)?lt:[lt],typeof yt>"u")for(yt=[],Ue=0;Ue<lt.length;Ue++)yt.push(-lt.length+Ue);for(yt=Array.isArray(yt)?yt:[yt],lt=I(lt,_t.data.length-1),yt=I(yt,_t.data.length-1),Ue=0;Ue<_t.data.length;Ue++)lt.indexOf(Ue)===-1&&St.push(_t.data[Ue]);for(Ue=0;Ue<lt.length;Ue++)Ht.push({newIndex:yt[Ue],trace:_t.data[lt[Ue]]});for(Ht.sort(function(ar,Ye){return ar.newIndex-Ye.newIndex}),Ue=0;Ue<Ht.length;Ue+=1)St.splice(Ht[Ue].newIndex,0,Ht[Ue].trace);_t.data=St;var ir=Z.redraw(_t);return e.add(_t,Yt,ke,se,Ee),ir}function ut(_t,lt,yt,St){_t=E.getGraphDiv(_t),y.clearPromiseQueue(_t);var Ht={};if(typeof lt=="string")Ht[lt]=yt;else if(E.isPlainObject(lt))Ht=E.extendFlat({},lt),St===void 0&&(St=yt);else return E.warn("Restyle fail.",lt,yt,St),Promise.reject();Object.keys(Ht).length&&(_t.changed=!0);var Yt=y.coerceTraceIndices(_t,St),se=dt(_t,Ht,Yt),ke=se.flags;ke.calc&&(_t.calcdata=void 0),ke.clearAxisTypes&&y.clearAxisTypes(_t,Yt,{});var Ee=[];ke.fullReplot?Ee.push(Z._doPlot):(Ee.push(n.previousPromises),n.supplyDefaults(_t),ke.markerSize&&(n.doCalcdata(_t),It(Ee)),ke.style&&Ee.push(S.doTraceStyle),ke.colorbars&&Ee.push(S.doColorBars),Ee.push(b)),Ee.push(n.rehover,n.redrag,n.reselect),e.add(_t,ut,[_t,se.undoit,se.traces],ut,[_t,se.redoit,se.traces]);var Ue=E.syncOrAsync(Ee,_t);return(!Ue||!Ue.then)&&(Ue=Promise.resolve()),Ue.then(function(){return _t.emit("plotly_restyle",se.eventData),_t})}function J(_t){return _t===void 0?null:_t}function q(_t,lt){return lt?function(yt,St,Ht){var Yt=A(yt,St),se=Yt.set;return Yt.set=function(ke){var Ee=(Ht||"")+St;it(Ee,Yt.get(),ke,_t),se(ke)},Yt}:A}function it(_t,lt,yt,St){if(Array.isArray(lt)||Array.isArray(yt))for(var Ht=Array.isArray(lt)?lt:[],Yt=Array.isArray(yt)?yt:[],se=Math.max(Ht.length,Yt.length),ke=0;ke<se;ke++)it(_t+"["+ke+"]",Ht[ke],Yt[ke],St);else if(E.isPlainObject(lt)||E.isPlainObject(yt)){var Ee=E.isPlainObject(lt)?lt:{},Ue=E.isPlainObject(yt)?yt:{},ir=E.extendFlat({},Ee,Ue);for(var ar in ir)it(_t+"."+ar,Ee[ar],Ue[ar],St)}else St[_t]===void 0&&(St[_t]=J(lt))}function nt(_t,lt,yt){for(var St in yt){var Ht=A(_t,St);it(St,Ht.get(),yt[St],lt)}}function dt(_t,lt,yt){var St=_t._fullLayout,Ht=_t._fullData,Yt=_t.data,se=St._guiEditing,ke=q(St._preGUI,se),Ee=E.extendDeepAll({},lt),Ue,ir=k.traceFlags(),ar={},Ye={},Er;function pn(){return yt.map(function(){})}function dn(Ke){var xr=o.id2name(Ke);Er.indexOf(xr)===-1&&Er.push(xr)}function bn(Ke){return"LAYOUT"+Ke+".autorange"}function Zn(Ke){return"LAYOUT"+Ke+".range"}function En(Ke){for(var xr=Ke;xr<Ht.length;xr++)if(Ht[xr]._input===Yt[Ke])return Ht[xr]}function gn(Ke,xr,Gr){if(Array.isArray(Ke)){Ke.forEach(function(Qr){gn(Qr,xr,Gr)});return}if(!(Ke in lt||y.hasParent(lt,Ke))){var ln;if(Ke.substr(0,6)==="LAYOUT")ln=ke(_t.layout,Ke.replace("LAYOUT",""));else{var wn=yt[Gr],rn=St._tracePreGUI[En(wn)._fullInput.uid];ln=q(rn,se)(Yt[wn],Ke)}Ke in Ye||(Ye[Ke]=pn()),Ye[Ke][Gr]===void 0&&(Ye[Ke][Gr]=J(ln.get())),xr!==void 0&&ln.set(xr)}}function da(Ke){return function(xr){return Ht[xr][Ke]}}function ra(Ke){return function(xr,Gr){return xr===!1?Ht[yt[Gr]][Ke]:null}}for(var Se in lt){if(y.hasParent(lt,Se))throw new Error("cannot set "+Se+" and a parent attribute simultaneously");var Re=lt[Se],Ze,tr,zr,tn,Yr,$r;if((Se==="autobinx"||Se==="autobiny")&&(Se=Se.charAt(Se.length-1)+"bins",Array.isArray(Re)?Re=Re.map(ra(Se)):Re===!1?Re=yt.map(da(Se)):Re=null),ar[Se]=Re,Se.substr(0,6)==="LAYOUT"){zr=ke(_t.layout,Se.replace("LAYOUT","")),Ye[Se]=[J(zr.get())],zr.set(Array.isArray(Re)?Re[0]:Re),ir.calc=!0;continue}for(Ye[Se]=pn(),Ue=0;Ue<yt.length;Ue++){Ze=Yt[yt[Ue]],tr=En(yt[Ue]);var In=St._tracePreGUI[tr._fullInput.uid];if(zr=q(In,se)(Ze,Se),tn=zr.get(),Yr=Array.isArray(Re)?Re[Ue%Re.length]:Re,Yr!==void 0){var Nn=zr.parts[zr.parts.length-1],Kn=Se.substr(0,Se.length-Nn.length-1),$n=Kn?Kn+".":"",ia=Kn?A(tr,Kn).get():tr;if($r=i.getTraceValObject(tr,zr.parts),$r&&$r.impliedEdits&&Yr!==null)for(var Cn in $r.impliedEdits)gn(E.relativeAttr(Se,Cn),$r.impliedEdits[Cn],Ue);else if((Nn==="thicknessmode"||Nn==="lenmode")&&tn!==Yr&&(Yr==="fraction"||Yr==="pixels")&&ia){var Fa=St._size,Ga=ia.orient,ve=Ga==="top"||Ga==="bottom";if(Nn==="thicknessmode"){var ge=ve?Fa.h:Fa.w;gn($n+"thickness",ia.thickness*(Yr==="fraction"?1/ge:ge),Ue)}else{var dr=ve?Fa.w:Fa.h;gn($n+"len",ia.len*(Yr==="fraction"?1/dr:dr),Ue)}}else if(Se==="type"&&(Yr==="pie"!=(tn==="pie")||Yr==="funnelarea"!=(tn==="funnelarea"))){var br="x",Tr="y";(Yr==="bar"||tn==="bar")&&Ze.orientation==="h"&&(br="y",Tr="x"),E.swapAttrs(Ze,["?","?src"],"labels",br),E.swapAttrs(Ze,["d?","?0"],"label",br),E.swapAttrs(Ze,["?","?src"],"values",Tr),tn==="pie"||tn==="funnelarea"?(A(Ze,"marker.color").set(A(Ze,"marker.colors").get()),St._pielayer.selectAll("g.trace").remove()):r.traceIs(Ze,"cartesian")&&A(Ze,"marker.colors").set(A(Ze,"marker.color").get())}Ye[Se][Ue]=J(tn);var mr=["swapxy","swapxyaxes","orientation","orientationaxes"];if(mr.indexOf(Se)!==-1){if(Se==="orientation"){zr.set(Yr);var kr=Ze.x&&!Ze.y?"h":"v";if((zr.get()||kr)===tr.orientation)continue}else Se==="orientationaxes"&&(Ze.orientation={v:"h",h:"v"}[tr.orientation]);y.swapXYData(Ze),ir.calc=ir.clearAxisTypes=!0}else n.dataArrayContainers.indexOf(zr.parts[0])!==-1?(y.manageArrayContainers(zr,Yr,Ye),ir.calc=!0):($r?$r.arrayOk&&!r.traceIs(tr,"regl")&&(E.isArrayOrTypedArray(Yr)||E.isArrayOrTypedArray(tn))?ir.calc=!0:k.update(ir,$r):ir.calc=!0,zr.set(Yr))}}if(["swapxyaxes","orientationaxes"].indexOf(Se)!==-1&&o.swap(_t,yt),Se==="orientationaxes"){var Ur=A(_t.layout,"hovermode"),Or=Ur.get();Or==="x"?Ur.set("y"):Or==="y"?Ur.set("x"):Or==="x unified"?Ur.set("y unified"):Or==="y unified"&&Ur.set("x unified")}if(["orientation","type"].indexOf(Se)!==-1){for(Er=[],Ue=0;Ue<yt.length;Ue++){var pe=Yt[yt[Ue]];r.traceIs(pe,"cartesian")&&(dn(pe.xaxis||"x"),dn(pe.yaxis||"y"))}gn(Er.map(bn),!0,0),gn(Er.map(Zn),[0,1],0)}}return(ir.calc||ir.plot)&&(ir.fullReplot=!0),{flags:ir,undoit:Ye,redoit:ar,traces:yt,eventData:E.extendDeepNoArrays([],[Ee,yt])}}function Tt(_t,lt,yt){_t=E.getGraphDiv(_t),y.clearPromiseQueue(_t);var St={};if(typeof lt=="string")St[lt]=yt;else if(E.isPlainObject(lt))St=E.extendFlat({},lt);else return E.warn("Relayout fail.",lt,yt),Promise.reject();Object.keys(St).length&&(_t.changed=!0);var Ht=Jt(_t,St),Yt=Ht.flags;Yt.calc&&(_t.calcdata=void 0);var se=[n.previousPromises];Yt.layoutReplot?se.push(S.layoutReplot):Object.keys(St).length&&(wt(_t,Yt,Ht)||n.supplyDefaults(_t),Yt.legend&&se.push(S.doLegend),Yt.layoutstyle&&se.push(S.layoutStyles),Yt.axrange&&It(se,Ht.rangesAltered),Yt.ticks&&se.push(S.doTicksRelayout),Yt.modebar&&se.push(S.doModeBar),Yt.camera&&se.push(S.doCamera),Yt.colorbars&&se.push(S.doColorBars),se.push(b)),se.push(n.rehover,n.redrag,n.reselect),e.add(_t,Tt,[_t,Ht.undoit],Tt,[_t,Ht.redoit]);var ke=E.syncOrAsync(se,_t);return(!ke||!ke.then)&&(ke=Promise.resolve(_t)),ke.then(function(){return _t.emit("plotly_relayout",Ht.eventData),_t})}function wt(_t,lt,yt){var St=_t._fullLayout;if(!lt.axrange)return!1;for(var Ht in lt)if(Ht!=="axrange"&&lt[Ht])return!1;var Yt,se,ke=function(Er,pn){return E.coerce(Yt,se,s,Er,pn)},Ee={};for(var Ue in yt.rangesAltered){var ir=o.id2name(Ue);if(Yt=_t.layout[ir],se=St[ir],a(Yt,se,ke,Ee),se._matchGroup){for(var ar in se._matchGroup)if(ar!==Ue){var Ye=St[o.id2name(ar)];Ye.autorange=se.autorange,Ye.range=se.range.slice(),Ye._input.range=se.range.slice()}}}return!0}function It(_t,lt){var yt=lt?function(St){var Ht=[],Yt=!0;for(var se in lt){var ke=o.getFromId(St,se);if(Ht.push(se),(ke.ticklabelposition||"").indexOf("inside")!==-1&&ke._anchorAxis&&Ht.push(ke._anchorAxis._id),ke._matchGroup)for(var Ee in ke._matchGroup)lt[Ee]||Ht.push(Ee)}return o.draw(St,Ht,{skipTitle:Yt})}:function(St){return o.draw(St,"redraw")};_t.push(w,S.doAutoRangeAndConstraints,yt,S.drawData,S.finalDraw)}var Ct=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Nt=/^[xyz]axis[0-9]*\.autorange$/,ee=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Jt(_t,lt){var yt=_t.layout,St=_t._fullLayout,Ht=St._guiEditing,Yt=q(St._preGUI,Ht),se=Object.keys(lt),ke=o.list(_t),Ee=E.extendDeepAll({},lt),Ue={},ir,ar,Ye;for(se=Object.keys(lt),ar=0;ar<se.length;ar++)if(se[ar].indexOf("allaxes")===0){for(Ye=0;Ye<ke.length;Ye++){var Er=ke[Ye]._id.substr(1),pn=Er.indexOf("scene")!==-1?Er+".":"",dn=se[ar].replace("allaxes",pn+ke[Ye]._name);lt[dn]||(lt[dn]=lt[se[ar]])}delete lt[se[ar]]}var bn=k.layoutFlags(),Zn={},En={};function gn(rn,Qr){if(Array.isArray(rn)){rn.forEach(function(Oa){gn(Oa,Qr)});return}if(!(rn in lt||y.hasParent(lt,rn))){var vn=Yt(yt,rn);rn in En||(En[rn]=J(vn.get())),Qr!==void 0&&vn.set(Qr)}}var da={},ra;function Se(rn){var Qr=o.name2id(rn.split(".")[0]);return da[Qr]=1,Qr}for(var Re in lt){if(y.hasParent(lt,Re))throw new Error("cannot set "+Re+" and a parent attribute simultaneously");for(var Ze=Yt(yt,Re),tr=lt[Re],zr=Ze.parts.length,tn=zr-1;tn>0&&typeof Ze.parts[tn]!="string";)tn--;var Yr=Ze.parts[tn],$r=Ze.parts[tn-1]+"."+Yr,In=Ze.parts.slice(0,tn).join("."),Nn=A(_t.layout,In).get(),Kn=A(St,In).get(),$n=Ze.get();if(tr!==void 0){Zn[Re]=tr,En[Re]=Yr==="reverse"?tr:J($n);var ia=i.getLayoutValObject(St,Ze.parts);if(ia&&ia.impliedEdits&&tr!==null)for(var Cn in ia.impliedEdits)gn(E.relativeAttr(Re,Cn),ia.impliedEdits[Cn]);if(["width","height"].indexOf(Re)!==-1)if(tr){gn("autosize",null);var Fa=Re==="height"?"width":"height";gn(Fa,St[Fa])}else St[Re]=_t._initialAutoSize[Re];else if(Re==="autosize")gn("width",tr?null:St.width),gn("height",tr?null:St.height);else if($r.match(Ct))Se($r),A(St,In+"._inputRange").set(null);else if($r.match(Nt)){Se($r),A(St,In+"._inputRange").set(null);var Ga=A(St,In).get();Ga._inputDomain&&(Ga._input.domain=Ga._inputDomain.slice())}else $r.match(ee)&&A(St,In+"._inputDomain").set(null);if(Yr==="type"){ra=Nn;var ve=Kn.type==="linear"&&tr==="log",ge=Kn.type==="log"&&tr==="linear";if(ve||ge){if(!ra||!ra.range)gn(In+".autorange",!0);else if(Kn.autorange)ve&&(ra.range=ra.range[1]>ra.range[0]?[1,2]:[2,1]);else{var dr=ra.range[0],br=ra.range[1];ve?(dr<=0&&br<=0&&gn(In+".autorange",!0),dr<=0?dr=br/1e6:br<=0&&(br=dr/1e6),gn(In+".range[0]",Math.log(dr)/Math.LN10),gn(In+".range[1]",Math.log(br)/Math.LN10)):(gn(In+".range[0]",Math.pow(10,dr)),gn(In+".range[1]",Math.pow(10,br)))}Array.isArray(St._subplots.polar)&&St._subplots.polar.length&&St[Ze.parts[0]]&&Ze.parts[1]==="radialaxis"&&delete St[Ze.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(_t,Kn,tr,gn),r.getComponentMethod("images","convertCoords")(_t,Kn,tr,gn)}else gn(In+".autorange",!0),gn(In+".range",null);A(St,In+"._inputRange").set(null)}else if(Yr.match(M)){var Tr=A(St,Re).get(),mr=(tr||{}).type;(!mr||mr==="-")&&(mr="linear"),r.getComponentMethod("annotations","convertCoords")(_t,Tr,mr,gn),r.getComponentMethod("images","convertCoords")(_t,Tr,mr,gn)}var kr=x.containerArrayMatch(Re);if(kr){ir=kr.array,ar=kr.index;var Ur=kr.property,Or=ia||{editType:"calc"};ar!==""&&Ur===""&&(x.isAddVal(tr)?En[Re]=null:x.isRemoveVal(tr)?En[Re]=(A(yt,ir).get()||[])[ar]:E.warn("unrecognized full object value",lt)),k.update(bn,Or),Ue[ir]||(Ue[ir]={});var pe=Ue[ir][ar];pe||(pe=Ue[ir][ar]={}),pe[Ur]=tr,delete lt[Re]}else Yr==="reverse"?(Nn.range?Nn.range.reverse():(gn(In+".autorange",!0),Nn.range=[1,0]),Kn.autorange?bn.calc=!0:bn.plot=!0):(Re==="dragmode"&&(tr===!1&&$n!==!1||tr!==!1&&$n===!1)||St._has("scatter-like")&&St._has("regl")&&Re==="dragmode"&&(tr==="lasso"||tr==="select")&&!($n==="lasso"||$n==="select")?bn.plot=!0:ia?k.update(bn,ia):bn.calc=!0,Ze.set(tr))}}for(ir in Ue){var Ke=x.applyContainerArrayChanges(_t,Yt(yt,ir),Ue[ir],bn,Yt);Ke||(bn.plot=!0)}for(var xr in da){ra=o.getFromId(_t,xr);var Gr=ra&&ra._constraintGroup;if(Gr){bn.calc=!0;for(var ln in Gr)da[ln]||(o.getFromId(_t,ln)._constraintShrinkable=!0)}}(te(_t)||lt.height||lt.width)&&(bn.plot=!0);var wn=St.shapes;for(ar=0;ar<wn.length;ar++)if(wn[ar].showlegend){bn.calc=!0;break}return(bn.plot||bn.calc)&&(bn.layoutReplot=!0),{flags:bn,rangesAltered:da,undoit:En,redoit:Zn,eventData:Ee}}function te(_t){var lt=_t._fullLayout,yt=lt.width,St=lt.height;return _t.layout.autosize&&n.plotAutoSize(_t,_t.layout,lt),lt.width!==yt||lt.height!==St}function Kt(_t,lt,yt,St){_t=E.getGraphDiv(_t),y.clearPromiseQueue(_t),E.isPlainObject(lt)||(lt={}),E.isPlainObject(yt)||(yt={}),Object.keys(lt).length&&(_t.changed=!0),Object.keys(yt).length&&(_t.changed=!0);var Ht=y.coerceTraceIndices(_t,St),Yt=dt(_t,E.extendFlat({},lt),Ht),se=Yt.flags,ke=Jt(_t,E.extendFlat({},yt)),Ee=ke.flags;(se.calc||Ee.calc)&&(_t.calcdata=void 0),se.clearAxisTypes&&y.clearAxisTypes(_t,Ht,yt);var Ue=[];Ee.layoutReplot?Ue.push(S.layoutReplot):se.fullReplot?Ue.push(Z._doPlot):(Ue.push(n.previousPromises),wt(_t,Ee,ke)||n.supplyDefaults(_t),se.style&&Ue.push(S.doTraceStyle),(se.colorbars||Ee.colorbars)&&Ue.push(S.doColorBars),Ee.legend&&Ue.push(S.doLegend),Ee.layoutstyle&&Ue.push(S.layoutStyles),Ee.axrange&&It(Ue,ke.rangesAltered),Ee.ticks&&Ue.push(S.doTicksRelayout),Ee.modebar&&Ue.push(S.doModeBar),Ee.camera&&Ue.push(S.doCamera),Ue.push(b)),Ue.push(n.rehover,n.redrag,n.reselect),e.add(_t,Kt,[_t,Yt.undoit,ke.undoit,Yt.traces],Kt,[_t,Yt.redoit,ke.redoit,Yt.traces]);var ir=E.syncOrAsync(Ue,_t);return(!ir||!ir.then)&&(ir=Promise.resolve(_t)),ir.then(function(){return _t.emit("plotly_update",{data:Yt.eventData,layout:ke.eventData}),_t})}function mt(_t){return function(lt){lt._fullLayout._guiEditing=!0;var yt=_t.apply(null,arguments);return lt._fullLayout._guiEditing=!1,yt}}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(_t,lt){for(var yt=0;yt<lt.length;yt++){var St=lt[yt],Ht=_t.match(St.pattern);if(Ht){var Yt=Ht[1]||"";return{head:Yt,tail:_t.substr(Yt.length+1),attr:St.attr}}}}function re(_t,lt){var yt=A(lt,_t).get();if(yt!==void 0)return yt;var St=_t.split(".");for(St.pop();St.length>1;)if(St.pop(),yt=A(lt,St.join(".")+".uirevision").get(),yt!==void 0)return yt;return lt.uirevision}function Zt(_t,lt){for(var yt=0;yt<lt.length;yt++)if(lt[yt]._fullInput.uid===_t)return yt;return-1}function ue(_t,lt,yt){for(var St=0;St<lt.length;St++)if(lt[St].uid===_t)return St;return!lt[yt]||lt[yt].uid?-1:yt}function Me(_t,lt){var yt=E.isPlainObject(_t),St=Array.isArray(_t);return yt||St?(yt&&E.isPlainObject(lt)||St&&Array.isArray(lt))&&JSON.stringify(_t)===JSON.stringify(lt):_t===lt}function Ce(_t,lt,yt,St){var Ht=St._preGUI,Yt,se,ke,Ee,Ue,ir,ar,Ye,Er,pn,dn=[],bn={},Zn={};for(Yt in Ht){if(Ue=Ut(Yt,bt),Ue){if(Er=Ue.head,pn=Ue.tail,se=Ue.attr||Er+".uirevision",ke=A(St,se).get(),Ee=ke&&re(se,lt),Ee&&Ee===ke){if(ir=Ht[Yt],ir===null&&(ir=void 0),ar=A(lt,Yt),Ye=ar.get(),Me(Ye,ir)){Ye===void 0&&pn==="autorange"&&dn.push(Er),ar.set(J(A(St,Yt).get()));continue}else if(pn==="autorange"||pn.substr(0,6)==="range["){var En=Ht[Er+".range[0]"],gn=Ht[Er+".range[1]"],da=Ht[Er+".autorange"];if(da||da===null&&En===null&&gn===null){if(!(Er in bn)){var ra=A(lt,Er).get();bn[Er]=ra&&(ra.autorange||ra.autorange!==!1&&(!ra.range||ra.range.length!==2))}if(bn[Er]){ar.set(J(A(St,Yt).get()));continue}}}}}else E.warn("unrecognized GUI edit: "+Yt);delete Ht[Yt],Ue&&Ue.tail.substr(0,6)==="range["&&(Zn[Ue.head]=1)}for(var Se=0;Se<dn.length;Se++){var Re=dn[Se];if(Zn[Re]){var Ze=A(lt,Re).get();Ze&&delete Ze.autorange}}var tr=St._tracePreGUI;for(var zr in tr){var tn=tr[zr],Yr=null,$r;for(Yt in tn){if(!Yr){var In=Zt(zr,yt);if(In<0){delete tr[zr];break}var Nn=yt[In];$r=Nn._fullInput;var Kn=ue(zr,_t,$r.index);if(Kn<0){delete tr[zr];break}Yr=_t[Kn]}if(Ue=Ut(Yt,vt),Ue){if(Ue.attr?(ke=A(St,Ue.attr).get(),Ee=ke&&re(Ue.attr,lt)):(ke=$r.uirevision,Ee=Yr.uirevision,Ee===void 0&&(Ee=lt.uirevision)),Ee&&Ee===ke&&(ir=tn[Yt],ir===null&&(ir=void 0),ar=A(Yr,Yt),Ye=ar.get(),Me(Ye,ir))){ar.set(J(A($r,Yt).get()));continue}}else E.warn("unrecognized GUI edit: "+Yt+" in trace uid "+zr);delete tn[Yt]}}}function We(_t,lt,yt,St){var Ht,Yt;function se(){return Z.addFrames(_t,Ht)}_t=E.getGraphDiv(_t),y.clearPromiseQueue(_t);var ke=_t._fullData,Ee=_t._fullLayout;if(!E.isPlotDiv(_t)||!ke||!Ee)Yt=Z.newPlot(_t,lt,yt,St);else{if(E.isPlainObject(lt)){var Ue=lt;lt=Ue.data,yt=Ue.layout,St=Ue.config,Ht=Ue.frames}var ir=!1;if(St){let $r=E.extendDeepAll({},_t._context);_t._context=void 0,D(_t,St),ir=!y.collectionsAreEqual($r,_t._context)}if(ir){let $r=_t._ev.eventNames().map(In=>[In,_t._ev.listeners(In)]);Yt=Z.newPlot(_t,lt,yt,St).then(()=>{for(let[In,Nn]of $r)Nn.forEach(Kn=>_t.on(In,Kn));return Z.react(_t,lt,yt,St)})}else{_t.data=lt||[],y.cleanData(_t.data),_t.layout=yt||{},y.cleanLayout(_t.layout),Ce(_t.data,_t.layout,ke,Ee),n.supplyDefaults(_t,{skipUpdateCalc:!0});var ar=_t._fullData,Ye=_t._fullLayout,Er=Ye.datarevision===void 0,pn=Ye.transition,dn=vr(_t,Ee,Ye,Er,pn),bn=dn.newDataRevision,Zn=qe(_t,ke,ar,Er,pn,bn);if(te(_t)&&(dn.layoutReplot=!0),Zn.calc||dn.calc){_t.calcdata=void 0;for(var En=Object.getOwnPropertyNames(Ye),gn=0;gn<En.length;gn++){var da=En[gn],ra=da.substring(0,5);if(ra==="xaxis"||ra==="yaxis"){var Se=Ye[da]._emptyCategories;Se&&Se()}}}else n.supplyDefaultsUpdateCalc(_t.calcdata,ar);var Re=[];if(Ht&&(_t._transitionData={},n.createTransitionData(_t),Re.push(se)),Ye.transition&&(Zn.anim||dn.anim))dn.ticks&&Re.push(S.doTicksRelayout),n.doCalcdata(_t),S.doAutoRangeAndConstraints(_t),Re.push(function(){return n.transitionFromReact(_t,Zn,dn,Ee)});else if(Zn.fullReplot||dn.layoutReplot)_t._fullLayout._skipDefaults=!0,Re.push(Z._doPlot);else{for(var Ze in dn.arrays){var tr=dn.arrays[Ze];if(tr.length){var zr=r.getComponentMethod(Ze,"drawOne");if(zr!==E.noop)for(var tn=0;tn<tr.length;tn++)zr(_t,tr[tn]);else{var Yr=r.getComponentMethod(Ze,"draw");if(Yr===E.noop)throw new Error("cannot draw components: "+Ze);Yr(_t)}}}Re.push(n.previousPromises),Zn.style&&Re.push(S.doTraceStyle),(Zn.colorbars||dn.colorbars)&&Re.push(S.doColorBars),dn.legend&&Re.push(S.doLegend),dn.layoutstyle&&Re.push(S.layoutStyles),dn.axrange&&It(Re),dn.ticks&&Re.push(S.doTicksRelayout),dn.modebar&&Re.push(S.doModeBar),dn.camera&&Re.push(S.doCamera),Re.push(b)}Re.push(n.rehover,n.redrag,n.reselect),Yt=E.syncOrAsync(Re,_t),(!Yt||!Yt.then)&&(Yt=Promise.resolve(_t))}}return Yt.then(()=>(ir||_t.emit("plotly_react",{config:St,data:lt,layout:yt}),_t))}function qe(_t,lt,yt,St,Ht,Yt){var se=lt.length===yt.length;if(!Ht&&!se)return{fullReplot:!0,calc:!0};var ke=k.traceFlags();ke.arrays={},ke.nChanges=0,ke.nChangesAnim=0;var Ee,Ue;function ir(Er){var pn=i.getTraceValObject(Ue,Er);return!Ue._module.animatable&&pn.anim&&(pn.anim=!1),pn}var ar={getValObject:ir,flags:ke,immutable:St,transition:Ht,newDataRevision:Yt,gd:_t},Ye={};for(Ee=0;Ee<lt.length;Ee++)if(yt[Ee]){if(Ue=yt[Ee]._fullInput,Ye[Ue.uid])continue;Ye[Ue.uid]=1,_r(lt[Ee]._fullInput,Ue,[],ar)}return(ke.calc||ke.plot)&&(ke.fullReplot=!0),Ht&&ke.nChanges&&ke.nChangesAnim&&(ke.anim=ke.nChanges===ke.nChangesAnim&&se?"all":"some"),ke}function vr(_t,lt,yt,St,Ht){var Yt=k.layoutFlags();Yt.arrays={},Yt.rangesAltered={},Yt.nChanges=0,Yt.nChangesAnim=0;function se(Ye){return i.getLayoutValObject(yt,Ye)}for(var ke in yt)if(!(!ke.startsWith("xaxis")&&!ke.startsWith("yaxis"))&&lt[ke]){var Ee=yt[ke].domain,Ue=lt[ke].domain,ir=lt[ke]._inputDomain;lt[ke]._inputDomain&&(Ee[0]===ir[0]&&Ee[1]===ir[1]?yt[ke].domain=lt[ke].domain:(Ee[0]!==Ue[0]||Ee[1]!==Ue[1])&&(yt[ke]._inputDomain=null))}var ar={getValObject:se,flags:Yt,immutable:St,transition:Ht,gd:_t};return _r(lt,yt,[],ar),(Yt.plot||Yt.calc)&&(Yt.layoutReplot=!0),Ht&&Yt.nChanges&&Yt.nChangesAnim&&(Yt.anim=Yt.nChanges===Yt.nChangesAnim?"all":"some"),Yt}function _r(_t,lt,yt,St){var Ht,Yt,se,ke=St.getValObject,Ee=St.flags,Ue=St.immutable,ir=St.inArray,ar=St.arrayIndex;function Ye(){var In=Ht.editType;if(ir&&In.indexOf("arraydraw")!==-1){E.pushUnique(Ee.arrays[ir],ar);return}k.update(Ee,Ht),In!=="none"&&Ee.nChanges++,St.transition&&Ht.anim&&Ee.nChangesAnim++,(Ct.test(se)||Nt.test(se))&&(Ee.rangesAltered[yt[0]]=1),Yt==="datarevision"&&(Ee.newDataRevision=1)}function Er(In){return In.valType==="data_array"||In.arrayOk}for(Yt in _t){if(Ee.calc&&!St.transition)return;var pn=_t[Yt],dn=lt[Yt],bn=yt.concat(Yt);if(se=bn.join("."),!(Yt.charAt(0)==="_"||typeof pn=="function"||pn===dn)){if((Yt==="tick0"||Yt==="dtick")&&yt[0]!=="geo"){var Zn=lt.tickmode;if(Zn==="auto"||Zn==="array"||!Zn)continue}if(!(Yt==="range"&&lt.autorange)&&!((Yt==="zmin"||Yt==="zmax")&&lt.type==="contourcarpet")&&(Ht=ke(bn),!!Ht&&!(Ht._compareAsJSON&&JSON.stringify(pn)===JSON.stringify(dn)))){var En=Ht.valType,gn,da=Er(Ht),ra=Array.isArray(pn),Se=Array.isArray(dn);if(ra&&Se){var Re="_input_"+Yt,Ze=_t[Re],tr=lt[Re];if(Array.isArray(Ze)&&Ze===tr)continue}if(dn===void 0)da&&ra?Ee.calc=!0:Ye();else if(Ht._isLinkedToArray){var zr=[],tn=!1;ir||(Ee.arrays[Yt]=zr);var Yr=Math.min(pn.length,dn.length),$r=Math.max(pn.length,dn.length);if(Yr!==$r)if(Ht.editType==="arraydraw")tn=!0;else{Ye();continue}for(gn=0;gn<Yr;gn++)_r(pn[gn],dn[gn],bn.concat(gn),E.extendFlat({inArray:Yt,arrayIndex:gn},St));if(tn)for(gn=Yr;gn<$r;gn++)zr.push(gn)}else!En&&E.isPlainObject(pn)?_r(pn,dn,bn,St):da?ra&&Se?(Ue&&(Ee.calc=!0),(Ue||St.newDataRevision)&&Ye()):ra!==Se?Ee.calc=!0:Ye():ra&&Se?(pn.length!==dn.length||String(pn)!==String(dn))&&Ye():Ye()}}}for(Yt in lt)if(!(Yt in _t||Yt.charAt(0)==="_"||typeof lt[Yt]=="function"))if(Ht=ke(yt.concat(Yt)),Er(Ht)&&Array.isArray(lt[Yt])){Ee.calc=!0;return}else Ye()}function er(_t,lt,yt){if(_t=E.getGraphDiv(_t),!E.isPlotDiv(_t))throw new Error("This element is not a Plotly plot: "+_t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var St=_t._transitionData;St._frameQueue||(St._frameQueue=[]),yt=n.supplyAnimationDefaults(yt);var Ht=yt.transition,Yt=yt.frame;St._frameWaitingCnt===void 0&&(St._frameWaitingCnt=0);function se(Ue){return Array.isArray(Ht)?Ue>=Ht.length?Ht[0]:Ht[Ue]:Ht}function ke(Ue){return Array.isArray(Yt)?Ue>=Yt.length?Yt[0]:Yt[Ue]:Yt}function Ee(Ue,ir){var ar=0;return function(){if(Ue&&++ar===ir)return Ue()}}return new Promise(function(Ue,ir){function ar(){if(St._frameQueue.length!==0){for(;St._frameQueue.length;){var Yr=St._frameQueue.pop();Yr.onInterrupt&&Yr.onInterrupt()}_t.emit("plotly_animationinterrupted",[])}}function Ye(Yr){if(Yr.length!==0){for(var $r=0;$r<Yr.length;$r++){var In;Yr[$r].type==="byname"?In=n.computeFrame(_t,Yr[$r].name):In=Yr[$r].data;var Nn=ke($r),Kn=se($r);Kn.duration=Math.min(Kn.duration,Nn.duration);var $n={frame:In,name:Yr[$r].name,frameOpts:Nn,transitionOpts:Kn};$r===Yr.length-1&&($n.onComplete=Ee(Ue,2),$n.onInterrupt=ir),St._frameQueue.push($n)}yt.mode==="immediate"&&(St._lastFrameAt=-1/0),St._animationRaf||dn()}}function Er(){_t.emit("plotly_animated"),window.cancelAnimationFrame(St._animationRaf),St._animationRaf=null}function pn(){St._currentFrame&&St._currentFrame.onComplete&&St._currentFrame.onComplete();var Yr=St._currentFrame=St._frameQueue.shift();if(Yr){var $r=Yr.name?Yr.name.toString():null;_t._fullLayout._currentFrame=$r,St._lastFrameAt=Date.now(),St._timeToNext=Yr.frameOpts.duration,n.transition(_t,Yr.frame.data,Yr.frame.layout,y.coerceTraceIndices(_t,Yr.frame.traces),Yr.frameOpts,Yr.transitionOpts).then(function(){Yr.onComplete&&Yr.onComplete()}),_t.emit("plotly_animatingframe",{name:$r,frame:Yr.frame,animation:{frame:Yr.frameOpts,transition:Yr.transitionOpts}})}else Er()}function dn(){_t.emit("plotly_animating"),St._lastFrameAt=-1/0,St._timeToNext=0,St._runningTransitions=0,St._currentFrame=null;var Yr=function(){St._animationRaf=window.requestAnimationFrame(Yr),Date.now()-St._lastFrameAt>St._timeToNext&&pn()};Yr()}var bn=0;function Zn(Yr){return Array.isArray(Ht)?bn>=Ht.length?Yr.transitionOpts=Ht[bn]:Yr.transitionOpts=Ht[0]:Yr.transitionOpts=Ht,bn++,Yr}var En,gn,da=[],ra=lt==null,Se=Array.isArray(lt),Re=!ra&&!Se&&E.isPlainObject(lt);if(Re)da.push({type:"object",data:Zn(E.extendFlat({},lt))});else if(ra||["string","number"].indexOf(typeof lt)!==-1)for(En=0;En<St._frames.length;En++)gn=St._frames[En],gn&&(ra||String(gn.group)===String(lt))&&da.push({type:"byname",name:String(gn.name),data:Zn({name:gn.name})});else if(Se)for(En=0;En<lt.length;En++){var Ze=lt[En];["number","string"].indexOf(typeof Ze)!==-1?(Ze=String(Ze),da.push({type:"byname",name:Ze,data:Zn({name:Ze})})):E.isPlainObject(Ze)&&da.push({type:"object",data:Zn(E.extendFlat({},Ze))})}for(En=0;En<da.length;En++)if(gn=da[En],gn.type==="byname"&&!St._frameHash[gn.data.name]){E.warn('animate failure: frame not found: "'+gn.data.name+'"'),ir();return}["next","immediate"].indexOf(yt.mode)!==-1&&ar(),yt.direction==="reverse"&&da.reverse();var tr=_t._fullLayout._currentFrame;if(tr&&yt.fromcurrent){var zr=-1;for(En=0;En<da.length;En++)if(gn=da[En],gn.type==="byname"&&gn.name===tr){zr=En;break}if(zr>0&&zr<da.length-1){var tn=[];for(En=0;En<da.length;En++)gn=da[En],(da[En].type!=="byname"||En>zr)&&tn.push(gn);da=tn}}da.length>0?Ye(da):(_t.emit("plotly_animated"),Ue())})}function Mr(_t,lt,yt){if(_t=E.getGraphDiv(_t),lt==null)return Promise.resolve();if(!E.isPlotDiv(_t))throw new Error("This element is not a Plotly plot: "+_t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var St,Ht,Yt,se,ke=_t._transitionData._frames,Ee=_t._transitionData._frameHash;if(!Array.isArray(lt))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+lt);var Ue=ke.length+lt.length*2,ir=[],ar={};for(St=lt.length-1;St>=0;St--)if(E.isPlainObject(lt[St])){var Ye=lt[St].name,Er=(Ee[Ye]||ar[Ye]||{}).name,pn=lt[St].name,dn=Ee[Er]||ar[Er];Er&&pn&&typeof pn=="number"&&dn&&T<c&&(T++,E.warn('addFrames: overwriting frame "'+(Ee[Er]||ar[Er]).name+'" with a frame whose name of type "number" also equates to "'+Er+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),T===c&&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.")),ar[Ye]={name:Ye},ir.push({frame:n.supplyFrameDefaults(lt[St]),index:yt&&yt[St]!==void 0&&yt[St]!==null?yt[St]:Ue+St})}ir.sort(function(Re,Ze){return Re.index>Ze.index?-1:Re.index<Ze.index?1:0});var bn=[],Zn=[],En=ke.length;for(St=ir.length-1;St>=0;St--){if(Ht=ir[St].frame,typeof Ht.name=="number"&&E.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Ht.name)for(;Ee[Ht.name="frame "+_t._transitionData._counter++];);if(Ee[Ht.name]){for(Yt=0;Yt<ke.length&&(ke[Yt]||{}).name!==Ht.name;Yt++);bn.push({type:"replace",index:Yt,value:Ht}),Zn.unshift({type:"replace",index:Yt,value:ke[Yt]})}else se=Math.max(0,Math.min(ir[St].index,En)),bn.push({type:"insert",index:se,value:Ht}),Zn.unshift({type:"delete",index:se}),En++}var gn=n.modifyFrames,da=n.modifyFrames,ra=[_t,Zn],Se=[_t,bn];return e&&e.add(_t,gn,ra,da,Se),n.modifyFrames(_t,bn)}function Ir(_t,lt){if(_t=E.getGraphDiv(_t),!E.isPlotDiv(_t))throw new Error("This element is not a Plotly plot: "+_t);var yt,St,Ht=_t._transitionData._frames,Yt=[],se=[];if(!lt)for(lt=[],yt=0;yt<Ht.length;yt++)lt.push(yt);for(lt=lt.slice(),lt.sort(),yt=lt.length-1;yt>=0;yt--)St=lt[yt],Yt.push({type:"delete",index:St}),se.unshift({type:"insert",index:St,value:Ht[St]});var ke=n.modifyFrames,Ee=n.modifyFrames,Ue=[_t,se],ir=[_t,Yt];return e&&e.add(_t,ke,Ue,Ee,ir),n.modifyFrames(_t,Yt)}function de(_t){_t=E.getGraphDiv(_t);var lt=_t._fullLayout||{},yt=_t._fullData||[];return n.cleanPlot([],{},yt,lt),n.purge(_t),t.purge(_t),lt._container&&lt._container.remove(),delete _t._context,_t}function Dt(_t){var lt=_t._fullLayout,yt=_t.getBoundingClientRect();if(!E.equalDomRects(yt,lt._lastBBox)){var St=lt._invTransform=E.inverseTransformMatrix(E.getFullTransformMatrix(_t));lt._invScaleX=Math.sqrt(St[0][0]*St[0][0]+St[0][1]*St[0][1]+St[0][2]*St[0][2]),lt._invScaleY=Math.sqrt(St[1][0]*St[1][0]+St[1][1]*St[1][1]+St[1][2]*St[1][2]),lt._lastBBox=yt}}function qt(_t){var lt=V.select(_t),yt=_t._fullLayout;if(yt._calcInverseTransform=Dt,yt._calcInverseTransform(_t),yt._container=lt.selectAll(".plot-container").data([0]),yt._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),yt._paperdiv=yt._container.selectAll(".svg-container").data([0]),yt._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),yt._glcontainer=yt._paperdiv.selectAll(".gl-container").data([{}]),yt._glcontainer.enter().append("div").classed("gl-container",!0),yt._paperdiv.selectAll(".main-svg").remove(),yt._paperdiv.select(".modebar-container").remove(),yt._paper=yt._paperdiv.insert("svg",":first-child").classed("main-svg",!0),yt._toppaper=yt._paperdiv.append("svg").classed("main-svg",!0),yt._modebardiv=yt._paperdiv.append("div"),delete yt._modeBar,yt._hoverpaper=yt._paperdiv.append("svg").classed("main-svg",!0),!yt._uid){var St={};V.selectAll("defs").each(function(){this.id&&(St[this.id.split("-")[1]]=1)}),yt._uid=E.randstr(St)}yt._paperdiv.selectAll(".main-svg").attr(m.svgAttrs),yt._defs=yt._paper.append("defs").attr("id","defs-"+yt._uid),yt._clips=yt._defs.append("g").classed("clips",!0),yt._topdefs=yt._toppaper.append("defs").attr("id","topdefs-"+yt._uid),yt._topclips=yt._topdefs.append("g").classed("clips",!0),yt._bgLayer=yt._paper.append("g").classed("bglayer",!0),yt._draggers=yt._paper.append("g").classed("draglayer",!0);var Ht=yt._paper.append("g").classed("layer-below",!0);yt._imageLowerLayer=Ht.append("g").classed("imagelayer",!0),yt._shapeLowerLayer=Ht.append("g").classed("shapelayer",!0),yt._cartesianlayer=yt._paper.append("g").classed("cartesianlayer",!0),yt._polarlayer=yt._paper.append("g").classed("polarlayer",!0),yt._smithlayer=yt._paper.append("g").classed("smithlayer",!0),yt._ternarylayer=yt._paper.append("g").classed("ternarylayer",!0),yt._geolayer=yt._paper.append("g").classed("geolayer",!0),yt._funnelarealayer=yt._paper.append("g").classed("funnelarealayer",!0),yt._pielayer=yt._paper.append("g").classed("pielayer",!0),yt._iciclelayer=yt._paper.append("g").classed("iciclelayer",!0),yt._treemaplayer=yt._paper.append("g").classed("treemaplayer",!0),yt._sunburstlayer=yt._paper.append("g").classed("sunburstlayer",!0),yt._indicatorlayer=yt._toppaper.append("g").classed("indicatorlayer",!0),yt._glimages=yt._paper.append("g").classed("glimages",!0);var Yt=yt._toppaper.append("g").classed("layer-above",!0);yt._imageUpperLayer=Yt.append("g").classed("imagelayer",!0),yt._shapeUpperLayer=Yt.append("g").classed("shapelayer",!0),yt._selectionLayer=yt._toppaper.append("g").classed("selectionlayer",!0),yt._infolayer=yt._toppaper.append("g").classed("infolayer",!0),yt._menulayer=yt._toppaper.append("g").classed("menulayer",!0),yt._zoomlayer=yt._toppaper.append("g").classed("zoomlayer",!0),yt._hoverlayer=yt._hoverpaper.append("g").classed("hoverlayer",!0),yt._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),_t.emit("plotly_framework")}Z.animate=er,Z.addFrames=Mr,Z.deleteFrames=Ir,Z.addTraces=ot,Z.deleteTraces=X,Z.extendTraces=et,Z.moveTraces=Q,Z.prependTraces=K,Z.newPlot=R,Z._doPlot=h,Z.purge=de,Z.react=We,Z.redraw=B,Z.relayout=Tt,Z.restyle=ut,Z.setPlotConfig=_,Z.update=Kt,Z._guiRelayout=mt(Tt),Z._guiRestyle=mt(ut),Z._guiUpdate=mt(Kt),Z._storeDirectGUIEdit=nt}),Bp=Vt(Z=>{var V=ji();Z.getDelay=function(E){return E._has&&(E._has("gl3d")||E._has("mapbox")||E._has("map"))?500:0},Z.getRedrawFunc=function(E){return function(){V.getComponentMethod("colorbar","draw")(E)}},Z.encodeSVG=function(E){return"data:image/svg+xml,"+encodeURIComponent(E)},Z.encodeJSON=function(E){return"data:application/json,"+encodeURIComponent(E)};var u=window.URL||window.webkitURL;Z.createObjectURL=function(E){return u.createObjectURL(E)},Z.revokeObjectURL=function(E){return u.revokeObjectURL(E)},Z.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=d(window.atob(E));return new window.Blob([t],{type:"image/"+A})},Z.octetStream=function(E){document.location.href="data:application/octet-stream"+E};function d(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}Z.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}),Yy=Vt((Z,V)=>{var u=Ni();Xr();var d=Eo(),E=Pi();Eh();var A=/"/g,t="TOBESTRIPPED",e=new RegExp('("'+t+")|("+t+'")',"g");function r(n){var o=u.select("body").append("div").style({display:"none"}).html(""),a=n.replace(/(&[^;]*;)/gi,function(s){return s==="&lt;"?"&#60;":s==="&rt;"?"&#62;":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,"&amp;")}V.exports=function(n,o,a){var s=n._fullLayout,f=s._paper,v=s._toppaper,g=s.width,m=s.height,w;f.insert("rect",":first-child").call(d.setRect,0,0,g,m).call(E.fill,s.paper_bgcolor);var l=s._basePlotModules||[];for(w=0;w<l.length;w++){var x=l[w];x.toSVG&&x.toSVG(n)}if(v){var y=v.node().childNodes,S=Array.prototype.slice.call(y);for(w=0;w<S.length;w++){var k=S[w];k.childNodes.length&&f.node().appendChild(k)}}s._draggers&&s._draggers.remove(),f.node().style.background="",f.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var T=u.select(this);if(this.style.visibility==="hidden"||this.style.display==="none"){T.remove();return}else T.style({visibility:null,display:null});var c=this.style.fontFamily;c&&c.indexOf('"')!==-1&&T.style("font-family",c.replace(A,t));var h=this.style.fontWeight;h&&(h==="normal"||h==="400")&&T.style("font-weight",void 0);var b=this.style.fontStyle;b&&b==="normal"&&T.style("font-style",void 0);var _=this.style.fontVariant;_&&_==="normal"&&T.style("font-variant",void 0)}),f.selectAll(".gradient_filled,.pattern_filled").each(function(){var T=u.select(this),c=this.style.fill;c&&c.indexOf("url(")!==-1&&T.style("fill",c.replace(A,t));var h=this.style.stroke;h&&h.indexOf("url(")!==-1&&T.style("stroke",h.replace(A,t))}),(o==="pdf"||o==="eps")&&f.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),o==="svg"&&a&&(f.attr("width",a*g),f.attr("height",a*m),f.attr("viewBox","0 0 "+g+" "+m));var M=new window.XMLSerializer().serializeToString(f.node());return M=r(M),M=i(M),M=M.replace(e,"'"),M}}),Xy=Vt((Z,V)=>{var u=Xr(),d=a0().EventEmitter,E=Bp();function A(t){var e=t.emitter||new d,r=new Promise(function(i,n){var o=window.Image,a=t.svg,s=t.format||"png",f=t.canvas,v=t.scale||1,g=t.width||300,m=t.height||150,w=v*g,l=v*m,x=f.getContext("2d",{willReadFrequently:!0}),y=new o,S,k;s==="svg"||u.isSafari()?k=E.encodeSVG(a):(S=E.createBlob(a,"svg"),k=E.createObjectURL(S)),f.width=w,f.height=l,y.onload=function(){var M;switch(S=null,E.revokeObjectURL(k),s!=="svg"&&x.drawImage(y,0,0,w,l),s){case"jpeg":M=f.toDataURL("image/jpeg");break;case"png":M=f.toDataURL("image/png");break;case"webp":M=f.toDataURL("image/webp");break;case"svg":M=k;break;default:var T="Image format is not jpeg, png, svg or webp.";if(n(new Error(T)),!t.promise)return e.emit("error",T)}i(M),t.promise||e.emit("success",M)},y.onerror=function(M){if(S=null,E.revokeObjectURL(k),n(M),!t.promise)return e.emit("error",M)},y.src=k});return t.promise?r:e}V.exports=A}),Lb=Vt((Z,V)=>{var u=Lo(),d=Ky(),E=Uu(),A=Xr(),t=Bp(),e=Yy(),r=Xy(),i=Ly().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 f,v,g,m;A.isPlainObject(a)?(f=a.data||[],v=a.layout||{},g=a.config||{},m={}):(a=A.getGraphDiv(a),f=A.extendDeep([],a.data),v=A.extendDeep({},a.layout),g=a._context,m=a._fullLayout||{});function w(R){return!(R in s)||A.validate(s[R],n[R])}if(!w("width")&&s.width!==null||!w("height")&&s.height!==null)throw new Error("Height and width should be pixel values.");if(!w("format"))throw new Error("Export format is not "+A.join2(n.format.values,", "," or ")+".");var l={};function x(R,I){return A.coerce(s,l,n,R,I)}var y=x("format"),S=x("width"),k=x("height"),M=x("scale"),T=x("setBackground"),c=x("imageDataOnly"),h=document.createElement("div");h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var b=A.extendFlat({},v);S?b.width=S:s.width===null&&u(m.width)&&(b.width=m.width),k?b.height=k:s.height===null&&u(m.height)&&(b.height=m.height);var _=A.extendFlat({},g,{_exportedPlot:!0,staticPlot:!0,setBackground:T}),P=t.getRedrawFunc(h);function L(){return new Promise(function(R){setTimeout(R,t.getDelay(h._fullLayout))})}function D(){return new Promise(function(R,I){var F=e(h,y,M),N=h._fullLayout.width,j=h._fullLayout.height;function G(){d.purge(h),document.body.removeChild(h)}if(y==="full-json"){var rt=E.graphJson(h,!1,"keepdata","object",!0,!0);return rt.version=i,rt=JSON.stringify(rt),G(),R(c?rt:t.encodeJSON(rt))}if(G(),y==="svg")return R(c?F:t.encodeSVG(F));var ct=document.createElement("canvas");ct.id=A.randstr(),r({format:y,width:N,height:j,scale:M,canvas:ct,svg:F,promise:!0}).then(R).catch(I)})}function B(R){return c?R.replace(t.IMAGE_URL_PREFIX,""):R}return new Promise(function(R,I){d.newPlot(h,f,b,_).then(P).then(L).then(D).then(function(F){R(B(F))}).catch(function(F){I(F)})})}V.exports=o}),Tk=Vt((Z,V)=>{var u=Xr(),d=Uu(),E=gm(),A=n0().dfltConfig,t=u.isPlainObject,e=Array.isArray,r=u.isArrayOrTypedArray;V.exports=function(l,x){l===void 0&&(l=[]),x===void 0&&(x={});var y=E.get(),S=[],k={_context:u.extendFlat({},A)},M,T;e(l)?(k.data=u.extendDeep([],l),M=l):(k.data=[],M=[],S.push(s("array","data"))),t(x)?(k.layout=u.extendDeep({},x),T=x):(k.layout={},T={},arguments.length>1&&S.push(s("object","layout"))),d.supplyDefaults(k);for(var c=k._fullData,h=M.length,b=0;b<h;b++){var _=M[b],P=["data",b];if(!t(_)){S.push(s("object",P));continue}var L=c[b],D=L.type,B=y.traces[D].attributes;B.type={valType:"enumerated",values:[D]},L.visible===!1&&_.visible!==!1&&S.push(s("invisible",P)),i(_,L,B,S,P)}var R=k._fullLayout,I=n(y,c);return i(T,R,I,S,"layout"),S.length===0?void 0:S};function i(l,x,y,S,k,M){M=M||[];for(var T=Object.keys(l),c=0;c<T.length;c++){var h=T[c],b=M.slice();b.push(h);var _=l[h],P=x[h],L=v(y,h),D=(L||{}).valType,B=D==="info_array",R=D==="colorscale",I=(L||{}).items;if(!f(y,h))S.push(s("schema",k,b));else if(t(_)&&t(P)&&D!=="any")i(_,P,L,S,k,b);else if(B&&e(_)){_.length>P.length&&S.push(s("unused",k,b.concat(P.length)));var F=P.length,N=Array.isArray(I);N&&(F=Math.min(F,I.length));var j,G,rt,ct,st;if(L.dimensions===2)for(G=0;G<F;G++)if(e(_[G])){_[G].length>P[G].length&&S.push(s("unused",k,b.concat(G,P[G].length)));var et=P[G].length;for(j=0;j<(N?Math.min(et,I[G].length):et);j++)rt=N?I[G][j]:I,ct=_[G][j],st=P[G][j],u.validate(ct,rt)?st!==ct&&st!==+ct&&S.push(s("dynamic",k,b.concat(G,j),ct,st)):S.push(s("value",k,b.concat(G,j),ct))}else S.push(s("array",k,b.concat(G),_[G]));else for(G=0;G<F;G++)rt=N?I[G]:I,ct=_[G],st=P[G],u.validate(ct,rt)?st!==ct&&st!==+ct&&S.push(s("dynamic",k,b.concat(G),ct,st)):S.push(s("value",k,b.concat(G),ct))}else if(L.items&&!B&&e(_)){var K=I[Object.keys(I)[0]],ot=[],X,Q;for(X=0;X<P.length;X++){var ut=P[X]._index||X;if(Q=b.slice(),Q.push(ut),t(_[ut])&&t(P[X])){ot.push(ut);var J=_[ut],q=P[X];t(J)&&J.visible!==!1&&q.visible===!1?S.push(s("invisible",k,Q)):i(J,q,K,S,k,Q)}}for(X=0;X<_.length;X++)Q=b.slice(),Q.push(X),t(_[X])?ot.indexOf(X)===-1&&S.push(s("unused",k,Q)):S.push(s("object",k,Q,_[X]))}else!t(_)&&t(P)?S.push(s("object",k,b,_)):!r(_)&&r(P)&&!B&&!R?S.push(s("array",k,b,_)):h in x?u.validate(_,L)?L.valType==="enumerated"&&(L.coerceNumber&&_!==+P||!r(_)&&_!==P||String(_)!==String(P))&&S.push(s("dynamic",k,b,_,P)):S.push(s("value",k,b,_)):S.push(s("unused",k,b,_))}return S}function n(l,x){for(var y=l.layout.layoutAttributes,S=0;S<x.length;S++){var k=x[S],M=l.traces[k.type],T=M.layoutAttributes;T&&(k.subplot?u.extendFlat(y[M.attributes.subplot.dflt],T):u.extendFlat(y,T))}return y}var o={object:function(l,x){var y;return l==="layout"&&x===""?y="The layout argument":l[0]==="data"&&x===""?y="Trace "+l[1]+" in the data argument":y=a(l)+"key "+x,y+" must be linked to an object container"},array:function(l,x){var y;return l==="data"?y="The data argument":y=a(l)+"key "+x,y+" 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,y){var S=t(y)?"container":"key";return a(l)+S+" "+x+" did not get coerced"},dynamic:function(l,x,y,S){return[a(l)+"key",x,"(set to '"+y+"')","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,y){return[a(l)+"key "+x,"is set to an invalid value ("+y+")"].join(" ")}};function a(l){return e(l)?"In data trace "+l[1]+", ":"In "+l+", "}function s(l,x,y,S,k){y=y||"";var M,T;e(x)?(M=x[0],T=x[1]):(M=x,T=null);var c=w(y),h=o[l](x,c,S,k);return u.log(h),{code:l,container:M,trace:T,path:y,astr:c,msg:h}}function f(l,x){var y=m(x),S=y.keyMinusId,k=y.id;return S in l&&l[S]._isSubplotObj&&k?!0:x in l}function v(l,x){if(x in l)return l[x];var y=m(x);return l[y.keyMinusId]}var g=u.counterRegex("([a-z]+)");function m(l){var x=l.match(g);return{keyMinusId:x&&x[1],id:x&&x[2]}}function w(l){if(!e(l))return String(l);for(var x="",y=0;y<l.length;y++){var S=l[y];typeof S=="number"?x=x.substr(0,x.length-1)+"["+S+"]":x+=S,y<l.length-1&&(x+=".")}return x}}),kk=Vt((Z,V)=>{var u=Xr(),d=Bp();function E(A,t,e){var r=document.createElement("a"),i="download"in r,n=new Promise(function(o,a){var s,f;if(i)return s=d.createBlob(A,e),f=d.createObjectURL(s),r.href=f,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),d.revokeObjectURL(f),s=null,o(t);if(u.isSafari()){var v=e==="svg"?",":";base64,";return d.octetStream(v+encodeURIComponent(A)),o(t)}a(new Error("download error"))});return n}V.exports=E}),Cb=Vt((Z,V)=>{var u=Xr(),d=Lb(),E=kk();Bp();function A(t,e){var r;return u.isPlainObject(t)||(r=u.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=d(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}),Ak=Vt(Z=>{var V=Xr(),u=V.isPlainObject,d=gm(),E=Uu(),A=Tl(),t=cl(),e=n0().dfltConfig;Z.makeTemplate=function(g){g=V.isPlainObject(g)?g:V.getGraphDiv(g),g=V.extendDeep({_context:e},{data:g.data,layout:g.layout}),E.supplyDefaults(g);var m=g.data||[],w=g.layout||{};w._basePlotModules=g._fullLayout._basePlotModules,w._modules=g._fullLayout._modules;var l={data:{},layout:{}};m.forEach(function(_){var P={};n(_,P,a.bind(null,_));var L=V.coerce(_,{},A,"type"),D=l.data[L];D||(D=l.data[L]=[]),D.push(P)}),n(w,l.layout,o.bind(null,w)),delete l.layout.template;var x=w.template;if(u(x)){var y=x.layout,S,k,M,T,c,h;u(y)&&r(y,l.layout);var b=x.data;if(u(b)){for(k in l.data)if(M=b[k],Array.isArray(M)){for(c=l.data[k],h=c.length,T=M.length,S=0;S<h;S++)r(M[S%T],c[S]);for(S=h;S<T;S++)c.push(V.extendDeep({},M[S]))}for(k in b)k in l.data||(l.data[k]=V.extendDeep([],b[k]))}}return l};function r(g,m){g=V.extendDeep({},g);var w=Object.keys(g).sort(),l,x;function y(c,h,b){if(u(h)&&u(c))r(c,h);else if(Array.isArray(h)&&Array.isArray(c)){var _=t.arrayTemplater({_template:g},b);for(x=0;x<h.length;x++){var P=h[x],L=_.newItem(P)._template;L&&r(L,P)}var D=_.defaultItems();for(x=0;x<D.length;x++)h.push(D[x]._template);for(x=0;x<h.length;x++)delete h[x].templateitemname}}for(l=0;l<w.length;l++){var S=w[l],k=g[S];if(S in m?y(k,m[S],S):m[S]=k,i(S)===S)for(var M in m){var T=i(M);M!==T&&T===S&&!(M in g)&&y(k,m[M],S)}}}function i(g){return g.replace(/[0-9]+$/,"")}function n(g,m,w,l,x){var y=x&&w(x);for(var S in g){var k=g[S],M=s(g,S,l),T=s(g,S,x),c=w(T);if(!c){var h=i(S);h!==S&&(T=s(g,h,x),c=w(T))}if(!(y&&y===c)&&!(!c||c._noTemplating||c.valType==="data_array"||c.arrayOk&&Array.isArray(k)))if(!c.valType&&u(k))n(k,m,w,M,T);else if(c._isLinkedToArray&&Array.isArray(k))for(var b=!1,_=0,P={},L=0;L<k.length;L++){var D=k[L];if(u(D)){var B=D.name;if(B)P[B]||(n(D,m,w,s(k,_,M),s(k,_,T)),_++,P[B]=1);else if(!b){var R=t.arrayDefaultKey(S),I=s(g,R,l),F=s(k,_,M);n(D,m,w,F,s(k,_,T));var N=V.nestedProperty(m,F),j=V.nestedProperty(m,I);j.set(N.get()),N.set(null),b=!0}}}else{var G=V.nestedProperty(m,M);G.set(k)}}}function o(g,m){return d.getLayoutValObject(g,V.nestedProperty({},m).parts)}function a(g,m){return d.getTraceValObject(g,V.nestedProperty({},m).parts)}function s(g,m,w){var l;return w?Array.isArray(g)?l=w+"["+m+"]":l=w+"."+m:l=m,l}Z.validateTemplate=function(g,m){var w=V.extendDeep({},{_context:e,data:g.data,layout:g.layout}),l=w.layout||{};u(m)||(m=l.template||{});var x=m.layout,y=m.data,S=[];w.layout=l,w.layout.template=m,E.supplyDefaults(w);var k=w._fullLayout,M=w._fullData,T={};function c(I,F){for(var N in I)if(N.charAt(0)!=="_"&&u(I[N])){var j=i(N),G=[],rt;for(rt=0;rt<F.length;rt++)G.push(s(I,N,F[rt])),j!==N&&G.push(s(I,j,F[rt]));for(rt=0;rt<G.length;rt++)T[G[rt]]=1;c(I[N],G)}}function h(I,F){for(var N in I)if(N.indexOf("defaults")===-1&&u(I[N])){var j=s(I,N,F);T[j]?h(I[N],j):S.push({code:"unused",path:j})}}if(u(x)?(c(k,["layout"]),h(x,"layout")):S.push({code:"layout"}),!u(y))S.push({code:"data"});else{for(var b={},_,P=0;P<M.length;P++){var L=M[P];_=L.type,b[_]=(b[_]||0)+1,L._fullInput._template||S.push({code:"missing",index:L.index,traceType:_})}for(_ in y){var D=y[_].length,B=b[_]||0;D>B?S.push({code:"unused",traceType:_,templateCount:D,dataCount:B}):B>D&&S.push({code:"reused",traceType:_,templateCount:D,dataCount:B})}}function R(I,F){for(var N in I)if(N.charAt(0)!=="_"){var j=I[N],G=s(I,N,F);u(j)?(Array.isArray(I)&&j._template===!1&&j.templateitemname&&S.push({code:"missing",path:G,templateitemname:j.templateitemname}),R(j,G)):Array.isArray(j)&&f(j)&&R(j,G)}}if(R({data:M,layout:k},""),S.length)return S.map(v)};function f(g){for(var m=0;m<g.length;m++)if(u(g[m]))return!0}function v(g){var m;switch(g.code){case"data":m="The template has no key data.";break;case"layout":m="The template has no key layout.";break;case"missing":g.path?m="There are no templates for item "+g.path+" with name "+g.templateitemname:m="There are no templates for trace "+g.index+", of type "+g.traceType+".";break;case"unused":g.path?m="The template item at "+g.path+" was not used in constructing the plot.":g.dataCount?m="Some of the templates of type "+g.traceType+" were not used. The template has "+g.templateCount+" traces, the data only has "+g.dataCount+" of this type.":m="The template has "+g.templateCount+" traces of type "+g.traceType+" but there are none in the data.";break;case"reused":m="Some of the templates of type "+g.traceType+" were used more than once. The template has "+g.templateCount+" traces, the data has "+g.dataCount+" of this type.";break}return g.msg=m,g}}),Mk=Vt(Z=>{var V=Ky();Z._doPlot=V._doPlot,Z.newPlot=V.newPlot,Z.restyle=V.restyle,Z.relayout=V.relayout,Z.redraw=V.redraw,Z.update=V.update,Z._guiRestyle=V._guiRestyle,Z._guiRelayout=V._guiRelayout,Z._guiUpdate=V._guiUpdate,Z._storeDirectGUIEdit=V._storeDirectGUIEdit,Z.react=V.react,Z.extendTraces=V.extendTraces,Z.prependTraces=V.prependTraces,Z.addTraces=V.addTraces,Z.deleteTraces=V.deleteTraces,Z.moveTraces=V.moveTraces,Z.purge=V.purge,Z.addFrames=V.addFrames,Z.deleteFrames=V.deleteFrames,Z.animate=V.animate,Z.setPlotConfig=V.setPlotConfig;var u=Lg().getGraphDiv,d=Zy().eraseActiveShape;Z.deleteActiveShape=function(A){return d(u(A))},Z.toImage=Lb(),Z.validate=Tk(),Z.downloadImage=Cb();var E=Ak();Z.makeTemplate=E.makeTemplate,Z.validateTemplate=E.validateTemplate}),bm=Vt((Z,V)=>{var u=Xr(),d=ji();V.exports=function(E,A,t,e){var r=e("x"),i=e("y"),n,o=d.getComponentMethod("calendars","handleTraceDefaults");if(o(E,A,["x","y"],t),r){var a=u.minRowLength(r);i?n=Math.min(a,u.minRowLength(i)):(n=a,e("y0"),e("dy"))}else{if(!i)return 0;n=u.minRowLength(i),e("x0"),e("dx")}return A._length=n,n}}),tp=Vt((Z,V)=>{var u=Xr().dateTick0,d=ks(),E=d.ONEWEEK;function A(t,e){return t%E===0?u(e,1):u(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"))}}}),Sk=Vt((Z,V)=>{var u=["orientation","groupnorm","stackgaps"];V.exports=function(d,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"},f=0;f<u.length;f++){var v=u[f],g=v+"Found";if(!o[g]){var m=d[v]!==void 0,w=v==="orientation";if((m||a)&&(o[v]=t(v,s[v]),w&&(o.fillDflt=o[v]==="h"?"tonextx":"tonexty"),m&&(o[g]=!0,!a&&(delete o.traces[0][v],w))))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}}}),zh=Vt((Z,V)=>{var u=Pi(),d=nh().hasColorscale,E=gf(),A=nu();V.exports=function(t,e,r,i,n,o){var a=A.isBubble(t),s=(t.line||{}).color,f;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),d(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?f=s:a?f=u.background:f=u.defaultLine,n("marker.line.color",f),d(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")}}}),Bh=Vt((Z,V)=>{var u=Xr().isArrayOrTypedArray,d=nh().hasColorscale,E=gf();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),d(A,"line"))E(A,t,r,i,{prefix:"line.",cLetter:"c"});else{var a=(u(o)?!1:o)||e;i("line.color",a)}i("line.width"),n.noDash||i("line.dash"),n.backoff&&i("line.backoff")}}),wm=Vt((Z,V)=>{V.exports=function(u,d,E){var A=E("line.shape");A==="spline"&&E("line.smoothing")}}),Rh=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E,A,t,e){e=e||{},t("textposition"),u.coerceFont(t,"textfont",e.font||A.font,e),e.noSelect||(t("selected.textfont.color"),t("unselected.textfont.color"))}}),ep=Vt((Z,V)=>{var u=Pi(),d=Xr().isArrayOrTypedArray;function E(A){for(var t=u.interpolate(A[0][1],A[1][1],.5),e=2;e<A.length;e++){var r=u.interpolate(A[e-1][1],A[e][1],.5);t=u.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&&!d(o)?n=o:a&&!d(a)&&(n=a)}var s;if(i.moduleHasFillgradient){var f=r("fillgradient.type");if(f!=="none"){r("fillgradient.start"),r("fillgradient.stop");var v=r("fillgradient.colorscale");v&&(s=E(v))}}r("fillcolor",u.addOpacity((t.line||{}).color||n||s||e,.5))}}),Ek=Vt((Z,V)=>{var u=Xr(),d=ji(),E=pc(),A=gp(),t=nu(),e=bm(),r=tp(),i=Sk(),n=zh(),o=Bh(),a=wm(),s=Rh(),f=ep(),v=Xr().coercePattern;V.exports=function(g,m,w,l){function x(b,_){return u.coerce(g,m,E,b,_)}var y=e(g,m,l,x);if(y||(m.visible=!1),!!m.visible){r(g,m,l,x),x("xhoverformat"),x("yhoverformat"),x("zorder");var S=i(g,m,l,x);l.scattermode==="group"&&m.orientation===void 0&&x("orientation","v");var k=!S&&y<A.PTS_LINESONLY?"lines+markers":"lines";x("text"),x("hovertext"),x("mode",k),t.hasMarkers(m)&&n(g,m,w,l,x,{gradient:!0}),t.hasLines(m)&&(o(g,m,w,l,x,{backoff:!0}),a(g,m,x),x("connectgaps"),x("line.simplify")),t.hasText(m)&&(x("texttemplate"),x("texttemplatefallback"),s(g,m,l,x));var M=[];(t.hasMarkers(m)||t.hasText(m))&&(x("cliponaxis"),x("marker.maxdisplayed"),M.push("points")),x("fill",S?S.fillDflt:"none"),m.fill!=="none"&&(f(g,m,w,x,{moduleHasFillgradient:!0}),t.hasLines(m)||a(g,m,x),v(x,"fillpattern",m.fillcolor,!1));var T=(m.line||{}).color,c=(m.marker||{}).color;(m.fill==="tonext"||m.fill==="toself")&&M.push("fills"),x("hoveron",M.join("+")||"points"),m.hoveron!=="fills"&&(x("hovertemplate"),x("hovertemplatefallback"));var h=d.getComponentMethod("errorbars","supplyDefaults");h(g,m,T||c||w,{axis:"y"}),h(g,m,T||c||w,{axis:"x",inherit:"y"}),u.coerceSelectionMarkerOpacity(m,x)}}}),u0=Vt((Z,V)=>{var u=s0().getAxisGroup;V.exports=function(d,E,A,t,e){var r=E.orientation,i=E[{v:"x",h:"y"}[r]+"axis"],n=u(A,i)+r,o=A._alignmentOpts||{},a=t("alignmentgroup"),s=o[n];s||(s=o[n]={});var f=s[a];f?f.traces.push(E):f=s[a]={traces:[E],alignmentIndex:Object.keys(s).length,offsetGroups:{}};var v=t("offsetgroup")||"",g=f.offsetGroups,m=g[v];E._offsetIndex=0,(e!=="group"||v)&&(m||(m=g[v]={offsetIndex:Object.keys(g).length}),E._offsetIndex=m.offsetIndex)}}),Ib=Vt((Z,V)=>{var u=Xr(),d=u0(),E=pc();V.exports=function(A,t){var e,r,i,n=t.scattermode;function o(g){return u.coerce(r._input,r,E,g)}if(t.scattermode==="group")for(i=0;i<A.length;i++)r=A[i],r.type==="scatter"&&(e=r._input,d(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 f=i-1;f>=0;f--){var v=A[f];if(v.type==="scatter"&&v.xaxis===a.xaxis&&v.yaxis===a.yaxis){v.opacity=void 0;break}}}}}}),zk=Vt((Z,V)=>{var u=Xr(),d=Ry();V.exports=function(E,A){function t(r,i){return u.coerce(E,A,d,r,i)}var e=A.barmode==="group";A.scattermode==="group"&&t("scattergap",e?A.bargap:.2)}}),rp=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=d.dateTime2ms,A=d.incrementMonth,t=ks(),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"],f;if(u(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)f=v;else return{vals:o}}for(var g=i.calendar,m=a==="start",w=a==="end",l=r[n+"period0"],x=E(l,g)||0,y=[],S=[],k=[],M=o.length,T=0;T<M;T++){var c=o[T],h,b,_;if(f){for(h=Math.round((c-x)/(f*e)),_=A(x,f*h,g);_>c;)_=A(_,-f,g);for(;_<=c;)_=A(_,f,g);b=A(_,-f,g)}else{for(h=Math.round((c-x)/s),_=x+h*s;_>c;)_-=s;for(;_<=c;)_+=s;b=_-s}y[T]=m?b:w?_:(b+_)/2,S[T]=b,k[T]=_}return{vals:y,starts:S,ends:k}}}),Nh=Vt((Z,V)=>{var u=nh().hasColorscale,d=ah(),E=nu();V.exports=function(A,t){E.hasLines(t)&&u(t,"line")&&d(A,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),E.hasMarkers(t)&&(u(t,"marker")&&d(A,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),u(t,"marker.line")&&d(A,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),vp=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){for(var A=0;A<d.length;A++)d[A].i=A;u.mergeArray(E.text,d,"tx"),u.mergeArray(E.texttemplate,d,"txt"),u.mergeArray(E.hovertext,d,"htx"),u.mergeArray(E.customdata,d,"data"),u.mergeArray(E.textposition,d,"tp"),E.textfont&&(u.mergeArrayCastPositive(E.textfont.size,d,"ts"),u.mergeArray(E.textfont.color,d,"tc"),u.mergeArray(E.textfont.family,d,"tf"),u.mergeArray(E.textfont.weight,d,"tw"),u.mergeArray(E.textfont.style,d,"ty"),u.mergeArray(E.textfont.variant,d,"tv"),u.mergeArray(E.textfont.textcase,d,"tC"),u.mergeArray(E.textfont.lineposition,d,"tE"),u.mergeArray(E.textfont.shadow,d,"tS"));var t=E.marker;if(t){u.mergeArrayCastPositive(t.size,d,"ms"),u.mergeArrayCastPositive(t.opacity,d,"mo"),u.mergeArray(t.symbol,d,"mx"),u.mergeArray(t.angle,d,"ma"),u.mergeArray(t.standoff,d,"mf"),u.mergeArray(t.color,d,"mc");var e=t.line;t.line&&(u.mergeArray(e.color,d,"mlc"),u.mergeArrayCastPositive(e.width,d,"mlw"));var r=t.gradient;r&&r.type!=="none"&&(u.mergeArray(r.type,d,"mgt"),u.mergeArray(r.color,d,"mgc"))}}}),jh=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){u.isArrayOrTypedArray(E.selectedpoints)&&u.tagSelected(d,E)}}),Uh=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=yo(),A=rp(),t=ks().BADNUM,e=nu(),r=Nh(),i=vp(),n=jh();function o(m,w){var l=m._fullLayout,x=w._xA=E.getFromId(m,w.xaxis||"x","x"),y=w._yA=E.getFromId(m,w.yaxis||"y","y"),S=x.makeCalcdata(w,"x"),k=y.makeCalcdata(w,"y"),M=A(w,x,"x",S),T=A(w,y,"y",k),c=M.vals,h=T.vals,b=w._length,_=new Array(b),P=w.ids,L=g(w,l,x,y),D=!1,B,R,I,F,N,j;f(l,w);var G="x",rt="y",ct;if(L)d.pushUnique(L.traceIndices,w.index),B=L.orientation==="v",B?(rt="s",ct="x"):(G="s",ct="y"),N=L.stackgaps==="interpolate";else{var st=s(w,b);a(m,w,x,y,c,h,st)}var et=!!w.xperiodalignment,K=!!w.yperiodalignment;for(R=0;R<b;R++){var ot=_[R]={},X=u(c[R]),Q=u(h[R]);X&&Q?(ot[G]=c[R],ot[rt]=h[R],et&&(ot.orig_x=S[R],ot.xEnd=M.ends[R],ot.xStart=M.starts[R]),K&&(ot.orig_y=k[R],ot.yEnd=T.ends[R],ot.yStart=T.starts[R])):L&&(B?X:Q)?(ot[ct]=B?c[R]:h[R],ot.gap=!0,N?(ot.s=t,D=!0):ot.s=0):ot[G]=ot[rt]=t,P&&(ot.id=String(P[R]))}if(i(_,w),r(m,w),n(_,w),L){for(R=0;R<_.length;)_[R][ct]===t?_.splice(R,1):R++;if(d.sort(_,function(it,nt){return it[ct]-nt[ct]||it.i-nt.i}),D){for(R=0;R<_.length-1&&_[R].gap;)R++;for(j=_[R].s,j||(j=_[R].s=0),I=0;I<R;I++)_[I].s=j;for(F=_.length-1;F>R&&_[F].gap;)F--;for(j=_[F].s,I=_.length-1;I>F;I--)_[I].s=j;for(;R<F;)if(R++,_[R].gap){for(I=R+1;_[I].gap;)I++;for(var ut=_[R-1][ct],J=_[R-1].s,q=(_[I].s-J)/(_[I][ct]-ut);R<I;)_[R].s=J+(_[R][ct]-ut)*q,R++}}}return _}function a(m,w,l,x,y,S,k){var M=w._length,T=m._fullLayout,c=l._id,h=x._id,b=T._firstScatter[v(w)]===w.uid,_=(g(w,T,l,x)||{}).orientation,P=w.fill;l._minDtick=0,x._minDtick=0;var L={padded:!0},D={padded:!0};k&&(L.ppad=D.ppad=k);var B=M<2||y[0]!==y[M-1]||S[0]!==S[M-1];B&&(P==="tozerox"||P==="tonextx"&&(b||_==="h"))?L.tozero=!0:!(w.error_y||{}).visible&&(P==="tonexty"||P==="tozeroy"||!e.hasMarkers(w)&&!e.hasText(w))&&(L.padded=!1,L.ppad=0),B&&(P==="tozeroy"||P==="tonexty"&&(b||_==="v"))?D.tozero=!0:(P==="tonextx"||P==="tozerox")&&(D.padded=!1),c&&(w._extremes[c]=E.findExtremes(l,y,L)),h&&(w._extremes[h]=E.findExtremes(x,S,D))}function s(m,w){if(e.hasMarkers(m)){var l=m.marker,x=1.6*(m.marker.sizeref||1),y;if(m.marker.sizemode==="area"?y=function(c){return Math.max(Math.sqrt((c||0)/x),3)}:y=function(c){return Math.max((c||0)/x,3)},d.isArrayOrTypedArray(l.size)){var S={type:"linear"};E.setConvert(S);for(var k=S.makeCalcdata(m.marker,"size"),M=new Array(w),T=0;T<w;T++)M[T]=y(k[T]);return M}else return y(l.size)}}function f(m,w){var l=v(w),x=m._firstScatter;x[l]||(x[l]=w.uid)}function v(m){var w=m.stackgroup;return m.xaxis+m.yaxis+m.type+(w?"-"+w:"")}function g(m,w,l,x){var y=m.stackgroup;if(y){var S=w._scatterStackOpts[l._id+x._id][y],k=S.orientation==="v"?x:l;if(k.type==="linear"||k.type==="log")return S}}V.exports={calc:o,calcMarkerSize:s,calcAxisExpansion:a,setFirstScatter:f,getStackOpts:g}}),Lk=Vt((Z,V)=>{V.exports=d;var u=Xr().distinctVals;function d(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 f=u(r);this.distinctPositions=f.vals,f.vals.length===1&&t!==1/0?this.minDiff=t:this.minDiff=Math.min(f.minDiff,t);var v=(A.posAxis||{}).type;(v==="category"||v==="multicategory")&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}d.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},d.prototype.get=function(E,A,t){var e=this.getLabel(E,A,t);return this.bins[e]||0},d.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}}),c0=Vt((Z,V)=>{var u=Lo(),d=Xr().isArrayOrTypedArray,E=ks().BADNUM,A=ji(),t=yo(),e=s0().getAxisGroup,r=Lk();function i(_,P){for(var L=P.xaxis,D=P.yaxis,B=_._fullLayout,R=_._fullData,I=_.calcdata,F=[],N=[],j=0;j<R.length;j++){var G=R[j];if(G.visible===!0&&A.traceIs(G,"bar")&&G.xaxis===L._id&&G.yaxis===D._id&&(G.orientation==="h"?F.push(I[j]):N.push(I[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 st={xCat:L.type==="category"||L.type==="multicategory",yCat:D.type==="category"||D.type==="multicategory",mode:B.barmode,norm:B.barnorm,gap:B.bargap,groupgap:B.bargroupgap};n(_,L,D,N,st),n(_,D,L,F,st)}function n(_,P,L,D,B){if(D.length){var R,I,F,N,j;switch(s(L,D),B.mode){case"overlay":f(_,P,L,D,B);break;case"group":for(R=[],I=[],F=0;F<D.length;F++)N=D[F],j=N[0].trace,j.offset===void 0?I.push(N):R.push(N);I.length&&v(_,P,L,I,B),R.length&&f(_,P,L,R,B);break;case"stack":case"relative":for(R=[],I=[],F=0;F<D.length;F++)N=D[F],j=N[0].trace,j.base===void 0?I.push(N):R.push(N);a(I),I.length&&g(_,P,L,I,B),R.length&&f(_,P,L,R,B);break}o(D),h(D,P)}}function o(_){var P,L,D,B,R,I,F;for(P=0;P<_.length;P++)L=_[P],D=L[0].trace,B=L[0].t,B.cornerradiusvalue===void 0&&(R=D.marker?D.marker.cornerradius:void 0,R!==void 0&&(I=u(R)?+R:+R.slice(0,-1),F=u(R)?"px":"%",B.cornerradiusvalue=I,B.cornerradiusform=F))}function a(_){if(!(_.length<2)){var P,L,D,B,R,I,F;for(P=0;P<_.length&&(L=_[P],D=L[0].trace,R=D.marker?D.marker.cornerradius:void 0,R===void 0);P++);if(R!==void 0)for(I=u(R)?+R:+R.slice(0,-1),F=u(R)?"px":"%",P=0;P<_.length;P++)L=_[P],B=L[0].t,B.cornerradiusvalue=I,B.cornerradiusform=F}}function s(_,P){var L,D;for(L=0;L<P.length;L++){var B=P[L],R=B[0].trace,I=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(d(I)){for(D=0;D<Math.min(I.length,B.length);D++)F=j(I[D],0,N),u(F)?(B[D].b=+F,B[D].hasB=1):B[D].b=0;for(;D<B.length;D++)B[D].b=0}else{F=j(I,0,N);var G=u(F);for(F=G?F:0,D=0;D<B.length;D++)B[D].b=F,G&&(B[D].hasB=1)}}}function f(_,P,L,D,B){for(var R=0;R<D.length;R++){var I=D[R],F=new r([I],{posAxis:P,sepNegVal:!1,overlapNoMerge:!B.norm});m(_,P,F,B),B.norm?(k(F),T(L,F,B)):y(L,F)}}function v(_,P,L,D,B){var R=new r(D,{posAxis:P,sepNegVal:!1,overlapNoMerge:!B.norm});m(_,P,R,B),M(R,P),B.norm?(k(R),T(L,R,B)):y(L,R)}function g(_,P,L,D,B){var R=new r(D,{posAxis:P,sepNegVal:B.mode==="relative",overlapNoMerge:!(B.norm||B.mode==="stack"||B.mode==="relative")});m(_,P,R,B),S(L,R,B);for(var I=0;I<D.length;I++)for(var F=D[I],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&&T(L,R,B)}function m(_,P,L,D){var B=_._fullLayout,R=L.positions,I=L.distinctPositions,F=L.minDiff,N=L.traces,j=N.length,G=R.length!==I.length,rt=F*(1-D.gap),ct,st,et,K;if(P._id==="angularaxis")ct=rt,st=ct*(1-(D.groupgap||0)),et=-st/2;else{var ot=e(B,P._id)+N[0][0].trace.orientation;K=B._alignmentOpts[ot]||{}}for(var X=0;X<j;X++){var Q=N[X],ut=Q[0].trace;if(P._id!=="angularaxis"){var J=K[ut.alignmentgroup]||{},q=Object.keys(J.offsetGroups||{}).length;q?ct=rt/q:ct=G?rt/j:rt,st=ct*(1-(D.groupgap||0)),q?et=((2*ut._offsetIndex+1-q)*ct-st)/2:et=G?((2*X+1-j)*ct-st)/2:-st/2}var it=Q[0].t;it.barwidth=st,it.offsetindex=ut._offsetIndex||0,it.poffset=et,it.bargroupwidth=rt,it.bardelta=F}L.binWidth=N[0][0].t.barwidth/100,w(L),l(P,L),P._id==="angularaxis"?x(P,L):x(P,L,G)}function w(_){var P=_.traces,L,D;for(L=0;L<P.length;L++){var B=P[L],R=B[0],I=R.trace,F=R.t,N=I._offset||I.offset,j=F.poffset,G;if(d(N)){for(G=Array.prototype.slice.call(N,0,B.length),D=0;D<G.length;D++)u(G[D])||(G[D]=j);for(D=G.length;D<B.length;D++)G.push(j);F.poffset=G}else N!==void 0&&(F.poffset=N);var rt=I._width||I.width,ct=F.barwidth;if(d(rt)){var st=Array.prototype.slice.call(rt,0,B.length);for(D=0;D<st.length;D++)u(st[D])||(st[D]=ct);for(D=st.length;D<B.length;D++)st.push(ct);if(F.barwidth=st,N===void 0){for(G=[],D=0;D<B.length;D++)G.push(j+(ct-st[D])/2);F.poffset=G}}else rt!==void 0&&(F.barwidth=rt,N===void 0&&(F.poffset=j+(ct-rt)/2))}}function l(_,P){for(var L=P.traces,D=b(_),B=0;B<L.length;B++)for(var R=L[B],I=R[0].t,F=I.poffset,N=d(F),j=I.barwidth,G=d(j),rt=0;rt<R.length;rt++){var ct=R[rt],st=ct.w=G?j[rt]:j;ct.p===void 0&&(ct.p=ct[D],ct["orig_"+D]=ct[D]);var et=(N?F[rt]:F)+st/2;ct[D]=ct.p+et}}function x(_,P,L){var D=P.traces,B=P.minDiff,R=B/2;t.minDtick(_,P.minDiff,P.distinctPositions[0],L);for(var I=0;I<D.length;I++){var F=D[I],N=F[0],j=N.trace,G=[],rt,ct,st,et;for(et=0;et<F.length;et++)rt=F[et],ct=rt.p-R,st=rt.p+R,G.push(ct,st);if(j.width||j.offset){var K=N.t,ot=K.poffset,X=K.barwidth,Q=d(ot),ut=d(X);for(et=0;et<F.length;et++){rt=F[et];var J=Q?ot[et]:ot,q=ut?X[et]:X;ct=rt.p+J,st=ct+q,G.push(ct,st)}}j._extremes[_._id]=t.findExtremes(_,G,{padded:!1})}}function y(_,P){for(var L=P.traces,D=b(_),B=0;B<L.length;B++){for(var R=L[B],I=R[0].trace,F=I.type==="scatter",N=I.orientation==="v",j=[],G=!1,rt=0;rt<R.length;rt++){var ct=R[rt],st=F?0:ct.b,et=F?N?ct.y:ct.x:st+ct.s;ct[D]=et,j.push(et),ct.hasB&&j.push(st),(!ct.hasB||!ct.b)&&(G=!0)}I._extremes[_._id]=t.findExtremes(_,j,{tozero:G,padded:!0})}}function S(_,P,L){var D=b(_),B=P.traces,R,I,F,N,j,G,rt;for(N=0;N<B.length;N++)if(R=B[N],I=R[0].trace,I.type==="funnel")for(rt=R[0].t.offsetindex,j=0;j<R.length;j++)G=R[j],G.s!==E&&P.put(G.p,rt,-.5*G.s);for(N=0;N<B.length;N++){R=B[N],I=R[0].trace,F=I.type==="funnel",rt=I.type==="barpolar"?0:R[0].t.offsetindex;var ct=[];for(j=0;j<R.length;j++)if(G=R[j],G.s!==E){var st;F?st=G.s:st=G.s+G.b;var et=P.put(G.p,rt,st),K=et+st;G.b=et,G[D]=K,L.norm||(ct.push(K),G.hasB&&ct.push(et))}L.norm||(I._extremes[_._id]=t.findExtremes(_,ct,{tozero:!0,padded:!0}))}}function k(_){for(var P=_.traces,L=0;L<P.length;L++)for(var D=P[L],B=D[0].t.offsetindex,R=0;R<D.length;R++){var I=D[R];I.s!==E&&_.put(I.p,B,I.b+I.s)}}function M(_,P){for(var L=_.traces,D=0;D<L.length;D++){var B=L[D],R=B[0].trace,I=B[0].t.offsetindex;if(R.base===void 0)for(var F=new r([B],{posAxis:P,sepNegVal:!0,overlapNoMerge:!0}),N=0;N<B.length;N++){var j=B[N];if(j.p!==E){var G=F.put(j.p,I,j.b+j.s);G&&(j.b=G)}}}}function T(_,P,L){var D=P.traces,B=b(_),R=L.norm==="fraction"?1:100,I=R/1e9,F=_.l2c(_.c2l(0)),N=L.mode==="stack"?R:F;function j(it){return u(_.c2l(it))&&(it<F-I||it>N+I||!u(F))}for(var G=0;G<D.length;G++){for(var rt=D[G],ct=rt[0].t.offsetindex,st=rt[0].trace,et=[],K=!1,ot=!1,X=0;X<rt.length;X++){var Q=rt[X];if(Q.s!==E){var ut=Math.abs(R/P.get(Q.p,ct,Q.s));Q.b*=ut,Q.s*=ut;var J=Q.b,q=J+Q.s;Q[B]=q,et.push(q),ot=ot||j(q),Q.hasB&&(et.push(J),ot=ot||j(J)),(!Q.hasB||!Q.b)&&(K=!0)}}st._extremes[_._id]=t.findExtremes(_,et,{tozero:K,padded:ot})}}function c(_,P,L,D){for(var B=b(D),R=0;R<_.length;R++)for(var I=_[R],F=0;F<I.length;F++){var N=I[F],j=N[B];N._sMin=P[j],N._sMax=L[j]}}function h(_,P){var L=b(P),D={},B,R,I,F=1/0,N=-1/0;for(B=0;B<_.length;B++)for(I=_[B],R=0;R<I.length;R++){var j=I[R].p;u(j)&&(F=Math.min(F,j),N=Math.max(N,j))}var G=1e4/(N-F),rt=D.round=function(dt){return String(Math.round(G*(dt-F)))},ct={},st={},et=_.some(function(dt){var Tt=dt[0].trace;return"marker"in Tt&&Tt.marker.cornerradius});for(B=0;B<_.length;B++){I=_[B],I[0].t.extents=D;var K=I[0].t.poffset,ot=d(K);for(R=0;R<I.length;R++){var X=I[R],Q=X[L]-X.w/2;if(u(Q)){var ut=X[L]+X.w/2,J=rt(X.p);D[J]?D[J]=[Math.min(Q,D[J][0]),Math.max(ut,D[J][1])]:D[J]=[Q,ut]}if(X.p0=X.p+(ot?K[R]:K),X.p1=X.p0+X.w,X.s0=X.b,X.s1=X.s0+X.s,et){var q=Math.min(X.s0,X.s1)||0,it=Math.max(X.s0,X.s1)||0,nt=X[L];ct[nt]=nt in ct?Math.min(ct[nt],q):q,st[nt]=nt in st?Math.max(st[nt],it):it}}}et&&c(_,ct,st,P)}function b(_){return _._id.charAt(0)}V.exports={crossTraceCalc:i,setGroupPositions:n}}),Ck=Vt((Z,V)=>{var u=Uh(),d=c0().setGroupPositions;function E(e,r){for(var i=r.xaxis,n=r.yaxis,o=e._fullLayout,a=e._fullData,s=e.calcdata,f=[],v=[],g=0;g<a.length;g++){var m=a[g];m.visible===!0&&m.type==="scatter"&&m.xaxis===i._id&&m.yaxis===n._id&&(m.orientation==="h"?f.push(s[g]):m.orientation==="v"&&v.push(s[g]))}var w={mode:o.scattermode,gap:o.scattergap};d(e,i,n,v,w),d(e,n,i,f,w)}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,f,v,g,m,w,l,x,y,S,k,M,T,c,h,b;for(var _ in a){k=a[_];var P=k.traceIndices;if(P.length){for(M=k.stackgaps==="interpolate",T=k.groupnorm,k.orientation==="v"?(c="x",h="y"):(c="y",h="x"),b=new Array(P.length),f=0;f<b.length;f++)b[f]=!1;l=s[P[0]];var L=new Array(l.length);for(f=0;f<l.length;f++)L[f]=l[f][c];for(f=1;f<P.length;f++){for(w=s[P[f]],v=g=0;v<w.length;v++){for(x=w[v][c];x>L[g]&&g<L.length;g++)A(w,v,L[g],f,b,M,c),v++;if(x!==L[g]){for(m=0;m<f;m++)A(s[P[m]],g,x,m,b,M,c);L.splice(g,0,x)}g++}for(;g<L.length;g++)A(w,v,L[g],f,b,M,c),v++}var D=L.length;for(v=0;v<l.length;v++){for(y=l[v][h]=l[v].s,f=1;f<P.length;f++)w=s[P[f]],w[0].trace._rawLength=w[0].trace._length,w[0].trace._length=D,y+=w[v].s,w[v][h]=y;if(T)for(S=(T==="fraction"?y:y/100)||1,f=0;f<P.length;f++){var B=s[P[f]][v];B[h]/=S,B.sNorm=B.s/S}}for(f=0;f<P.length;f++){w=s[P[f]];var R=w[0].trace,I=u.calcMarkerSize(R,R._rawLength),F=Array.isArray(I);if(I&&b[f]||F){var N=I;for(I=new Array(D),v=0;v<D;v++)I[v]=w[v].gap?0:F?N[w[v].i]:N}var j=new Array(D),G=new Array(D);for(v=0;v<D;v++)j[v]=w[v].x,G[v]=w[v].y;u.calcAxisExpansion(e,R,i,n,j,G,I),w[0].t.orientation=k.orientation}}}}};function A(e,r,i,n,o,a,s){o[n]=!0;var f={i:null,gap:!0,s:0};if(f[s]=i,e.splice(r,0,f),r&&i===e[r-1][s]){var v=e[r-1];f.s=v.s,f.i=v.i,f.gap=v.gap}else a&&(f.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}}),Pb=Vt((Z,V)=>{var u=Eo(),d=ks(),E=d.BADNUM,A=d.LOG_CLIP,t=A+.5,e=A-.5,r=Xr(),i=r.segmentsIntersect,n=r.constrain,o=gp();V.exports=function(a,s){var f=s.trace||{},v=s.xaxis,g=s.yaxis,m=v.type==="log",w=g.type==="log",l=v._length,x=g._length,y=s.backoff,S=f.marker,k=s.connectGaps,M=s.baseTolerance,T=s.shape,c=T==="linear",h=f.fill&&f.fill!=="none",b=[],_=o.minTolerance,P=a.length,L=new Array(P),D=0,B,R,I,F,N,j,G,rt,ct,st,et,K,ot,X,Q,ut;function J(se){var ke=a[se];if(!ke)return!1;var Ee=s.linearized?v.l2p(ke.x):v.c2p(ke.x),Ue=s.linearized?g.l2p(ke.y):g.c2p(ke.y);if(Ee===E){if(m&&(Ee=v.c2p(ke.x,!0)),Ee===E)return!1;w&&Ue===E&&(Ee*=Math.abs(v._m*x*(v._m>0?t:e)/(g._m*l*(g._m>0?t:e)))),Ee*=1e3}if(Ue===E){if(w&&(Ue=g.c2p(ke.y,!0)),Ue===E)return!1;Ue*=1e3}return[Ee,Ue]}function q(se,ke,Ee,Ue){var ir=Ee-se,ar=Ue-ke,Ye=.5-se,Er=.5-ke,pn=ir*ir+ar*ar,dn=ir*Ye+ar*Er;if(dn>0&&dn<pn){var bn=Ye*ar-Er*ir;if(bn*bn<pn)return!0}}var it,nt;function dt(se,ke){var Ee=se[0]/l,Ue=se[1]/x,ir=Math.max(0,-Ee,Ee-1,-Ue,Ue-1);return ir&&it!==void 0&&q(Ee,Ue,it,nt)&&(ir=0),ir&&ke&&q(Ee,Ue,ke[0]/l,ke[1]/x)&&(ir=0),(1+o.toleranceGrowth*ir)*M}function Tt(se,ke){var Ee=se[0]-ke[0],Ue=se[1]-ke[1];return Math.sqrt(Ee*Ee+Ue*Ue)}var wt=o.maxScreensAway,It=-l*wt,Ct=l*(1+wt),Nt=-x*wt,ee=x*(1+wt),Jt=[[It,Nt,Ct,Nt],[Ct,Nt,Ct,ee],[Ct,ee,It,ee],[It,ee,It,Nt]],te,Kt,mt,bt,vt,Ut;function re(se,ke){for(var Ee=[],Ue=0,ir=0;ir<4;ir++){var ar=Jt[ir],Ye=i(se[0],se[1],ke[0],ke[1],ar[0],ar[1],ar[2],ar[3]);Ye&&(!Ue||Math.abs(Ye.x-Ee[0][0])>1||Math.abs(Ye.y-Ee[0][1])>1)&&(Ye=[Ye.x,Ye.y],Ue&&Tt(Ye,se)<Tt(Ee[0],se)?Ee.unshift(Ye):Ee.push(Ye),Ue++)}return Ee}function Zt(se){if(se[0]<It||se[0]>Ct||se[1]<Nt||se[1]>ee)return[n(se[0],It,Ct),n(se[1],Nt,ee)]}function ue(se,ke){if(se[0]===ke[0]&&(se[0]===It||se[0]===Ct)||se[1]===ke[1]&&(se[1]===Nt||se[1]===ee))return!0}function Me(se,ke){var Ee=[],Ue=Zt(se),ir=Zt(ke);return Ue&&ir&&ue(Ue,ir)||(Ue&&Ee.push(Ue),ir&&Ee.push(ir)),Ee}function Ce(se,ke,Ee){return function(Ue,ir){var ar=Zt(Ue),Ye=Zt(ir),Er=[];if(ar&&Ye&&ue(ar,Ye))return Er;ar&&Er.push(ar),Ye&&Er.push(Ye);var pn=2*r.constrain((Ue[se]+ir[se])/2,ke,Ee)-((ar||Ue)[se]+(Ye||ir)[se]);if(pn){var dn;ar&&Ye?dn=pn>0==ar[se]>Ye[se]?ar:Ye:dn=ar||Ye,dn[se]+=pn}return Er}}var We;T==="linear"||T==="spline"?We=re:T==="hv"||T==="vh"?We=Me:T==="hvh"?We=Ce(0,It,Ct):T==="vhv"&&(We=Ce(1,Nt,ee));function qe(se,ke){var Ee=ke[0]-se[0],Ue=(ke[1]-se[1])/Ee,ir=(se[1]*ke[0]-ke[1]*se[0])/Ee;return ir>0?[Ue>0?It:Ct,ee]:[Ue>0?Ct:It,Nt]}function vr(se){var ke=se[0],Ee=se[1],Ue=ke===L[D-1][0],ir=Ee===L[D-1][1];if(!(Ue&&ir))if(D>1){var ar=ke===L[D-2][0],Ye=Ee===L[D-2][1];Ue&&(ke===It||ke===Ct)&&ar?Ye?D--:L[D-1]=se:ir&&(Ee===Nt||Ee===ee)&&Ye?ar?D--:L[D-1]=se:L[D++]=se}else L[D++]=se}function _r(se){L[D-1][0]!==se[0]&&L[D-1][1]!==se[1]&&vr([mt,bt]),vr(se),vt=null,mt=bt=0}var er=r.isArrayOrTypedArray(S);function Mr(se){if(se&&y&&(se.i=B,se.d=a,se.trace=f,se.marker=er?S[se.i]:S,se.backoff=y),it=se[0]/l,nt=se[1]/x,te=se[0]<It?It:se[0]>Ct?Ct:0,Kt=se[1]<Nt?Nt:se[1]>ee?ee:0,te||Kt){if(!D)L[D++]=[te||se[0],Kt||se[1]];else if(vt){var ke=We(vt,se);ke.length>1&&(_r(ke[0]),L[D++]=ke[1])}else Ut=We(L[D-1],se)[0],L[D++]=Ut;var Ee=L[D-1];te&&Kt&&(Ee[0]!==te||Ee[1]!==Kt)?(vt&&(mt!==te&&bt!==Kt?vr(mt&&bt?qe(vt,se):[mt||te,bt||Kt]):mt&&bt&&vr([mt,bt])),vr([te,Kt])):mt-te&&bt-Kt&&vr([te||mt,Kt||bt]),vt=se,mt=te,bt=Kt}else vt&&_r(We(vt,se)[0]),L[D++]=se}for(B=0;B<P;B++)if(R=J(B),!!R){for(D=0,vt=null,Mr(R),B++;B<P;B++){if(F=J(B),!F){if(k)continue;break}if(!c||!s.simplify){Mr(F);continue}var Ir=J(B+1);if(st=Tt(F,R),!(!(h&&(D===0||D===P-1))&&st<dt(F,Ir)*_)){for(rt=[(F[0]-R[0])/st,(F[1]-R[1])/st],N=R,et=st,K=X=Q=0,G=!1,I=F,B++;B<a.length;B++){if(j=Ir,Ir=J(B+1),!j){if(k)continue;break}if(ct=[j[0]-R[0],j[1]-R[1]],ut=ct[0]*rt[1]-ct[1]*rt[0],X=Math.min(X,ut),Q=Math.max(Q,ut),Q-X>dt(j,Ir))break;I=j,ot=ct[0]*rt[0]+ct[1]*rt[1],ot>et?(et=ot,F=j,G=!1):ot<K&&(K=ot,N=j,G=!0)}if(G?(Mr(F),I!==N&&Mr(N)):(N!==R&&Mr(N),I!==F&&Mr(F)),Mr(I),B>=a.length||!j)break;Mr(j),R=j}}vt&&vr([mt||vt[0],bt||vt[1]]),b.push(L.slice(0,D))}var de=T.slice(T.length-1);if(y&&de!=="h"&&de!=="v"){for(var Dt=!1,qt=-1,_t=[],lt=0;lt<b.length;lt++)for(var yt=0;yt<b[lt].length-1;yt++){var St=b[lt][yt],Ht=b[lt][yt+1],Yt=u.applyBackoff(Ht,St);(Yt[0]!==Ht[0]||Yt[1]!==Ht[1])&&(Dt=!0),_t[qt+1]||(qt++,_t[qt]=[St,[Yt[0],Yt[1]]])}return Dt?_t:b}return b}}),Ob=Vt((Z,V)=>{var u={tonextx:1,tonexty:1,tonext:1};V.exports=function(d,E,A){var t,e,r,i,n,o={},a=!1,s=-1,f=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]=f,f++):t.fill in u&&v>=0?n=v:(n=v=f,f++),n<s&&(a=!0),t._groupIndex=s=n;var g=A.slice();a&&g.sort(function(w,l){var x=w[0].trace,y=l[0].trace;return x._groupIndex-y._groupIndex||x.index-y.index});var m={};for(e=0;e<g.length;e++)t=g[e][0].trace,r=t.stackgroup||"",t.visible===!0?(t._nexttrace=null,t.fill in u&&(i=m[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),m[r]=t):t._prevtrace=t._nexttrace=t._ownfill=null;return g}}),Tm=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Xr(),A=E.ensureSingle,t=E.identity,e=Eo(),r=nu(),i=Pb(),n=Ob(),o=Rg().tester;V.exports=function(v,g,m,w,l,x){var y,S,k=!l,M=!!l&&l.duration>0,T=n(v,g,m);if(y=w.selectAll("g.trace").data(T,function(h){return h[0].trace.uid}),y.enter().append("g").attr("class",function(h){return"trace scatter trace"+h[0].trace.uid}).style("stroke-miterlimit",2),y.order(),a(v,y,g),M){x&&(S=x());var c=u.transition().duration(l.duration).ease(l.easing).each("end",function(){S&&S()}).each("interrupt",function(){S&&S()});c.each(function(){w.selectAll("g.trace").each(function(h,b){s(v,b,g,h,T,this,l)})})}else y.each(function(h,b){s(v,b,g,h,T,this,l)});k&&y.exit().remove(),w.selectAll("path:not([d])").remove()};function a(v,g,m){g.each(function(w){var l=A(u.select(this),"g","fills");e.setClipUrl(l,m.layerClipId,v);var x=w[0].trace,y=[];x._ownfill&&y.push("_ownFill"),x._nexttrace&&y.push("_nextFill");var S=l.selectAll("g").data(y,t);S.enter().append("g"),S.exit().each(function(k){x[k]=null}).remove(),S.order().each(function(k){x[k]=A(u.select(this),"path","js-fill")})})}function s(v,g,m,w,l,x,y){var S=v._context.staticPlot,k;f(v,g,m,w,l);var M=!!y&&y.duration>0;function T(_r){return M?_r.transition():_r}var c=m.xaxis,h=m.yaxis,b=w[0].trace,_=b.line,P=u.select(x),L=A(P,"g","errorbars"),D=A(P,"g","lines"),B=A(P,"g","points"),R=A(P,"g","text");if(d.getComponentMethod("errorbars","plot")(v,L,m,y),b.visible!==!0)return;T(P).style("opacity",b.opacity);var I,F,N=b.fill.charAt(b.fill.length-1);N!=="x"&&N!=="y"&&(N="");var j,G;N==="y"?(j=1,G=h.c2p(0,!0)):N==="x"&&(j=0,G=c.c2p(0,!0)),w[0][m.isRangePlot?"nodeRangePlot3":"node3"]=P;var rt="",ct=[],st=b._prevtrace,et=null,K=null;st&&(rt=st._prevRevpath||"",F=st._nextFill,ct=st._ownPolygons,et=st._fillsegments,K=st._fillElement);var ot,X,Q="",ut="",J,q,it,nt,dt,Tt,wt=[];b._polygons=[];var It=[],Ct=[],Nt=E.noop;if(I=b._ownFill,r.hasLines(b)||b.fill!=="none"){F&&F.datum(w),["hv","vh","hvh","vhv"].indexOf(_.shape)!==-1?(J=e.steps(_.shape),q=e.steps(_.shape.split("").reverse().join(""))):_.shape==="spline"?J=q=function(_r){var er=_r[_r.length-1];return _r.length>1&&_r[0][0]===er[0]&&_r[0][1]===er[1]?e.smoothclosed(_r.slice(1),_.smoothing):e.smoothopen(_r,_.smoothing)}:J=q=function(_r){return"M"+_r.join("L")},it=function(_r){return q(_r.reverse())},Ct=i(w,{xaxis:c,yaxis:h,trace:b,connectGaps:b.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,backoff:_.backoff,simplify:_.simplify,fill:b.fill}),It=new Array(Ct.length);var ee=0;for(k=0;k<Ct.length;k++){var Jt,te=Ct[k];!Jt||!N?(Jt=te.slice(),It[ee]=Jt,ee++):Jt.push.apply(Jt,te)}b._fillElement=null,b._fillExclusionElement=K,b._fillsegments=It.slice(0,ee),It=b._fillsegments,Ct.length&&(nt=Ct[0][0].slice(),dt=Ct[Ct.length-1],Tt=dt[dt.length-1].slice()),Nt=function(_r){return function(er){if(ot=J(er),X=it(er),Q?N?(Q+="L"+ot.substr(1),ut=X+("L"+ut.substr(1))):(Q+="Z"+ot,ut=X+"Z"+ut):(Q=ot,ut=X),r.hasLines(b)){var Mr=u.select(this);if(Mr.datum(w),_r)T(Mr.style("opacity",0).attr("d",ot).call(e.lineGroupStyle)).style("opacity",1);else{var Ir=T(Mr);Ir.attr("d",ot),e.singleLineStyle(w,Ir)}}}}}var Kt=D.selectAll(".js-line").data(Ct);T(Kt.exit()).style("opacity",0).remove(),Kt.each(Nt(!1)),Kt.enter().append("path").classed("js-line",!0).style("vector-effect",S?"none":"non-scaling-stroke").call(e.lineGroupStyle).each(Nt(!0)),e.setClipUrl(Kt,m.layerClipId,v);function mt(_r){T(_r).attr("d","M0,0Z")}var bt=function(){var _r=new Array(It.length);for(k=0;k<It.length;k++)_r[k]=o(It[k]);return _r},vt=function(_r){var er,Mr;if(!_r||_r.length===0)for(er=new Array(It.length),Mr=0;Mr<It.length;Mr++){var Ir=It[Mr][0].slice(),de=It[Mr][It[Mr].length-1].slice();Ir[j]=de[j]=G;var Dt=[de,Ir],qt=Dt.concat(It[Mr]);er[Mr]=o(qt)}else{for(er=new Array(_r.length-1+It.length),Mr=0;Mr<_r.length-1;Mr++)er[Mr]=o(_r[Mr]);var _t=_r[_r.length-1].slice();for(_t.reverse(),Mr=0;Mr<It.length;Mr++)er[_r.length-1+Mr]=o(It[Mr].concat(_t))}return er};Ct.length?(I?(I.datum(w),nt&&Tt&&(N?(nt[j]=Tt[j]=G,T(I).attr("d","M"+Tt+"L"+nt+"L"+Q.substr(1)).call(e.singleFillStyle,v),wt=vt(null)):(T(I).attr("d",Q+"Z").call(e.singleFillStyle,v),wt=bt())),b._polygons=wt,b._fillElement=I):F&&(b.fill.substr(0,6)==="tonext"&&Q&&rt?(b.fill==="tonext"?(T(F).attr("d",Q+"Z"+rt+"Z").call(e.singleFillStyle,v),wt=bt(),b._polygons=wt.concat(ct)):(T(F).attr("d",Q+"L"+rt.substr(1)+"Z").call(e.singleFillStyle,v),wt=vt(et),b._polygons=wt),b._fillElement=F):mt(F)),b._prevRevpath=ut):(I?mt(I):F&&mt(F),b._prevRevpath=null),b._ownPolygons=wt;function Ut(_r){return _r.filter(function(er){return!er.gap&&er.vis})}function re(_r){return _r.filter(function(er){return er.vis})}function Zt(_r){return _r.filter(function(er){return!er.gap})}function ue(_r){return _r.id}function Me(_r){if(_r.ids)return ue}function Ce(){return!1}function We(_r,er,Mr){var Ir,de,Dt,qt=Mr[0].trace,_t=r.hasMarkers(qt),lt=r.hasText(qt),yt=Me(qt),St=Ce,Ht=Ce;if(_t||lt){var Yt=t,se=qt.stackgroup,ke=se&&v._fullLayout._scatterStackOpts[c._id+h._id][se].stackgaps==="infer zero";qt.marker.maxdisplayed||qt._needsCull?Yt=ke?re:Ut:se&&!ke&&(Yt=Zt),_t&&(St=Yt),lt&&(Ht=Yt)}de=_r.selectAll("path.point"),Ir=de.data(St,yt);var Ee=Ir.enter().append("path").classed("point",!0);M&&Ee.call(e.pointStyle,qt,v).call(e.translatePoints,c,h).style("opacity",0).transition().style("opacity",1),Ir.order();var Ue;_t&&(Ue=e.makePointStyleFns(qt)),Ir.each(function(ir){var ar=u.select(this),Ye=T(ar);Dt=e.translatePoint(ir,Ye,c,h),Dt?(e.singlePointStyle(ir,Ye,qt,Ue,v),m.layerClipId&&e.hideOutsideRangePoint(ir,Ye,c,h,qt.xcalendar,qt.ycalendar),qt.customdata&&ar.classed("plotly-customdata",ir.data!==null&&ir.data!==void 0)):Ye.remove()}),M?Ir.exit().transition().style("opacity",0).remove():Ir.exit().remove(),de=er.selectAll("g"),Ir=de.data(Ht,yt),Ir.enter().append("g").classed("textpoint",!0).append("text"),Ir.order(),Ir.each(function(ir){var ar=u.select(this),Ye=T(ar.select("text"));Dt=e.translatePoint(ir,Ye,c,h),Dt?m.layerClipId&&e.hideOutsideRangePoint(ir,ar,c,h,qt.xcalendar,qt.ycalendar):ar.remove()}),Ir.selectAll("text").call(e.textPointStyle,qt,v).each(function(ir){var ar=c.c2p(ir.x),Ye=h.c2p(ir.y);u.select(this).selectAll("tspan.line").each(function(){T(u.select(this)).attr({x:ar,y:Ye})})}),Ir.exit().remove()}B.datum(w),R.datum(w),We(B,R,w);var qe=b.cliponaxis===!1,vr=qe?null:m.layerClipId;e.setClipUrl(B,vr,v),e.setClipUrl(R,vr,v)}function f(v,g,m,w,l){var x=m.xaxis,y=m.yaxis,S=u.extent(E.simpleMap(x.range,x.r2c)),k=u.extent(E.simpleMap(y.range,y.r2c)),M=w[0].trace;if(r.hasMarkers(M)){var T=M.marker.maxdisplayed;if(T!==0){var c=w.filter(function(P){return P.x>=S[0]&&P.x<=S[1]&&P.y>=k[0]&&P.y<=k[1]}),h=Math.ceil(c.length/T),b=0;l.forEach(function(P,L){var D=P[0].trace;r.hasMarkers(D)&&D.marker.maxdisplayed>0&&L<g&&b++});var _=Math.round(b*h/3+Math.floor(b/3)*h/7.1);w.forEach(function(P){delete P.vis}),c.forEach(function(P,L){Math.round((L+_)%h)===0&&(P.vis=!0)})}}}}),Gf=Vt((Z,V)=>{V.exports={container:"marker",min:"cmin",max:"cmax"}}),$y=Vt((Z,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e={_fullLayout:A},r=u.getFromTrace(e,E,"x"),i=u.getFromTrace(e,E,"y"),n=d.orig_x;n===void 0&&(n=d.x);var o=d.orig_y;return o===void 0&&(o=d.y),t.xLabel=u.tickText(r,r.c2l(n),!0).text,t.yLabel=u.tickText(i,i.c2l(o),!0).text,t}}),mh=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=ji();function A(i){var n=u.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=u.select(this),s=o.trace||o[0].trace;t(a,s,i)}),n.selectAll("g.text").each(function(o){var a=u.select(this),s=o.trace||o[0].trace;e(a,s,i)}),n.selectAll("g.trace path.js-line").call(d.lineGroupStyle),n.selectAll("g.trace path.js-fill").call(d.fillGroupStyle,i,!1),E.getComponentMethod("errorbars","style")(n)}function t(i,n,o){d.pointStyle(i.selectAll("path.point"),n,o)}function e(i,n,o){d.textPointStyle(i.selectAll("text"),n,o)}function r(i,n,o){var a=n[0].trace;a.selectedpoints?(d.selectedPointStyle(o.selectAll("path.point"),a),d.selectedTextStyle(o.selectAll("text"),a)):(t(o,a,i),e(o,a,i))}V.exports={style:A,stylePoints:t,styleText:e,styleOnSelect:r}}),km=Vt((Z,V)=>{var u=Pi(),d=nu();V.exports=function(E,A){var t,e;if(E.mode==="lines")return t=E.line.color,t&&u.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&&u.opacity(r)?r:i&&u.opacity(i)&&(A.mlw||((E.marker||{}).line||{}).width)?i:"",e?u.opacity(e)<.3?u.addOpacity(e,.3):e:(t=(E.line||{}).color,t&&u.opacity(t)&&d.hasLines(E)&&E.line.width?t:E.fillcolor)}}),Am=Vt((Z,V)=>{var u=Xr(),d=hc(),E=ji(),A=km(),t=Pi(),e=u.fillText;V.exports=function(r,i,n,o){var a=r.cd,s=a[0].trace,f=r.xa,v=r.ya,g=f.c2p(i),m=v.c2p(n),w=[g,m],l=s.hoveron||"",x=s.mode.indexOf("markers")!==-1?3:.5,y=!!s.xperiodalignment,S=!!s.yperiodalignment;if(l.indexOf("points")!==-1){var k=function(rt){if(y){var ct=f.c2p(rt.xStart),st=f.c2p(rt.xEnd);return g>=Math.min(ct,st)&&g<=Math.max(ct,st)?0:1/0}var et=Math.max(3,rt.mrc||0),K=1-1/et,ot=Math.abs(f.c2p(rt.x)-g);return ot<et?K*ot/et:ot-et+K},M=function(rt){if(S){var ct=v.c2p(rt.yStart),st=v.c2p(rt.yEnd);return m>=Math.min(ct,st)&&m<=Math.max(ct,st)?0:1/0}var et=Math.max(3,rt.mrc||0),K=1-1/et,ot=Math.abs(v.c2p(rt.y)-m);return ot<et?K*ot/et:ot-et+K},T=function(rt){var ct=Math.max(x,rt.mrc||0),st=f.c2p(rt.x)-g,et=v.c2p(rt.y)-m;return Math.max(Math.sqrt(st*st+et*et)-ct,1-x/ct)},c=d.getDistanceFunction(o,k,M,T);if(d.getClosest(a,c,r),r.index!==!1){var h=a[r.index],b=f.c2p(h.x,!0),_=v.c2p(h.y,!0),P=h.mrc||1;r.index=h.i;var L=a[0].t.orientation,D=L&&(h.sNorm||h.s),B=L==="h"?D:h.orig_x!==void 0?h.orig_x:h.x,R=L==="v"?D:h.orig_y!==void 0?h.orig_y:h.y;return u.extendFlat(r,{color:A(s,h),x0:b-P,x1:b+P,xLabelVal:B,y0:_-P,y1:_+P,yLabelVal:R,spikeDistance:T(h),hovertemplate:s.hovertemplate}),e(h,s,r),E.getComponentMethod("errorbars","hoverInfo")(h,s,r),[r]}}function I(rt){if(!rt)return!1;var ct=rt.node();try{var st=new DOMPoint(w[0],w[1]);return ct.isPointInFill(st)}catch{var et=ct.ownerSVGElement.createSVGPoint();return et.x=w[0],et.y=w[1],ct.isPointInFill(et)}}function F(rt){var ct,st=[],et=1/0,K=-1/0,ot=1/0,X=-1/0,Q;for(ct=0;ct<rt.length;ct++){var ut=rt[ct];ut.contains(w)&&(st.push(ut),ot=Math.min(ot,ut.ymin),X=Math.max(X,ut.ymax))}if(st.length===0)return null;ot=Math.max(ot,0),X=Math.min(X,v._length),Q=(ot+X)/2;var J,q,it,nt,dt,Tt,wt;for(ct=0;ct<st.length;ct++)for(q=st[ct].pts,J=1;J<q.length;J++)Tt=q[J-1][1],wt=q[J][1],Tt>Q!=wt>=Q&&(nt=q[J-1][0],dt=q[J][0],wt-Tt&&(it=nt+(dt-nt)*(Q-Tt)/(wt-Tt),et=Math.min(et,it),K=Math.max(K,it)));return et=Math.max(et,0),K=Math.min(K,f._length),{x0:et,x1:K,y0:Q,y1:Q}}if(l.indexOf("fills")!==-1&&s._fillElement){var N=I(s._fillElement)&&!I(s._fillExclusionElement);if(N){var j=F(s._polygons);j===null&&(j={x0:w[0],x1:w[0],y0:w[1],y1:w[1]});var G=t.defaultLine;return t.opacity(s.fillcolor)?G=s.fillcolor:t.opacity((s.line||{}).color)&&(G=s.line.color),u.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&&!u.isArrayOrTypedArray(s.text)?r.text=String(s.text):r.text=s.name,[r]}}}}),Mm=Vt((Z,V)=>{var u=nu();V.exports=function(d,E){var A=d.cd,t=d.xaxis,e=d.yaxis,r=[],i=A[0].trace,n,o,a,s,f=!u.hasMarkers(i)&&!u.hasText(i);if(f)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,d)?(r.push({pointNumber:o.i,x:t.c2d(o.x),y:e.c2d(o.y)}),o.selected=1):o.selected=0;return r}}),Ik=Vt((Z,V)=>{V.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),Db=Vt((Z,V)=>{var u=ji().traceIs,d=xm();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 f=o+"calendar",v=s[f],g={noMultiCategory:!u(s,"cartesian")||u(s,"noMultiCategory")};if(s.type==="box"&&s._hasPreCompStats&&o==={h:"x",v:"y"}[s.orientation||"v"]&&(g.noMultiCategory=!0),g.autotypenumbers=r.autotypenumbers,e(s,o)){var m=t(s),w=[];for(a=0;a<i.length;a++){var l=i[a];!u(l,"box-violin")||(l[o+"axis"]||o)!==n||(l[m]!==void 0?w.push(l[m][0]):l.name!==void 0?w.push(l.name):w.push("text"),l[f]!==v&&(v=void 0))}r.type=d(w,v,g)}else if(s.type==="splom"){var x=s.dimensions,y=x[s._axesDim[n]];y.visible&&(r.type=d(y.values,v,g))}else r.type=d(s[o]||[s[o+"0"]],v,g)}}}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=u(r,"box-violin"),a=u(r._fullInput||{},"candlestick");return o&&!a&&i===n&&r[n]===void 0&&r[n+"0"]===void 0}}),Jy=Vt((Z,V)=>{var u=rh().isTypedArraySpec;function d(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||u(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=d(A,e).sort(),o==="category ascending"?A._initialCategories=a:o==="category descending"&&(A._initialCategories=a.reverse()))}}}),Ug=Vt((Z,V)=>{var u=kf().mix,d=nf(),E=Xr();V.exports=function(A,t,e,r){r=r||{};var i=r.dfltColor;function n(h,b){return E.coerce2(A,t,r.attributes,h,b)}var o=n("linecolor",i),a=n("linewidth"),s=e("showline",r.showLine||!!o||!!a);s||(delete t.linecolor,delete t.linewidth);var f=u(i,r.bgColor,r.blend||d.lightFraction).toRgbString(),v=n("gridcolor",f),g=n("gridwidth"),m=n("griddash"),w=e("showgrid",r.showGrid||!!v||!!g||!!m);if(w||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),r.hasMinor){var l=u(t.gridcolor,r.bgColor,67).toRgbString(),x=n("minor.gridcolor",l),y=n("minor.gridwidth",t.gridwidth||1),S=n("minor.griddash",t.griddash||"solid"),k=e("minor.showgrid",!!x||!!y||!!S);k||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!r.noZeroLine){n("zerolinelayer");var M=n("zerolinecolor",i),T=n("zerolinewidth"),c=e("zeroline",r.showGrid||!!M||!!T);c||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}),Vg=Vt((Z,V)=>{var u=Lo(),d=ji(),E=Xr(),A=cl(),t=Wf(),e=Pf(),r=i0(),i=vm(),n=Td(),o=kd(),a=Jy(),s=Ug(),f=cb(),v=mp(),g=Af().WEEKDAY_PATTERN,m=Af().HOUR_PATTERN;V.exports=function(y,S,k,M,T){var c=M.letter,h=M.font||{},b=M.splomStash||{},_=k("visible",!M.visibleDflt),P=S._template||{},L=S.type||P.type||"-",D;if(L==="date"){var B=d.getComponentMethod("calendars","handleDefaults");B(y,S,"calendar",M.calendar),M.noTicklabelmode||(D=k("ticklabelmode"))}!M.noTicklabelindex&&(L==="date"||L==="linear")&&k("ticklabelindex");var R="";(!M.noTicklabelposition||L==="multicategory")&&(R=E.coerce(y,S,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:D==="period"?["outside","inside"]:c==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),M.noTicklabeloverflow||k("ticklabeloverflow",R.indexOf("inside")!==-1?"hide past domain":L==="category"||L==="multicategory"?"allow":"hide past div"),v(S,T),f(y,S,k,M),a(y,S,k,M),M.noHover||(L!=="category"&&k("hoverformat"),M.noUnifiedhovertitle||k("unifiedhovertitle.text"));var I=k("color"),F=I!==e.color.dflt?I:h.color,N=b.label||T._dfltTitle[c];if(o(y,S,k,L,M),!_)return S;k("title.text",N),E.coerceFont(k,"title.font",h,{overrideDflt:{size:E.bigFont(h.size),color:F}}),r(y,S,k,L);var j=M.hasMinor;if(j&&(A.newContainer(S,"minor"),r(y,S,k,L,{isMinor:!0})),n(y,S,k,L,M),i(y,S,k,M),j){var G=M.isMinor;M.isMinor=!0,i(y,S,k,M),M.isMinor=G}s(y,S,k,{dfltColor:I,bgColor:M.bgColor,showGrid:M.showGrid,hasMinor:j,attributes:e}),j&&!S.minor.ticks&&!S.minor.showgrid&&delete S.minor,(S.showline||S.ticks)&&k("mirror");var rt=L==="multicategory";if(!M.noTickson&&(L==="category"||rt)&&(S.ticks||S.showgrid)&&(rt?(k("tickson","boundaries"),delete S.ticklabelposition):k("tickson")),rt){var ct=k("showdividers");ct&&(k("dividercolor"),k("dividerwidth"))}if(L==="date")if(t(y,S,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:w}),!S.rangebreaks.length)delete S.rangebreaks;else{for(var st=0;st<S.rangebreaks.length;st++)if(S.rangebreaks[st].pattern===g){S._hasDayOfWeekBreaks=!0;break}if(v(S,T),T._has("scattergl")||T._has("splom"))for(var et=0;et<M.data.length;et++){var K=M.data[et];(K.type==="scattergl"||K.type==="splom")&&(K.visible=!1,E.warn(K.type+" traces do not work on axes with rangebreaks. Setting trace "+K.index+" to `visible: false`."))}}return S};function w(y,S,k){function M(B,R){return E.coerce(y,S,e.rangebreaks,B,R)}var T=M("enabled");if(T){var c=M("bounds");if(c&&c.length>=2){var h="",b,_;if(c.length===2){for(b=0;b<2;b++)if(_=x(c[b]),_){h=g;break}}var P=M("pattern",h);if(P===g)for(b=0;b<2;b++)_=x(c[b]),_&&(S.bounds[b]=c[b]=_-1);if(P)for(b=0;b<2;b++)switch(_=c[b],P){case g:if(!u(_)){S.enabled=!1;return}if(_=+_,_!==Math.floor(_)||_<0||_>=7){S.enabled=!1;return}S.bounds[b]=c[b]=_;break;case m:if(!u(_)){S.enabled=!1;return}if(_=+_,_<0||_>24){S.enabled=!1;return}S.bounds[b]=c[b]=_;break}if(k.autorange===!1){var L=k.range;if(L[0]<L[1]){if(c[0]<L[0]&&c[1]>L[1]){S.enabled=!1;return}}else if(c[0]>L[0]&&c[1]<L[1]){S.enabled=!1;return}}}else{var D=M("values");if(D&&D.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(y){if(typeof y=="string")return l[y.substr(0,3).toLowerCase()]}}),Qy=Vt((Z,V)=>{var u=Lo(),d=Xr();V.exports=function(E,A,t,e){var r=e.counterAxes||[],i=e.overlayableAxes||[],n=e.letter,o=e.grid,a=e.overlayingDomain,s,f,v,g,m,w;o&&(f=o._domains[n][o._axisMap[A._id]],s=o._anchors[A._id],f&&(v=o[n+"side"].split(" ")[0],g=o.domain[n][v==="right"||v==="top"?1:0])),f=f||[0,1],s=s||(u(E.position)?"free":r[0]||"free"),v=v||(n==="x"?"bottom":"left"),g=g||0,m=0,w=!1;var l=d.coerce(E,A,{anchor:{valType:"enumerated",values:["free"].concat(r),dflt:s}},"anchor"),x=d.coerce(E,A,{side:{valType:"enumerated",values:n==="x"?["bottom","top"]:["left","right"],dflt:v}},"side");if(l==="free"){if(n==="y"){var y=t("autoshift");y&&(g=x==="left"?a[0]:a[1],w=A.automargin?A.automargin:!0,m=x==="left"?-3:3),t("shift",m)}t("position",g)}t("automargin",w);var S=!1;if(i.length&&(S=d.coerce(E,A,{overlaying:{valType:"enumerated",values:[!1].concat(i),dflt:!1}},"overlaying")),!S){var k=t("domain",f);k[0]>k[1]-1/4096&&(A.domain=f),d.noneOrAll(E.domain,A.domain,f),A.tickmode==="sync"&&(A.tickmode="auto")}return t("layer"),A}}),Pk=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=dh().isUnifiedHover,A=vb(),t=cl(),e=dm(),r=Pf(),i=Db(),n=Vg(),o=s0(),a=Qy(),s=cc(),f=s.id2name,v=s.name2id,g=Af().AX_ID_PATTERN,m=ji(),w=m.traceIs,l=m.getComponentMethod;function x(y,S,k){Array.isArray(y[S])?y[S].push(k):y[S]=[k]}V.exports=function(y,S,k){var M=S.autotypenumbers,T={},c={},h={},b={},_={},P={},L={},D={},B={},R={},I,F;for(I=0;I<k.length;I++){var N=k[I];if(w(N,"cartesian")){var j;if(N.xaxis)j=f(N.xaxis),x(T,j,N);else if(N.xaxes)for(F=0;F<N.xaxes.length;F++)x(T,f(N.xaxes[F]),N);var G;if(N.yaxis)G=f(N.yaxis),x(T,G,N);else if(N.yaxes)for(F=0;F<N.yaxes.length;F++)x(T,f(N.yaxes[F]),N);if(N.type==="funnel"?N.orientation==="h"?(j&&(c[j]=!0),G&&(L[G]=!0)):G&&(h[G]=!0):N.type==="image"?(G&&(D[G]=!0),j&&(D[j]=!0)):(G&&(_[G]=!0,P[G]=!0),(!w(N,"carpet")||N.type==="carpet"&&!N._cheater)&&j&&(b[j]=!0)),N.type==="carpet"&&N._cheater&&j&&(c[j]=!0),w(N,"2dMap")&&(B[j]=!0,B[G]=!0),w(N,"oriented")){var rt=N.orientation==="h"?G:j;R[rt]=!0}}}var ct=S._subplots,st=ct.xaxis,et=ct.yaxis,K=u.simpleMap(st,f),ot=u.simpleMap(et,f),X=K.concat(ot),Q=d.background;st.length&&et.length&&(Q=u.coerce(y,S,e,"plot_bgcolor"));var ut=d.combine(Q,S.paper_bgcolor),J,q,it,nt,dt;function Tt(){var yt=T[J]||[];dt._traceIndices=yt.map(function(St){return St.index}),dt._annIndices=[],dt._shapeIndices=[],dt._selectionIndices=[],dt._imgIndices=[],dt._subplotsWith=[],dt._counterAxes=[],dt._name=dt._attr=J,dt._id=q}function wt(yt,St){return u.coerce(nt,dt,r,yt,St)}function It(yt,St){return u.coerce2(nt,dt,r,yt,St)}function Ct(yt){return yt==="x"?et:st}function Nt(yt,St){for(var Ht=yt==="x"?K:ot,Yt=[],se=0;se<Ht.length;se++){var ke=Ht[se];ke!==St&&!(y[ke]||{}).overlaying&&Yt.push(v(ke))}return Yt}var ee={x:Ct("x"),y:Ct("y")},Jt=ee.x.concat(ee.y),te={},Kt=[];function mt(){var yt=nt.matches;g.test(yt)&&Jt.indexOf(yt)===-1&&(te[yt]=nt.type,Kt=Object.keys(te))}var bt=A(y,S),vt=E(bt);for(I=0;I<X.length;I++){J=X[I],q=v(J),it=J.charAt(0),u.isPlainObject(y[J])||(y[J]={}),nt=y[J],dt=t.newContainer(S,J,it+"axis"),Tt();var Ut=it==="x"&&!b[J]&&c[J]||it==="y"&&!_[J]&&h[J],re=it==="y"&&(!P[J]&&L[J]||D[J]),Zt={hasMinor:!0,letter:it,font:S.font,outerTicks:B[J],showGrid:!R[J],data:T[J]||[],bgColor:ut,calendar:S.calendar,automargin:!0,visibleDflt:Ut,reverseDflt:re,autotypenumbersDflt:M,splomStash:((S._splomAxes||{})[it]||{})[q],noAutotickangles:it==="y"};wt("uirevision",S.uirevision),i(nt,dt,wt,Zt),n(nt,dt,wt,Zt,S);var ue=vt&&it===bt.charAt(0),Me=It("spikecolor",vt?dt.color:void 0),Ce=It("spikethickness",vt?1.5:void 0),We=It("spikedash",vt?"dot":void 0),qe=It("spikemode",vt?"across":void 0),vr=It("spikesnap"),_r=wt("showspikes",!!ue||!!Me||!!Ce||!!We||!!qe||!!vr);_r||(delete dt.spikecolor,delete dt.spikethickness,delete dt.spikedash,delete dt.spikemode,delete dt.spikesnap);var er=f(nt.overlaying),Mr=[0,1];if(S[er]!==void 0){var Ir=f(S[er].anchor);S[Ir]!==void 0&&(Mr=S[Ir].domain)}a(nt,dt,wt,{letter:it,counterAxes:ee[it],overlayableAxes:Nt(it,J),grid:S.grid,overlayingDomain:Mr}),wt("title.standoff"),mt(),dt._input=nt}for(I=0;I<Kt.length;){q=Kt[I++],J=f(q),it=J.charAt(0),u.isPlainObject(y[J])||(y[J]={}),nt=y[J],dt=t.newContainer(S,J,it+"axis"),Tt();var de={letter:it,font:S.font,outerTicks:B[J],showGrid:!R[J],data:[],bgColor:ut,calendar:S.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:M,splomStash:((S._splomAxes||{})[it]||{})[q]};wt("uirevision",S.uirevision),dt.type=te[q]||"linear",n(nt,dt,wt,de,S),a(nt,dt,wt,{letter:it,counterAxes:ee[it],overlayableAxes:Nt(it,J),grid:S.grid}),wt("fixedrange"),wt("modebardisable"),mt(),dt._input=nt}var Dt=l("rangeslider","handleDefaults"),qt=l("rangeselector","handleDefaults");for(I=0;I<K.length;I++)J=K[I],nt=y[J],dt=S[J],Dt(y,S,J),dt.type==="date"&&qt(nt,dt,S,ot,dt.calendar),wt("fixedrange"),wt("modebardisable");for(I=0;I<ot.length;I++){J=ot[I],nt=y[J],dt=S[J];var _t=S[f(dt.anchor)],lt=l("rangeslider","isVisible")(_t);wt("fixedrange",lt),wt("modebardisable")}o.handleDefaults(y,S,{axIds:Jt.concat(Kt).sort(s.idSort),axHasImage:D})}}),Ok=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Xr(),A=Eo(),t=yo();V.exports=function(e,r,i,n){var o=e._fullLayout;if(r.length===0){t.redrawComponents(e);return}function a(S){var k=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,k._offset,M._offset).call(A.setScale,1,1);var T=S.plot.selectAll(".scatterlayer .trace");T.selectAll(".point").call(A.setPointGroupScale,1,1),T.selectAll(".textpoint").call(A.setTextPointsScale,1,1),T.call(A.hideOutsideRangePoints,S)}function s(S,k){var M=S.plotinfo,T=M.xaxis,c=M.yaxis,h=T._length,b=c._length,_=!!S.xr1,P=!!S.yr1,L=[];if(_){var D=E.simpleMap(S.xr0,T.r2l),B=E.simpleMap(S.xr1,T.r2l),R=D[1]-D[0],I=B[1]-B[0];L[0]=(D[0]*(1-k)+k*B[0]-D[0])/(D[1]-D[0])*h,L[2]=h*(1-k+k*I/R),T.range[0]=T.l2r(D[0]*(1-k)+k*B[0]),T.range[1]=T.l2r(D[1]*(1-k)+k*B[1])}else L[0]=0,L[2]=h;if(P){var F=E.simpleMap(S.yr0,c.r2l),N=E.simpleMap(S.yr1,c.r2l),j=F[1]-F[0],G=N[1]-N[0];L[1]=(F[1]*(1-k)+k*N[1]-F[1])/(F[0]-F[1])*b,L[3]=b*(1-k+k*G/j),c.range[0]=T.l2r(F[0]*(1-k)+k*N[0]),c.range[1]=c.l2r(F[1]*(1-k)+k*N[1])}else L[1]=0,L[3]=b;t.drawOne(e,T,{skipTitle:!0}),t.drawOne(e,c,{skipTitle:!0}),t.redrawComponents(e,[T._id,c._id]);var rt=_?h/L[2]:1,ct=P?b/L[3]:1,st=_?L[0]:0,et=P?L[1]:0,K=_?L[0]/L[2]*h:0,ot=P?L[1]/L[3]*b:0,X=T._offset-K,Q=c._offset-ot;M.clipRect.call(A.setTranslate,st,et).call(A.setScale,1/rt,1/ct),M.plot.call(A.setTranslate,X,Q).call(A.setScale,rt,ct),A.setPointGroupScale(M.zoomScalePts,1/rt,1/ct),A.setTextPointsScale(M.zoomScaleTxt,1/rt,1/ct)}var f;n&&(f=n());function v(){for(var S={},k=0;k<r.length;k++){var M=r[k],T=M.plotinfo.xaxis,c=M.plotinfo.yaxis;M.xr1&&(S[T._name+".range"]=M.xr1.slice()),M.yr1&&(S[c._name+".range"]=M.yr1.slice())}return f&&f(),d.call("relayout",e,S).then(function(){for(var h=0;h<r.length;h++)a(r[h].plotinfo)})}function g(){for(var S={},k=0;k<r.length;k++){var M=r[k],T=M.plotinfo.xaxis,c=M.plotinfo.yaxis;M.xr0&&(S[T._name+".range"]=M.xr0.slice()),M.yr0&&(S[c._name+".range"]=M.yr0.slice())}return d.call("relayout",e,S).then(function(){for(var h=0;h<r.length;h++)a(r[h].plotinfo)})}var m,w,l,x=u.ease(i.easing);e._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(l),l=null,g()});function y(){w=Date.now();for(var S=Math.min(1,(w-m)/i.duration),k=x(S),M=0;M<r.length;M++)s(r[M],k);w-m>i.duration?(v(),l=window.cancelAnimationFrame(y)):l=window.requestAnimationFrame(y)}return m=Date.now(),l=window.requestAnimationFrame(y),Promise.resolve()}}),Kc=Vt(Z=>{var V=Ni(),u=ji(),d=Xr(),E=Uu(),A=Eo(),t=If().getModuleCalcData,e=cc(),r=Af(),i=Eh(),n=d.ensureSingle;function o(w,l,x){return d.ensureSingle(w,l,x,function(y){y.datum(x)})}var a=r.zindexSeparator;Z.name="cartesian",Z.attr=["xaxis","yaxis"],Z.idRoot=["x","y"],Z.idRegex=r.idRegex,Z.attrRegex=r.attrRegex,Z.attributes=Ik(),Z.layoutAttributes=Pf(),Z.supplyLayoutDefaults=Pk(),Z.transitionAxes=Ok(),Z.finalizeSubplots=function(w,l){var x=l._subplots,y=x.xaxis,S=x.yaxis,k=x.cartesian,M=k,T={},c={},h,b,_;for(h=0;h<M.length;h++){var P=M[h].split("y");T[P[0]]=1,c["y"+P[1]]=1}for(h=0;h<y.length;h++)b=y[h],T[b]||(_=(w[e.id2name(b)]||{}).anchor,r.idRegex.y.test(_)||(_="y"),k.push(b+_),M.push(b+_),c[_]||(c[_]=1,d.pushUnique(S,_)));for(h=0;h<S.length;h++)_=S[h],c[_]||(b=(w[e.id2name(_)]||{}).anchor,r.idRegex.x.test(b)||(b="x"),k.push(b+_),M.push(b+_),T[b]||(T[b]=1,d.pushUnique(y,b)));if(!M.length){b="",_="";for(var L in w)if(r.attrRegex.test(L)){var D=L.charAt(0);D==="x"?(!b||+L.substr(5)<+b.substr(5))&&(b=L):(!_||+L.substr(5)<+_.substr(5))&&(_=L)}b=b?e.name2id(b):"x",_=_?e.name2id(_):"y",y.push(b),S.push(_),k.push(b+_)}},Z.plot=function(w,l,x,y){var S=w._fullLayout,k=S._subplots.cartesian,M=w.calcdata,T;if(!Array.isArray(l))for(l=[],T=0;T<M.length;T++)l.push(T);for(var c=S._zindices,h=0;h<c.length;h++){var b=c[h];for(T=0;T<k.length;T++){var _=k[T],P=S._plots[_];if(h>0){var L=P.id;if(L.indexOf(a)!==-1)continue;L+=a+(h+1),P=d.extendFlat({},P,{id:L,plot:S._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var D=[],B,R=0;R<M.length;R++){var I=M[R],F=I[0].trace;b===(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&&D.indexOf(B)===-1&&D.push(B),D.push(I)),B=I)}s(w,P,D,x,y)}}};function s(w,l,x,y,S){for(var k=r.traceLayerClasses,M=w._fullLayout,T=M._zindices,c=M._modules,h,b,_,P=[],L=[],D=0;D<T.length;D++)for(var B=T[D],R=0;R<c.length;R++){h=c[R];var I=h.name,F=u.modules[I].categories;if(F.svg){var N=h.layerName||I+"layer",j=N+(D?Number(D)+1:""),G=h.plot;b=t(x,G,B),_=b[0],x=b[1],_.length&&P.push({i:k.indexOf(N),zindex:D,className:j,plotMethod:G,cdModule:_}),F.zoomScale&&L.push("."+j)}}P.sort(function(st,et){return(st.zindex||0)-(et.zindex||0)||st.i-et.i});var rt=l.plot.selectAll("g.mlayer").data(P,function(st){return st.className});if(rt.enter().append("g").attr("class",function(st){return st.className}).classed("mlayer",!0).classed("rangeplot",l.isRangePlot),rt.exit().remove(),rt.order(),rt.each(function(st){var et=V.select(this),K=st.className;st.plotMethod(w,l,st.cdModule,et,y,S),r.clipOnAxisFalseQuery.indexOf("."+K)===-1&&A.setClipUrl(et,l.layerClipId,w)}),M._has("scattergl")&&(h=u.getModule("scattergl"),_=t(x,h)[0],h.plot(w,l,_)),!w._context.staticPlot&&(l._hasClipOnAxisFalse&&(l.clipOnAxisFalseTraces=l.plot.selectAll(r.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),L.length)){var ct=l.plot.selectAll(L.join(",")).selectAll(".trace");l.zoomScalePts=ct.selectAll("path.point"),l.zoomScaleTxt=ct.selectAll(".textpoint")}}Z.clean=function(w,l,x,y){var S=y._plots||{},k=l._plots||{},M=y._subplots||{},T,c,h;if(y._hasOnlyLargeSploms&&!l._hasOnlyLargeSploms)for(h in S)T=S[h],T.plotgroup&&T.plotgroup.remove();var b=y._has&&y._has("gl"),_=l._has&&l._has("gl");if(b&&!_)for(h in S)T=S[h],T._scene&&T._scene.destroy();if(M.xaxis&&M.yaxis){var P=e.listIds({_fullLayout:y});for(c=0;c<P.length;c++){var L=P[c];l[e.id2name(L)]||y._infolayer.selectAll(".g-"+L+"title").remove()}}var D=y._has&&y._has("cartesian"),B=l._has&&l._has("cartesian");if(D&&!B)g(y._cartesianlayer.selectAll(".subplot"),y),y._defs.selectAll(".axesclip").remove(),delete y._axisConstraintGroups,delete y._axisMatchGroups;else if(M.cartesian)for(c=0;c<M.cartesian.length;c++){var R=M.cartesian[c];if(R.indexOf(a)===-1&&!k[R]){var I="."+R+",."+R+"-x,."+R+"-y";y._cartesianlayer.selectAll(I).remove(),m(R,y)}}},Z.drawFramework=function(w){var l=w._fullLayout,x=w.calcdata,y,S={};for(y=0;y<x.length;y++){var k=x[y][0],M=k.trace,T=M.zorder||0;S[T]||(S[T]=[]),S[T].push(k)}var c=Object.keys(S).map(Number).sort(d.sorterAsc);c.length||(c=[0]),l._zindices=c;var h=f(w),b=h.length,_=[];for(y=0;y<b;y++)_[y]=h[y].slice();for(var P=1;P<c.length;P++){var L=[];for(y=0;y<b;y++)L[y]=h[y].slice(),L[y][0]+=a+(P+1);_=_.concat(L)}var D=l._cartesianlayer.selectAll(".subplot").data(_,String);D.enter().append("g").attr("class",function(B){return"subplot "+B[0]}),D.order(),D.exit().call(g,l),D.each(function(B){var R=B[0],I=R.indexOf(a),F=I!==-1,N=F?R.slice(0,I):R,j=l._plots[R];j||(j=d.extendFlat({},l._plots[N]),j&&(j.id=R,l._plots[R]=j,l._subplots.cartesian.push(R))),j&&(j.plotgroup=V.select(this),v(w,j),F||(j.draglayer=n(l._draggers,"g",R)))})},Z.rangePlot=function(w,l,x){v(w,l),s(w,l,x),E.style(w)};function f(w){var l=w._fullLayout,x=l._zindices.length,y=l._subplots.cartesian,S=y.length,k,M,T,c,h,b,_=[],P=[];for(k=0;k<S;k++){T=y[k],c=l._plots[T],h=c.xaxis,b=c.yaxis;var L=h._mainAxis,D=b._mainAxis,B=L._id+D._id,R=l._plots[B];c.overlays=[],B!==T&&R?(c.mainplot=B,c.mainplotinfo=R,P.push(T)):(c.mainplot=void 0,c.mainplotinfo=void 0,_.push(T))}for(k=0;k<P.length;k++)T=P[k],c=l._plots[T],c.mainplotinfo.overlays.push(c);var I=_.concat(P),F=[];for(k=0;k<S;k++){T=I[k],c=l._plots[T],h=c.xaxis,b=c.yaxis;for(var N=[],j=1;j<=x;j++){var G="";for(j>1&&(G+=a+j),N.push(T+G),M=0;M<c.overlays.length;M++)N.push(c.overlays[M].id+G)}N=N.concat([h.layer,b.layer,h.overlaying||"",b.overlaying||""]),F.push(N)}return F}function v(w,l){var x=w._fullLayout,y=l.plotgroup,S=l.id,k=S.indexOf(a),M=k!==-1,T=r.layerValue2layerClass[l.xaxis.layer],c=r.layerValue2layerClass[l.yaxis.layer],h=x._hasOnlyLargeSploms,b=x._zindices.length>1,_=l.mainplotinfo;if(!l.mainplot||b)if(h)l.xlines=n(y,"path","xlines-above"),l.ylines=n(y,"path","ylines-above"),l.xaxislayer=n(y,"g","xaxislayer-above"),l.yaxislayer=n(y,"g","yaxislayer-above");else{if(!M){var P=n(y,"g","layer-subplot");l.shapelayer=n(P,"g","shapelayer"),l.imagelayer=n(P,"g","imagelayer"),_&&b?(l.minorGridlayer=_.minorGridlayer,l.gridlayer=_.gridlayer,l.zerolinelayer=_.zerolinelayer):(l.minorGridlayer=n(y,"g","minor-gridlayer"),l.gridlayer=n(y,"g","gridlayer"),l.zerolinelayer=n(y,"g","zerolinelayer"));var L=n(y,"g","layer-between");l.shapelayerBetween=n(L,"g","shapelayer"),l.imagelayerBetween=n(L,"g","imagelayer"),n(y,"path","xlines-below"),n(y,"path","ylines-below"),l.overlinesBelow=n(y,"g","overlines-below"),n(y,"g","xaxislayer-below"),n(y,"g","yaxislayer-below"),l.overaxesBelow=n(y,"g","overaxes-below")}l.overplot=n(y,"g","overplot"),l.plot=n(l.overplot,"g",S),_&&b?l.zerolinelayerAbove=_.zerolinelayerAbove:l.zerolinelayerAbove=n(y,"g","zerolinelayer-above"),M||(l.xlines=n(y,"path","xlines-above"),l.ylines=n(y,"path","ylines-above"),l.overlinesAbove=n(y,"g","overlines-above"),n(y,"g","xaxislayer-above"),n(y,"g","yaxislayer-above"),l.overaxesAbove=n(y,"g","overaxes-above"),l.xlines=y.select(".xlines-"+T),l.ylines=y.select(".ylines-"+c),l.xaxislayer=y.select(".xaxislayer-"+T),l.yaxislayer=y.select(".yaxislayer-"+c))}else{var D=_.plotgroup,B=S+"-x",R=S+"-y";l.minorGridlayer=_.minorGridlayer,l.gridlayer=_.gridlayer,l.zerolinelayer=_.zerolinelayer,l.zerolinelayerAbove=_.zerolinelayerAbove,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=D.select(".overlines-"+T).select("."+B),l.ylines=D.select(".overlines-"+c).select("."+R),l.xaxislayer=D.select(".overaxes-"+T).select("."+B),l.yaxislayer=D.select(".overaxes-"+c).select("."+R)}M||(h||(o(l.minorGridlayer,"g",l.xaxis._id),o(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(I){return I[0]}).sort(e.idSort),o(l.gridlayer,"g",l.xaxis._id),o(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(I){return I[0]}).sort(e.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function g(w,l){if(w){var x={};w.each(function(c){var h=c[0],b=V.select(this);b.remove(),m(h,l),x[h]=!0});for(var y in l._plots)for(var S=l._plots[y],k=S.overlays||[],M=0;M<k.length;M++){var T=k[M];x[T.id]&&T.plot.selectAll(".trace").remove()}}}function m(w,l){l._draggers.selectAll("g."+w).remove(),l._defs.select("#clip"+l._uid+w+"plot").remove()}Z.toSVG=function(w){var l=w._fullLayout._glimages,x=V.select(w).selectAll(".svg-container"),y=x.filter(function(k,M){return M===x.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function S(){var k=this,M=k.toDataURL("image/png"),T=l.append("svg:image");T.attr({xmlns:i.svg,"xlink:href":M,preserveAspectRatio:"none",x:0,y:0,width:k.style.width,height:k.style.height})}y.each(S)},Z.updateFx=zb().updateFx}),Dk=Vt((Z,V)=>{var u=nu();V.exports={hasLines:u.hasLines,hasMarkers:u.hasMarkers,hasText:u.hasText,isBubble:u.isBubble,attributes:pc(),layoutAttributes:Ry(),supplyDefaults:Ek(),crossTraceDefaults:Ib(),supplyLayoutDefaults:zk(),calc:Uh().calc,crossTraceCalc:Ck(),arraysToCalcdata:vp(),plot:Tm(),colorbar:Gf(),formatLabels:$y(),style:mh().style,styleOnSelect:mh().styleOnSelect,hoverPoints:Am(),selectPoints:Mm(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Kc(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),Fk=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Mb(),A=Xr(),t=A.strScale,e=A.strRotate,r=A.strTranslate;V.exports=function(i,n,o){var a=i.node(),s=E[o.arrowhead||0],f=E[o.startarrowhead||0],v=(o.arrowwidth||1)*(o.arrowsize||1),g=(o.arrowwidth||1)*(o.startarrowsize||1),m=n.indexOf("start")>=0,w=n.indexOf("end")>=0,l=s.backoff*v+o.standoff,x=f.backoff*g+o.startstandoff,y,S,k,M;if(a.nodeName==="line"){y={x:+i.attr("x1"),y:+i.attr("y1")},S={x:+i.attr("x2"),y:+i.attr("y2")};var T=y.x-S.x,c=y.y-S.y;if(k=Math.atan2(c,T),M=k+Math.PI,l&&x&&l+x>Math.sqrt(T*T+c*c)){j();return}if(l){if(l*l>T*T+c*c){j();return}var h=l*Math.cos(k),b=l*Math.sin(k);S.x+=h,S.y+=b,i.attr({x2:S.x,y2:S.y})}if(x){if(x*x>T*T+c*c){j();return}var _=x*Math.cos(k),P=x*Math.sin(k);y.x-=_,y.y-=P,i.attr({x1:y.x,y1:y.y})}}else if(a.nodeName==="path"){var L=a.getTotalLength(),D="";if(L<l+x){j();return}var B=a.getPointAtLength(0),R=a.getPointAtLength(.1);k=Math.atan2(B.y-R.y,B.x-R.x),y=a.getPointAtLength(Math.min(x,L)),D="0px,"+x+"px,";var I=a.getPointAtLength(L),F=a.getPointAtLength(L-.1);M=Math.atan2(I.y-F.y,I.x-F.x),S=a.getPointAtLength(Math.max(0,L-l));var N=D?x+l:l;D+=L-N+"px,"+L+"px",i.style("stroke-dasharray",D)}function j(){i.style("stroke-dasharray","0px,100px")}function G(rt,ct,st,et){rt.path&&(rt.noRotate&&(st=0),u.select(a.parentNode).append("path").attr({class:i.attr("class"),d:rt.path,transform:r(ct.x,ct.y)+e(st*180/Math.PI)+t(et)}).style({fill:d.rgb(o.arrowcolor),"stroke-width":0}))}m&&G(f,y,k,g),w&&G(s,S,M,v)}}),t1=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Uu(),A=Xr(),t=A.strTranslate,e=yo(),r=Pi(),i=Eo(),n=hc(),o=Dl(),a=$h(),s=ih(),f=cl().arrayEditor,v=Fk();V.exports={draw:g,drawOne:m,drawRaw:l};function g(x){var y=x._fullLayout;y._infolayer.selectAll(".annotation").remove();for(var S=0;S<y.annotations.length;S++)y.annotations[S].visible&&m(x,S);return E.previousPromises(x)}function m(x,y){var S=x._fullLayout,k=S.annotations[y]||{},M=e.getFromId(x,k.xref),T=e.getFromId(x,k.yref);M&&M.setScale(),T&&T.setScale(),l(x,k,y,!1,M,T)}function w(x,y,S,k,M){var T=M[S],c=M[S+"ref"],h=S.indexOf("y")!==-1,b=e.getRefType(c)==="domain",_=h?k.h:k.w;return x?b?T+(h?-y:y)/x._length:x.p2r(x.r2p(T)+y):T+(h?-y:y)/_}function l(x,y,S,k,M,T){var c=x._fullLayout,h=x._fullLayout._size,b=x._context.edits,_,P;k?(_="annotation-"+k,P=k+".annotations"):(_="annotation",P="annotations");var L=f(x.layout,P,y),D=L.modifyBase,B=L.modifyItem,R=L.getUpdateObj;c._infolayer.selectAll("."+_+'[data-index="'+S+'"]').remove();var I="clip"+c._uid+"_ann"+S;if(!y._input||y.visible===!1){u.selectAll("#"+I).remove();return}var F={x:{},y:{}},N=+y.textangle||0,j=c._infolayer.append("g").classed(_,!0).attr("data-index",String(S)).style("opacity",y.opacity),G=j.append("g").classed("annotation-text-g",!0),rt=b[y.showarrow?"annotationTail":"annotationPosition"],ct=y.captureevents||b.annotationText||rt;function st(wt){var It={index:S,annotation:y._input,fullAnnotation:y,event:wt};return k&&(It.subplotId=k),It}var et=G.append("g").style("pointer-events",ct?"all":null).call(a,"pointer").on("click",function(){x._dragging=!1,x.emit("plotly_clickannotation",st(u.event))});y.hovertext&&et.on("mouseover",function(){var wt=y.hoverlabel,It=wt.font,Ct=this.getBoundingClientRect(),Nt=x.getBoundingClientRect();n.loneHover({x0:Ct.left-Nt.left,x1:Ct.right-Nt.left,y:(Ct.top+Ct.bottom)/2-Nt.top,text:y.hovertext,color:wt.bgcolor,borderColor:wt.bordercolor,fontFamily:It.family,fontSize:It.size,fontColor:It.color,fontWeight:It.weight,fontStyle:It.style,fontVariant:It.variant,fontShadow:It.fontShadow,fontLineposition:It.fontLineposition,fontTextcase:It.fontTextcase},{container:c._hoverlayer.node(),outerContainer:c._paper.node(),gd:x})}).on("mouseout",function(){n.loneUnhover(c._hoverlayer.node())});var K=y.borderwidth,ot=y.borderpad,X=K+ot,Q=et.append("rect").attr("class","bg").style("stroke-width",K+"px").call(r.stroke,y.bordercolor).call(r.fill,y.bgcolor),ut=y.width||y.height,J=c._topclips.selectAll("#"+I).data(ut?[0]:[]);J.enter().append("clipPath").classed("annclip",!0).attr("id",I).append("rect"),J.exit().remove();var q=y.font,it=c._meta?A.templateString(y.text,c._meta):y.text,nt=et.append("text").classed("annotation-text",!0).text(it);function dt(wt){return wt.call(i.font,q).attr({"text-anchor":{left:"start",right:"end"}[y.align]||"middle"}),o.convertToTspans(wt,x,Tt),wt}function Tt(){var wt=nt.selectAll("a");if(wt.size()===1&&wt.text()===nt.text()){var It=et.insert("a",":first-child").attr({"xlink:xlink:href":wt.attr("xlink:href"),"xlink:xlink:show":wt.attr("xlink:show")}).style({cursor:"pointer"});It.node().appendChild(Q.node())}var Ct=et.select(".annotation-text-math-group"),Nt=!Ct.empty(),ee=i.bBox((Nt?Ct:nt).node()),Jt=ee.width,te=ee.height,Kt=y.width||Jt,mt=y.height||te,bt=Math.round(Kt+2*X),vt=Math.round(mt+2*X);function Ut(En,gn){return gn==="auto"&&(En<1/3?gn="left":En>2/3?gn="right":gn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[gn]}for(var re=!1,Zt=["x","y"],ue=0;ue<Zt.length;ue++){var Me=Zt[ue],Ce=y[Me+"ref"]||Me,We=y["a"+Me+"ref"],qe={x:M,y:T}[Me],vr=(N+(Me==="x"?0:-90))*Math.PI/180,_r=bt*Math.cos(vr),er=vt*Math.sin(vr),Mr=Math.abs(_r)+Math.abs(er),Ir=y[Me+"anchor"],de=y[Me+"shift"]*(Me==="x"?1:-1),Dt=F[Me],qt,_t,lt,yt,St,Ht=e.getRefType(Ce);if(qe&&Ht!=="domain"){var Yt=qe.r2fraction(y[Me]);(Yt<0||Yt>1)&&(We===Ce?(Yt=qe.r2fraction(y["a"+Me]),(Yt<0||Yt>1)&&(re=!0)):re=!0),qt=qe._offset+qe.r2p(y[Me]),yt=.5}else{var se=Ht==="domain";Me==="x"?(lt=y[Me],qt=se?qe._offset+qe._length*lt:qt=h.l+h.w*lt):(lt=1-y[Me],qt=se?qe._offset+qe._length*lt:qt=h.t+h.h*lt),yt=y.showarrow?.5:lt}if(y.showarrow){Dt.head=qt;var ke=y["a"+Me];if(St=_r*Ut(.5,y.xanchor)-er*Ut(.5,y.yanchor),We===Ce){var Ee=e.getRefType(We);Ee==="domain"?(Me==="y"&&(ke=1-ke),Dt.tail=qe._offset+qe._length*ke):Ee==="paper"?Me==="y"?(ke=1-ke,Dt.tail=h.t+h.h*ke):Dt.tail=h.l+h.w*ke:Dt.tail=qe._offset+qe.r2p(ke),_t=St}else Dt.tail=qt+ke,_t=St+ke;Dt.text=Dt.tail+St;var Ue=c[Me==="x"?"width":"height"];if(Ce==="paper"&&(Dt.head=A.constrain(Dt.head,1,Ue-1)),We==="pixel"){var ir=-Math.max(Dt.tail-3,Dt.text),ar=Math.min(Dt.tail+3,Dt.text)-Ue;ir>0?(Dt.tail+=ir,Dt.text+=ir):ar>0&&(Dt.tail-=ar,Dt.text-=ar)}Dt.tail+=de,Dt.head+=de}else St=Mr*Ut(yt,Ir),_t=St,Dt.text=qt+St;Dt.text+=de,St+=de,_t+=de,y["_"+Me+"padplus"]=Mr/2+_t,y["_"+Me+"padminus"]=Mr/2-_t,y["_"+Me+"size"]=Mr,y["_"+Me+"shift"]=St}if(re){et.remove();return}var Ye=0,Er=0;if(y.align!=="left"&&(Ye=(Kt-Jt)*(y.align==="center"?.5:1)),y.valign!=="top"&&(Er=(mt-te)*(y.valign==="middle"?.5:1)),Nt)Ct.select("svg").attr({x:X+Ye-1,y:X+Er}).call(i.setClipUrl,ut?I:null,x);else{var pn=X+Er-ee.top,dn=X+Ye-ee.left;nt.call(o.positionText,dn,pn).call(i.setClipUrl,ut?I:null,x)}J.select("rect").call(i.setRect,X,X,Kt,mt),Q.call(i.setRect,K/2,K/2,bt-K,vt-K),et.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 bn=function(En,gn){j.selectAll(".annotation-arrow-g").remove();var da=F.x.head,ra=F.y.head,Se=F.x.tail+En,Re=F.y.tail+gn,Ze=F.x.text+En,tr=F.y.text+gn,zr=A.rotationXYMatrix(N,Ze,tr),tn=A.apply2DTransform(zr),Yr=A.apply2DTransform2(zr),$r=+Q.attr("width"),In=+Q.attr("height"),Nn=Ze-.5*$r,Kn=Nn+$r,$n=tr-.5*In,ia=$n+In,Cn=[[Nn,$n,Nn,ia],[Nn,ia,Kn,ia],[Kn,ia,Kn,$n],[Kn,$n,Nn,$n]].map(Yr);if(!Cn.reduce(function(pe,Ke){return pe^!!A.segmentsIntersect(da,ra,da+1e6,ra+1e6,Ke[0],Ke[1],Ke[2],Ke[3])},!1)){Cn.forEach(function(pe){var Ke=A.segmentsIntersect(Se,Re,da,ra,pe[0],pe[1],pe[2],pe[3]);Ke&&(Se=Ke.x,Re=Ke.y)});var Fa=y.arrowwidth,Ga=y.arrowcolor,ve=y.arrowside,ge=j.append("g").style({opacity:r.opacity(Ga)}).classed("annotation-arrow-g",!0),dr=ge.append("path").attr("d","M"+Se+","+Re+"L"+da+","+ra).style("stroke-width",Fa+"px").call(r.stroke,r.rgb(Ga));if(v(dr,ve,y),b.annotationPosition&&dr.node().parentNode&&!k){var br=da,Tr=ra;if(y.standoff){var mr=Math.sqrt(Math.pow(da-Se,2)+Math.pow(ra-Re,2));br+=y.standoff*(Se-da)/mr,Tr+=y.standoff*(Re-ra)/mr}var kr=ge.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Se-br)+","+(Re-Tr),transform:t(br,Tr)}).style("stroke-width",Fa+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Ur,Or;s.init({element:kr.node(),gd:x,prepFn:function(){var pe=i.getTranslate(et);Ur=pe.x,Or=pe.y,M&&M.autorange&&D(M._name+".autorange",!0),T&&T.autorange&&D(T._name+".autorange",!0)},moveFn:function(pe,Ke){var xr=tn(Ur,Or),Gr=xr[0]+pe,ln=xr[1]+Ke;et.call(i.setTranslate,Gr,ln),B("x",w(M,pe,"x",h,y)),B("y",w(T,Ke,"y",h,y)),y.axref===y.xref&&B("ax",w(M,pe,"ax",h,y)),y.ayref===y.yref&&B("ay",w(T,Ke,"ay",h,y)),ge.attr("transform",t(pe,Ke)),G.attr({transform:"rotate("+N+","+Gr+","+ln+")"})},doneFn:function(){d.call("_guiRelayout",x,R());var pe=document.querySelector(".js-notes-box-panel");pe&&pe.redraw(pe.selectedObj)}})}}};if(y.showarrow&&bn(0,0),rt){var Zn;s.init({element:et.node(),gd:x,prepFn:function(){Zn=G.attr("transform")},moveFn:function(En,gn){var da="pointer";if(y.showarrow)y.axref===y.xref?B("ax",w(M,En,"ax",h,y)):B("ax",y.ax+En),y.ayref===y.yref?B("ay",w(T,gn,"ay",h.w,y)):B("ay",y.ay+gn),bn(En,gn);else{if(k)return;var ra,Se;if(M)ra=w(M,En,"x",h,y);else{var Re=y._xsize/h.w,Ze=y.x+(y._xshift-y.xshift)/h.w-Re/2;ra=s.align(Ze+En/h.w,Re,0,1,y.xanchor)}if(T)Se=w(T,gn,"y",h,y);else{var tr=y._ysize/h.h,zr=y.y-(y._yshift+y.yshift)/h.h-tr/2;Se=s.align(zr-gn/h.h,tr,0,1,y.yanchor)}B("x",ra),B("y",Se),(!M||!T)&&(da=s.getCursor(M?.5:ra,T?.5:Se,y.xanchor,y.yanchor))}G.attr({transform:t(En,gn)+Zn}),a(et,da)},clickFn:function(En,gn){y.captureevents&&x.emit("plotly_clickannotation",st(gn))},doneFn:function(){a(et),d.call("_guiRelayout",x,R());var En=document.querySelector(".js-notes-box-panel");En&&En.redraw(En.selectedObj)}})}}b.annotationText?nt.call(o.makeEditable,{delegate:et,gd:x}).call(dt).on("edit",function(wt){y.text=wt,this.call(dt),B("text",wt),M&&M.autorange&&D(M._name+".autorange",!0),T&&T.autorange&&D(T._name+".autorange",!0),d.call("_guiRelayout",x,R())}):nt.call(dt)}}),Bk=Vt((Z,V)=>{var u=Xr(),d=ji(),E=cl().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),f={},v=i._fullLayout.annotations,g,m;if(a.length||s.length){for(g=0;g<a.length;g++)m=E(i.layout,"annotations",v[a[g]]),m.modifyItem("visible",!0),u.extendFlat(f,m.getUpdateObj());for(g=0;g<s.length;g++)m=E(i.layout,"annotations",v[s[g]]),m.modifyItem("visible",!1),u.extendFlat(f,m.getUpdateObj());return d.call("update",i,{},f)}}function e(i,n){var o=i._fullLayout.annotations,a=[],s=[],f=[],v=(n||[]).length,g,m,w,l,x,y,S,k;for(g=0;g<o.length;g++)if(w=o[g],l=w.clicktoshow,l){for(m=0;m<v;m++)if(x=n[m],y=x.xaxis,S=x.yaxis,y._id===w.xref&&S._id===w.yref&&y.d2r(x.x)===r(w._xclick,y)&&S.d2r(x.y)===r(w._yclick,S)){w.visible?l==="onout"?k=s:k=f:k=a,k.push(g);break}m===v&&w.visible&&l==="onout"&&s.push(g)}return{on:a,off:s,explicitOff:f}}function r(i,n){return n.type==="log"?n.l2r(i):n.d2r(i)}}),Fb=Vt((Z,V)=>{var u=Xr(),d=Pi();V.exports=function(E,A,t,e){e("opacity");var r=e("bgcolor"),i=e("bordercolor"),n=d.opacity(i);e("borderpad");var o=e("borderwidth"),a=e("showarrow");e("text",a?" ":t._dfltTitle.annotation),e("textangle"),u.coerceFont(e,"font",t.font),e("width"),e("align");var s=e("height");if(s&&e("valign"),a){var f=e("arrowside"),v,g;f.indexOf("end")!==-1&&(v=e("arrowhead"),g=e("arrowsize")),f.indexOf("start")!==-1&&(e("startarrowhead",v),e("startarrowsize",g)),e("arrowcolor",n?A.bordercolor:d.defaultLine),e("arrowwidth",(n&&o||1)*2),e("standoff"),e("startstandoff")}var m=e("hovertext"),w=t.hoverlabel||{};if(m){var l=e("hoverlabel.bgcolor",w.bgcolor||(d.opacity(r)?d.rgb(r):d.defaultLine)),x=e("hoverlabel.bordercolor",w.bordercolor||d.contrast(l)),y=u.extendFlat({},w.font);y.color||(y.color=x),u.coerceFont(e,"hoverlabel.font",y)}e("captureevents",!!m)}}),Rk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Wf(),A=Fb(),t=l0();V.exports=function(r,i){E(r,i,{name:"annotations",handleItemDefaults:e})};function e(r,i,n){function o(h,b){return u.coerce(r,i,t,h,b)}var a=o("visible"),s=o("clicktoshow");if(a||s){A(r,i,n,o);for(var f=i.showarrow,v=["x","y"],g=[-10,-30],m={_fullLayout:n},w=0;w<2;w++){var l=v[w],x=d.coerceRef(r,i,m,l,"","paper");if(x!=="paper"){var y=d.getFromId(m,x);y._annIndices.push(i._index)}if(d.coercePosition(i,m,o,x,l,.5),f){var S="a"+l,k=d.coerceRef(r,i,m,S,"pixel",["pixel","paper"]);k!=="pixel"&&k!==x&&(k=i[S]="pixel");var M=k==="pixel"?g[w]:.4;d.coercePosition(i,m,o,k,S,M)}o(l+"anchor"),o(l+"shift")}if(u.noneOrAll(r,i,["x","y"]),f&&u.noneOrAll(r,i,["ax","ay"]),s){var T=o("xclick"),c=o("yclick");i._xclick=T===void 0?i.x:d.cleanPosition(T,m,i.xref),i._yclick=c===void 0?i.y:d.cleanPosition(c,m,i.yref)}}}}),Nk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=t1().draw;V.exports=function(e){var r=e._fullLayout,i=u.filterVisible(r.annotations);if(i.length&&e._fullData.length)return u.syncOrAsync([E,A],e)};function A(e){var r=e._fullLayout;u.filterVisible(r.annotations).forEach(function(i){var n=d.getFromId(e,i.xref),o=d.getFromId(e,i.yref),a=d.getRefType(i.xref),s=d.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"],f=e["a"+n+"ref"],v=e["_"+n+"padplus"],g=e["_"+n+"padminus"],m={x:1,y:-1}[n]*e[n+"shift"],w=3*e.arrowsize*e.arrowwidth||0,l=w+m,x=w-m,y=3*e.startarrowsize*e.arrowwidth||0,S=y+m,k=y-m,M;if(f===s){var T=d.findExtremes(r,[r.r2c(o)],{ppadplus:l,ppadminus:x}),c=d.findExtremes(r,[r.r2c(a)],{ppadplus:Math.max(v,S),ppadminus:Math.max(g,k)});M={min:[T.min[0],c.min[0]],max:[T.max[0],c.max[0]]}}else S=a?S+a:S,k=a?k-a:k,M=d.findExtremes(r,[r.r2c(o)],{ppadplus:Math.max(v,l,S),ppadminus:Math.max(g,x,k)});e._extremes[i]=M}}),jk=Vt((Z,V)=>{var u=Lo(),d=Cy();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 f(g){var m=a[g],w=null;r?w=d(m,A.range):w=Math.pow(10,m),u(w)||(w=null),e(s+g,w)}for(var v=0;v<n.length;v++)a=n[v],s="annotations["+v+"].",a[o+"ref"]===A._id&&f(o),a["a"+o+"ref"]===A._id&&f("a"+o)}}),Uk=Vt((Z,V)=>{var u=t1(),d=Bk();V.exports={moduleType:"component",name:"annotations",layoutAttributes:l0(),supplyLayoutDefaults:Rk(),includeBasePlot:jg()("annotations"),calcAutorange:Nk(),draw:u.draw,drawOne:u.drawOne,drawRaw:u.drawRaw,hasClickToShow:d.hasClickToShow,onClick:d.onClick,convertCoords:jk()}}),e1=Vt((Z,V)=>{var u=l0(),d=Cu().overrideAll,E=cl().templatedArray;V.exports=d(E("annotation",{visible:u.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:u.xanchor,xshift:u.xshift,yanchor:u.yanchor,yshift:u.yshift,text:u.text,textangle:u.textangle,font:u.font,width:u.width,height:u.height,opacity:u.opacity,align:u.align,valign:u.valign,bgcolor:u.bgcolor,bordercolor:u.bordercolor,borderpad:u.borderpad,borderwidth:u.borderwidth,showarrow:u.showarrow,arrowcolor:u.arrowcolor,arrowhead:u.arrowhead,startarrowhead:u.startarrowhead,arrowside:u.arrowside,arrowsize:u.arrowsize,startarrowsize:u.startarrowsize,arrowwidth:u.arrowwidth,standoff:u.standoff,startstandoff:u.startstandoff,hovertext:u.hovertext,hoverlabel:u.hoverlabel,captureevents:u.captureevents}),"calc","from-root")}),Vk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Wf(),A=Fb(),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,g){return u.coerce(r,i,t,v,g)}function s(v){var g=v+"axis",m={_fullLayout:{}};return m._fullLayout[g]=n[g],d.coercePosition(i,m,a,v,v,.5)}var f=a("visible");f&&(A(r,i,o.fullLayout,a),s("x"),s("y"),s("z"),u.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),u.noneOrAll(r,i,["ax","ay"])))}}),Hk=Vt((Z,V)=>{var u=Xr(),d=yo();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={},u.extendFlat(A._xa,n),d.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={},u.extendFlat(A._ya,n),d.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])}}}),Bb=Vt((Z,V)=>{function u(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 d(E,A){var t=u(E.projection,u(E.view,u(E.model,[A[0],A[1],A[2],1])));return t}V.exports=d}),qk=Vt((Z,V)=>{var u=t1().drawRaw,d=Bb(),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],f=n[s],v=t[s+"axis"],g=v.r2fraction(f);if(g<0||g>1){o=!0;break}}o?A.fullLayout._infolayer.select(".annotation-"+A.id+'[data-index="'+i+'"]').remove():(n._pdata=d(A.glplot.cameraParams,[t.xaxis.r2l(n.x)*e[0],t.yaxis.r2l(n.y)*e[1],t.zaxis.r2l(n.z)*e[2]]),u(A.graphDiv,n,i,A.id,n._xa,n._ya))}}}),Wk=Vt((Z,V)=>{var u=ji(),d=Xr();V.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e1()}}},layoutAttributes:e1(),handleDefaults:Vk(),includeBasePlot:E,convert:Hk(),draw:qk()};function E(A,t){var e=u.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&&(d.pushUnique(t._basePlotModules,e),d.pushUnique(t._subplots.gl3d,o))}}}),Rb=Vt((Z,V)=>{var u=l0(),d=yu(),E=pc().line,A=Cf().dash,t=So().extendFlat,e=cl().templatedArray;Ng();var r=Tl(),{shapeTexttemplateAttrs:i,templatefallbackAttrs:n}=kl(),o=Oy();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:d({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({},u.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({},u.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(o)}),texttemplatefallback:n({editType:"arraydraw"}),font:d({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"})}),Gk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Wf(),A=Rb(),t=Sd();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(K,ot){return u.coerce(i,n,A,K,ot)}n._isShape=!0;var s=a("visible");if(s){var f=a("showlegend");f&&(a("legend"),a("legendwidth"),a("legendgroup"),a("legendgrouptitle.text"),u.coerceFont(a,"legendgrouptitle.font"),a("legendrank"));var v=a("path"),g=v?"path":"rect",m=a("type",g),w=m!=="path";w&&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"),y=a("ysizemode"),S=["x","y"],k=0;k<2;k++){var M=S[k],T=M+"anchor",c=M==="x"?x:y,h={_fullLayout:o},b,_,P,L=d.coerceRef(i,n,h,M,void 0,"paper"),D=d.getRefType(L);if(D==="range"?(b=d.getFromId(h,L),b._shapeIndices.push(n._index),P=t.rangeToShapePosition(b),_=t.shapePositionToRange(b),(b.type==="category"||b.type==="multicategory")&&(a(M+"0shift"),a(M+"1shift"))):_=P=u.identity,w){var B=.25,R=.75,I=M+"0",F=M+"1",N=i[I],j=i[F];i[I]=_(i[I],!0),i[F]=_(i[F],!0),c==="pixel"?(a(I,0),a(F,10)):(d.coercePosition(n,h,a,L,I,B),d.coercePosition(n,h,a,L,F,R)),n[I]=P(n[I]),n[F]=P(n[F]),i[I]=N,i[F]=j}if(c==="pixel"){var G=i[T];i[T]=_(i[T],!0),d.coercePosition(n,h,a,L,T,.25),n[T]=P(n[T]),i[T]=G}}w&&u.noneOrAll(i,n,["x0","x1","y0","y1"]);var rt=m==="line",ct,st;if(w&&(ct=a("label.texttemplate"),a("label.texttemplatefallback")),ct||(st=a("label.text")),st||ct){a("label.textangle");var et=a("label.textposition",rt?"middle":"middle center");a("label.xanchor"),a("label.yanchor",e(rt,et)),a("label.padding"),u.coerceFont(a,"label.font",o.font)}}}}),Zk=Vt((Z,V)=>{var u=Pi(),d=Xr();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"),d.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",u.contrast(i)),e("newshape.line.dash")}var n=A.dragmode==="drawline",o=e("newshape.label.text"),a=e("newshape.label.texttemplate");if(e("newshape.label.texttemplatefallback"),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"),d.coerceFont(e,"newshape.label.font",t.font)}e("activeshape.fillcolor"),e("activeshape.opacity")}}),Kk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Fg(),A=Sd();V.exports=function(n){var o=n._fullLayout,a=u.filterVisible(o.shapes);if(!(!a.length||!n._fullData.length))for(var s=0;s<a.length;s++){var f=a[s];f._extremes={};var v,g,m=d.getRefType(f.xref),w=d.getRefType(f.yref);f.xref!=="paper"&&m!=="domain"&&(v=d.getFromId(n,f.xref),g=i(v,f,E.paramIsX),g&&(f._extremes[v._id]=d.findExtremes(v,g,t(f)))),f.yref!=="paper"&&w!=="domain"&&(v=d.getFromId(n,f.yref),g=i(v,f,E.paramIsY),g&&(f._extremes[v._id]=d.findExtremes(v,g,e(f))))}};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,f,v){var g=n/2,m=v;if(o==="pixel"){var w=f?A.extractPathCoords(f,v?E.paramIsY:E.paramIsX):[a,s],l=u.aggNums(Math.max,null,w),x=u.aggNums(Math.min,null,w),y=x<0?Math.abs(x)+g:g,S=l>0?l+g:g;return{ppad:g,ppadplus:m?y:S,ppadminus:m?S:y}}else return{ppad:g}}function i(n,o,a){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",v,g,m=0,w=0,l=f?n.r2c:n.d2c,x=o[s+"sizemode"]==="scaled";if(x?(v=o[s+"0"],g=o[s+"1"],f&&(m=o[s+"0shift"],w=o[s+"1shift"])):(v=o[s+"anchor"],g=o[s+"anchor"]),v!==void 0)return[l(v)+m,l(g)+w];if(o.path){var y=1/0,S=-1/0,k=o.path.match(E.segmentRE),M,T,c,h,b;for(n.type==="date"&&(l=A.decodeDate(l)),M=0;M<k.length;M++)T=k[M],c=a[T.charAt(0)].drawn,c!==void 0&&(h=k[M].substr(1).match(E.paramRE),!(!h||h.length<c)&&(b=l(h[c]),b<y&&(y=b),b>S&&(S=b)));if(S>=y)return[y,S]}}}),Yk=Vt((Z,V)=>{var u=Zy();V.exports={moduleType:"component",name:"shapes",layoutAttributes:Rb(),supplyLayoutDefaults:Gk(),supplyDrawNewShapeDefaults:Zk(),includeBasePlot:jg()("shapes"),calcAutorange:Kk(),draw:u.draw,drawOne:u.drawOne}}),Nb=Vt((Z,V)=>{var u=Af(),d=cl().templatedArray;Ng(),V.exports=d("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",u.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",u.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),Xk=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Wf(),A=Nb(),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,y){return u.coerce(r,i,A,x,y)}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 f={_fullLayout:n},v=["x","y"],g=0;g<2;g++){var m=v[g],w=d.coerceRef(r,i,f,m,"paper",void 0);if(w!=="paper"){var l=d.getFromId(f,w);l._imgIndices.push(i._index)}d.coercePosition(i,f,o,w,m,0)}return i}}),$k=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=yo(),A=cc(),t=Eh();V.exports=function(e){var r=e._fullLayout,i=[],n={},o=[],a,s;for(s=0;s<r.images.length;s++){var f=r.images[s];if(f.visible)if(f.layer==="below"&&f.xref!=="paper"&&f.yref!=="paper"){a=A.ref2id(f.xref)+A.ref2id(f.yref);var v=r._plots[a];if(!v){o.push(f);continue}v.mainplot&&(a=v.mainplot.id),n[a]||(n[a]=[]),n[a].push(f)}else f.layer==="above"?i.push(f):o.push(f)}var g={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 m(c){var h=u.select(this);if(this._imgSrc!==c.source)if(h.attr("xmlns",t.svg),!e._context.staticPlot||c.source&&c.source.slice(0,5)==="data:")h.attr("xlink:href",c.source),this._imgSrc=c.source;else{var b=new Promise((function(_){var P=new Image;this.img=P,P.setAttribute("crossOrigin","anonymous"),P.onerror=L,P.onload=function(){var D=document.createElement("canvas");D.width=this.width,D.height=this.height;var B=D.getContext("2d",{willReadFrequently:!0});B.drawImage(this,0,0);var R=D.toDataURL("image/png");h.attr("xlink:href",R),_()},h.on("error",L),P.src=c.source,this._imgSrc=c.source;function L(){h.remove(),_()}}).bind(this));e._promises.push(b)}}function w(c){var h=u.select(this),b=E.getFromId(e,c.xref),_=E.getFromId(e,c.yref),P=E.getRefType(c.xref)==="domain",L=E.getRefType(c.yref)==="domain",D=r._size,B,R;b!==void 0?B=typeof c.xref=="string"&&P?b._length*c.sizex:Math.abs(b.l2p(c.sizex)-b.l2p(0)):B=c.sizex*D.w,_!==void 0?R=typeof c.yref=="string"&&L?_._length*c.sizey:Math.abs(_.l2p(c.sizey)-_.l2p(0)):R=c.sizey*D.h;var I=B*g.x[c.xanchor].offset,F=R*g.y[c.yanchor].offset,N=g.x[c.xanchor].sizing+g.y[c.yanchor].sizing,j,G;switch(b!==void 0?j=typeof c.xref=="string"&&P?b._length*c.x+b._offset:b.r2p(c.x)+b._offset:j=c.x*D.w+D.l,j+=I,_!==void 0?G=typeof c.yref=="string"&&L?_._length*(1-c.y)+_._offset:_.r2p(c.y)+_._offset:G=D.h-c.y*D.h+D.t,G+=F,c.sizing){case"fill":N+=" slice";break;case"stretch":N="none";break}h.attr({x:j,y:G,width:B,height:R,preserveAspectRatio:N,opacity:c.opacity});var rt=b&&E.getRefType(c.xref)!=="domain"?b._id:"",ct=_&&E.getRefType(c.yref)!=="domain"?_._id:"",st=rt+ct;d.setClipUrl(h,st?"clip"+r._uid+st:null,e)}function l(c){return[c.xref,c.x,c.sizex,c.yref,c.y,c.sizey].join("_")}function x(c,h){return c._index-h._index}var y=r._imageLowerLayer.selectAll("image").data(o,l),S=r._imageUpperLayer.selectAll("image").data(i,l);y.enter().append("image"),S.enter().append("image"),y.exit().remove(),S.exit().remove(),y.each(function(c){m.bind(this)(c),w.bind(this)(c)}),S.each(function(c){m.bind(this)(c),w.bind(this)(c)}),y.sort(x),S.sort(x);var k=Object.keys(r._plots);for(s=0;s<k.length;s++){a=k[s];var M=r._plots[a];if(M.imagelayer){var T=M.imagelayer.selectAll("image").data(n[a]||[],l);T.enter().append("image"),T.exit().remove(),T.each(function(c){m.bind(this)(c),w.bind(this)(c)}),T.sort(x)}}}}),Jk=Vt((Z,V)=>{var u=Lo(),d=Cy();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,f=0;f<n.length;f++)if(a=n[f],s="images["+f+"].",a[o+"ref"]===A._id){var v=a[o],g=a["size"+o],m=null,w=null;if(r){m=d(v,A.range);var l=g/Math.pow(10,m)/2;w=2*Math.log(l+Math.sqrt(1+l*l))/Math.LN10}else m=Math.pow(10,v),w=m*(Math.pow(10,g/2)-Math.pow(10,-g/2));u(m)?u(w)||(w=null):(m=null,w=null),e(s+o,m),e(s+"size"+o,w)}}}}),Qk=Vt((Z,V)=>{V.exports={moduleType:"component",name:"images",layoutAttributes:Nb(),supplyLayoutDefaults:Xk(),includeBasePlot:jg()("images"),draw:$k(),convertCoords:Jk()}}),r1=Vt((Z,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:"▼"}}}),jb=Vt((Z,V)=>{var u=yu(),d=nf(),E=So().extendFlat,A=Cu().overrideAll,t=Dy(),e=cl().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:u({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:d.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),t6=Vt((Z,V)=>{var u=Xr(),d=Wf(),E=jb(),A=r1(),t=A.name,e=E.buttons;V.exports=function(n,o){var a={name:t,handleItemDefaults:r};d(n,o,a)};function r(n,o,a){function s(g,m){return u.coerce(n,o,E,g,m)}var f=d(n,o,{name:"buttons",handleItemDefaults:i}),v=s("visible",f.length>0);v&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),u.noneOrAll(n,o,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),u.coerceFont(s,"font",a.font),s("bgcolor",a.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function i(n,o){function a(f,v){return u.coerce(n,o,e,f,v)}var s=a("visible",n.method==="skip"||Array.isArray(n.args));s&&(a("method"),a("args"),a("args2"),a("label"),a("execute"))}}),e6=Vt((Z,V)=>{V.exports=t;var u=Ni(),d=Pi(),E=Eo(),A=Xr();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,f=this.position.w,v=this.position.t,g=this.position.h,m=this.position.direction,w=m==="down",l=m==="left",x=m==="right",y=m==="up",S=f,k=g,M,T,c,h;!w&&!l&&!x&&!y&&(this.position.direction="down",w=!0);var b=w||y;b?(M=s,T=M+S,w?(c=v,h=Math.min(c+k,a),k=h-c):(h=v+k,c=Math.max(h-k,0),k=h-c)):(c=v,h=c+k,l?(T=s+S,M=Math.max(T-S,0),S=T-M):(M=s,T=Math.min(M+S,o),S=T-M)),this._box={l:M,t:c,w:S,h:k};var _=f>S,P=t.barLength+2*t.barPad,L=t.barWidth+2*t.barPad,D=s,B=v+g;B+L>a&&(B=a-L);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(d.fill,t.barColor),_?(this.hbar=R.attr({rx:t.barRadius,ry:t.barRadius,x:D,y:B,width:P,height:L}),this._hbarXMin=D+P/2,this._hbarTranslateMax=S-P):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>k,F=t.barWidth+2*t.barPad,N=t.barLength+2*t.barPad,j=s+f,G=v;j+F>o&&(j=o-F);var rt=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);rt.exit().on(".drag",null).remove(),rt.enter().append("rect").classed("scrollbar-vertical",!0).call(d.fill,t.barColor),I?(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=k-N):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var ct=this.id,st=M-.5,et=I?T+F+.5:T+.5,K=c-.5,ot=_?h+L+.5:h+.5,X=n._topdefs.selectAll("#"+ct).data(_||I?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",ct).append("rect"),_||I?(this._clipRect=X.select("rect").attr({x:Math.floor(st),y:Math.floor(K),width:Math.ceil(et)-Math.floor(st),height:Math.ceil(ot)-Math.floor(K)}),this.container.call(E.setClipUrl,ct,this.gd),this.bg.attr({x:s,y:v,width:f,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(E.setClipUrl,null),delete this._clipRect),_||I){var Q=u.behavior.drag().on("dragstart",function(){u.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 ut=u.behavior.drag().on("dragstart",function(){u.event.sourceEvent.preventDefault(),u.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));_&&this.hbar.on(".drag",null).call(ut),I&&this.vbar.on(".drag",null).call(ut)}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-=u.event.dx),this.vbar&&(r-=u.event.dy),this.setTranslate(e,r)},t.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=u.event.deltaY),this.vbar&&(r+=u.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(u.event.x,i,n),a=(o-i)/(n-i),s=this.position.w-this._box.w;e=a*s}if(this.vbar){var f=r+this._vbarYMin,v=f+this._vbarTranslateMax,g=A.constrain(u.event.y,f,v),m=(g-f)/(v-f),w=this.position.h-this._box.h;r=m*w}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)}}}),r6=Vt((Z,V)=>{var u=Ni(),d=Uu(),E=Pi(),A=Eo(),t=Xr(),e=Dl(),r=cl().arrayEditor,i=mf().LINE_SPACING,n=r1(),o=e6();V.exports=function(P){var L=P._fullLayout,D=t.filterVisible(L[n.name]);function B(ct){d.autoMargin(P,h(ct))}var R=L._menulayer.selectAll("g."+n.containerClassName).data(D.length>0?[0]:[]);if(R.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),R.exit().each(function(){u.select(this).selectAll("g."+n.headerGroupClassName).each(B)}).remove(),D.length!==0){var I=R.selectAll("g."+n.headerGroupClassName).data(D,a);I.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<D.length;N++){var j=D[N];c(P,j)}var G="updatemenus"+L._uid,rt=new o(P,F,G);I.enter().size()&&(F.node().parentNode.appendChild(F.node()),F.call(_)),I.exit().each(function(ct){F.call(_),B(ct)}).remove(),I.each(function(ct){var st=u.select(this),et=ct.type==="dropdown"?F:null;d.manageCommandObserver(P,ct,ct.buttons,function(K){v(P,ct,ct.buttons[K.index],st,et,rt,K.index,!0)}),ct.type==="dropdown"?(g(P,st,F,rt,ct),f(F,ct)&&m(P,st,F,rt,ct)):m(P,st,null,null,ct)})}};function a(P){return P._index}function s(P){return+P.attr(n.menuIndexAttrName)==-1}function f(P,L){return+P.attr(n.menuIndexAttrName)===L._index}function v(P,L,D,B,R,I,F,N){L.active=F,r(P.layout,n.name,L).applyUpdate("active",F),L.type==="buttons"?m(P,B,null,null,L):L.type==="dropdown"&&(R.attr(n.menuIndexAttrName,"-1"),g(P,B,R,I,L),N||m(P,B,R,I,L))}function g(P,L,D,B,R){var I=t.ensureSingle(L,"g",n.headerClassName,function(st){st.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};I.call(x,R,j,P).call(b,R,G,rt);var ct=t.ensureSingle(L,"text",n.headerArrowClassName,function(st){st.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}),I.on("click",function(){D.call(_,String(f(D,R)?-1:R._index)),m(P,L,D,B,R)}),I.on("mouseover",function(){I.call(M)}),I.on("mouseout",function(){I.call(T,R)}),A.setTranslate(L,F.lx,F.ly)}function m(P,L,D,B,R){D||(D=L,D.attr("pointer-events","all"));var I=!s(D)||R.type==="buttons"?R.buttons:[],F=R.type==="dropdown"?n.dropdownButtonClassName:n.buttonClassName,N=D.selectAll("g."+F).data(t.filterVisible(I)),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,st=R._dims,et=["up","down"].indexOf(R.direction)!==-1;R.type==="dropdown"&&(et?ct=st.headerHeight+n.gapButtonHeader:rt=st.headerWidth+n.gapButtonHeader),R.type==="dropdown"&&R.direction==="up"&&(ct=-n.gapButtonHeader+n.gapButton-st.openHeight),R.type==="dropdown"&&R.direction==="left"&&(rt=-n.gapButtonHeader+n.gapButton-st.openWidth);var K={x:st.lx+rt+R.pad.l,y:st.ly+ct+R.pad.t,yPad:n.gapButton,xPad:n.gapButton,index:0},ot={l:K.x+R.borderwidth,t:K.y+R.borderwidth};N.each(function(X,Q){var ut=u.select(this);ut.call(x,R,X,P).call(b,R,K),ut.on("click",function(){u.event.defaultPrevented||(X.execute&&(X.args2&&R.active===Q?(v(P,R,X,L,D,B,-1),d.executeAPICommand(P,X.method,X.args2)):(v(P,R,X,L,D,B,Q),d.executeAPICommand(P,X.method,X.args))),P.emit("plotly_buttonclicked",{menu:R,button:X,active:R.active}))}),ut.on("mouseover",function(){ut.call(M)}),ut.on("mouseout",function(){ut.call(T,R),N.call(k,R)})}),N.call(k,R),et?(ot.w=Math.max(st.openWidth,st.headerWidth),ot.h=K.y-ot.t):(ot.w=K.x-ot.l,ot.h=Math.max(st.openHeight,st.headerHeight)),ot.direction=R.direction,B&&(N.size()?w(P,L,D,B,R,ot):l(B))}function w(P,L,D,B,R,I){var F=R.direction,N=F==="up"||F==="down",j=R._dims,G=R.active,rt,ct,st;if(N)for(ct=0,st=0;st<G;st++)ct+=j.heights[st]+n.gapButton;else for(rt=0,st=0;st<G;st++)rt+=j.widths[st]+n.gapButton;B.enable(I,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(P){var L=!!P.hbar,D=!!P.vbar;L&&P.hbar.transition().attr("opacity","0").each("end",function(){L=!1,D||P.disable()}),D&&P.vbar.transition().attr("opacity","0").each("end",function(){D=!1,L||P.disable()})}function x(P,L,D,B){P.call(y,L).call(S,L,D,B)}function y(P,L){var D=t.ensureSingle(P,"rect",n.itemRectClassName,function(B){B.attr({rx:n.rx,ry:n.ry,"shape-rendering":"crispEdges"})});D.call(E.stroke,L.bordercolor).call(E.fill,L.bgcolor).style("stroke-width",L.borderwidth+"px")}function S(P,L,D,B){var R=t.ensureSingle(P,"text",n.itemTextClassName,function(N){N.attr({"text-anchor":"start","data-notex":1})}),I=D.label,F=B._fullLayout._meta;F&&(I=t.templateString(I,F)),R.call(A.font,L.font).text(I).call(e.convertToTspans,B)}function k(P,L){var D=L.active;P.each(function(B,R){var I=u.select(this);R===D&&L.showactive&&I.select("rect."+n.itemRectClassName).call(E.fill,n.activeColor)})}function M(P){P.select("rect."+n.itemRectClassName).call(E.fill,n.hoverColor)}function T(P,L){P.select("rect."+n.itemRectClassName).call(E.fill,L.bgcolor)}function c(P,L){var D=L._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(L.buttons));B.enter().append("g").classed(n.dropdownButtonClassName,!0);var R=["up","down"].indexOf(L.direction)!==-1;B.each(function(rt,ct){var st=u.select(this);st.call(x,L,rt,P);var et=st.select("."+n.itemTextClassName),K=et.node()&&A.bBox(et.node()).width,ot=Math.max(K+n.textPadX,n.minWidth),X=L.font.size*i,Q=e.lineCount(et),ut=Math.max(X*Q,n.minHeight)+n.textOffsetY;ut=Math.ceil(ut),ot=Math.ceil(ot),D.widths[ct]=ot,D.heights[ct]=ut,D.height1=Math.max(D.height1,ut),D.width1=Math.max(D.width1,ot),R?(D.totalWidth=Math.max(D.totalWidth,ot),D.openWidth=D.totalWidth,D.totalHeight+=ut+n.gapButton,D.openHeight+=ut+n.gapButton):(D.totalWidth+=ot+n.gapButton,D.openWidth+=ot+n.gapButton,D.totalHeight=Math.max(D.totalHeight,ut),D.openHeight=D.totalHeight)}),R?D.totalHeight-=n.gapButton:D.totalWidth-=n.gapButton,D.headerWidth=D.width1+n.arrowPadX,D.headerHeight=D.height1,L.type==="dropdown"&&(R?(D.width1+=n.arrowPadX,D.totalHeight=D.height1):D.totalWidth=D.width1,D.totalWidth+=n.arrowPadX),B.remove();var I=D.totalWidth+L.pad.l+L.pad.r,F=D.totalHeight+L.pad.t+L.pad.b,N=P._fullLayout._size;D.lx=N.l+N.w*L.x,D.ly=N.t+N.h*(1-L.y);var j="left";t.isRightAnchor(L)&&(D.lx-=I,j="right"),t.isCenterAnchor(L)&&(D.lx-=I/2,j="center");var G="top";t.isBottomAnchor(L)&&(D.ly-=F,G="bottom"),t.isMiddleAnchor(L)&&(D.ly-=F/2,G="middle"),D.totalWidth=Math.ceil(D.totalWidth),D.totalHeight=Math.ceil(D.totalHeight),D.lx=Math.round(D.lx),D.ly=Math.round(D.ly),d.autoMargin(P,h(L),{x:L.x,y:L.y,l:I*({right:1,center:.5}[j]||0),r:I*({left:1,center:.5}[j]||0),b:F*({top:1,middle:.5}[G]||0),t:F*({bottom:1,middle:.5}[G]||0)})}function h(P){return n.autoMarginIdRoot+P._index}function b(P,L,D,B){B=B||{};var R=P.select("."+n.itemRectClassName),I=P.select("."+n.itemTextClassName),F=L.borderwidth,N=D.index,j=L._dims;A.setTranslate(P,F+D.x,F+D.y);var G=["up","down"].indexOf(L.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=L.font.size*i,st=e.lineCount(I),et=(st-1)*ct/2;e.positionText(I,n.textOffsetX,rt/2-et+n.textOffsetY),G?D.y+=j.heights[N]+D.yPad:D.x+=j.widths[N]+D.xPad,D.index++}function _(P,L){P.attr(n.menuIndexAttrName,L||"-1").selectAll("g."+n.dropdownButtonClassName).remove()}}),n6=Vt((Z,V)=>{var u=r1();V.exports={moduleType:"component",name:u.name,layoutAttributes:jb(),supplyLayoutDefaults:t6(),draw:r6()}}),Hg=Vt((Z,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}}),Ub=Vt((Z,V)=>{var u=yu(),d=Dy(),E=So().extendDeepAll,A=Cu().overrideAll,t=Cg(),e=cl().templatedArray,r=Hg(),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(d({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:u({})},font:u({}),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")}),a6=Vt((Z,V)=>{var u=Xr(),d=Wf(),E=Ub(),A=Hg(),t=A.name,e=E.steps;V.exports=function(n,o){d(n,o,{name:t,handleItemDefaults:r})};function r(n,o,a){function s(y,S){return u.coerce(n,o,E,y,S)}for(var f=d(n,o,{name:"steps",handleItemDefaults:i}),v=0,g=0;g<f.length;g++)f[g].visible&&v++;var m;if(v<2?m=o.visible=!1:m=s("visible"),!!m){o._stepCount=v;var w=o._visibleSteps=u.filterVisible(f),l=s("active");(f[l]||{}).visible||(o.active=w[0]._index),s("x"),s("y"),u.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"),u.coerceFont(s,"font",a.font);var x=s("currentvalue.visible");x&&(s("currentvalue.xanchor"),s("currentvalue.prefix"),s("currentvalue.suffix"),s("currentvalue.offset"),u.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,g){return u.coerce(n,o,e,v,g)}var s;if(n.method!=="skip"&&!Array.isArray(n.args)?s=o.visible=!1:s=a("visible"),s){a("method"),a("args");var f=a("label","step-"+o._index);a("value",f),a("execute")}}}),i6=Vt((Z,V)=>{var u=Ni(),d=Uu(),E=Pi(),A=Eo(),t=Xr(),e=t.strTranslate,r=Dl(),i=cl().arrayEditor,n=Hg(),o=mf(),a=o.LINE_SPACING,s=o.FROM_TL,f=o.FROM_BR;V.exports=function(R){var I=R._context.staticPlot,F=R._fullLayout,N=g(F,R),j=F._infolayer.selectAll("g."+n.containerClassName).data(N.length>0?[0]:[]);j.enter().append("g").classed(n.containerClassName,!0).style("cursor",I?null:"ew-resize");function G(et){et._commandObserver&&(et._commandObserver.remove(),delete et._commandObserver),d.autoMargin(R,v(et))}if(j.exit().each(function(){u.select(this).selectAll("g."+n.groupClassName).each(G)}).remove(),N.length!==0){var rt=j.selectAll("g."+n.groupClassName).data(N,m);rt.enter().append("g").classed(n.groupClassName,!0),rt.exit().each(G).remove();for(var ct=0;ct<N.length;ct++){var st=N[ct];w(R,st)}rt.each(function(et){var K=u.select(this);b(et),d.manageCommandObserver(R,et,et._visibleSteps,function(ot){var X=K.data()[0];X.active!==ot.index&&(X._dragging||T(R,K,X,ot.index,!1,!0))}),l(R,u.select(this),et)})}};function v(R){return n.autoMarginIdRoot+R._index}function g(R,I){for(var F=R[n.name],N=[],j=0;j<F.length;j++){var G=F[j];G.visible&&(G._gd=I,N.push(G))}return N}function m(R){return R._index}function w(R,I){var F=A.tester.selectAll("g."+n.labelGroupClass).data(I._visibleSteps);F.enter().append("g").classed(n.labelGroupClass,!0);var N=0,j=0;F.each(function(ut){var J=u.select(this),q=S(J,{step:ut},I),it=q.node();if(it){var nt=A.bBox(it);j=Math.max(j,nt.height),N=Math.max(N,nt.width)}}),F.remove();var G=I._dims={};G.inputAreaWidth=Math.max(n.railWidth,n.gripHeight);var rt=R._fullLayout._size;G.lx=rt.l+rt.w*I.x,G.ly=rt.t+rt.h*(1-I.y),I.lenmode==="fraction"?G.outerLength=Math.round(rt.w*I.len):G.outerLength=I.len,G.inputAreaStart=0,G.inputAreaLength=Math.round(G.outerLength-I.pad.l-I.pad.r);var ct=G.inputAreaLength-2*n.stepInset,st=ct/(I._stepCount-1),et=N+n.labelPadding;if(G.labelStride=Math.max(1,Math.ceil(et/st)),G.labelHeight=j,G.currentValueMaxWidth=0,G.currentValueHeight=0,G.currentValueTotalHeight=0,G.currentValueMaxLines=1,I.currentvalue.visible){var K=A.tester.append("g");F.each(function(ut){var J=x(K,I,ut.label),q=J.node()&&A.bBox(J.node())||{width:0,height:0},it=r.lineCount(J);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,it)}),G.currentValueTotalHeight=G.currentValueHeight+I.currentvalue.offset,K.remove()}G.height=G.currentValueTotalHeight+n.tickOffset+I.ticklen+n.labelOffset+G.labelHeight+I.pad.t+I.pad.b;var ot="left";t.isRightAnchor(I)&&(G.lx-=G.outerLength,ot="right"),t.isCenterAnchor(I)&&(G.lx-=G.outerLength/2,ot="center");var X="top";t.isBottomAnchor(I)&&(G.ly-=G.height,X="bottom"),t.isMiddleAnchor(I)&&(G.ly-=G.height/2,X="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:I.y,b:G.height*f[X],t:G.height*s[X]};I.lenmode==="fraction"?(Q.l=0,Q.xl=I.x-I.len*s[ot],Q.r=0,Q.xr=I.x+I.len*f[ot]):(Q.x=I.x,Q.l=G.outerLength*s[ot],Q.r=G.outerLength*f[ot]),d.autoMargin(R,v(I),Q)}function l(R,I,F){(F.steps[F.active]||{}).visible||(F.active=F._visibleSteps[0]._index),I.call(x,F).call(B,F).call(k,F).call(h,F).call(D,R,F).call(y,R,F);var N=F._dims;A.setTranslate(I,N.lx+F.pad.l,N.ly+F.pad.t),I.call(_,F,!1),I.call(x,F)}function x(R,I,F){if(I.currentvalue.visible){var N=I._dims,j,G;switch(I.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(X){X.attr({"text-anchor":G,"data-notex":1})}),ct=I.currentvalue.prefix?I.currentvalue.prefix:"";if(typeof F=="string")ct+=F;else{var st=I.steps[I.active].label,et=I._gd._fullLayout._meta;et&&(st=t.templateString(st,et)),ct+=st}I.currentvalue.suffix&&(ct+=I.currentvalue.suffix),rt.call(A.font,I.currentvalue.font).text(ct).call(r.convertToTspans,I._gd);var K=r.lineCount(rt),ot=(N.currentValueMaxLines+1-K)*I.currentvalue.font.size*a;return r.positionText(rt,j,ot),rt}}function y(R,I,F){var N=t.ensureSingle(R,"rect",n.gripRectClass,function(j){j.call(c,I,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,I,F){var N=t.ensureSingle(R,"text",n.labelClass,function(rt){rt.attr({"text-anchor":"middle","data-notex":1})}),j=I.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 k(R,I){var F=t.ensureSingle(R,"g",n.labelsClass),N=I._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=u.select(this);rt.call(S,G,I),A.setTranslate(rt,P(I,G.fraction),n.tickOffset+I.ticklen+I.font.size*a+n.labelOffset+N.currentValueTotalHeight)})}function M(R,I,F,N,j){var G=Math.round(N*(F._stepCount-1)),rt=F._visibleSteps[G]._index;rt!==F.active&&T(R,I,F,rt,!0,j)}function T(R,I,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];I.call(_,F,G),I.call(x,F),R.emit("plotly_sliderchange",{slider:F,step:F.steps[F.active],interaction:j,previousActive:rt}),ct&&ct.method&&j&&(I._nextMethod?(I._nextMethod.step=ct,I._nextMethod.doCallback=j,I._nextMethod.doTransition=G):(I._nextMethod={step:ct,doCallback:j,doTransition:G},I._nextMethodRaf=window.requestAnimationFrame(function(){var st=I._nextMethod.step;st.method&&(st.execute&&d.executeAPICommand(R,st.method,st.args),I._nextMethod=null,I._nextMethodRaf=null)})))}function c(R,I,F){if(I._context.staticPlot)return;var N=F.node(),j=u.select(I);function G(){return F.data()[0]}function rt(){var ct=G();I.emit("plotly_sliderstart",{slider:ct});var st=F.select("."+n.gripRectClass);u.event.stopPropagation(),u.event.preventDefault(),st.call(E.fill,ct.activebgcolor);var et=L(ct,u.mouse(N)[0]);M(I,F,ct,et,!0),ct._dragging=!0;function K(){var X=G(),Q=L(X,u.mouse(N)[0]);M(I,F,X,Q,!1)}j.on("mousemove",K),j.on("touchmove",K);function ot(){var X=G();X._dragging=!1,st.call(E.fill,X.bgcolor),j.on("mouseup",null),j.on("mousemove",null),j.on("touchend",null),j.on("touchmove",null),I.emit("plotly_sliderend",{slider:X,step:X.steps[X.active]})}j.on("mouseup",ot),j.on("touchend",ot)}R.on("mousedown",rt),R.on("touchstart",rt)}function h(R,I){var F=R.selectAll("rect."+n.tickRectClass).data(I._visibleSteps),N=I._dims;F.enter().append("rect").classed(n.tickRectClass,!0),F.exit().remove(),F.attr({width:I.tickwidth+"px","shape-rendering":"crispEdges"}),F.each(function(j,G){var rt=G%N.labelStride===0,ct=u.select(this);ct.attr({height:rt?I.ticklen:I.minorticklen}).call(E.fill,I.tickcolor),A.setTranslate(ct,P(I,G/(I._stepCount-1))-.5*I.tickwidth,(rt?n.tickOffset:n.minorTickOffset)+N.currentValueTotalHeight)})}function b(R){var I=R._dims;I.labelSteps=[];for(var F=R._stepCount,N=0;N<F;N+=I.labelStride)I.labelSteps.push({fraction:N/(F-1),step:R._visibleSteps[N]})}function _(R,I,F){for(var N=R.select("rect."+n.gripRectClass),j=0,G=0;G<I._stepCount;G++)if(I._visibleSteps[G]._index===I.active){j=G;break}var rt=P(I,j/(I._stepCount-1));if(!I._invokingCommand){var ct=N;F&&I.transition.duration>0&&(ct=ct.transition().duration(I.transition.duration).ease(I.transition.easing)),ct.attr("transform",e(rt-n.gripWidth*.5,I._dims.currentValueTotalHeight))}}function P(R,I){var F=R._dims;return F.inputAreaStart+n.stepInset+(F.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,I))}function L(R,I){var F=R._dims;return Math.min(1,Math.max(0,(I-n.stepInset-F.inputAreaStart)/(F.inputAreaLength-2*n.stepInset-2*F.inputAreaStart)))}function D(R,I,F){var N=F._dims,j=t.ensureSingle(R,"rect",n.railTouchRectClass,function(G){G.call(c,I,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,I){var F=I._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,I.bordercolor).call(E.fill,I.bgcolor).style("stroke-width",I.borderwidth+"px"),A.setTranslate(j,n.railInset,(F.inputAreaWidth-n.railWidth)*.5+F.currentValueTotalHeight)}}),o6=Vt((Z,V)=>{var u=Hg();V.exports={moduleType:"component",name:u.name,layoutAttributes:Ub(),supplyLayoutDefaults:a6(),draw:i6()}}),n1=Vt((Z,V)=>{var u=nf();V.exports={bgcolor:{valType:"color",dflt:u.background,editType:"plot"},bordercolor:{valType:"color",dflt:u.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"}}),Vb=Vt((Z,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((Z,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}}),s6=Vt(Z=>{var V=cc(),u=Dl(),d=a1(),E=mf().LINE_SPACING,A=d.name;function t(e){var r=e&&e[A];return r&&r.visible}Z.isVisible=t,Z.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},Z.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 f=(r.title.text.match(u.BR_TAG_ALL)||[]).length;s+=f*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:d.extraPad+n._offsetShift*2}}}),l6=Vt((Z,V)=>{var u=Xr(),d=cl(),E=cc(),A=n1(),t=Vb();V.exports=function(e,r,i){var n=e[i],o=r[i];if(!(n.rangeslider||r._requestRangeslider[o._id]))return;u.isPlainObject(n.rangeslider)||(n.rangeslider={});var a=n.rangeslider,s=d.newContainer(o,"rangeslider");function f(h,b){return u.coerce(a,s,A,h,b)}var v,g;function m(h,b){return u.coerce(v,g,t,h,b)}var w=f("visible");if(w){f("bgcolor",r.plot_bgcolor),f("bordercolor"),f("borderwidth"),f("thickness"),f("autorange",!o.isValidRange(a.range)),f("range");var l=r._subplots;if(l)for(var x=l.cartesian.filter(function(h){return h.substr(0,h.indexOf("y"))===E.name2id(i)}).map(function(h){return h.substr(h.indexOf("y"),h.length)}),y=u.simpleMap(x,E.id2name),S=0;S<y.length;S++){var k=y[S];v=a[k]||{},g=d.newContainer(s,k,"yaxis");var M=r[k],T;v.range&&M.isValidRange(v.range)&&(T="fixed");var c=m("rangemode",T);c!=="match"&&m("range",M.range.slice())}s._input=a}}}),u6=Vt((Z,V)=>{var u=cc().list,d=Xh().getAutoRange,E=a1();V.exports=function(A){for(var t=u(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=d(A,r))}}}),c6=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Uu(),A=Xr(),t=A.strTranslate,e=Eo(),r=Pi(),i=o0(),n=Kc(),o=cc(),a=ih(),s=$h(),f=a1();V.exports=function(c){for(var h=c._fullLayout,b=h._rangeSliderData,_=0;_<b.length;_++){var P=b[_][f.name];P._clipId=P._id+"-"+h._uid}function L(B){return B._name}var D=h._infolayer.selectAll("g."+f.containerClassName).data(b,L);D.exit().each(function(B){var R=B[f.name];h._topdefs.select("#"+R._clipId).remove()}).remove(),b.length!==0&&(D.enter().append("g").classed(f.containerClassName,!0).attr("pointer-events","all"),D.each(function(B){var R=u.select(this),I=B[f.name],F=h[o.id2name(B.anchor)],N=I[o.id2name(B.anchor)];if(I.range){var j=A.simpleMap(I.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])],I.range=I._input.range=A.simpleMap(rt,B.l2r)}B.cleanRange("rangeslider.range");var ct=h._size,st=B.domain;I._width=ct.w*(st[1]-st[0]);var et=Math.round(ct.l+ct.w*st[0]),K=Math.round(ct.t+ct.h*(1-B._counterDomainMin)+(B.side==="bottom"?B._depth:0)+I._offsetShift+f.extraPad);R.attr("transform",t(et,K)),I._rl=A.simpleMap(I.range,B.r2l);var ot=I._rl[0],X=I._rl[1],Q=X-ot;if(I.p2d=function(Ct){return Ct/I._width*Q+ot},I.d2p=function(Ct){return(Ct-ot)/Q*I._width},B.rangebreaks){var ut=B.locateBreaks(ot,X);if(ut.length){var J,q,it=0;for(J=0;J<ut.length;J++)q=ut[J],it+=q.max-q.min;var nt=I._width/(X-ot-it),dt=[-nt*ot];for(J=0;J<ut.length;J++)q=ut[J],dt.push(dt[dt.length-1]-nt*(q.max-q.min));for(I.d2p=function(Ct){for(var Nt=dt[0],ee=0;ee<ut.length;ee++){var Jt=ut[ee];if(Ct>=Jt.max)Nt=dt[ee+1];else if(Ct<Jt.min)break}return Nt+nt*Ct},J=0;J<ut.length;J++)q=ut[J],q.pmin=I.d2p(q.min),q.pmax=I.d2p(q.max);I.p2d=function(Ct){for(var Nt=dt[0],ee=0;ee<ut.length;ee++){var Jt=ut[ee];if(Ct>=Jt.pmax)Nt=dt[ee+1];else if(Ct<Jt.pmin)break}return(Ct-Nt)/nt}}}if(N.rangemode!=="match"){var Tt=F.r2l(N.range[0]),wt=F.r2l(N.range[1]),It=wt-Tt;I.d2pOppAxis=function(Ct){return(Ct-Tt)/It*I._height}}R.call(l,c,B,I).call(x,c,B,I).call(y,c,B,I).call(k,c,B,I,N).call(M,c,B,I).call(T,c,B,I),g(R,c,B,I),w(R,c,B,I,F,N),B.side==="bottom"&&i.draw(c,B._id+"title",{propContainer:B,propName:B._name+".title.text",placeholder:h._dfltTitle.x,attributes:{x:B._offset+B._length/2,y:K+I._height+I._offsetShift+10+1.5*B.title.font.size,"text-anchor":"middle"}})}))};function v(c){return typeof c.clientX=="number"?c.clientX:c.touches&&c.touches.length>0?c.touches[0].clientX:0}function g(c,h,b,_){if(h._context.staticPlot)return;var P=c.select("rect."+f.slideBoxClassName).node(),L=c.select("rect."+f.grabAreaMinClassName).node(),D=c.select("rect."+f.grabAreaMaxClassName).node();function B(){var R=u.event,I=R.target,F=v(R),N=F-c.node().getBoundingClientRect().left,j=_.d2p(b._rl[0]),G=_.d2p(b._rl[1]),rt=a.coverSlip();this.addEventListener("touchmove",ct),this.addEventListener("touchend",st),rt.addEventListener("mousemove",ct),rt.addEventListener("mouseup",st);function ct(et){var K=v(et),ot=+K-F,X,Q,ut;switch(I){case P:if(ut="ew-resize",j+ot>b._length||G+ot<0)return;X=j+ot,Q=G+ot;break;case L:if(ut="col-resize",j+ot>b._length)return;X=j+ot,Q=G;break;case D:if(ut="col-resize",G+ot<0)return;X=j,Q=G+ot;break;default:ut="ew-resize",X=N,Q=N+ot;break}if(Q<X){var J=Q;Q=X,X=J}_._pixelMin=X,_._pixelMax=Q,s(u.select(rt),ut),m(c,h,b,_)}function st(){rt.removeEventListener("mousemove",ct),rt.removeEventListener("mouseup",st),this.removeEventListener("touchmove",ct),this.removeEventListener("touchend",st),A.removeElement(rt)}}c.on("mousedown",B),c.on("touchstart",B)}function m(c,h,b,_){function P(B){return b.l2r(A.constrain(B,_._rl[0],_._rl[1]))}var L=P(_.p2d(_._pixelMin)),D=P(_.p2d(_._pixelMax));window.requestAnimationFrame(function(){d.call("_guiRelayout",h,b._name+".range",[L,D])})}function w(c,h,b,_,P,L){var D=f.handleWidth/2;function B(et){return A.constrain(et,0,_._width)}function R(et){return A.constrain(et,0,_._height)}function I(et){return A.constrain(et,-D,_._width+D)}var F=B(_.d2p(b._rl[0])),N=B(_.d2p(b._rl[1]));if(c.select("rect."+f.slideBoxClassName).attr("x",F).attr("width",N-F),c.select("rect."+f.maskMinClassName).attr("width",F),c.select("rect."+f.maskMaxClassName).attr("x",N).attr("width",_._width-N),L.rangemode!=="match"){var j=_._height-R(_.d2pOppAxis(P._rl[1])),G=_._height-R(_.d2pOppAxis(P._rl[0]));c.select("rect."+f.maskMinOppAxisClassName).attr("x",F).attr("height",j).attr("width",N-F),c.select("rect."+f.maskMaxOppAxisClassName).attr("x",F).attr("y",G).attr("height",_._height-G).attr("width",N-F),c.select("rect."+f.slideBoxClassName).attr("y",j).attr("height",G-j)}var rt=.5,ct=Math.round(I(F-D))-rt,st=Math.round(I(N-D))+rt;c.select("g."+f.grabberMinClassName).attr("transform",t(ct,rt)),c.select("g."+f.grabberMaxClassName).attr("transform",t(st,rt))}function l(c,h,b,_){var P=A.ensureSingle(c,"rect",f.bgClassName,function(R){R.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),L=_.borderwidth%2===0?_.borderwidth:_.borderwidth-1,D=-_._offsetShift,B=e.crispRound(h,_.borderwidth);P.attr({width:_._width+L,height:_._height+L,transform:t(D,D),"stroke-width":B}).call(r.stroke,_.bordercolor).call(r.fill,_.bgcolor)}function x(c,h,b,_){var P=h._fullLayout,L=A.ensureSingleById(P._topdefs,"clipPath",_._clipId,function(D){D.append("rect").attr({x:0,y:0})});L.select("rect").attr({width:_._width,height:_._height})}function y(c,h,b,_){var P=h.calcdata,L=c.selectAll("g."+f.rangePlotClassName).data(b._subplotsWith,A.identity);L.enter().append("g").attr("class",function(B){return f.rangePlotClassName+" "+B}).call(e.setClipUrl,_._clipId,h),L.order(),L.exit().remove();var D;L.each(function(B,R){var I=u.select(this),F=R===0,N=o.getFromId(h,B,"y"),j=N._name,G=_[j],rt={data:[],layout:{xaxis:{type:b.type,domain:[0,1],range:_.range.slice(),calendar:b.calendar},width:_._width,height:_._height,margin:{t:0,b:0,l:0,r:0}},_context:h._context};b.rangebreaks&&(rt.layout.xaxis.rangebreaks=b.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,st=rt._fullLayout[j];ct.clearCalc(),ct.setScale(),st.clearCalc(),st.setScale();var et={id:B,plotgroup:I,xaxis:ct,yaxis:st,isRangePlot:!0};F?D=et:(et.mainplot="xy",et.mainplotinfo=D),n.rangePlot(h,et,S(P,B))})}function S(c,h){for(var b=[],_=0;_<c.length;_++){var P=c[_],L=P[0].trace;L.xaxis+L.yaxis===h&&b.push(P)}return b}function k(c,h,b,_,P){var L=A.ensureSingle(c,"rect",f.maskMinClassName,function(I){I.attr({x:0,y:0,"shape-rendering":"crispEdges"})});L.attr("height",_._height).call(r.fill,f.maskColor);var D=A.ensureSingle(c,"rect",f.maskMaxClassName,function(I){I.attr({y:0,"shape-rendering":"crispEdges"})});if(D.attr("height",_._height).call(r.fill,f.maskColor),P.rangemode!=="match"){var B=A.ensureSingle(c,"rect",f.maskMinOppAxisClassName,function(I){I.attr({y:0,"shape-rendering":"crispEdges"})});B.attr("width",_._width).call(r.fill,f.maskOppAxisColor);var R=A.ensureSingle(c,"rect",f.maskMaxOppAxisClassName,function(I){I.attr({y:0,"shape-rendering":"crispEdges"})});R.attr("width",_._width).style("border-top",f.maskOppBorder).call(r.fill,f.maskOppAxisColor)}}function M(c,h,b,_){if(!h._context.staticPlot){var P=A.ensureSingle(c,"rect",f.slideBoxClassName,function(L){L.attr({y:0,cursor:f.slideBoxCursor,"shape-rendering":"crispEdges"})});P.attr({height:_._height,fill:f.slideBoxFill})}}function T(c,h,b,_){var P=A.ensureSingle(c,"g",f.grabberMinClassName),L=A.ensureSingle(c,"g",f.grabberMaxClassName),D={x:0,width:f.handleWidth,rx:f.handleRadius,fill:r.background,stroke:r.defaultLine,"stroke-width":f.handleStrokeWidth,"shape-rendering":"crispEdges"},B={y:Math.round(_._height/4),height:Math.round(_._height/2)},R=A.ensureSingle(P,"rect",f.handleMinClassName,function(G){G.attr(D)});R.attr(B);var I=A.ensureSingle(L,"rect",f.handleMaxClassName,function(G){G.attr(D)});I.attr(B);var F={width:f.grabAreaWidth,x:0,y:0,fill:f.grabAreaFill,cursor:h._context.staticPlot?void 0:f.grabAreaCursor},N=A.ensureSingle(P,"rect",f.grabAreaMinClassName,function(G){G.attr(F)});N.attr("height",_._height);var j=A.ensureSingle(L,"rect",f.grabAreaMaxClassName,function(G){G.attr(F)});j.attr("height",_._height)}}),f6=Vt((Z,V)=>{var u=Xr(),d=n1(),E=Vb(),A=s6();V.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:u.extendFlat({},d,{yaxis:E})}}},layoutAttributes:n1(),handleDefaults:l6(),calcAutorange:u6(),draw:c6(),isVisible:A.isVisible,makeData:A.makeData,autoMarginOpts:A.autoMarginOpts}}),i1=Vt((Z,V)=>{var u=yu(),d=nf(),E=cl().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:u({editType:"plot"}),bgcolor:{valType:"color",dflt:d.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),Hb=Vt((Z,V)=>{V.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),h6=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=cl(),A=Wf(),t=i1(),e=Hb();V.exports=function(n,o,a,s,f){var v=n.rangeselector||{},g=E.newContainer(o,"rangeselector");function m(S,k){return u.coerce(v,g,t,S,k)}var w=A(v,g,{name:"buttons",handleItemDefaults:r,calendar:f}),l=m("visible",w.length>0);if(l){var x=i(o,a,s);m("x",x[0]),m("y",x[1]),u.noneOrAll(n,o,["x","y"]),m("xanchor"),m("yanchor"),u.coerceFont(m,"font",a.font);var y=m("bgcolor");m("activecolor",d.contrast(y,e.lightAmount,e.darkAmount)),m("bordercolor"),m("borderwidth")}};function r(n,o,a,s){var f=s.calendar;function v(w,l){return u.coerce(n,o,t.buttons,w,l)}var g=v("visible");if(g){var m=v("step");m!=="all"&&(f&&f!=="gregorian"&&(m==="month"||m==="year")?o.stepmode="backward":v("stepmode"),v("count")),v("label")}}function i(n,o,a){for(var s=a.filter(function(m){return o[m].anchor===n._id}),f=0,v=0;v<s.length;v++){var g=o[s[v]].domain;g&&(f=Math.max(g[1],f))}return[n.domain[0],f+e.yPad]}}),p6=Vt((Z,V)=>{var u=G_(),d=Xr().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=u["utc"+d(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 f=e[1];return[a,f]}}),d6=Vt((Z,V)=>{var u=Ni(),d=ji(),E=Uu(),A=Pi(),t=Eo(),e=Xr(),r=e.strTranslate,i=Dl(),n=cc(),o=mf(),a=o.LINE_SPACING,s=o.FROM_TL,f=o.FROM_BR,v=Hb(),g=p6();V.exports=function(T){var c=T._fullLayout,h=c._infolayer.selectAll(".rangeselector").data(m(T),w);h.enter().append("g").classed("rangeselector",!0),h.exit().remove(),h.style({cursor:"pointer","pointer-events":"all"}),h.each(function(b){var _=u.select(this),P=b,L=P.rangeselector,D=_.selectAll("g.button").data(e.filterVisible(L.buttons));D.enter().append("g").classed("button",!0),D.exit().remove(),D.each(function(B){var R=u.select(this),I=g(P,B);B._isActive=l(P,B,I),R.call(x,L,B),R.call(S,L,B,T),R.on("click",function(){T._dragged||d.call("_guiRelayout",T,I)}),R.on("mouseover",function(){B._isHovered=!0,R.call(x,L,B)}),R.on("mouseout",function(){B._isHovered=!1,R.call(x,L,B)})}),M(T,D,L,P._name,_)})};function m(T){for(var c=n.list(T,"x",!0),h=[],b=0;b<c.length;b++){var _=c[b];_.rangeselector&&_.rangeselector.visible&&h.push(_)}return h}function w(T){return T._id}function l(T,c,h){if(c.step==="all")return T.autorange===!0;var b=Object.keys(h);return T.range[0]===h[b[0]]&&T.range[1]===h[b[1]]}function x(T,c,h){var b=e.ensureSingle(T,"rect","selector-rect",function(_){_.attr("shape-rendering","crispEdges")});b.attr({rx:v.rx,ry:v.ry}),b.call(A.stroke,c.bordercolor).call(A.fill,y(c,h)).style("stroke-width",c.borderwidth+"px")}function y(T,c){return c._isActive||c._isHovered?T.activecolor:T.bgcolor}function S(T,c,h,b){function _(L){i.convertToTspans(L,b)}var P=e.ensureSingle(T,"text","selector-text",function(L){L.attr("text-anchor","middle")});P.call(t.font,c.font).text(k(h,b._fullLayout._meta)).call(_)}function k(T,c){return T.label?c?e.templateString(T.label,c):T.label:T.step==="all"?"all":T.count+T.step.charAt(0)}function M(T,c,h,b,_){var P=0,L=0,D=h.borderwidth;c.each(function(){var j=u.select(this),G=j.select(".selector-text"),rt=h.font.size*a,ct=Math.max(rt*i.lineCount(G),16)+3;L=Math.max(L,ct)}),c.each(function(){var j=u.select(this),G=j.select(".selector-rect"),rt=j.select(".selector-text"),ct=rt.node()&&t.bBox(rt.node()).width,st=h.font.size*a,et=i.lineCount(rt),K=Math.max(ct+10,v.minButtonWidth);j.attr("transform",r(D+P,D)),G.attr({x:0,y:0,width:K,height:L}),i.positionText(rt,K/2,L/2-(et-1)*st/2+3),P+=K+5});var B=T._fullLayout._size,R=B.l+B.w*h.x,I=B.t+B.h*(1-h.y),F="left";e.isRightAnchor(h)&&(R-=P,F="right"),e.isCenterAnchor(h)&&(R-=P/2,F="center");var N="top";e.isBottomAnchor(h)&&(I-=L,N="bottom"),e.isMiddleAnchor(h)&&(I-=L/2,N="middle"),P=Math.ceil(P),L=Math.ceil(L),R=Math.round(R),I=Math.round(I),E.autoMargin(T,b+"-range-selector",{x:h.x,y:h.y,l:P*s[F],r:P*f[F],b:L*f[N],t:L*s[N]}),_.attr("transform",r(R,I))}}),m6=Vt((Z,V)=>{V.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:i1()}}},layoutAttributes:i1(),handleDefaults:h6(),draw:d6()}}),Vu=Vt(Z=>{var V=So().extendFlat;Z.attributes=function(u,d){u=u||{},d=d||{};var E={valType:"info_array",editType:u.editType,items:[{valType:"number",min:0,max:1,editType:u.editType},{valType:"number",min:0,max:1,editType:u.editType}],dflt:[0,1]};u.name&&u.name+"",u.trace,d.description&&""+d.description;var A={x:V({},E,{}),y:V({},E,{}),editType:u.editType};return u.noGridCell||(A.row={valType:"integer",min:0,dflt:0,editType:u.editType},A.column={valType:"integer",min:0,dflt:0,editType:u.editType}),A},Z.defaults=function(u,d,E,A){var t=A&&A.x||[0,1],e=A&&A.y||[0,1],r=d.grid;if(r){var i=E("domain.column");i!==void 0&&(i<r.columns?t=r._domains.x[i]:delete u.domain.column);var n=E("domain.row");n!==void 0&&(n<r.rows?e=r._domains.y[n]:delete u.domain.row)}var o=E("domain.x",t),a=E("domain.y",e);o[0]<o[1]||(u.domain.x=t.slice()),a[0]<a[1]||(u.domain.y=e.slice())}}),qb=Vt((Z,V)=>{var u=Xr(),d=pm().counter,E=Vu().attributes,A=Af().idRegex,t=cl(),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:[d("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,f,v){var g=f[v+"axes"],m=Object.keys((s._splomAxes||{})[v]||{});if(Array.isArray(g))return g;if(m.length)return m}function i(s,f){var v=s.grid||{},g=r(f,v,"x"),m=r(f,v,"y");if(!s.grid&&!g&&!m)return;var w=Array.isArray(v.subplots)&&Array.isArray(v.subplots[0]),l=Array.isArray(g),x=Array.isArray(m),y=l&&g!==v.xaxes&&x&&m!==v.yaxes,S,k;w?(S=v.subplots.length,k=v.subplots[0].length):(x&&(S=m.length),l&&(k=g.length));var M=t.newContainer(f,"grid");function T(I,F){return u.coerce(v,M,e,I,F)}var c=T("rows",S),h=T("columns",k);if(!(c*h>1)){delete f.grid;return}if(!w&&!l&&!x){var b=T("pattern")==="independent";b&&(w=!0)}M._hasSubplotGrid=w;var _=T("roworder"),P=_==="top to bottom",L=w?.2:.1,D=w?.3:.1,B,R;y&&f._splomGridDflt&&(B=f._splomGridDflt.xside,R=f._splomGridDflt.yside),M._domains={x:n("x",T,L,B,h),y:n("y",T,D,R,c,P)}}function n(s,f,v,g,m,w){var l=f(s+"gap",v),x=f("domain."+s);f(s+"side",g);for(var y=new Array(m),S=x[0],k=(x[1]-S)/(m-l),M=k*(1-l),T=0;T<m;T++){var c=S+k*T;y[w?m-1-T:T]=[c,c+M]}return y}function o(s,f){var v=f.grid;if(!(!v||!v._domains)){var g=s.grid||{},m=f._subplots,w=v._hasSubplotGrid,l=v.rows,x=v.columns,y=v.pattern==="independent",S,k,M,T,c,h,b,_=v._axisMap={};if(w){var P=g.subplots||[];h=v.subplots=new Array(l);var L=1;for(S=0;S<l;S++){var D=h[S]=new Array(x),B=P[S]||[];for(k=0;k<x;k++)if(y?(c=L===1?"xy":"x"+L+"y"+L,L++):c=B[k],D[k]="",m.cartesian.indexOf(c)!==-1){if(b=c.indexOf("y"),M=c.slice(0,b),T=c.slice(b),_[M]!==void 0&&_[M]!==k||_[T]!==void 0&&_[T]!==S)continue;D[k]=c,_[M]=k,_[T]=S}}}else{var R=r(f,g,"x"),I=r(f,g,"y");v.xaxes=a(R,m.xaxis,x,_,"x"),v.yaxes=a(I,m.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,st,et;if(rt.length<8)F[j]="free";else if(G==="x"){if(rt.charAt(0)==="t"===N?(ct=0,st=1,et=l):(ct=l-1,st=-1,et=-1),w){var K=_[j];for(S=ct;S!==et;S+=st)if(c=h[S][K],!!c&&(b=c.indexOf("y"),c.slice(0,b)===j)){F[j]=c.slice(b);break}}else for(S=ct;S!==et;S+=st)if(T=v.yaxes[S],m.cartesian.indexOf(j+T)!==-1){F[j]=T;break}}else if(rt.charAt(0)==="l"?(ct=0,st=1,et=x):(ct=x-1,st=-1,et=-1),w){var ot=_[j];for(S=ct;S!==et;S+=st)if(c=h[ot][S],!!c&&(b=c.indexOf("y"),c.slice(b)===j)){F[j]=c.slice(0,b);break}}else for(S=ct;S!==et;S+=st)if(M=v.xaxes[S],m.cartesian.indexOf(M+j)!==-1){F[j]=M;break}}}}function a(s,f,v,g,m){var w=new Array(v),l;function x(y,S){f.indexOf(S)!==-1&&g[S]===void 0?(w[y]=S,g[S]=y):w[y]=""}if(Array.isArray(s))for(l=0;l<v;l++)x(l,s[l]);else for(x(0,m),l=1;l<v;l++)x(l,m+(l+1));return w}V.exports={moduleType:"component",name:"grid",schema:{layout:{grid:e}},layoutAttributes:e,sizeDefaults:i,contentDefaults:o}}),Wb=Vt((Z,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"}}),g6=Vt((Z,V)=>{var u=Lo(),d=ji(),E=Xr(),A=cl(),t=Wb();V.exports=function(e,r,i,n){var o="error_"+n.axis,a=A.newContainer(r,o),s=e[o]||{};function f(y,S){return E.coerce(s,a,t,y,S)}var v=s.array!==void 0||s.value!==void 0||s.type==="sqrt",g=f("visible",v);if(g!==!1){var m=f("type","array"in s?"data":"percent"),w=!0;m!=="sqrt"&&(w=f("symmetric",!((m==="data"?"arrayminus":"valueminus")in s))),m==="data"?(f("array"),f("traceref"),w||(f("arrayminus"),f("tracerefminus"))):(m==="percent"||m==="constant")&&(f("value"),w||f("valueminus"));var l="copy_"+n.inherit+"style";if(n.inherit){var x=r["error_"+n.inherit];(x||{}).visible&&f(l,!(s.color||u(s.thickness)||u(s.width)))}(!n.inherit||!a[l])&&(f("color",i),f("thickness"),f("width",d.traceIs(r,"gl3d")?0:4))}}}),Gb=Vt((Z,V)=>{V.exports=function(d){var E=d.type,A=d.symmetric;if(E==="data"){var t=d.array||[];if(A)return function(n,o){var a=+t[o];return[a,a]};var e=d.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=u(E,d.value),i=u(E,d.valueminus);return A||d.valueminus===void 0?function(n){var o=r(n);return[o,o]}:function(n){return[i(n),r(n)]}}};function u(d,E){if(d==="percent")return function(A){return Math.abs(A*E/100)};if(d==="constant")return function(){return Math.abs(E)};if(d==="sqrt")return function(A){return Math.sqrt(Math.abs(A))}}}),v6=Vt((Z,V)=>{var u=Lo(),d=ji(),E=yo(),A=Xr(),t=Gb();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&&d.traceIs(a,"errorBarsOK")){var s=E.getFromId(r,a.xaxis),f=E.getFromId(r,a.yaxis);e(o,a,s,"x"),e(o,a,f,"y")}}};function e(r,i,n,o){var a=i["error_"+o]||{},s=a.visible&&["linear","log"].indexOf(n.type)!==-1,f=[];if(s){for(var v=t(a),g=0;g<r.length;g++){var m=r[g],w=m.i;if(w===void 0)w=g;else if(w===null)continue;var l=m[o];if(u(n.c2l(l))){var x=v(l,w);if(u(x[0])&&u(x[1])){var y=m[o+"s"]=l-x[0],S=m[o+"h"]=l+x[1];f.push(y,S)}}}var k=n._id,M=i._extremes[k],T=E.findExtremes(n,f,A.extendFlat({tozero:M.opts.tozero},{padded:!0}));M.min=M.min.concat(T.min),M.max=M.max.concat(T.max)}}}),y6=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Eo(),A=nu();V.exports=function(e,r,i,n){var o,a=i.xaxis,s=i.yaxis,f=n&&n.duration>0,v=e._context.staticPlot;r.each(function(g){var m=g[0].trace,w=m.error_x||{},l=m.error_y||{},x;m.ids&&(x=function(M){return M.id});var y=A.hasMarkers(m)&&m.marker.maxdisplayed>0;!l.visible&&!w.visible&&(g=[]);var S=u.select(this).selectAll("g.errorbar").data(g,x);if(S.exit().remove(),!!g.length){w.visible||S.selectAll("path.xerror").remove(),l.visible||S.selectAll("path.yerror").remove(),S.style("opacity",1);var k=S.enter().append("g").classed("errorbar",!0);f&&k.style("opacity",0).transition().duration(n.duration).style("opacity",1),E.setClipUrl(S,i.layerClipId,e),S.each(function(M){var T=u.select(this),c=t(M,a,s);if(!(y&&!M.vis)){var h,b=T.select("path.yerror");if(l.visible&&d(c.x)&&d(c.yh)&&d(c.ys)){var _=l.width;h="M"+(c.x-_)+","+c.yh+"h"+2*_+"m-"+_+",0V"+c.ys,c.noYS||(h+="m-"+_+",0h"+2*_),o=!b.size(),o?b=T.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):f&&(b=b.transition().duration(n.duration).ease(n.easing)),b.attr("d",h)}else b.remove();var P=T.select("path.xerror");if(w.visible&&d(c.y)&&d(c.xh)&&d(c.xs)){var L=(w.copy_ystyle?l:w).width;h="M"+c.xh+","+(c.y-L)+"v"+2*L+"m0,-"+L+"H"+c.xs,c.noXS||(h+="m0,-"+L+"v"+2*L),o=!P.size(),o?P=T.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):f&&(P=P.transition().duration(n.duration).ease(n.easing)),P.attr("d",h)}else P.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),d(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),d(n.xs)||(n.noXS=!0,n.xs=r.c2p(e.xs,!0))),n}}),x6=Vt((Z,V)=>{var u=Ni(),d=Pi();V.exports=function(E){E.each(function(A){var t=A[0].trace,e=t.error_y||{},r=t.error_x||{},i=u.select(this);i.selectAll("path.yerror").style("stroke-width",e.thickness+"px").call(d.stroke,e.color),r.copy_ystyle&&(r=e),i.selectAll("path.xerror").style("stroke-width",r.thickness+"px").call(d.stroke,r.color)})}}),_6=Vt((Z,V)=>{var u=Xr(),d=Cu().overrideAll,E=Wb(),A={error_x:u.extendFlat({},E),error_y:u.extendFlat({},E)};delete A.error_x.copy_zstyle,delete A.error_y.copy_zstyle,delete A.error_y.copy_ystyle;var t={error_x:u.extendFlat({},E),error_y:u.extendFlat({},E),error_z:u.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:d(t,"calc","nested"),scattergl:d(A,"calc","nested")}},supplyDefaults:g6(),calc:v6(),makeComputeError:Gb(),plot:y6(),style:x6(),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))}}),b6=Vt((Z,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"}}}),w6=Vt((Z,V)=>{var u=Ni(),d=kf(),E=Uu(),A=ji(),t=yo(),e=ih(),r=Xr(),i=r.strTranslate,n=So().extendFlat,o=$h(),a=Eo(),s=Pi(),f=o0(),v=Dl(),g=nh().flipScale,m=Vg(),w=Qy(),l=Pf(),x=mf(),y=x.LINE_SPACING,S=x.FROM_TL,k=x.FROM_BR,M=b6().cn;function T(L){var D=L._fullLayout,B=D._infolayer.selectAll("g."+M.colorbar).data(c(L),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 I=u.select(this);r.ensureSingle(I,"rect",M.cbbg),r.ensureSingle(I,"g",M.cbfills),r.ensureSingle(I,"g",M.cblines),r.ensureSingle(I,"g",M.cbaxis,function(N){N.classed(M.crisp,!0)}),r.ensureSingle(I,"g",M.cbtitleunshift,function(N){N.append("g").classed(M.cbtitle,!0)}),r.ensureSingle(I,"rect",M.cboutline);var F=h(I,R,L);F&&F.then&&(L._promises||[]).push(F),L._context.edits.colorbarPosition&&b(I,R,L)}),B.exit().each(function(R){E.autoMargin(L,R._id)}).remove(),B.order()}function c(L){var D=L._fullLayout,B=L.calcdata,R=[],I,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(L,N,I):(I._fillgradient=F.reversescale?g(F.colorscale):F.colorscale,I._zrange=[F[j.min],F[j.max]])}for(var ct=0;ct<B.length;ct++){var st=B[ct];if(N=st[0].trace,!!N._module){var et=N._module.colorbar;if(N.visible===!0&&et)for(var K=Array.isArray(et),ot=K?et:[et],X=0;X<ot.length;X++){j=ot[X];var Q=j.container;F=Q?N[Q]:N,F&&F.showscale&&(I=G(F.colorbar),I._id="cb"+N.uid+(K&&Q?"-"+Q:""),I._traceIndex=N.index,I._propPrefix=(Q?Q+".":"")+"colorbar.",I._meta=N._meta,rt(),R.push(I))}}}for(var ut in D._colorAxes)if(F=D[ut],F.showscale){var J=D._colorAxes[ut];I=G(F.colorbar),I._id="cb"+ut,I._propPrefix=ut+".colorbar.",I._meta=D._meta,j={min:"cmin",max:"cmax"},J[0]!=="heatmap"&&(N=J[1],j.calc=N._module.colorbar.calc),rt(),R.push(I)}return R}function h(L,D,B){var R=D.orientation==="v",I=D.len,F=D.lenmode,N=D.thickness,j=D.thicknessmode,G=D.outlinewidth,rt=D.borderwidth,ct=D.bgcolor,st=D.xanchor,et=D.yanchor,K=D.xpad,ot=D.ypad,X=D.x,Q=R?D.y:1-D.y,ut=D.yref==="paper",J=D.xref==="paper",q=B._fullLayout,it=q._size,nt=D._fillcolor,dt=D._line,Tt=D.title,wt=Tt.side,It=D._zrange||u.extent((typeof nt=="function"?nt:dt.color).domain()),Ct=typeof dt.color=="function"?dt.color:function(){return dt.color},Nt=typeof nt=="function"?nt:function(){return nt},ee=D._levels,Jt=_(B,D,It),te=Jt.fill,Kt=Jt.line,mt=Math.round(N*(j==="fraction"?R?it.w:it.h:1)),bt=mt/(R?it.w:it.h),vt=Math.round(I*(F==="fraction"?R?it.h:it.w:1)),Ut=vt/(R?it.h:it.w),re=J?it.w:B._fullLayout.width,Zt=ut?it.h:B._fullLayout.height,ue=Math.round(R?X*re+K:Q*Zt+ot),Me={center:.5,right:1}[st]||0,Ce={top:1,middle:.5}[et]||0,We=R?X-Me*bt:Q-Ce*bt,qe=R?Q-Ce*Ut:X-Me*Ut,vr=Math.round(R?Zt*(1-qe):re*qe);D._lenFrac=Ut,D._thickFrac=bt,D._uFrac=We,D._vFrac=qe;var _r=D._axis=P(B,D,It);_r.position=bt+(R?X+K/it.w:Q+ot/it.h);var er=["top","bottom"].indexOf(wt)!==-1;if(R&&er&&(_r.title.side=wt,_r.titlex=X+K/it.w,_r.titley=qe+(Tt.side==="top"?Ut-ot/it.h:ot/it.h)),!R&&!er&&(_r.title.side=wt,_r.titley=Q+ot/it.h,_r.titlex=qe+K/it.w),dt.color&&D.tickmode==="auto"){_r.tickmode="linear",_r.tick0=ee.start;var Mr=ee.size,Ir=r.constrain(vt/50,4,15)+1,de=(It[1]-It[0])/((D.nticks||Ir)*Mr);if(de>1){var Dt=Math.pow(10,Math.floor(Math.log(de)/Math.LN10));Mr*=Dt*r.roundUp(de/Dt,[2,5,10]),(Math.abs(ee.start)/ee.size+1e-6)%1<2e-6&&(_r.tick0=0)}_r.dtick=Mr}_r.domain=R?[qe+ot/it.h,qe+Ut-ot/it.h]:[qe+K/it.w,qe+Ut-K/it.w],_r.setScale(),L.attr("transform",i(Math.round(it.l),Math.round(it.t)));var qt=L.select("."+M.cbtitleunshift).attr("transform",i(-Math.round(it.l),-Math.round(it.t))),_t=_r.ticklabelposition,lt=_r.title.font.size,yt=L.select("."+M.cbaxis),St,Ht=0,Yt=0;function se(ar,Ye){var Er={propContainer:_r,propName:D._propPrefix+"title.text",traceIndex:D._traceIndex,_meta:D._meta,placeholder:q._dfltTitle.colorbar,containerGroup:L.select("."+M.cbtitle)},pn=ar.charAt(0)==="h"?ar.substr(1):"h"+ar;L.selectAll("."+pn+",."+pn+"-math-group").remove(),f.draw(B,ar,n(Er,Ye||{}))}function ke(){if(R&&er||!R&&!er){var ar,Ye;wt==="top"&&(ar=K+it.l+re*X,Ye=ot+it.t+Zt*(1-qe-Ut)+3+lt*.75),wt==="bottom"&&(ar=K+it.l+re*X,Ye=ot+it.t+Zt*(1-qe)-3-lt*.25),wt==="right"&&(Ye=ot+it.t+Zt*Q+3+lt*.75,ar=K+it.l+re*qe),se(_r._id+"title",{attributes:{x:ar,y:Ye,"text-anchor":R?"start":"middle"}})}}function Ee(){if(R&&!er||!R&&er){var ar=_r.position||0,Ye=_r._offset+_r._length/2,Er,pn;if(wt==="right")pn=Ye,Er=it.l+re*ar+10+lt*(_r.showticklabels?1:.5);else if(Er=Ye,wt==="bottom"&&(pn=it.t+Zt*ar+10+(_t.indexOf("inside")===-1?_r.tickfont.size:0)+(_r.ticks!=="inside"&&D.ticklen||0)),wt==="top"){var dn=Tt.text.split("<br>").length;pn=it.t+Zt*ar+10-mt-y*lt*dn}se((R?"h":"v")+_r._id+"title",{avoid:{selection:u.select(B).selectAll("g."+_r._id+"tick"),side:wt,offsetTop:R?0:it.t,offsetLeft:R?it.l:0,maxShift:R?q.width:q.height},attributes:{x:Er,y:pn,"text-anchor":"middle"},transform:{rotate:R?-90:0,offset:0}})}}function Ue(){if(!R&&!er||R&&er){var ar=L.select("."+M.cbtitle),Ye=ar.select("text"),Er=[-G/2,G/2],pn=ar.select(".h"+_r._id+"title-math-group").node(),dn=15.6;Ye.node()&&(dn=parseInt(Ye.node().style.fontSize,10)*y);var bn;if(pn?(bn=a.bBox(pn),Yt=bn.width,Ht=bn.height,Ht>dn&&(Er[1]-=(Ht-dn)/2)):Ye.node()&&!Ye.classed(M.jsPlaceholder)&&(bn=a.bBox(Ye.node()),Yt=bn.width,Ht=bn.height),R){if(Ht){if(Ht+=5,wt==="top")_r.domain[1]-=Ht/it.h,Er[1]*=-1;else{_r.domain[0]+=Ht/it.h;var Zn=v.lineCount(Ye);Er[1]+=(1-Zn)*dn}ar.attr("transform",i(Er[0],Er[1])),_r.setScale()}}else Yt&&(wt==="right"&&(_r.domain[0]+=(Yt+lt/2)/it.w),ar.attr("transform",i(Er[0],Er[1])),_r.setScale())}L.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",R?i(0,Math.round(it.h*(1-_r.domain[1]))):i(Math.round(it.w*_r.domain[0]),0)),yt.attr("transform",R?i(0,Math.round(-it.t)):i(Math.round(-it.l),0));var En=L.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(te);En.enter().append("rect").classed(M.cbfill,!0).attr("style",""),En.exit().remove();var gn=It.map(_r.c2p).map(Math.round).sort(function(Ze,tr){return Ze-tr});En.each(function(Ze,tr){var zr=[tr===0?It[0]:(te[tr]+te[tr-1])/2,tr===te.length-1?It[1]:(te[tr]+te[tr+1])/2].map(_r.c2p).map(Math.round);R&&(zr[1]=r.constrain(zr[1]+(zr[1]>zr[0])?1:-1,gn[0],gn[1]));var tn=u.select(this).attr(R?"x":"y",ue).attr(R?"y":"x",u.min(zr)).attr(R?"width":"height",Math.max(mt,2)).attr(R?"height":"width",Math.max(u.max(zr)-u.min(zr),2));if(D._fillgradient)a.gradient(tn,B,D._id,R?"vertical":"horizontalreversed",D._fillgradient,"fill");else{var Yr=Nt(Ze).replace("e-","");tn.attr("fill",d(Yr).toHexString())}});var da=L.select("."+M.cblines).selectAll("path."+M.cbline).data(dt.color&&dt.width?Kt:[]);da.enter().append("path").classed(M.cbline,!0),da.exit().remove(),da.each(function(Ze){var tr=ue,zr=Math.round(_r.c2p(Ze))+dt.width/2%1;u.select(this).attr("d","M"+(R?tr+","+zr:zr+","+tr)+(R?"h":"v")+mt).call(a.lineGroupStyle,dt.width,Ct(Ze),dt.dash)}),yt.selectAll("g."+_r._id+"tick,path").remove();var ra=ue+mt+(G||0)/2-(D.ticks==="outside"?1:0),Se=t.calcTicks(_r),Re=t.getTickSigns(_r)[2];return t.drawTicks(B,_r,{vals:_r.ticks==="inside"?t.clipEnds(_r,Se):Se,layer:yt,path:t.makeTickPath(_r,ra,Re),transFn:t.makeTransTickFn(_r)}),t.drawLabels(B,_r,{vals:Se,layer:yt,transFn:t.makeTransTickLabelFn(_r),labelFns:t.makeLabelFns(_r,ra)})}function ir(){var ar,Ye=mt+G/2;_t.indexOf("inside")===-1&&(ar=a.bBox(yt.node()),Ye+=R?ar.width:ar.height),St=qt.select("text");var Er=0,pn=R&&wt==="top",dn=!R&&wt==="right",bn=0;if(St.node()&&!St.classed(M.jsPlaceholder)){var Zn,En=qt.select(".h"+_r._id+"title-math-group").node();En&&(R&&er||!R&&!er)?(ar=a.bBox(En),Er=ar.width,Zn=ar.height):(ar=a.bBox(qt.node()),Er=ar.right-it.l-(R?ue:vr),Zn=ar.bottom-it.t-(R?vr:ue),!R&&wt==="top"&&(Ye+=ar.height,bn=ar.height)),dn&&(St.attr("transform",i(Er/2+lt/2,0)),Er*=2),Ye=Math.max(Ye,R?Er:Zn)}var gn=(R?K:ot)*2+Ye+rt+G/2,da=0;!R&&Tt.text&&et==="bottom"&&Q<=0&&(da=gn/2,gn+=da,bn+=da),q._hColorbarMoveTitle=da,q._hColorbarMoveCBTitle=bn;var ra=rt+G,Se=(R?ue:vr)-ra/2-(R?K:0),Re=(R?vr:ue)-(R?vt:ot+bn-da);L.select("."+M.cbbg).attr("x",Se).attr("y",Re).attr(R?"width":"height",Math.max(gn-da,2)).attr(R?"height":"width",Math.max(vt+ra,2)).call(s.fill,ct).call(s.stroke,D.bordercolor).style("stroke-width",rt);var Ze=dn?Math.max(Er-10,0):0;L.selectAll("."+M.cboutline).attr("x",(R?ue:vr+K)+Ze).attr("y",(R?vr+ot-vt:ue)+(pn?Ht:0)).attr(R?"width":"height",Math.max(mt,2)).attr(R?"height":"width",Math.max(vt-(R?2*ot+Ht:2*K+Ze),2)).call(s.stroke,D.outlinecolor).style({fill:"none","stroke-width":G});var tr=R?Me*gn:0,zr=R?0:(1-Ce)*gn-bn;if(tr=J?it.l-tr:-tr,zr=ut?it.t-zr:-zr,L.attr("transform",i(tr,zr)),!R&&(rt||d(ct).getAlpha()&&!d.equals(q.paper_bgcolor,ct))){var tn=yt.selectAll("text"),Yr=tn[0].length,$r=L.select("."+M.cbbg).node(),In=a.bBox($r),Nn=a.getTranslate(L),Kn=2;tn.each(function(Tr,mr){var kr=0,Ur=Yr-1;if(mr===kr||mr===Ur){var Or=a.bBox(this),pe=a.getTranslate(this),Ke;if(mr===Ur){var xr=Or.right+pe.x,Gr=In.right+Nn.x+vr-rt-Kn+X;Ke=Gr-xr,Ke>0&&(Ke=0)}else if(mr===kr){var ln=Or.left+pe.x,wn=In.left+Nn.x+vr+rt+Kn;Ke=wn-ln,Ke<0&&(Ke=0)}Ke&&(Yr<3?this.setAttribute("transform","translate("+Ke+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var $n={},ia=S[st],Cn=k[st],Fa=S[et],Ga=k[et],ve=gn-mt;R?(F==="pixels"?($n.y=Q,$n.t=vt*Fa,$n.b=vt*Ga):($n.t=$n.b=0,$n.yt=Q+I*Fa,$n.yb=Q-I*Ga),j==="pixels"?($n.x=X,$n.l=gn*ia,$n.r=gn*Cn):($n.l=ve*ia,$n.r=ve*Cn,$n.xl=X-N*ia,$n.xr=X+N*Cn)):(F==="pixels"?($n.x=X,$n.l=vt*ia,$n.r=vt*Cn):($n.l=$n.r=0,$n.xl=X+I*ia,$n.xr=X-I*Cn),j==="pixels"?($n.y=1-Q,$n.t=gn*Fa,$n.b=gn*Ga):($n.t=ve*Fa,$n.b=ve*Ga,$n.yt=Q-N*Fa,$n.yb=Q+N*Ga));var ge=D.y<.5?"b":"t",dr=D.x<.5?"l":"r";B._fullLayout._reservedMargin[D._id]={};var br={r:q.width-Se-tr,l:Se+$n.r,b:q.height-Re-zr,t:Re+$n.b};J&&ut?E.autoMargin(B,D._id,$n):J?B._fullLayout._reservedMargin[D._id][ge]=br[ge]:ut||R?B._fullLayout._reservedMargin[D._id][dr]=br[dr]:B._fullLayout._reservedMargin[D._id][ge]=br[ge]}return r.syncOrAsync([E.previousPromises,ke,Ue,Ee,E.previousPromises,ir],B)}function b(L,D,B){var R=D.orientation==="v",I=B._fullLayout,F=I._size,N,j,G;e.init({element:L.node(),gd:B,prepFn:function(){N=L.attr("transform"),o(L)},moveFn:function(rt,ct){L.attr("transform",N+i(rt,ct)),j=e.align((R?D._uFrac:D._vFrac)+rt/F.w,R?D._thickFrac:D._lenFrac,0,1,D.xanchor),G=e.align((R?D._vFrac:1-D._uFrac)-ct/F.h,R?D._lenFrac:D._thickFrac,0,1,D.yanchor);var st=e.getCursor(j,G,D.xanchor,D.yanchor);o(L,st)},doneFn:function(){if(o(L),j!==void 0&&G!==void 0){var rt={};rt[D._propPrefix+"x"]=j,rt[D._propPrefix+"y"]=G,D._traceIndex!==void 0?A.call("_guiRestyle",B,rt,D._traceIndex):A.call("_guiRelayout",B,rt)}}})}function _(L,D,B){var R=D._levels,I=[],F=[],N,j,G=R.end+R.size/100,rt=R.size,ct=1.001*B[0]-.001*B[1],st=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<st&&I.push(N);if(D._fillgradient)F=[0];else if(typeof D._fillcolor=="function"){var et=D._filllevels;if(et)for(G=et.end+et.size/100,rt=et.size,j=0;j<1e5&&(N=et.start+j*rt,!(rt>0?N>=G:N<=G));j++)N>B[0]&&N<B[1]&&F.push(N);else F=I.map(function(K){return K-R.size/2}),F.push(F[F.length-1]+R.size)}else D._fillcolor&&typeof D._fillcolor=="string"&&(F=[0]);return R.size<0&&(I.reverse(),F.reverse()),{line:I,fill:F}}function P(L,D,B){var R=L._fullLayout,I=D.orientation==="v",F={type:"linear",range:B,tickmode:D.tickmode,nticks:D.nticks,tick0:D.tick0,dtick:D.dtick,tickvals:D.tickvals,ticktext:D.ticktext,ticks:D.ticks,ticklen:D.ticklen,tickwidth:D.tickwidth,tickcolor:D.tickcolor,showticklabels:D.showticklabels,labelalias:D.labelalias,ticklabelposition:D.ticklabelposition,ticklabeloverflow:D.ticklabeloverflow,ticklabelstep:D.ticklabelstep,tickfont:D.tickfont,tickangle:D.tickangle,tickformat:D.tickformat,exponentformat:D.exponentformat,minexponent:D.minexponent,separatethousands:D.separatethousands,showexponent:D.showexponent,showtickprefix:D.showtickprefix,tickprefix:D.tickprefix,showticksuffix:D.showticksuffix,ticksuffix:D.ticksuffix,title:D.title,showline:!0,anchor:"free",side:I?"right":"bottom",position:1},N=I?"y":"x",j={type:"linear",_id:N+D._id},G={letter:N,font:R.font,noAutotickangles:N==="y",noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:R.calendar};function rt(ct,st){return r.coerce(F,j,l,ct,st)}return m(F,j,rt,G,R),w(F,j,rt,G),j}V.exports={draw:T}}),T6=Vt((Z,V)=>{V.exports={moduleType:"component",name:"colorbar",attributes:Ny(),supplyDefaults:lb(),draw:w6().draw,hasColorbar:ib()}}),k6=Vt((Z,V)=>{V.exports={moduleType:"component",name:"legend",layoutAttributes:fb(),supplyLayoutDefaults:hb(),draw:mb(),style:db()}}),A6=Vt((Z,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"}}}),M6=Vt((Z,V)=>{V.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),Zb=Vt((Z,V)=>{var u=ji(),d=Xr(),E=d.extendFlat,A=d.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),f=A({},a,t(i.tileClass)),v=r._context||{};if(i.width&&(f.width=i.width),i.height&&(f.height=i.height),i.tileClass==="thumbnail"||i.tileClass==="themes__thumb"){f.annotations=[];var g=Object.keys(f);for(n=0;n<g.length;n++)e(g[n])&&(f[g[n]].title={text:""});for(n=0;n<s.length;n++){var m=s[n];m.showscale=!1,m.marker&&(m.marker.showscale=!1),u.traceIs(m,"pie-like")&&(m.textposition="none")}}if(Array.isArray(i.annotations))for(n=0;n<i.annotations.length;n++)f.annotations.push(i.annotations[n]);var w=Object.keys(f).filter(function(k){return k.match(/^scene\d*$/)});if(w.length){var l={};for(i.tileClass==="thumbnail"&&(l={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<w.length;n++){var x=f[w[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 y=document.createElement("div");i.tileClass&&(y.className=i.tileClass);var S={gd:y,td:y,layout:f,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}}),S6=Vt((Z,V)=>{var u=a0().EventEmitter,d=ji(),E=Xr(),A=Bp(),t=Zb(),e=Yy(),r=Xy();function i(n,o){var a=new u,s=t(n,{format:"png"}),f=s.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);function v(){var m=A.getDelay(f._fullLayout);setTimeout(function(){var w=e(f),l=document.createElement("canvas");l.id=E.randstr(),a=r({format:o.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:l,emitter:a,svg:w}),a.clean=function(){f&&document.body.removeChild(f)}},m)}var g=A.getRedrawFunc(f);return d.call("_doPlot",f,s.data,s.layout,s.config).then(g).then(v).catch(function(m){a.emit("error",m)}),a}V.exports=i}),E6=Vt((Z,V)=>{var u=Bp(),d={getDelay:u.getDelay,getRedrawFunc:u.getRedrawFunc,clone:Zb(),toSVG:Yy(),svgToImg:Xy(),toImage:S6(),downloadImage:Cb()};V.exports=d}),z6=Vt(Z=>{Z.version=Ly().version,H4(),NT();var V=ji(),u=Z.register=V.register,d=Mk(),E=Object.keys(d);for(t=0;t<E.length;t++)A=E[t],A.charAt(0)!=="_"&&(Z[A]=d[A]),u({moduleType:"apiMethod",name:A,fn:d[A]});var A,t;u(Dk()),u([Uk(),Wk(),Sc(),Yk(),Qk(),n6(),o6(),f6(),m6(),qb(),_6(),xu(),T6(),k6(),hc(),Tb()]),u([A6(),M6()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(u(window.PlotlyLocales),delete window.PlotlyLocales),Z.Icons=Vy();var e=hc(),r=Uu();Z.Plots={resize:r.resize,graphJson:r.graphJson,sendDataToCloud:r.sendDataToCloud},Z.Fx={hover:e.hover,unhover:e.unhover,loneHover:e.loneHover,loneUnhover:e.loneUnhover},Z.Snapshot=E6(),Z.PlotSchema=gm()}),L6=Vt((Z,V)=>{V.exports=z6()}),f0=Vt((Z,V)=>{V.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),yp=Vt((Z,V)=>{var u=pc(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,texttemplateAttrs:A,templatefallbackAttrs:t}=kl(),e=Wl(),r=yu(),i=f0(),n=Cf().pattern,o=So().extendFlat,a=r({editType:"calc",arrayOk:!0,colorEditType:"style"}),s=u.marker,f=s.line,v=o({},f.width,{dflt:0}),g=o({width:v,editType:"calc"},e("marker.line")),m=o({line:g,editType:"calc"},e("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:n,cornerradius:{valType:"any",editType:"calc"}});V.exports={x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:u.xperiod0,yperiod0:u.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,xhoverformat:d("x"),yhoverformat:d("y"),text:u.text,texttemplate:A({editType:"plot"},{keys:i.eventDataKeys}),texttemplatefallback:t({editType:"plot"}),hovertext:u.hovertext,hovertemplate:E({},{keys:i.eventDataKeys}),hovertemplatefallback:t(),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:o({},a,{}),insidetextfont:o({},a,{}),outsidetextfont:o({},a,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:o({},u.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:u.offsetgroup,alignmentgroup:u.alignmentgroup,selected:{marker:{opacity:u.selected.marker.opacity,color:u.selected.marker.color,editType:"style"},textfont:u.selected.textfont,editType:"style"},unselected:{marker:{opacity:u.unselected.marker.opacity,color:u.unselected.marker.color,editType:"style"},textfont:u.unselected.textfont,editType:"style"},zorder:u.zorder}}),o1=Vt((Z,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((Z,V)=>{var u=Pi(),d=nh().hasColorscale,E=gf(),A=Xr().coercePattern;V.exports=function(t,e,r,i,n){var o=r("marker.color",i),a=d(t,"marker");a&&E(t,e,n,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",u.defaultLine),d(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")}}),Lh=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=Pi(),A=ji(),t=bm(),e=tp(),r=s1(),i=u0(),n=yp(),o=d.coerceFont;function a(g,m,w,l){function x(T,c){return d.coerce(g,m,n,T,c)}var y=t(g,m,l,x);if(!y){m.visible=!1;return}e(g,m,l,x),x("xhoverformat"),x("yhoverformat"),x("zorder"),x("orientation",m.x&&!m.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var S=x("textposition");v(g,m,l,x,S,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),r(g,m,x,w,l);var k=(m.marker.line||{}).color,M=A.getComponentMethod("errorbars","supplyDefaults");M(g,m,k||E.defaultLine,{axis:"y"}),M(g,m,k||E.defaultLine,{axis:"x",inherit:"y"}),d.coerceSelectionMarkerOpacity(m,x)}function s(g,m){var w,l;function x(k,M){return d.coerce(l._input,l,n,k,M)}for(var y=0;y<g.length;y++)if(l=g[y],l.type==="bar"){w=l._input;var S=x("marker.cornerradius",m.barcornerradius);l.marker&&(l.marker.cornerradius=f(S)),i(w,l,m,x,m.barmode)}}function f(g){if(u(g)){if(g=+g,g>=0)return g}else if(typeof g=="string"&&(g=g.trim(),g.slice(-1)==="%"&&u(g.slice(0,-1))&&(g=+g.slice(0,-1),g>=0)))return g+"%"}function v(g,m,w,l,x,y){y=y||{};var S=y.moduleHasSelected!==!1,k=y.moduleHasUnselected!==!1,M=y.moduleHasConstrain!==!1,T=y.moduleHasCliponaxis!==!1,c=y.moduleHasTextangle!==!1,h=y.moduleHasInsideanchor!==!1,b=!!y.hasPathbar,_=Array.isArray(x)||x==="auto",P=_||x==="inside",L=_||x==="outside";if(P||L){var D=o(l,"textfont",w.font),B=d.extendFlat({},D),R=g.textfont&&g.textfont.color,I=!R;if(I&&delete B.color,o(l,"insidetextfont",B),b){var F=d.extendFlat({},D);I&&delete F.color,o(l,"pathbar.textfont",F)}L&&o(l,"outsidetextfont",D),S&&l("selected.textfont.color"),k&&l("unselected.textfont.color"),M&&l("constraintext"),T&&l("cliponaxis"),c&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}P&&h&&l("insidetextanchor")}V.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:v,validateCornerradius:f}}),Kb=Vt((Z,V)=>{var u=ji(),d=yo(),E=Xr(),A=o1(),t=Lh().validateCornerradius;V.exports=function(e,r,i){function n(S,k){return E.coerce(e,r,A,S,k)}for(var o=!1,a=!1,s=!1,f={},v=n("barmode"),g=v==="group",m=0;m<i.length;m++){var w=i[m];if(u.traceIs(w,"bar")&&w.visible)o=!0;else continue;var l=w.xaxis+w.yaxis;if(g?(f[l]&&(s=!0),f[l]=!0):(l+=w._input.offsetgroup,f.length>0&&!f[l]&&(s=!0),f[l]=!0),w.visible&&w.type==="histogram"){var x=d.getFromId({_fullLayout:r},w[w.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 y=n("barcornerradius");r.barcornerradius=t(y)}}),qg=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){for(var A=0;A<d.length;A++)d[A].i=A;u.mergeArray(E.text,d,"tx"),u.mergeArray(E.hovertext,d,"htx");var t=E.marker;if(t){u.mergeArray(t.opacity,d,"mo",!0),u.mergeArray(t.color,d,"mc");var e=t.line;e&&(u.mergeArray(e.color,d,"mlc"),u.mergeArrayCastPositive(e.width,d,"mlw"))}}}),C6=Vt((Z,V)=>{var u=yo(),d=rp(),E=nh().hasColorscale,A=ah(),t=qg(),e=jh();V.exports=function(r,i){var n=u.getFromId(r,i.xaxis||"x"),o=u.getFromId(r,i.yaxis||"y"),a,s,f,v,g,m,w={msUTC:!!(i.base||i.base===0)};i.orientation==="h"?(a=n.makeCalcdata(i,"x",w),f=o.makeCalcdata(i,"y"),v=d(i,o,"y",f),g=!!i.yperiodalignment,m="y"):(a=o.makeCalcdata(i,"y",w),f=n.makeCalcdata(i,"x"),v=d(i,n,"x",f),g=!!i.xperiodalignment,m="x"),s=v.vals;for(var l=Math.min(s.length,a.length),x=new Array(l),y=0;y<l;y++)x[y]={p:s[y],s:a[y]},g&&(x[y].orig_p=f[y],x[y][m+"End"]=v.ends[y],x[y][m+"Start"]=v.starts[y]),i.ids&&(x[y].id=String(i.ids[y]));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}}),oh=Vt((Z,V)=>{var u=Ni(),d=Xr();function E(r,i,n){var o=r._fullLayout,a=o["_"+n+"Text_minsize"];if(a){var s=o.uniformtext.mode==="hide",f;switch(n){case"funnelarea":case"pie":case"sunburst":f="g.slice";break;case"treemap":case"icicle":f="g.slice, g.pathbar";break;default:f="g.points > g.point"}i.selectAll(f).each(function(v){var g=v.transform;if(g){g.scale=s&&g.hide?0:a/g.fontSize;var m=u.select(this).select("text");d.setTransormAndDisplay(m,g)}})}}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(Z=>{var V=Lo(),u=kf(),d=Xr().isArrayOrTypedArray;Z.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},Z.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},Z.coerceColor=function(E,A,t){return u(A).isValid()?A:t!==void 0?t:E.dflt},Z.coerceEnumerated=function(E,A,t){return E.coerceNumber&&(A=+A),E.values.indexOf(A)!==-1?A:t!==void 0?t:E.dflt},Z.getValue=function(E,A){var t;return d(E)?A<E.length&&(t=E[A]):t=E,t},Z.getLineWidth=function(E,A){var t=0<A.mlw?A.mlw:d(E.marker.line.width)?0:E.marker.line.width;return t}}),Vh=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Eo(),A=Xr(),t=ji(),e=oh().resizeText,r=yp(),i=r.textfont,n=r.insidetextfont,o=r.outsidetextfont,a=l1();function s(T){var c=u.select(T).selectAll('g[class^="barlayer"]').selectAll("g.trace");e(T,c,"bar");var h=c.size(),b=T._fullLayout;c.style("opacity",function(_){return _[0].trace.opacity}).each(function(_){(b.barmode==="stack"&&h>1||b.bargap===0&&b.bargroupgap===0&&!_[0].trace.marker.line.width)&&u.select(this).attr("shape-rendering","crispEdges")}),c.selectAll("g.points").each(function(_){var P=u.select(this),L=_[0].trace;f(P,L,T)}),t.getComponentMethod("errorbars","style")(c)}function f(T,c,h){E.pointStyle(T.selectAll("path"),c,h),v(T,c,h)}function v(T,c,h){T.selectAll("text").each(function(b){var _=u.select(this),P=A.ensureUniformFontSize(h,l(_,b,c,h));E.font(_,P)})}function g(T,c,h){var b=c[0].trace;b.selectedpoints?m(h,b,T):(f(h,b,T),t.getComponentMethod("errorbars","style")(h))}function m(T,c,h){E.selectedPointStyle(T.selectAll("path"),c),w(T.selectAll("text"),c,h)}function w(T,c,h){T.each(function(b){var _=u.select(this),P;if(b.selected){P=A.ensureUniformFontSize(h,l(_,b,c,h));var L=c.selected.textfont&&c.selected.textfont.color;L&&(P.color=L),E.font(_,P)}else E.selectedTextStyle(_,c)})}function l(T,c,h,b){var _=b._fullLayout.font,P=h.textfont;if(T.classed("bartext-inside")){var L=M(c,h);P=y(h,c.i,_,L)}else T.classed("bartext-outside")&&(P=S(h,c.i,_));return P}function x(T,c,h){return k(i,T.textfont,c,h)}function y(T,c,h,b){var _=x(T,c,h),P=T._input.textfont===void 0||T._input.textfont.color===void 0||Array.isArray(T.textfont.color)&&T.textfont.color[c]===void 0;return P&&(_={color:d.contrast(b),family:_.family,size:_.size,weight:_.weight,style:_.style,variant:_.variant,textcase:_.textcase,lineposition:_.lineposition,shadow:_.shadow}),k(n,T.insidetextfont,c,_)}function S(T,c,h){var b=x(T,c,h);return k(o,T.outsidetextfont,c,b)}function k(T,c,h,b){c=c||{};var _=a.getValue(c.family,h),P=a.getValue(c.size,h),L=a.getValue(c.color,h),D=a.getValue(c.weight,h),B=a.getValue(c.style,h),R=a.getValue(c.variant,h),I=a.getValue(c.textcase,h),F=a.getValue(c.lineposition,h),N=a.getValue(c.shadow,h);return{family:a.coerceString(T.family,_,b.family),size:a.coerceNumber(T.size,P,b.size),color:a.coerceColor(T.color,L,b.color),weight:a.coerceString(T.weight,D,b.weight),style:a.coerceString(T.style,B,b.style),variant:a.coerceString(T.variant,R,b.variant),textcase:a.coerceString(T.variant,I,b.textcase),lineposition:a.coerceString(T.variant,F,b.lineposition),shadow:a.coerceString(T.variant,N,b.shadow)}}function M(T,c){return c.type==="waterfall"?c[T.dir].marker.color:T.mcc||T.mc||c.marker.color}V.exports={style:s,styleTextPoints:v,styleOnSelect:g,getInsideTextFont:y,getOutsideTextFont:S,getBarColor:M,resizeText:e}}),h0=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=Dl(),t=Pi(),e=Eo(),r=ji(),i=yo().tickText,n=oh(),o=n.recordMinTextSize,a=n.clearMinTextSize,s=Vh(),f=l1(),v=f0(),g=yp(),m=g.text,w=g.textposition,l=dh().appendArrayPointValue,x=v.TEXTPAD;function y(rt){return rt.id}function S(rt){if(rt.ids)return y}function k(rt){return(rt>0)-(rt<0)}function M(rt,ct){return rt<ct?1:-1}function T(rt,ct,st,et){var K=[],ot=[],X=et?ct:st,Q=et?st:ct;return K[0]=X.c2p(rt.s0,!0),ot[0]=Q.c2p(rt.p0,!0),K[1]=X.c2p(rt.s1,!0),ot[1]=Q.c2p(rt.p1,!0),et?[K,ot]:[ot,K]}function c(rt,ct,st,et){if(!ct.uniformtext.mode&&h(st)){var K;return et&&(K=et()),rt.transition().duration(st.duration).ease(st.easing).each("end",function(){K&&K()}).each("interrupt",function(){K&&K()})}else return rt}function h(rt){return rt&&rt.duration>0}function b(rt,ct,st,et,K,ot){var X=ct.xaxis,Q=ct.yaxis,ut=rt._fullLayout,J=rt._context.staticPlot;K||(K={mode:ut.barmode,norm:ut.barmode,gap:ut.bargap,groupgap:ut.bargroupgap},a("bar",ut));var q=E.makeTraceGroups(et,st,"trace bars").each(function(it){var nt=u.select(this),dt=it[0].trace,Tt=it[0].t,wt=dt.type==="waterfall",It=dt.type==="funnel",Ct=dt.type==="histogram",Nt=dt.type==="bar",ee=Nt||It,Jt=0;wt&&dt.connector.visible&&dt.connector.mode==="between"&&(Jt=dt.connector.line.width/2);var te=dt.orientation==="h",Kt=h(K),mt=E.ensureSingle(nt,"g","points"),bt=S(dt),vt=mt.selectAll("g.point").data(E.identity,bt);vt.enter().append("g").classed("point",!0),vt.exit().remove(),vt.each(function(re,Zt){var ue=u.select(this),Me=T(re,X,Q,te),Ce=Me[0][0],We=Me[0][1],qe=Me[1][0],vr=Me[1][1],_r=(te?We-Ce:vr-qe)===0;_r&&ee&&f.getLineWidth(dt,re)&&(_r=!1),_r||(_r=!d(Ce)||!d(We)||!d(qe)||!d(vr)),re.isBlank=_r,_r&&(te?We=Ce:vr=qe),Jt&&!_r&&(te?(Ce-=M(Ce,We)*Jt,We+=M(Ce,We)*Jt):(qe-=M(qe,vr)*Jt,vr+=M(qe,vr)*Jt));var er,Mr;if(dt.type==="waterfall"){if(!_r){var Ir=dt[re.dir].marker;er=Ir.line.width,Mr=Ir.color}}else er=f.getLineWidth(dt,re),Mr=re.mc||dt.marker.color;function de(ra){var Se=u.round(er/2%1,2);return K.gap===0&&K.groupgap===0?u.round(Math.round(ra)-Se,2):ra}function Dt(ra,Se,Re){return Re&&ra===Se?ra:Math.abs(ra-Se)>=2?de(ra):ra>Se?Math.ceil(ra):Math.floor(ra)}var qt=t.opacity(Mr),_t=qt<1||er>.01?de:Dt;rt._context.staticPlot||(Ce=_t(Ce,We,te),We=_t(We,Ce,te),qe=_t(qe,vr,!te),vr=_t(vr,qe,!te));var lt=te?X.c2p:Q.c2p,yt;re.s0>0?yt=re._sMax:re.s0<0?yt=re._sMin:yt=re.s1>0?re._sMax:re._sMin;function St(ra,Se){if(!ra)return 0;var Re=Math.abs(te?vr-qe:We-Ce),Ze=Math.abs(te?We-Ce:vr-qe),tr=_t(Math.abs(lt(yt,!0)-lt(0,!0))),zr=re.hasB?Math.min(Re/2,Ze/2):Math.min(Re/2,tr),tn;if(Se==="%"){var Yr=Math.min(50,ra);tn=Re*(Yr/100)}else tn=ra;return _t(Math.max(Math.min(tn,zr),0))}var Ht=Nt||Ct?St(Tt.cornerradiusvalue,Tt.cornerradiusform):0,Yt,se,ke="M"+Ce+","+qe+"V"+vr+"H"+We+"V"+qe+"Z",Ee=0;if(Ht&&re.s){var Ue=k(re.s0)===0||k(re.s)===k(re.s0)?re.s1:re.s0;if(Ee=_t(re.hasB?0:Math.abs(lt(yt,!0)-lt(Ue,!0))),Ee<Ht){var ir=M(Ce,We),ar=M(qe,vr),Ye=ir===-ar?1:0;if(te)if(re.hasB)Yt="M"+(Ce+Ht*ir)+","+qe+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+Ce+","+(qe+Ht*ar)+"V"+(vr-Ht*ar)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(Ce+Ht*ir)+","+vr+"H"+(We-Ht*ir)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+We+","+(vr-Ht*ar)+"V"+(qe+Ht*ar)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(We-Ht*ir)+","+qe+"Z";else{se=Math.abs(We-Ce)+Ee;var Er=se<Ht?Ht-Math.sqrt(se*(2*Ht-se)):0,pn=Ee>0?Math.sqrt(Ee*(2*Ht-Ee)):0,dn=ir>0?Math.max:Math.min;Yt="M"+Ce+","+qe+"V"+(vr-Er*ar)+"H"+dn(We-(Ht-Ee)*ir,Ce)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+We+","+(vr-Ht*ar-pn)+"V"+(qe+Ht*ar+pn)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+dn(We-(Ht-Ee)*ir,Ce)+","+(qe+Er*ar)+"Z"}else if(re.hasB)Yt="M"+(Ce+Ht*ir)+","+qe+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+Ce+","+(qe+Ht*ar)+"V"+(vr-Ht*ar)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(Ce+Ht*ir)+","+vr+"H"+(We-Ht*ir)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+We+","+(vr-Ht*ar)+"V"+(qe+Ht*ar)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(We-Ht*ir)+","+qe+"Z";else{se=Math.abs(vr-qe)+Ee;var bn=se<Ht?Ht-Math.sqrt(se*(2*Ht-se)):0,Zn=Ee>0?Math.sqrt(Ee*(2*Ht-Ee)):0,En=ar>0?Math.max:Math.min;Yt="M"+(Ce+bn*ir)+","+qe+"V"+En(vr-(Ht-Ee)*ar,qe)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(Ce+Ht*ir-Zn)+","+vr+"H"+(We-Ht*ir+Zn)+"A "+Ht+","+Ht+" 0 0 "+Ye+" "+(We-bn*ir)+","+En(vr-(Ht-Ee)*ar,qe)+"V"+qe+"Z"}}else Yt=ke}else Yt=ke;var gn=c(E.ensureSingle(ue,"path"),ut,K,ot);if(gn.style("vector-effect",J?"none":"non-scaling-stroke").attr("d",isNaN((We-Ce)*(vr-qe))||_r&&rt._context.staticPlot?"M0,0Z":Yt).call(e.setClipUrl,ct.layerClipId,rt),!ut.uniformtext.mode&&Kt){var da=e.makePointStyleFns(dt);e.singlePointStyle(re,gn,dt,da,rt)}_(rt,ct,ue,it,Zt,Ce,We,qe,vr,Ht,Ee,K,ot),ct.layerClipId&&e.hideOutsideRangePoint(re,ue.select("text"),X,Q,dt.xcalendar,dt.ycalendar)});var Ut=dt.cliponaxis===!1;e.setClipUrl(nt,Ut?null:ct.layerClipId,rt)});r.getComponentMethod("errorbars","plot")(rt,q,ct,K)}function _(rt,ct,st,et,K,ot,X,Q,ut,J,q,it,nt){var dt=ct.xaxis,Tt=ct.yaxis,wt=rt._fullLayout,It;function Ct(se,ke,Ee){var Ue=E.ensureSingle(se,"text").text(ke).attr({class:"bartext bartext-"+It,"text-anchor":"middle","data-notex":1}).call(e.font,Ee).call(A.convertToTspans,rt);return Ue}var Nt=et[0].trace,ee=Nt.orientation==="h",Jt=F(wt,et,K,dt,Tt);It=N(Nt,K);var te=it.mode==="stack"||it.mode==="relative",Kt=et[K],mt=!te||Kt._outmost,bt=Kt.hasB,vt=J&&J-q>x;if(!Jt||It==="none"||(Kt.isBlank||ot===X||Q===ut)&&(It==="auto"||It==="inside")){st.select("text").remove();return}var Ut=wt.font,re=s.getBarColor(et[K],Nt),Zt=s.getInsideTextFont(Nt,K,Ut,re),ue=s.getOutsideTextFont(Nt,K,Ut),Me=Nt.insidetextanchor||"end",Ce=st.datum();ee?dt.type==="log"&&Ce.s0<=0&&(dt.range[0]<dt.range[1]?ot=0:ot=dt._length):Tt.type==="log"&&Ce.s0<=0&&(Tt.range[0]<Tt.range[1]?Q=Tt._length:Q=0);var We=Math.abs(X-ot),qe=Math.abs(ut-Q),vr=We-2*x,_r=qe-2*x,er,Mr,Ir,de,Dt;if(It==="outside"&&!mt&&!Kt.hasB&&(It="inside"),It==="auto")if(mt){It="inside",Dt=E.ensureUniformFontSize(rt,Zt),er=Ct(st,Jt,Dt),Mr=e.bBox(er.node()),Ir=Mr.width,de=Mr.height;var qt=Ir>0&&de>0,_t;vt?bt?_t=P(vr-2*J,_r,Ir,de,ee)||P(vr,_r-2*J,Ir,de,ee):ee?_t=P(vr-(J-q),_r,Ir,de,ee)||P(vr,_r-2*(J-q),Ir,de,ee):_t=P(vr,_r-(J-q),Ir,de,ee)||P(vr-2*(J-q),_r,Ir,de,ee):_t=P(vr,_r,Ir,de,ee),qt&&_t?It="inside":(It="outside",er.remove(),er=null)}else It="inside";if(!er){Dt=E.ensureUniformFontSize(rt,It==="outside"?ue:Zt),er=Ct(st,Jt,Dt);var lt=er.attr("transform");if(er.attr("transform",""),Mr=e.bBox(er.node()),Ir=Mr.width,de=Mr.height,er.attr("transform",lt),Ir<=0||de<=0){er.remove();return}}var yt=Nt.textangle,St,Ht;It==="outside"?(Ht=Nt.constraintext==="both"||Nt.constraintext==="outside",St=I(ot,X,Q,ut,Mr,{isHorizontal:ee,constrained:Ht,angle:yt})):(Ht=Nt.constraintext==="both"||Nt.constraintext==="inside",St=B(ot,X,Q,ut,Mr,{isHorizontal:ee,constrained:Ht,angle:yt,anchor:Me,hasB:bt,r:J,overhead:q})),St.fontSize=Dt.size,o(Nt.type==="histogram"?"bar":Nt.type,St,wt),Kt.transform=St;var Yt=c(er,wt,it,nt);E.setTransormAndDisplay(Yt,St)}function P(rt,ct,st,et,K){if(rt<0||ct<0)return!1;var ot=st<=rt&&et<=ct,X=st<=ct&&et<=rt,Q=K?rt>=st*(ct/et):ct>=et*(rt/st);return ot||X||Q}function L(rt){return rt==="auto"?0:rt}function D(rt,ct){var st=Math.PI/180*ct,et=Math.abs(Math.sin(st)),K=Math.abs(Math.cos(st));return{x:rt.width*K+rt.height*et,y:rt.width*et+rt.height*K}}function B(rt,ct,st,et,K,ot){var X=!!ot.isHorizontal,Q=!!ot.constrained,ut=ot.angle||0,J=ot.anchor,q=J==="end",it=J==="start",nt=ot.leftToRight||0,dt=(nt+1)/2,Tt=1-dt,wt=ot.hasB,It=ot.r,Ct=ot.overhead,Nt=K.width,ee=K.height,Jt=Math.abs(ct-rt),te=Math.abs(et-st),Kt=Jt>2*x&&te>2*x?x:0;Jt-=2*Kt,te-=2*Kt;var mt=L(ut);ut==="auto"&&!(Nt<=Jt&&ee<=te)&&(Nt>Jt||ee>te)&&(!(Nt>te||ee>Jt)||Nt<ee!=Jt<te)&&(mt+=90);var bt=D(K,mt),vt,Ut;if(It&&It-Ct>x){var re=R(rt,ct,st,et,bt,It,Ct,X,wt);vt=re.scale,Ut=re.pad}else vt=1,Q&&(vt=Math.min(1,Jt/bt.x,te/bt.y)),Ut=0;var Zt=K.left*Tt+K.right*dt,ue=(K.top+K.bottom)/2,Me=(rt+x)*Tt+(ct-x)*dt,Ce=(st+et)/2,We=0,qe=0;if(it||q){var vr=(X?bt.x:bt.y)/2;It&&(q||wt)&&(Kt+=Ut);var _r=X?M(rt,ct):M(st,et);X?it?(Me=rt+_r*Kt,We=-_r*vr):(Me=ct-_r*Kt,We=_r*vr):it?(Ce=st+_r*Kt,qe=-_r*vr):(Ce=et-_r*Kt,qe=_r*vr)}return{textX:Zt,textY:ue,targetX:Me,targetY:Ce,anchorX:We,anchorY:qe,scale:vt,rotate:mt}}function R(rt,ct,st,et,K,ot,X,Q,ut){var J=Math.max(0,Math.abs(ct-rt)-2*x),q=Math.max(0,Math.abs(et-st)-2*x),it=ot-x,nt=X?it-Math.sqrt(it*it-(it-X)*(it-X)):it,dt=ut?it*2:Q?it-X:2*nt,Tt=ut?it*2:Q?2*nt:it-X,wt,It,Ct,Nt,ee;return K.y/K.x>=q/(J-dt)?Nt=q/K.y:K.y/K.x<=(q-Tt)/J?Nt=J/K.x:!ut&&Q?(wt=K.x*K.x+K.y*K.y/4,It=-2*K.x*(J-it)-K.y*(q/2-it),Ct=(J-it)*(J-it)+(q/2-it)*(q/2-it)-it*it,Nt=(-It+Math.sqrt(It*It-4*wt*Ct))/(2*wt)):ut?(wt=(K.x*K.x+K.y*K.y)/4,It=-K.x*(J/2-it)-K.y*(q/2-it),Ct=(J/2-it)*(J/2-it)+(q/2-it)*(q/2-it)-it*it,Nt=(-It+Math.sqrt(It*It-4*wt*Ct))/(2*wt)):(wt=K.x*K.x/4+K.y*K.y,It=-K.x*(J/2-it)-2*K.y*(q-it),Ct=(J/2-it)*(J/2-it)+(q-it)*(q-it)-it*it,Nt=(-It+Math.sqrt(It*It-4*wt*Ct))/(2*wt)),Nt=Math.min(1,Nt),Q?ee=Math.max(0,it-Math.sqrt(Math.max(0,it*it-(it-(q-K.y*Nt)/2)*(it-(q-K.y*Nt)/2)))-X):ee=Math.max(0,it-Math.sqrt(Math.max(0,it*it-(it-(J-K.x*Nt)/2)*(it-(J-K.x*Nt)/2)))-X),{scale:Nt,pad:ee}}function I(rt,ct,st,et,K,ot){var X=!!ot.isHorizontal,Q=!!ot.constrained,ut=ot.angle||0,J=K.width,q=K.height,it=Math.abs(ct-rt),nt=Math.abs(et-st),dt;X?dt=nt>2*x?x:0:dt=it>2*x?x:0;var Tt=1;Q&&(Tt=X?Math.min(1,nt/q):Math.min(1,it/J));var wt=L(ut),It=D(K,wt),Ct=(X?It.x:It.y)/2,Nt=(K.left+K.right)/2,ee=(K.top+K.bottom)/2,Jt=(rt+ct)/2,te=(st+et)/2,Kt=0,mt=0,bt=X?M(ct,rt):M(st,et);return X?(Jt=ct-bt*dt,Kt=bt*Ct):(te=et+bt*dt,mt=-bt*Ct),{textX:Nt,textY:ee,targetX:Jt,targetY:te,anchorX:Kt,anchorY:mt,scale:Tt,rotate:wt}}function F(rt,ct,st,et,K){var ot=ct[0].trace,X=ot.texttemplate,Q;return X?Q=j(rt,ct,st,et,K):ot.textinfo?Q=G(ct,st,et,K):Q=f.getValue(ot.text,st),f.coerceString(m,Q)}function N(rt,ct){var st=f.getValue(rt.textposition,ct);return f.coerceEnumerated(w,st)}function j(rt,ct,st,et,K){var ot=ct[0].trace,X=E.castOption(ot,st,"texttemplate");if(!X)return"";var Q=ot.type==="histogram",ut=ot.type==="waterfall",J=ot.type==="funnel",q=ot.orientation==="h",it,nt,dt,Tt;q?(it="y",nt=K,dt="x",Tt=et):(it="x",nt=et,dt="y",Tt=K);function wt(Kt){return i(nt,nt.c2l(Kt),!0).text}function It(Kt){return i(Tt,Tt.c2l(Kt),!0).text}var Ct=ct[st],Nt={};Nt.label=Ct.p,Nt.labelLabel=Nt[it+"Label"]=wt(Ct.p);var ee=E.castOption(ot,Ct.i,"text");(ee===0||ee)&&(Nt.text=ee),Nt.value=Ct.s,Nt.valueLabel=Nt[dt+"Label"]=It(Ct.s);var Jt={};l(Jt,ot,Ct.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),ut&&(Nt.delta=+Ct.rawS||Ct.s,Nt.deltaLabel=It(Nt.delta),Nt.final=Ct.v,Nt.finalLabel=It(Nt.final),Nt.initial=Nt.final-Nt.delta,Nt.initialLabel=It(Nt.initial)),J&&(Nt.value=Ct.s,Nt.valueLabel=It(Nt.value),Nt.percentInitial=Ct.begR,Nt.percentInitialLabel=E.formatPercent(Ct.begR),Nt.percentPrevious=Ct.difR,Nt.percentPreviousLabel=E.formatPercent(Ct.difR),Nt.percentTotal=Ct.sumR,Nt.percenTotalLabel=E.formatPercent(Ct.sumR));var te=E.castOption(ot,Ct.i,"customdata");return te&&(Nt.customdata=te),E.texttemplateString({data:[Jt,Nt,ot._meta],fallback:ot.texttemplatefallback,labels:Nt,locale:rt._d3locale,template:X})}function G(rt,ct,st,et){var K=rt[0].trace,ot=K.orientation==="h",X=K.type==="waterfall",Q=K.type==="funnel";function ut(te){var Kt=ot?et:st;return i(Kt,te,!0).text}function J(te){var Kt=ot?st:et;return i(Kt,+te,!0).text}var q=K.textinfo,it=rt[ct],nt=q.split("+"),dt=[],Tt,wt=function(te){return nt.indexOf(te)!==-1};if(wt("label")&&dt.push(ut(rt[ct].p)),wt("text")&&(Tt=E.castOption(K,it.i,"text"),(Tt===0||Tt)&&dt.push(Tt)),X){var It=+it.rawS||it.s,Ct=it.v,Nt=Ct-It;wt("initial")&&dt.push(J(Nt)),wt("delta")&&dt.push(J(It)),wt("final")&&dt.push(J(Ct))}if(Q){wt("value")&&dt.push(J(it.s));var ee=0;wt("percent initial")&&ee++,wt("percent previous")&&ee++,wt("percent total")&&ee++;var Jt=ee>1;wt("percent initial")&&(Tt=E.formatPercent(it.begR),Jt&&(Tt+=" of initial"),dt.push(Tt)),wt("percent previous")&&(Tt=E.formatPercent(it.difR),Jt&&(Tt+=" of previous"),dt.push(Tt)),wt("percent total")&&(Tt=E.formatPercent(it.sumR),Jt&&(Tt+=" of total"),dt.push(Tt))}return dt.join("<br>")}V.exports={plot:b,toMoveInsideBar:B}}),Sm=Vt((Z,V)=>{var u=hc(),d=ji(),E=Pi(),A=Xr().fillText,t=l1().getLineWidth,e=yo().hoverLabelText,r=ks().BADNUM;function i(a,s,f,v,g){var m=n(a,s,f,v,g);if(m){var w=m.cd,l=w[0].trace,x=w[m.index];return m.color=o(l,x),d.getComponentMethod("errorbars","hoverInfo")(x,l,m),[m]}}function n(a,s,f,v,g){var m=a.cd,w=m[0].trace,l=m[0].t,x=v==="closest",y=w.type==="waterfall",S=a.maxHoverDistance,k=a.maxSpikeDistance,M,T,c,h,b,_,P;w.orientation==="h"?(M=f,T=s,c="y",h="x",b=et,_=rt):(M=s,T=f,c="x",h="y",_=et,b=rt);var L=w[c+"period"],D=x||L;function B(Tt){return I(Tt,-1)}function R(Tt){return I(Tt,1)}function I(Tt,wt){var It=Tt.w;return Tt[c]+wt*It/2}function F(Tt){return Tt[c+"End"]-Tt[c+"Start"]}var N=x?B:L?function(Tt){return Tt.p-F(Tt)/2}:function(Tt){return Math.min(B(Tt),Tt.p-l.bardelta/2)},j=x?R:L?function(Tt){return Tt.p+F(Tt)/2}:function(Tt){return Math.max(R(Tt),Tt.p+l.bardelta/2)};function G(Tt,wt,It){return g.finiteRange&&(It=0),u.inbox(Tt-M,wt-M,It+Math.min(1,Math.abs(wt-Tt)/P)-1)}function rt(Tt){return G(N(Tt),j(Tt),S)}function ct(Tt){return G(B(Tt),R(Tt),k)}function st(Tt){var wt=Tt[h];if(y){var It=Math.abs(Tt.rawS)||0;T>0?wt+=It:T<0&&(wt-=It)}return wt}function et(Tt){var wt=T,It=Tt.b,Ct=st(Tt);return u.inbox(It-wt,Ct-wt,S+(Ct-wt)/(Ct-It)-1)}function K(Tt){var wt=T,It=Tt.b,Ct=st(Tt);return u.inbox(It-wt,Ct-wt,k+(Ct-wt)/(Ct-It)-1)}var ot=a[c+"a"],X=a[h+"a"];P=Math.abs(ot.r2c(ot.range[1])-ot.r2c(ot.range[0]));function Q(Tt){return(b(Tt)+_(Tt))/2}var ut=u.getDistanceFunction(v,b,_,Q);if(u.getClosest(m,ut,a),a.index!==!1&&m[a.index].p!==r){D||(N=function(Tt){return Math.min(B(Tt),Tt.p-l.bargroupwidth/2)},j=function(Tt){return Math.max(R(Tt),Tt.p+l.bargroupwidth/2)});var J=a.index,q=m[J],it=w.base?q.b+q.s:q.s;a[h+"0"]=a[h+"1"]=X.c2p(q[h],!0),a[h+"LabelVal"]=it;var nt=l.extents[l.extents.round(q.p)];a[c+"0"]=ot.c2p(x?N(q):nt[0],!0),a[c+"1"]=ot.c2p(x?j(q):nt[1],!0);var dt=q.orig_p!==void 0;return a[c+"LabelVal"]=dt?q.orig_p:q.p,a.labelLabel=e(ot,a[c+"LabelVal"],w[c+"hoverformat"]),a.valueLabel=e(X,a[h+"LabelVal"],w[h+"hoverformat"]),a.baseLabel=e(X,q.b,w[h+"hoverformat"]),a.spikeDistance=(K(q)+ct(q))/2,a[c+"Spike"]=ot.c2p(q.p,!0),A(q,w,a),a.hovertemplate=w.hovertemplate,a}}function o(a,s){var f=s.mcc||a.marker.color,v=s.mlcc||a.marker.line.color,g=t(a,s);if(E.opacity(f))return f;if(E.opacity(v)&&g)return v}V.exports={hoverPoints:i,hoverOnBars:n,getTraceColor:o}}),I6=Vt((Z,V)=>{V.exports=function(u,d,E){return u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),E.orientation==="h"?(u.label=u.y,u.value=u.x):(u.label=u.x,u.value=u.y),u}}),Em=Vt((Z,V)=>{V.exports=function(d,E){var A=d.cd,t=d.xaxis,e=d.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],f="ct"in s?s.ct:u(s,t,e,n,i);E.contains(f,!1,a,d)?(o.push({pointNumber:a,x:t.c2d(s.x),y:e.c2d(s.y)}),s.selected=1):s.selected=0}return o};function u(d,E,A,t,e){var r=E.c2p(t?d.s0:d.p0,!0),i=E.c2p(t?d.s1:d.p1,!0),n=A.c2p(t?d.p0:d.s0,!0),o=A.c2p(t?d.p1:d.s1,!0);return e?[(r+i)/2,(n+o)/2]:t?[i,(n+o)/2]:[(r+i)/2,o]}}),P6=Vt((Z,V)=>{V.exports={attributes:yp(),layoutAttributes:o1(),supplyDefaults:Lh().supplyDefaults,crossTraceDefaults:Lh().crossTraceDefaults,supplyLayoutDefaults:Kb(),calc:C6(),crossTraceCalc:c0().crossTraceCalc,colorbar:Gf(),arraysToCalcdata:qg(),plot:h0().plot,style:Vh().style,styleOnSelect:Vh().styleOnSelect,hoverPoints:Sm().hoverPoints,eventData:I6(),selectPoints:Em(),moduleType:"trace",name:"bar",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),O6=Vt((Z,V)=>{V.exports=P6()}),Wg=Vt((Z,V)=>{var u=Qh(),d=pc(),E=yp(),A=nf(),t=fc().axisHoverFormat,{hovertemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=So().extendFlat,n=d.marker,o=n.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:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.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:i({},n.symbol,{arrayOk:!1,editType:"plot"}),opacity:i({},n.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:i({},n.angle,{arrayOk:!1,editType:"calc"}),size:i({},n.size,{arrayOk:!1,editType:"calc"}),color:i({},n.color,{arrayOk:!1,editType:"style"}),line:{color:i({},o.color,{arrayOk:!1,dflt:A.defaultLine,editType:"style"}),width:i({},o.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:u(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:E.offsetgroup,alignmentgroup:E.alignmentgroup,selected:{marker:d.selected.marker,editType:"style"},unselected:{marker:d.unselected.marker,editType:"style"},text:i({},d.text,{}),hovertext:i({},d.hovertext,{}),hovertemplate:e({}),hovertemplatefallback:r(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:d.zorder}}),Gg=Vt((Z,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"}}}),Zg=Vt((Z,V)=>{var u=Xr(),d=ji(),E=Pi(),A=tp(),t=u0(),e=xm(),r=Wg();function i(s,f,v,g){function m(h,b){return u.coerce(s,f,r,h,b)}if(n(s,f,m,g),f.visible!==!1){A(s,f,g,m),m("xhoverformat"),m("yhoverformat");var w=f._hasPreCompStats;w&&(m("lowerfence"),m("upperfence")),m("line.color",(s.marker||{}).color||v),m("line.width"),m("fillcolor",E.addOpacity(f.line.color,.5));var l=!1;if(w){var x=m("mean"),y=m("sd");x&&x.length&&(l=!0,y&&y.length&&(l="sd"))}m("whiskerwidth");var S=m("sizemode"),k;S==="quartiles"&&(k=m("boxmean",l)),m("showwhiskers",S==="quartiles"),(S==="sd"||k==="sd")&&m("sdmultiple"),m("width"),m("quartilemethod");var M=!1;if(w){var T=m("notchspan");T&&T.length&&(M=!0)}else u.validate(s.notchwidth,r.notchwidth)&&(M=!0);var c=m("notched",M);c&&m("notchwidth"),o(s,f,m,{prefix:"box"}),m("zorder")}}function n(s,f,v,g){function m(G){var rt=0;return G&&G.length&&(rt+=1,u.isArrayOrTypedArray(G[0])&&G[0].length&&(rt+=1)),rt}function w(G){return u.validate(s[G],r[G])}var l=v("y"),x=v("x"),y;if(f.type==="box"){var S=v("q1"),k=v("median"),M=v("q3");f._hasPreCompStats=S&&S.length&&k&&k.length&&M&&M.length,y=Math.min(u.minRowLength(S),u.minRowLength(k),u.minRowLength(M))}var T=m(l),c=m(x),h=T&&u.minRowLength(l),b=c&&u.minRowLength(x),_=g.calendar,P={autotypenumbers:g.autotypenumbers},L,D;if(f._hasPreCompStats)switch(String(c)+String(T)){case"00":var B=w("x0")||w("dx"),R=w("y0")||w("dy");R&&!B?L="h":L="v",D=y;break;case"10":L="v",D=Math.min(y,b);break;case"20":L="h",D=Math.min(y,x.length);break;case"01":L="h",D=Math.min(y,h);break;case"02":L="v",D=Math.min(y,l.length);break;case"12":L="v",D=Math.min(y,b,l.length);break;case"21":L="h",D=Math.min(y,x.length,h);break;case"11":D=0;break;case"22":var I=!1,F;for(F=0;F<x.length;F++)if(e(x[F],_,P)==="category"){I=!0;break}if(I)L="v",D=Math.min(y,b,l.length);else{for(F=0;F<l.length;F++)if(e(l[F],_,P)==="category"){I=!0;break}I?(L="h",D=Math.min(y,x.length,h)):(L="v",D=Math.min(y,b,l.length))}break}else T>0?(L="v",c>0?D=Math.min(b,h):D=Math.min(h)):c>0?(L="h",D=Math.min(b)):D=0;if(!D){f.visible=!1;return}f._length=D;var N=v("orientation",L);f._hasPreCompStats?N==="v"&&c===0?(v("x0",0),v("dx",1)):N==="h"&&T===0&&(v("y0",0),v("dy",1)):N==="v"&&c===0?v("x0"):N==="h"&&T===0&&v("y0");var j=d.getComponentMethod("calendars","handleTraceDefaults");j(s,f,["x","y"],g)}function o(s,f,v,g){var m=g.prefix,w=u.coerce2(s,f,r,"marker.outliercolor"),l=v("marker.line.outliercolor"),x="outliers";f._hasPreCompStats?x="all":(w||l)&&(x="suspectedoutliers");var y=v(m+"points",x);y?(v("jitter",y==="all"?.3:0),v("pointpos",y==="all"?-1.5:0),v("marker.symbol"),v("marker.opacity"),v("marker.size"),v("marker.angle"),v("marker.color",f.line.color),v("marker.line.color"),v("marker.line.width"),y==="suspectedoutliers"&&(v("marker.line.outliercolor",f.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 f.marker;var S=v("hoveron");(S==="all"||S.indexOf("points")!==-1)&&(v("hovertemplate"),v("hovertemplatefallback")),u.coerceSelectionMarkerOpacity(f,v)}function a(s,f){var v,g;function m(y){return u.coerce(g._input,g,r,y)}for(var w=0;w<s.length;w++){g=s[w];var l=g.type;if(l==="box"||l==="violin"){v=g._input;var x=f[l+"mode"];x==="group"&&t(v,g,f,m,x)}}}V.exports={supplyDefaults:i,crossTraceDefaults:a,handleSampleDefaults:n,handlePointsDefaults:o}}),u1=Vt((Z,V)=>{var u=ji(),d=Xr(),E=Gg();function A(e,r,i,n,o){for(var a=o+"Layout",s=!1,f=0;f<i.length;f++){var v=i[f];if(u.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 d.coerce(e,r,E,o,a)}A(e,r,i,n,"box")}V.exports={supplyLayoutDefaults:t,_supply:A}}),Yb=Vt((Z,V)=>{var u=Lo(),d=yo(),E=rp(),A=Xr(),t=ks().BADNUM,e=A._;V.exports=function(y,S){var k=y._fullLayout,M=d.getFromId(y,S.xaxis||"x"),T=d.getFromId(y,S.yaxis||"y"),c=[],h=S.type==="violin"?"_numViolins":"_numBoxes",b,_,P,L,D,B,R;S.orientation==="h"?(P=M,L="x",D=T,B="y",R=!!S.yperiodalignment):(P=T,L="y",D=M,B="x",R=!!S.xperiodalignment);var I=r(S,B,D,k[h]),F=I[0],N=I[1],j=A.distinctVals(F,D),G=j.vals,rt=j.minDiff/2,ct,st,et,K,ot,X,Q=(S.boxpoints||S.points)==="all"?A.identity:function(vr){return vr.v<ct.lf||vr.v>ct.uf};if(S._hasPreCompStats){var ut=S[L],J=function(vr){return P.d2c((S[vr]||[])[b])},q=1/0,it=-1/0;for(b=0;b<S._length;b++){var nt=F[b];if(u(nt)){if(ct={},ct.pos=ct[B]=nt,R&&N&&(ct.orig_p=N[b]),ct.q1=J("q1"),ct.med=J("median"),ct.q3=J("q3"),st=[],ut&&A.isArrayOrTypedArray(ut[b]))for(_=0;_<ut[b].length;_++)X=P.d2c(ut[b][_]),X!==t&&(ot={v:X,i:[b,_]},a(ot,S,[b,_]),st.push(ot));if(ct.pts=st.sort(f),et=ct[L]=st.map(v),K=et.length,ct.med!==t&&ct.q1!==t&&ct.q3!==t&&ct.med>=ct.q1&&ct.q3>=ct.med){var dt=J("lowerfence");ct.lf=dt!==t&&dt<=ct.q1?dt:g(ct,et,K);var Tt=J("upperfence");ct.uf=Tt!==t&&Tt>=ct.q3?Tt:m(ct,et,K);var wt=J("mean");ct.mean=wt!==t?wt:K?A.mean(et,K):(ct.q1+ct.q3)/2;var It=J("sd");ct.sd=wt!==t&&It>=0?It:K?A.stdev(et,K,ct.mean):ct.q3-ct.q1,ct.lo=w(ct),ct.uo=l(ct);var Ct=J("notchspan");Ct=Ct!==t&&Ct>0?Ct:x(ct,K),ct.ln=ct.med-Ct,ct.un=ct.med+Ct;var Nt=ct.lf,ee=ct.uf;S.boxpoints&&et.length&&(Nt=Math.min(Nt,et[0]),ee=Math.max(ee,et[K-1])),S.notched&&(Nt=Math.min(Nt,ct.ln),ee=Math.max(ee,ct.un)),ct.min=Nt,ct.max=ee}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),it=Math.max(it,ct.max),ct.pts2=st.filter(Q),c.push(ct)}}S._extremes[P._id]=d.findExtremes(P,[q,it],{padded:!0})}else{var te=P.makeCalcdata(S,L),Kt=i(G,rt),mt=G.length,bt=n(mt);for(b=0;b<S._length;b++)if(X=te[b],!!u(X)){var vt=A.findBin(F[b],Kt);vt>=0&&vt<mt&&(ot={v:X,i:b},a(ot,S,b),bt[vt].push(ot))}var Ut=1/0,re=-1/0,Zt=S.quartilemethod,ue=Zt==="exclusive",Me=Zt==="inclusive";for(b=0;b<mt;b++)if(bt[b].length>0){if(ct={},ct.pos=ct[B]=G[b],st=ct.pts=bt[b].sort(f),et=ct[L]=st.map(v),K=et.length,ct.min=et[0],ct.max=et[K-1],ct.mean=A.mean(et,K),ct.sd=A.stdev(et,K,ct.mean)*S.sdmultiple,ct.med=A.interp(et,.5),K%2&&(ue||Me)){var Ce,We;ue?(Ce=et.slice(0,K/2),We=et.slice(K/2+1)):Me&&(Ce=et.slice(0,K/2+1),We=et.slice(K/2)),ct.q1=A.interp(Ce,.5),ct.q3=A.interp(We,.5)}else ct.q1=A.interp(et,.25),ct.q3=A.interp(et,.75);ct.lf=g(ct,et,K),ct.uf=m(ct,et,K),ct.lo=w(ct),ct.uo=l(ct);var qe=x(ct,K);ct.ln=ct.med-qe,ct.un=ct.med+qe,Ut=Math.min(Ut,ct.ln),re=Math.max(re,ct.un),ct.pts2=st.filter(Q),c.push(ct)}S.notched&&A.isTypedArray(te)&&(te=Array.from(te)),S._extremes[P._id]=d.findExtremes(P,S.notched?te.concat([Ut,re]):te,{padded:!0})}return s(c,S),c.length>0?(c[0].t={num:k[h],dPos:rt,posLetter:B,valLetter:L,labels:{med:e(y,"median:"),min:e(y,"min:"),q1:e(y,"q1:"),q3:e(y,"q3:"),max:e(y,"max:"),mean:S.boxmean==="sd"||S.sizemode==="sd"?e(y,"mean ± σ:").replace("σ",S.sdmultiple===1?"σ":S.sdmultiple+"σ"):e(y,"mean:"),lf:e(y,"lower fence:"),uf:e(y,"upper fence:")}},k[h]++,c):[{t:{empty:!0}}]};function r(y,S,k,M){var T=S in y,c=S+"0"in y,h="d"+S in y;if(T||c&&h){var b=k.makeCalcdata(y,S),_=E(y,k,S,b).vals;return[_,b]}var P;c?P=y[S+"0"]:"name"in y&&(k.type==="category"||u(y.name)&&["linear","log"].indexOf(k.type)!==-1||A.isDateTime(y.name)&&k.type==="date")?P=y.name:P=M;for(var L=k.type==="multicategory"?k.r2c_just_indices(P):k.d2c(P,0,y[S+"calendar"]),D=y._length,B=new Array(D),R=0;R<D;R++)B[R]=L;return[B]}function i(y,S){for(var k=y.length,M=new Array(k+1),T=0;T<k;T++)M[T]=y[T]-S;return M[k]=y[k-1]+S,M}function n(y){for(var S=new Array(y),k=0;k<y;k++)S[k]=[];return S}var o={text:"tx",hovertext:"htx"};function a(y,S,k){for(var M in o)A.isArrayOrTypedArray(S[M])&&(Array.isArray(k)?A.isArrayOrTypedArray(S[M][k[0]])&&(y[o[M]]=S[M][k[0]][k[1]]):y[o[M]]=S[M][k])}function s(y,S){if(A.isArrayOrTypedArray(S.selectedpoints))for(var k=0;k<y.length;k++){for(var M=y[k].pts||[],T={},c=0;c<M.length;c++)T[M[c].i]=c;A.tagSelected(M,S,T)}}function f(y,S){return y.v-S.v}function v(y){return y.v}function g(y,S,k){return k===0?y.q1:Math.min(y.q1,S[Math.min(A.findBin(2.5*y.q1-1.5*y.q3,S,!0)+1,k-1)])}function m(y,S,k){return k===0?y.q3:Math.max(y.q3,S[Math.max(A.findBin(2.5*y.q3-1.5*y.q1,S),0)])}function w(y){return 4*y.q1-3*y.q3}function l(y){return 4*y.q3-3*y.q1}function x(y,S){return S===0?0:1.57*(y.q3-y.q1)/Math.sqrt(S)}}),c1=Vt((Z,V)=>{var u=yo(),d=Xr(),E=s0().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 f=A[s],v=f==="h"?a:o,g=[],m=0;m<n.length;m++){var w=n[m],l=w[0].t,x=w[0].trace;x.visible===!0&&(x.type==="box"||x.type==="candlestick")&&!l.empty&&(x.orientation||"v")===f&&x.xaxis===o._id&&x.yaxis===a._id&&g.push(m)}e("box",r,g,v)}}function e(r,i,n,o){var a=i.calcdata,s=i._fullLayout,f=o._id,v=f.charAt(0),g,m,w,l=[],x=0;for(g=0;g<n.length;g++)for(w=a[n[g]],m=0;m<w.length;m++)l.push(o.c2l(w[m].pos,!0)),x+=(w[m].pts2||[]).length;if(l.length){var y=d.distinctVals(l);(o.type==="category"||o.type==="multicategory")&&(y.minDiff=1);var S=y.minDiff/2;u.minDtick(o,y.minDiff,y.vals[0],!0);var k=r==="violin"?"_numViolins":"_numBoxes",M=s[k],T=s[r+"mode"]==="group"&&M>1,c=1-s[r+"gap"],h=1-s[r+"groupgap"];for(g=0;g<n.length;g++){w=a[n[g]];var b=w[0].trace,_=w[0].t,P=b.width,L=b.side,D,B,R,I;if(P)D=B=I=P/2,R=0;else if(D=S,T){var F=E(s,o._id)+b.orientation,N=s._alignmentOpts[F]||{},j=N[b.alignmentgroup]||{},G=Object.keys(j.offsetGroups||{}).length,rt=G||M,ct=G?b._offsetIndex:_.num;B=D*c*h/rt,R=2*D*(-.5+(ct+.5)/rt)*c,I=D*c/rt}else B=D*c*h,R=0,I=D;_.dPos=D,_.bPos=R,_.bdPos=B,_.wHover=I;var st,et,K=R+B,ot,X,Q,ut,J,q,it=!!P,nt=(b.boxpoints||b.points)&&x>0;if(L==="positive"?(st=D*(P?1:.5),ot=K,et=ot=R):L==="negative"?(st=ot=R,et=D*(P?1:.5),X=K):(st=et=D,ot=X=K),nt){var dt=b.pointpos,Tt=b.jitter,wt=b.marker.size/2,It=0;dt+Tt>=0&&(It=K*(dt+Tt),It>st?(it=!0,J=wt,Q=It):It>ot&&(J=wt,Q=st)),It<=st&&(Q=st);var Ct=0;dt-Tt<=0&&(Ct=-K*(dt-Tt),Ct>et?(it=!0,q=wt,ut=Ct):Ct>X&&(q=wt,ut=et)),Ct<=et&&(ut=et)}else Q=st,ut=et;var Nt=new Array(w.length);for(m=0;m<w.length;m++)Nt[m]=w[m].pos;b._extremes[f]=u.findExtremes(o,Nt,{padded:it,vpadminus:ut,vpadplus:Q,vpadLinearized:!0,ppadminus:{x:q,y:J}[v],ppadplus:{x:J,y:q}[v]})}}}V.exports={crossTraceCalc:t,setPositionOffset:e}}),f1=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=5,t=.01;function e(o,a,s,f){var v=o._context.staticPlot,g=a.xaxis,m=a.yaxis;d.makeTraceGroups(f,s,"trace boxes").each(function(w){var l=u.select(this),x=w[0],y=x.t,S=x.trace;if(y.wdPos=y.bdPos*S.whiskerwidth,S.visible!==!0||y.empty){l.remove();return}var k,M;S.orientation==="h"?(k=m,M=g):(k=g,M=m),r(l,{pos:k,val:M},S,y,v),i(l,{x:g,y:m},S,y),n(l,{pos:k,val:M},S,y)})}function r(o,a,s,f,v){var g=s.orientation==="h",m=a.val,w=a.pos,l=!!w.rangebreaks,x=f.bPos,y=f.wdPos||0,S=f.bPosPxOffset||0,k=s.whiskerwidth||0,M=s.showwhiskers!==!1,T=s.notched||!1,c=T?1-2*s.notchwidth:1,h,b;Array.isArray(f.bdPos)?(h=f.bdPos[0],b=f.bdPos[1]):(h=f.bdPos,b=f.bdPos);var _=o.selectAll("path.box").data(s.type!=="violin"||s.box.visible?d.identity:[]);_.enter().append("path").style("vector-effect",v?"none":"non-scaling-stroke").attr("class","box"),_.exit().remove(),_.each(function(P){if(P.empty)return u.select(this).attr("d","M0,0Z");var L=w.c2l(P.pos+x,!0),D=w.l2p(L-h)+S,B=w.l2p(L+b)+S,R=l?(D+B)/2:w.l2p(L)+S,I=s.whiskerwidth,F=l?D*I+(1-I)*R:w.l2p(L-y)+S,N=l?B*I+(1-I)*R:w.l2p(L+y)+S,j=w.l2p(L-h*c)+S,G=w.l2p(L+b*c)+S,rt=s.sizemode==="sd",ct=m.c2p(rt?P.mean-P.sd:P.q1,!0),st=rt?m.c2p(P.mean+P.sd,!0):m.c2p(P.q3,!0),et=d.constrain(rt?m.c2p(P.mean,!0):m.c2p(P.med,!0),Math.min(ct,st)+1,Math.max(ct,st)-1),K=P.lf===void 0||s.boxpoints===!1||rt,ot=m.c2p(K?P.min:P.lf,!0),X=m.c2p(K?P.max:P.uf,!0),Q=m.c2p(P.ln,!0),ut=m.c2p(P.un,!0);g?u.select(this).attr("d","M"+et+","+j+"V"+G+"M"+ct+","+D+"V"+B+(T?"H"+Q+"L"+et+","+G+"L"+ut+","+B:"")+"H"+st+"V"+D+(T?"H"+ut+"L"+et+","+j+"L"+Q+","+D:"")+"Z"+(M?"M"+ct+","+R+"H"+ot+"M"+st+","+R+"H"+X+(k===0?"":"M"+ot+","+F+"V"+N+"M"+X+","+F+"V"+N):"")):u.select(this).attr("d","M"+j+","+et+"H"+G+"M"+D+","+ct+"H"+B+(T?"V"+Q+"L"+G+","+et+"L"+B+","+ut:"")+"V"+st+"H"+D+(T?"V"+ut+"L"+j+","+et+"L"+D+","+Q:"")+"Z"+(M?"M"+R+","+ct+"V"+ot+"M"+R+","+st+"V"+X+(k===0?"":"M"+F+","+ot+"H"+N+"M"+F+","+X+"H"+N):""))})}function i(o,a,s,f){var v=a.x,g=a.y,m=f.bdPos,w=f.bPos,l=s.boxpoints||s.points;d.seedPseudoRandom();var x=function(k){return k.forEach(function(M){M.t=f,M.trace=s}),k},y=o.selectAll("g.points").data(l?x:[]);y.enter().append("g").attr("class","points"),y.exit().remove();var S=y.selectAll("path").data(function(k){var M,T=k.pts2,c=Math.max((k.max-k.min)/10,k.q3-k.q1),h=c*1e-9,b=c*t,_=[],P=0,L;if(s.jitter){if(c===0)for(P=1,_=new Array(T.length),M=0;M<T.length;M++)_[M]=1;else for(M=0;M<T.length;M++){var D=Math.max(0,M-A),B=T[D].v,R=Math.min(T.length-1,M+A),I=T[R].v;l!=="all"&&(T[M].v<k.lf?I=Math.min(I,k.lf):B=Math.max(B,k.uf));var F=Math.sqrt(b*(R-D)/(I-B+h))||0;F=d.constrain(Math.abs(F),0,1),_.push(F),P=Math.max(F,P)}L=s.jitter*2/(P||1)}for(M=0;M<T.length;M++){var N=T[M],j=N.v,G=s.jitter?L*_[M]*(d.pseudoRandom()-.5):0,rt=k.pos+w+m*(s.pointpos+G);s.orientation==="h"?(N.y=rt,N.x=j):(N.x=rt,N.y=j),l==="suspectedoutliers"&&j<k.uo&&j>k.lo&&(N.so=!0)}return T});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(E.translatePoints,v,g)}function n(o,a,s,f){var v=a.val,g=a.pos,m=!!g.rangebreaks,w=f.bPos,l=f.bPosPxOffset||0,x=s.boxmean||(s.meanline||{}).visible,y,S;Array.isArray(f.bdPos)?(y=f.bdPos[0],S=f.bdPos[1]):(y=f.bdPos,S=f.bdPos);var k=o.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?d.identity:[]);k.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),k.exit().remove(),k.each(function(M){var T=g.c2l(M.pos+w,!0),c=g.l2p(T-y)+l,h=g.l2p(T+S)+l,b=m?(c+h)/2:g.l2p(T)+l,_=v.c2p(M.mean,!0),P=v.c2p(M.mean-M.sd,!0),L=v.c2p(M.mean+M.sd,!0);s.orientation==="h"?u.select(this).attr("d","M"+_+","+c+"V"+h+(x==="sd"?"m0,0L"+P+","+b+"L"+_+","+c+"L"+L+","+b+"Z":"")):u.select(this).attr("d","M"+c+","+_+"H"+h+(x==="sd"?"m0,0L"+b+","+P+"L"+c+","+_+"L"+b+","+L+"Z":""))})}V.exports={plot:e,plotBoxAndWhiskers:r,plotPoints:i,plotBoxMean:n}}),h1=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Eo();function A(e,r,i){var n=i||u.select(e).selectAll("g.trace.boxes");n.style("opacity",function(o){return o[0].trace.opacity}),n.each(function(o){var a=u.select(this),s=o[0].trace,f=s.line.width;function v(w,l,x,y){w.style("stroke-width",l+"px").call(d.stroke,x).call(d.fill,y)}var g=a.selectAll("path.box");if(s.type==="candlestick")g.each(function(w){if(!w.empty){var l=u.select(this),x=s[w.dir];v(l,x.line.width,x.line.color,x.fillcolor),l.style("opacity",s.selectedpoints&&!w.selected?.3:1)}});else{v(g,f,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(d.stroke,s.line.color);var m=a.selectAll("path.point");E.pointStyle(m,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}}),Xb=Vt((Z,V)=>{var u=yo(),d=Xr(),E=hc(),A=Pi(),t=d.fillText;function e(n,o,a,s){var f=n.cd,v=f[0].trace,g=v.hoveron,m=[],w;return g.indexOf("boxes")!==-1&&(m=m.concat(r(n,o,a,s))),g.indexOf("points")!==-1&&(w=i(n,o,a)),s==="closest"?w?[w]:m:(w&&m.push(w),m)}function r(n,o,a,s){var f=n.cd,v=n.xa,g=n.ya,m=f[0].trace,w=f[0].t,l=m.type==="violin",x,y,S,k,M,T,c,h,b,_,P,L=w.bdPos,D,B,R=w.wHover,I=function(Ct){return S.c2l(Ct.pos)+w.bPos-S.c2l(T)};l&&m.side!=="both"?(m.side==="positive"&&(b=function(Ct){var Nt=I(Ct);return E.inbox(Nt,Nt+R,_)},D=L,B=0),m.side==="negative"&&(b=function(Ct){var Nt=I(Ct);return E.inbox(Nt-R,Nt,_)},D=0,B=L)):(b=function(Ct){var Nt=I(Ct);return E.inbox(Nt-R,Nt+R,_)},D=B=L);var F;l?F=function(Ct){return E.inbox(Ct.span[0]-M,Ct.span[1]-M,_)}:F=function(Ct){return E.inbox(Ct.min-M,Ct.max-M,_)},m.orientation==="h"?(M=o,T=a,c=F,h=b,x="y",S=g,y="x",k=v):(M=a,T=o,c=b,h=F,x="x",S=v,y="y",k=g);var N=Math.min(1,L/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));_=n.maxHoverDistance-N,P=n.maxSpikeDistance-N;function j(Ct){return(c(Ct)+h(Ct))/2}var G=E.getDistanceFunction(s,c,h,j);if(E.getClosest(f,G,n),n.index===!1)return[];var rt=f[n.index],ct=m.line.color,st=(m.marker||{}).color;A.opacity(ct)&&m.line.width?n.color=ct:A.opacity(st)&&m.boxpoints?n.color=st:n.color=m.fillcolor,n[x+"0"]=S.c2p(rt.pos+w.bPos-B,!0),n[x+"1"]=S.c2p(rt.pos+w.bPos+D,!0),n[x+"LabelVal"]=rt.orig_p!==void 0?rt.orig_p:rt.pos;var et=x+"Spike";n.spikeDistance=j(rt)*P/_,n[et]=S.c2p(rt.pos,!0);var K=m.boxmean||m.sizemode==="sd"||(m.meanline||{}).visible,ot=m.boxpoints||m.points,X=ot&&K?["max","uf","q3","med","mean","q1","lf","min"]:ot&&!K?["max","uf","q3","med","q1","lf","min"]:!ot&&K?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],Q=k.range[1]<k.range[0];m.orientation===(Q?"v":"h")&&X.reverse();for(var ut=n.spikeDistance,J=n[et],q=[],it=0;it<X.length;it++){var nt=X[it];if(nt in rt){var dt=rt[nt],Tt=k.c2p(dt,!0),wt=d.extendFlat({},n);wt.attr=nt,wt[y+"0"]=wt[y+"1"]=Tt,wt[y+"LabelVal"]=dt,wt[y+"Label"]=(w.labels?w.labels[nt]+" ":"")+u.hoverLabelText(k,dt,m[y+"hoverformat"]),wt.hoverOnBox=!0,nt==="mean"&&"sd"in rt&&(m.boxmean==="sd"||m.sizemode==="sd")&&(wt[y+"err"]=rt.sd),wt.hovertemplate=!1,q.push(wt)}}n.name="",n.spikeDistance=void 0,n[et]=void 0;for(var It=0;It<q.length;It++)q[It].attr!=="med"?(q[It].name="",q[It].spikeDistance=void 0,q[It][et]=void 0):(q[It].spikeDistance=ut,q[It][et]=J);return q}function i(n,o,a){for(var s=n.cd,f=n.xa,v=n.ya,g=s[0].trace,m=f.c2p(o),w=v.c2p(a),l,x=function(F){var N=Math.max(3,F.mrc||0);return Math.max(Math.abs(f.c2p(F.x)-m)-N,1-3/N)},y=function(F){var N=Math.max(3,F.mrc||0);return Math.max(Math.abs(v.c2p(F.y)-w)-N,1-3/N)},S=E.quadrature(x,y),k=!1,M,T,c=0;c<s.length;c++){M=s[c];for(var h=0;h<(M.pts||[]).length;h++){T=M.pts[h];var b=S(T);b<=n.distance&&(n.distance=b,k=[c,h])}}if(!k)return!1;M=s[k[0]],T=M.pts[k[1]];var _=f.c2p(T.x,!0),P=v.c2p(T.y,!0),L=T.mrc||1;l=d.extendFlat({},n,{index:T.i,color:(g.marker||{}).color,name:g.name,x0:_-L,x1:_+L,y0:P-L,y1:P+L,spikeDistance:n.distance,hovertemplate:g.hovertemplate});var D=M.orig_p,B=D!==void 0?D:M.pos,R;g.orientation==="h"?(R=v,l.xLabelVal=T.x,l.yLabelVal=B):(R=f,l.xLabelVal=B,l.yLabelVal=T.y);var I=R._id.charAt(0);return l[I+"Spike"]=R.c2p(M.pos,!0),t(T,g,l),l}V.exports={hoverPoints:e,hoverOnBoxes:r,hoverOnPoints:i}}),D6=Vt((Z,V)=>{V.exports=function(u,d){return d.hoverOnBox&&(u.hoverOnBox=d.hoverOnBox),"xVal"in d&&(u.x=d.xVal),"yVal"in d&&(u.y=d.yVal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u}}),$b=Vt((Z,V)=>{V.exports=function(u,d){var E=u.cd,A=u.xaxis,t=u.yaxis,e=[],r,i;if(d===!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);d.contains([o,a],null,n.i,u)?(e.push({pointNumber:n.i,x:A.c2d(n.x),y:t.c2d(n.y)}),n.selected=1):n.selected=0}return e}}),F6=Vt((Z,V)=>{V.exports={attributes:Wg(),layoutAttributes:Gg(),supplyDefaults:Zg().supplyDefaults,crossTraceDefaults:Zg().crossTraceDefaults,supplyLayoutDefaults:u1().supplyLayoutDefaults,calc:Yb(),crossTraceCalc:c1().crossTraceCalc,plot:f1().plot,style:h1().style,styleOnSelect:h1().styleOnSelect,hoverPoints:Xb().hoverPoints,eventData:D6(),selectPoints:$b(),moduleType:"trace",name:"box",basePlotModule:Kc(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),B6=Vt((Z,V)=>{V.exports=F6()}),zm=Vt((Z,V)=>{var u=Wl(),{extendFlat:d}=So(),E=Tl(),{axisHoverFormat:A}=fc(),t=yu(),{hovertemplateAttrs:e,templatefallbackAttrs:r,texttemplateAttrs:i}=kl(),n=pc();V.exports=d({z:{valType:"data_array",editType:"calc"},x:d({},n.x,{impliedEdits:{xtype:"array"}}),x0:d({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:d({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:d({},n.y,{impliedEdits:{ytype:"array"}}),y0:d({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:d({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:d({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:d({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:d({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:d({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:d({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:d({},n.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:e(),hovertemplatefallback:r(),texttemplate:i({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:r({editType:"plot"}),textfont:t({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:d({},E.showlegend,{dflt:!1}),zorder:n.zorder},u("",{cLetter:"z",autoColorDflt:!1}))}),p1=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ji();V.exports=function(e,r,i,n,o,a){var s=i("z");o=o||"x",a=a||"y";var f,v;if(s===void 0||!s.length)return 0;if(d.isArray1D(s)){f=i(o),v=i(a);var g=d.minRowLength(f),m=d.minRowLength(v);if(g===0||m===0)return 0;r._length=Math.min(g,m,s.length)}else{if(f=A(o,i),v=A(a,i),!t(s))return 0;i("transpose"),r._length=null}var w=E.getComponentMethod("calendars","handleTraceDefaults");return w(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],!d.isArrayOrTypedArray(o)){r=!1;break}o.length>0&&(i=!0);for(var s=0;s<o.length;s++)if(u(o[s])){n=!0;break}}return r&&i&&n}}),Kg=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){d("texttemplate"),d("texttemplatefallback");var A=u.extendFlat({},E.font,{color:"auto",size:"auto"});u.coerceFont(d,"textfont",A)}}),Jb=Vt((Z,V)=>{V.exports=function(u,d,E){var A=E("zsmooth");A===!1&&(E("xgap"),E("ygap")),E("zhoverformat")}}),R6=Vt((Z,V)=>{var u=Xr(),d=p1(),E=Kg(),A=tp(),t=Jb(),e=gf(),r=zm();V.exports=function(i,n,o,a){function s(v,g){return u.coerce(i,n,r,v,g)}var f=d(i,n,s,a);if(!f){n.visible=!1;return}A(i,n,a,s),s("xhoverformat"),s("yhoverformat"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),E(s,a),t(i,n,s,a),s("hoverongaps"),s("connectgaps",u.isArray1D(n.z)&&n.zsmooth!==!1),e(i,n,a,s,{prefix:"",cLetter:"z"}),s("zorder")}}),Qb=Vt((Z,V)=>{var u=Lo();V.exports={count:function(d,E,A){return A[d]++,1},sum:function(d,E,A,t){var e=t[E];return u(e)?(e=Number(e),A[d]+=e,e):0},avg:function(d,E,A,t,e){var r=t[E];return u(r)&&(r=Number(r),A[d]+=r,e[d]++),0},min:function(d,E,A,t){var e=t[E];if(u(e))if(e=Number(e),u(A[d])){if(A[d]>e){var r=e-A[d];return A[d]=e,r}}else return A[d]=e,e;return 0},max:function(d,E,A,t){var e=t[E];if(u(e))if(e=Number(e),u(A[d])){if(A[d]<e){var r=e-A[d];return A[d]=e,r}}else return A[d]=e,e;return 0}}}),t2=Vt((Z,V)=>{V.exports={percent:function(u,d){for(var E=u.length,A=100/d,t=0;t<E;t++)u[t]*=A},probability:function(u,d){for(var E=u.length,A=0;A<E;A++)u[A]/=d},density:function(u,d,E,A){var t=u.length;A=A||1;for(var e=0;e<t;e++)u[e]*=E[e]*A},"probability density":function(u,d,E,A){var t=u.length;A&&(d/=A);for(var e=0;e<t;e++)u[e]*=E[e]/d}}}),e2=Vt((Z,V)=>{V.exports=function(u,d){for(var E=u.length,A=0,t=0;t<E;t++)d[t]?(u[t]/=d[t],A+=u[t]):u[t]=null;return A}}),r2=Vt((Z,V)=>{var u=ks(),d=u.ONEAVGYEAR,E=u.ONEAVGMONTH,A=u.ONEDAY,t=u.ONEHOUR,e=u.ONEMIN,r=u.ONESEC,i=yo().tickIncrement;V.exports=function(f,v,g,m,w){var l=-1.1*v,x=-.1*v,y=f-x,S=g[0],k=g[1],M=Math.min(n(S+x,S+y,m,w),n(k+x,k+y,m,w)),T=Math.min(n(S+l,S+x,m,w),n(k+l,k+x,m,w)),c,h;if(M>T&&T<Math.abs(k-S)/4e3?(c=M,h=!1):(c=Math.min(M,T),h=!0),m.type==="date"&&c>A){var b=c===d?1:6,_=c===d?"M12":"M1";return function(P,L){var D=m.c2d(P,d,w),B=D.indexOf("-",b);B>0&&(D=D.substr(0,B));var R=m.d2c(D,0,w);if(R<P){var I=i(R,_,!1,w);(R+I)/2<P+f&&(R=I)}return L&&h?i(R,_,!0,w):R}}return function(P,L){var D=c*Math.round(P/c);return D+c/10<P&&D+c*.9<P+f&&(D+=c),L&&h&&(D-=c),D}};function n(f,v,g,m){if(f*v<=0)return 1/0;for(var w=Math.abs(v-f),l=g.type==="date",x=o(w,l),y=0;y<10;y++){var S=o(x*80,l);if(x===S)break;if(a(S,f,v,l,g,m))x=S;else break}return x}function o(f,v){return v&&f>r?f>A?f>d*1.1?d:f>E*1.1?E:A:f>t?t:f>e?e:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function a(f,v,g,m,w,l){if(m&&f>A){var x=s(v,w,l),y=s(g,w,l),S=f===d?0:1;return x[S]!==y[S]}return Math.floor(g/f)-Math.floor(v/f)>.1}function s(f,v,g){var m=v.c2d(f,d,g).split("-");return m[0]===""&&(m.unshift(),m[0]="-"+m[0]),m}}),n2=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ji(),A=yo(),{hasColorscale:t}=nh(),e=ah(),r=qg(),i=Qb(),n=t2(),o=e2(),a=r2();function s(w,l){var x=[],y=[],S=l.orientation==="h",k=A.getFromId(w,S?l.yaxis:l.xaxis),M=S?"y":"x",T={x:"y",y:"x"}[M],c=l[M+"calendar"],h=l.cumulative,b,_=f(w,l,k,M),P=_[0],L=_[1],D=typeof P.size=="string",B=[],R=D?B:P,I=[],F=[],N=[],j=0,G=l.histnorm,rt=l.histfunc,ct=G.indexOf("density")!==-1,st,et,K;h.enabled&&ct&&(G=G.replace(/ ?density$/,""),ct=!1);var ot=rt==="max"||rt==="min",X=ot?null:0,Q=i.count,ut=n[G],J=!1,q=function(Ut){return k.r2c(Ut,0,c)},it;for(d.isArrayOrTypedArray(l[T])&&rt!=="count"&&(it=l[T],J=rt==="avg",Q=i[rt]),b=q(P.start),et=q(P.end)+(b-A.tickIncrement(b,P.size,!1,c))/1e6;b<et&&x.length<1e6&&(st=A.tickIncrement(b,P.size,!1,c),x.push((b+st)/2),y.push(X),N.push([]),B.push(b),ct&&I.push(1/(st-b)),J&&F.push(0),!(st<=b));)b=st;B.push(b),!D&&k.type==="date"&&(R={start:q(R.start),end:q(R.end),size:R.size}),w._fullLayout._roundFnOpts||(w._fullLayout._roundFnOpts={});var nt=l["_"+M+"bingroup"],dt={leftGap:1/0,rightGap:1/0};nt&&(w._fullLayout._roundFnOpts[nt]||(w._fullLayout._roundFnOpts[nt]=dt),dt=w._fullLayout._roundFnOpts[nt]);var Tt=y.length,wt=!0,It=dt.leftGap,Ct=dt.rightGap,Nt={};for(b=0;b<L.length;b++){var ee=L[b];K=d.findBin(ee,R),K>=0&&K<Tt&&(j+=Q(K,b,y,it,F),wt&&N[K].length&&ee!==L[N[K][0]]&&(wt=!1),N[K].push(b),Nt[b]=K,It=Math.min(It,ee-B[K]),Ct=Math.min(Ct,B[K+1]-ee))}dt.leftGap=It,dt.rightGap=Ct;var Jt;wt||(Jt=function(Ut,re){return function(){var Zt=w._fullLayout._roundFnOpts[nt];return a(Zt.leftGap,Zt.rightGap,B,k,c)(Ut,re)}}),J&&(j=o(y,F)),ut&&ut(y,j,I),h.enabled&&m(y,h.direction,h.currentbin);var te=Math.min(x.length,y.length),Kt=[],mt=0,bt=te-1;for(b=0;b<te;b++)if(y[b]){mt=b;break}for(b=te-1;b>=mt;b--)if(y[b]){bt=b;break}for(b=mt;b<=bt;b++)if(u(x[b])&&u(y[b])){var vt={p:x[b],s:y[b],b:0};h.enabled||(vt.pts=N[b],wt?vt.ph0=vt.ph1=N[b].length?L[N[b][0]]:x[b]:(l._computePh=!0,vt.ph0=Jt(B[b]),vt.ph1=Jt(B[b+1],!0))),Kt.push(vt)}return Kt.length===1&&(Kt[0].width1=A.tickIncrement(Kt[0].p,P.size,!1,c)-Kt[0].p),t(l,"marker")&&e(w,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),t(l,"marker.line")&&e(w,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(Kt,l),d.isArrayOrTypedArray(l.selectedpoints)&&d.tagSelected(Kt,l,Nt),Kt}function f(w,l,x,y,S){var k=y+"bins",M=w._fullLayout,T=l["_"+y+"bingroup"],c=M._histogramBinOpts[T],h=M.barmode==="overlay",b,_,P,L,D,B,R,I=function(ee){return x.r2c(ee,0,L)},F=function(ee){return x.c2r(ee,0,L)},N=x.type==="date"?function(ee){return ee||ee===0?d.cleanDate(ee,null,L):null}:function(ee){return u(ee)?Number(ee):null};function j(ee,Jt,te){Jt[ee+"Found"]?(Jt[ee]=N(Jt[ee]),Jt[ee]===null&&(Jt[ee]=te[ee])):(B[ee]=Jt[ee]=te[ee],d.nestedProperty(_[0],k+"."+ee).set(te[ee]))}if(l["_"+y+"autoBinFinished"])delete l["_"+y+"autoBinFinished"];else{_=c.traces;var G=[],rt=!0,ct=!1,st=!1;for(b=0;b<_.length;b++)if(P=_[b],P.visible){var et=c.dirs[b];D=P["_"+et+"pos0"]=x.makeCalcdata(P,et),G=d.concat(G,D),delete P["_"+y+"autoBinFinished"],l.visible===!0&&(rt?rt=!1:(delete P._autoBin,P["_"+y+"autoBinFinished"]=1),E.traceIs(P,"2dMap")&&(ct=!0),P.type==="histogram2dcontour"&&(st=!0))}L=_[0][y+"calendar"];var K=A.autoBin(G,x,c.nbins,ct,L,c.sizeFound&&c.size),ot=_[0]._autoBin={};if(B=ot[c.dirs[0]]={},st&&(c.size||(K.start=F(A.tickIncrement(I(K.start),K.size,!0,L))),c.end===void 0&&(K.end=F(A.tickIncrement(I(K.end),K.size,!1,L)))),h&&!E.traceIs(l,"2dMap")&&K._dataSpan===0&&x.type!=="category"&&x.type!=="multicategory"&&l.bingroup===""&&typeof l.xbins>"u"){if(S)return[K,D,!0];K=v(w,l,x,y,k)}R=P.cumulative||{},R.enabled&&R.currentbin!=="include"&&(R.direction==="decreasing"?K.start=F(A.tickIncrement(I(K.start),K.size,!0,L)):K.end=F(A.tickIncrement(I(K.end),K.size,!1,L))),c.size=K.size,c.sizeFound||(B.size=K.size,d.nestedProperty(_[0],k+".size").set(K.size)),j("start",c,K),j("end",c,K)}D=l["_"+y+"pos0"],delete l["_"+y+"pos0"];var X=l._input[k]||{},Q=d.extendFlat({},c),ut=c.start,J=x.r2l(X.start),q=J!==void 0;if((c.startFound||q)&&J!==x.r2l(ut)){var it=q?J:d.aggNums(Math.min,null,D),nt={type:x.type==="category"||x.type==="multicategory"?"linear":x.type,r2l:x.r2l,dtick:c.size,tick0:ut,calendar:L,range:[it,A.tickIncrement(it,c.size,!1,L)].map(x.l2r)},dt=A.tickFirst(nt);dt>x.r2l(it)&&(dt=A.tickIncrement(dt,c.size,!0,L)),Q.start=x.l2r(dt),q||d.nestedProperty(l,k+".start").set(Q.start)}var Tt=c.end,wt=x.r2l(X.end),It=wt!==void 0;if((c.endFound||It)&&wt!==x.r2l(Tt)){var Ct=It?wt:d.aggNums(Math.max,null,D);Q.end=x.l2r(Ct),It||d.nestedProperty(l,k+".start").set(Q.end)}var Nt="autobin"+y;return l._input[Nt]===!1&&(l._input[k]=d.extendFlat({},l[k]||{}),delete l._input[Nt],delete l[Nt]),[Q,D]}function v(w,l,x,y,S){var k=w._fullLayout,M=g(w,l),T=!1,c=1/0,h=[l],b,_,P;for(b=0;b<M.length;b++)if(_=M[b],_===l)T=!0;else if(!T)P=k._histogramBinOpts[_["_"+y+"bingroup"]],c=Math.min(c,P.size||_[S].size);else{var L=f(w,_,x,y,!0),D=L[0],B=L[2];_["_"+y+"autoBinFinished"]=1,_["_"+y+"pos0"]=L[1],B?h.push(_):c=Math.min(c,D.size)}var R=new Array(h.length);for(b=0;b<h.length;b++)for(var I=h[b]["_"+y+"pos0"],F=0;F<I.length;F++)if(I[F]!==void 0){R[b]=I[F];break}for(isFinite(c)||(c=d.distinctVals(R).minDiff),b=0;b<h.length;b++){_=h[b];var N=_[y+"calendar"],j={start:x.c2r(R[b]-c/2,0,N),end:x.c2r(R[b]+c/2,0,N),size:c};_._input[S]=_[S]=j,P=k._histogramBinOpts[_["_"+y+"bingroup"]],P&&d.extendFlat(P,j)}return l[S]}function g(w,l){for(var x=l.xaxis,y=l.yaxis,S=l.orientation,k=[],M=w._fullData,T=0;T<M.length;T++){var c=M[T];c.type==="histogram"&&c.visible===!0&&c.orientation===S&&c.xaxis===x&&c.yaxis===y&&k.push(c)}return k}function m(w,l,x){var y,S,k;function M(c){k=w[c],w[c]/=2}function T(c){S=w[c],w[c]=k+S/2,k+=S}if(x==="half")if(l==="increasing")for(M(0),y=1;y<w.length;y++)T(y);else for(M(w.length-1),y=w.length-2;y>=0;y--)T(y);else if(l==="increasing"){for(y=1;y<w.length;y++)w[y]+=w[y-1];x==="exclude"&&(w.unshift(0),w.pop())}else{for(y=w.length-2;y>=0;y--)w[y]+=w[y+1];x==="exclude"&&(w.push(0),w.shift())}}V.exports={calc:s,calcAllAutoBins:f}}),N6=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Qb(),A=t2(),t=e2(),e=r2(),r=n2().calcAllAutoBins;V.exports=function(a,s){var f=d.getFromId(a,s.xaxis),v=d.getFromId(a,s.yaxis),g=s.xcalendar,m=s.ycalendar,w=function(de){return f.r2c(de,0,g)},l=function(de){return v.r2c(de,0,m)},x=function(de){return f.c2r(de,0,g)},y=function(de){return v.c2r(de,0,m)},S,k,M,T,c=r(a,s,f,"x"),h=c[0],b=c[1],_=r(a,s,v,"y"),P=_[0],L=_[1],D=s._length;b.length>D&&b.splice(D,b.length-D),L.length>D&&L.splice(D,L.length-D);var B=[],R=[],I=[],F=typeof h.size=="string",N=typeof P.size=="string",j=[],G=[],rt=F?j:h,ct=N?G:P,st=0,et=[],K=[],ot=s.histnorm,X=s.histfunc,Q=ot.indexOf("density")!==-1,ut=X==="max"||X==="min",J=ut?null:0,q=E.count,it=A[ot],nt=!1,dt=[],Tt=[],wt="z"in s?s.z:"marker"in s&&Array.isArray(s.marker.color)?s.marker.color:"";wt&&X!=="count"&&(nt=X==="avg",q=E[X]);var It=h.size,Ct=w(h.start),Nt=w(h.end)+(Ct-d.tickIncrement(Ct,It,!1,g))/1e6;for(S=Ct;S<Nt;S=d.tickIncrement(S,It,!1,g))R.push(J),j.push(S),nt&&I.push(0);j.push(S);var ee=R.length,Jt=(S-Ct)/ee,te=x(Ct+Jt/2),Kt=P.size,mt=l(P.start),bt=l(P.end)+(mt-d.tickIncrement(mt,Kt,!1,m))/1e6;for(S=mt;S<bt;S=d.tickIncrement(S,Kt,!1,m)){B.push(R.slice()),G.push(S);var vt=new Array(ee);for(k=0;k<ee;k++)vt[k]=[];K.push(vt),nt&&et.push(I.slice())}G.push(S);var Ut=B.length,re=(S-mt)/Ut,Zt=y(mt+re/2);Q&&(dt=i(R.length,rt,Jt,F),Tt=i(B.length,ct,re,N)),!F&&f.type==="date"&&(rt=n(w,rt)),!N&&v.type==="date"&&(ct=n(l,ct));var ue=!0,Me=!0,Ce=new Array(ee),We=new Array(Ut),qe=1/0,vr=1/0,_r=1/0,er=1/0;for(S=0;S<D;S++){var Mr=b[S],Ir=L[S];M=u.findBin(Mr,rt),T=u.findBin(Ir,ct),M>=0&&M<ee&&T>=0&&T<Ut&&(st+=q(M,S,B[T],wt,et[T]),K[T][M].push(S),ue&&(Ce[M]===void 0?Ce[M]=Mr:Ce[M]!==Mr&&(ue=!1)),Me&&(We[T]===void 0?We[T]=Ir:We[T]!==Ir&&(Me=!1)),qe=Math.min(qe,Mr-j[M]),vr=Math.min(vr,j[M+1]-Mr),_r=Math.min(_r,Ir-G[T]),er=Math.min(er,G[T+1]-Ir))}if(nt)for(T=0;T<Ut;T++)st+=t(B[T],et[T]);if(it)for(T=0;T<Ut;T++)it(B[T],st,dt,Tt[T]);return{x:b,xRanges:o(j,ue&&Ce,qe,vr,f,g),x0:te,dx:Jt,y:L,yRanges:o(G,Me&&We,_r,er,v,m),y0:Zt,dy:re,z:B,pts:K}};function i(a,s,f,v){var g=new Array(a),m;if(v)for(m=0;m<a;m++)g[m]=1/(s[m+1]-s[m]);else{var w=1/f;for(m=0;m<a;m++)g[m]=w}return g}function n(a,s){return{start:a(s.start),end:a(s.end),size:s.size}}function o(a,s,f,v,g,m){var w,l=a.length-1,x=new Array(l),y=e(f,v,a,g,m);for(w=0;w<l;w++){var S=(s||[])[w];x[w]=S===void 0?[y(a[w]),y(a[w+1],!0)]:[S,S]}return x}}),d1=Vt((Z,V)=>{var u=Xr(),d=ks().BADNUM,E=rp();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 f=A.text,v=f!==void 0&&u.isArray1D(f),g=A.hovertext,m=g!==void 0&&u.isArray1D(g),w,l,x=u.distinctVals(a),y=x.vals,S=u.distinctVals(s),k=S.vals,M=[],T,c,h=k.length,b=y.length;for(w=0;w<n.length;w++)M[w]=u.init2dArray(h,b);v&&(T=u.init2dArray(h,b)),m&&(c=u.init2dArray(h,b));var _=u.init2dArray(h,b);for(w=0;w<o;w++)if(a[w]!==d&&s[w]!==d){var P=u.findBin(a[w]+x.minDiff/2,y),L=u.findBin(s[w]+S.minDiff/2,k);for(l=0;l<n.length;l++){var D=n[l],B=A[D],R=M[l];R[L][P]=B[w],_[L][P]=w}v&&(T[L][P]=f[w]),m&&(c[L][P]=g[w])}for(A["_"+r]=y,A["_"+i]=k,l=0;l<n.length;l++)A["_"+n[l]]=M[l];v&&(A._text=T),m&&(A._hovertext=c),t&&t.type==="category"&&(A["_"+r+"CategoryMap"]=y.map(function(I){return t._categories[I]})),e&&e.type==="category"&&(A["_"+i+"CategoryMap"]=k.map(function(I){return e._categories[I]})),A._after2before=_}}),m1=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ks().BADNUM;V.exports=function(A,t,e,r){var i,n,o,a,s,f;function v(y){if(u(y))return+y}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(y){return y.length},a=function(y,S,k){return(y[k]||[])[S]}}else i=A.length,o=function(y,S){return y[S].length},a=function(y,S,k){return(y[S]||[])[k]};var g=function(y,S,k){return S===E||k===E?E:a(y,S,k)};function m(y){if(t&&t.type!=="carpet"&&t.type!=="contourcarpet"&&y&&y.type==="category"&&t["_"+y._id.charAt(0)].length){var S=y._id.charAt(0),k={},M=t["_"+S+"CategoryMap"]||t[S];for(s=0;s<M.length;s++)k[M[s]]=s;return function(T){var c=k[y._categories[T]];return c+1?c:E}}else return d.identity}var w=m(e),l=m(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),f=0;f<n;f++)x[s][f]=v(g(A,l(s),w(f)));return x}}),g1=Vt((Z,V)=>{var u=Xr(),d=.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>d;n++)i=t(e,r,A(i));return i>d&&u.log("interp2d didn't converge quickly",i),e};function t(e,r,i){var n=0,o,a,s,f,v,g,m,w,l,x,y,S,k;for(f=0;f<r.length;f++){for(o=r[f],a=o[0],s=o[1],y=e[a][s],x=0,l=0,v=0;v<4;v++)g=E[v],m=e[a+g[0]],m&&(w=m[s+g[1]],w!==void 0&&(x===0?S=k=w:(S=Math.min(S,w),k=Math.max(k,w)),l++,x+=w));if(l===0)throw"iterateInterp2d order is wrong: no defined neighbors";e[a][s]=x/l,y===void 0?l<4&&(n=1):(e[a][s]=(1+i)*e[a][s]-i*y,k>S&&(n=Math.max(n,Math.abs(e[a][s]-y)/(k-S))))}return n}}),v1=Vt((Z,V)=>{var u=Xr().maxRowLength;V.exports=function(d){var E=[],A={},t=[],e=d[0],r=[],i=[0,0,0],n=u(d),o,a,s,f,v,g,m,w;for(a=0;a<d.length;a++)for(o=r,r=e,e=d[a+1]||[],s=0;s<n;s++)r[s]===void 0&&(g=(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),g?(a===0&&g++,s===0&&g++,a===d.length-1&&g++,s===r.length-1&&g++,g<4&&(A[[a,s]]=[a,s,g]),E.push([a,s,g])):t.push([a,s]));for(;t.length;){for(m={},w=!1,v=t.length-1;v>=0;v--)f=t[v],a=f[0],s=f[1],g=((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,g&&(m[f]=[a,s,g],t.splice(v,1),w=!0);if(!w)throw"findEmpties iterated with no new neighbors";for(f in m)A[f]=m[f],E.push(m[f])}return E.sort(function(l,x){return x[2]-l[2]})}}),a2=Vt((Z,V)=>{var u=ji(),d=Xr().isArrayOrTypedArray;V.exports=function(E,A,t,e,r,i){var n=[],o=u.traceIs(E,"contour"),a=u.traceIs(E,"histogram"),s,f,v,g=d(A)&&A.length>1;if(g&&!a&&i.type!=="category"){var m=A.length;if(m<=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<m;v++)n.push(Math.sqrt(A[v-1]*A[v]));n.push(Math.pow(A[m-1],1.5)/Math.pow(A[m-2],.5))}else{for(n=[1.5*A[0]-.5*A[1]],v=1;v<m;v++)n.push((A[v-1]+A[v])*.5);n.push(1.5*A[m-1]-.5*A[m-2])}if(m<r){var w=n[n.length-1],l;if(i.type==="log")for(l=w/n[n.length-2],v=m;v<r;v++)w*=l,n.push(w);else for(l=w-n[n.length-2],v=m;v<r;v++)w+=l,n.push(w)}}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(d(A)&&A.length===1)s=A[0];else if(t===void 0)s=0;else{var y=i.type==="log"?i.d2c:i.r2c;s=y(t,0,x)}for(f=e||1,v=o?0:-.5;v<r;v++)n.push(s+f*v)}return n}}),y1=Vt((Z,V)=>{var u=ji(),d=Xr(),E=yo(),A=rp(),t=N6(),e=ah(),r=d1(),i=m1(),n=g1(),o=v1(),a=a2(),s=ks().BADNUM;V.exports=function(g,m){var w=E.getFromId(g,m.xaxis||"x"),l=E.getFromId(g,m.yaxis||"y"),x=u.traceIs(m,"contour"),y=u.traceIs(m,"histogram"),S=x?"best":m.zsmooth,k,M,T,c,h,b,_,P,L,D,B;if(w._minDtick=0,l._minDtick=0,y)B=t(g,m),c=B.orig_x,k=B.x,M=B.x0,T=B.dx,P=B.orig_y,h=B.y,b=B.y0,_=B.dy,L=B.z;else{var R=m.z;d.isArray1D(R)?(r(m,w,l,"x","y",["z"]),k=m._x,h=m._y,R=m._z):(c=m.x?w.makeCalcdata(m,"x"):[],P=m.y?l.makeCalcdata(m,"y"):[],k=A(m,w,"x",c).vals,h=A(m,l,"y",P).vals,m._x=k,m._y=h),M=m.x0,T=m.dx,b=m.y0,_=m.dy,L=i(R,m,w,l)}(w.rangebreaks||l.rangebreaks)&&(L=v(k,h,L),y||(k=f(k),h=f(h),m._x=k,m._y=h)),!y&&(x||m.connectgaps)&&(m._emptypoints=o(L),n(L,m._emptypoints));function I(K){S=m._input.zsmooth=m.zsmooth=!1,d.warn('cannot use zsmooth: "fast": '+K)}function F(K){if(K.length>1){var ot=(K[K.length-1]-K[0])/(K.length-1),X=Math.abs(ot/100);for(D=0;D<K.length-1;D++)if(Math.abs(K[D+1]-K[D]-ot)>X)return!1}return!0}m._islinear=!1,w.type==="log"||l.type==="log"?S==="fast"&&I("log axis found"):F(k)?F(h)?m._islinear=!0:S==="fast"&&I("y scale is not linear"):S==="fast"&&I("x scale is not linear");var N=d.maxRowLength(L),j=m.xtype==="scaled"?"":k,G=a(m,j,M,T,N,w),rt=m.ytype==="scaled"?"":h,ct=a(m,rt,b,_,L.length,l);m._extremes[w._id]=E.findExtremes(w,G),m._extremes[l._id]=E.findExtremes(l,ct);var st={x:G,y:ct,z:L,text:m._text||m.text,hovertext:m._hovertext||m.hovertext};if(m.xperiodalignment&&c&&(st.orig_x=c),m.yperiodalignment&&P&&(st.orig_y=P),j&&j.length===G.length-1&&(st.xCenter=j),rt&&rt.length===ct.length-1&&(st.yCenter=rt),y&&(st.xRanges=B.xRanges,st.yRanges=B.yRanges,st.pts=B.pts),x||e(g,m,{vals:L,cLetter:"z"}),x&&m.contours&&m.contours.coloring==="heatmap"){var et={type:m.type==="contour"?"heatmap":"histogram2d",xcalendar:m.xcalendar,ycalendar:m.ycalendar};st.xfill=a(et,j,M,T,N,w),st.yfill=a(et,rt,b,_,L.length,l)}return[st]};function f(g){for(var m=[],w=g.length,l=0;l<w;l++){var x=g[l];x!==s&&m.push(x)}return m}function v(g,m,w){for(var l=[],x=-1,y=0;y<w.length;y++)if(m[y]!==s){x++,l[x]=[];for(var S=0;S<w[y].length;S++)g[S]!==s&&l[x].push(w[y][S])}return l}}),x1=Vt(Z=>{Z.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"]],Z.STYLE=Z.CSS_DECLARATIONS.map(function(V){return V.join(": ")+"; "}).join("")}),i2=Vt((Z,V)=>{var u=x1(),d=Eo(),E=Xr(),A=null;function t(){if(A!==null)return A;A=!1;var e=E.isSafari()||E.isMacWKWebView()||E.isIOS();if(window.navigator.userAgent&&!e){var r=Array.from(u.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=d.tester.append("image").attr("style",u.STYLE),o=window.getComputedStyle(n.node()),a=o.imageRendering;A=r.some(function(s){var f=s[1];return a===f||a===f.toLowerCase()}),n.remove()}}return A}V.exports=t}),_1=Vt((Z,V)=>{var u=Ni(),d=kf(),E=ji(),A=Eo(),t=yo(),e=Xr(),r=Dl(),i=$y(),n=Pi(),o=xu().extractOpts,a=xu().makeColorScaleFuncFromTrace,s=Eh(),f=mf(),v=f.LINE_SPACING,g=i2(),m=x1().STYLE,w="heatmap-label";function l(M){return M.selectAll("g."+w)}function x(M){l(M).remove()}V.exports=function(M,T,c,h){var b=T.xaxis,_=T.yaxis;e.makeTraceGroups(h,c,"hm").each(function(P){var L=u.select(this),D=P[0],B=D.trace,R=B.xgap||0,I=B.ygap||0,F=D.z,N=D.x,j=D.y,G=D.xCenter,rt=D.yCenter,ct=E.traceIs(B,"contour"),st=ct?"best":B.zsmooth,et=F.length,K=e.maxRowLength(F),ot=!1,X=!1,Q,ut,J,q,it,nt,dt,Tt;for(nt=0;Q===void 0&&nt<N.length-1;)Q=b.c2p(N[nt]),nt++;for(nt=N.length-1;ut===void 0&&nt>0;)ut=b.c2p(N[nt]),nt--;for(ut<Q&&(J=ut,ut=Q,Q=J,ot=!0),nt=0;q===void 0&&nt<j.length-1;)q=_.c2p(j[nt]),nt++;for(nt=j.length-1;it===void 0&&nt>0;)it=_.c2p(j[nt]),nt--;it<q&&(J=q,q=it,it=J,X=!0),ct&&(G=N,rt=j,N=D.xfill,j=D.yfill);var wt="default";if(st?wt=st==="best"?"smooth":"fast":B._islinear&&R===0&&I===0&&g()&&(wt="fast"),wt!=="fast"){var It=st==="best"?0:.5;Q=Math.max(-It*b._length,Q),ut=Math.min((1+It)*b._length,ut),q=Math.max(-It*_._length,q),it=Math.min((1+It)*_._length,it)}var Ct=Math.round(ut-Q),Nt=Math.round(it-q),ee=Q>=b._length||ut<=0||q>=_._length||it<=0;if(ee){var Jt=L.selectAll("image").data([]);Jt.exit().remove(),x(L);return}var te,Kt;wt==="fast"?(te=K,Kt=et):(te=Ct,Kt=Nt);var mt=document.createElement("canvas");mt.width=te,mt.height=Kt;var bt=mt.getContext("2d",{willReadFrequently:!0}),vt=a(B,{noNumericCheck:!0,returnArray:!0}),Ut,re;wt==="fast"?(Ut=ot?function(vn){return K-1-vn}:e.identity,re=X?function(vn){return et-1-vn}:e.identity):(Ut=function(vn){return e.constrain(Math.round(b.c2p(N[vn])-Q),0,Ct)},re=function(vn){return e.constrain(Math.round(_.c2p(j[vn])-q),0,Nt)});var Zt=re(0),ue=[Zt,Zt],Me=ot?0:1,Ce=X?0:1,We=0,qe=0,vr=0,_r=0,er,Mr,Ir,de,Dt;function qt(vn,Oa){if(vn!==void 0){var Qn=vt(vn);return Qn[0]=Math.round(Qn[0]),Qn[1]=Math.round(Qn[1]),Qn[2]=Math.round(Qn[2]),We+=Oa,qe+=Qn[0]*Oa,vr+=Qn[1]*Oa,_r+=Qn[2]*Oa,Qn}return[0,0,0,0]}function _t(vn,Oa,Qn,Qa){var Ja=vn[Qn.bin0];if(Ja===void 0)return qt(void 0,1);var wi=vn[Qn.bin1],ci=Oa[Qn.bin0],Ti=Oa[Qn.bin1],Ra=wi-Ja||0,Qi=ci-Ja||0,Hi;return wi===void 0?Ti===void 0?Hi=0:ci===void 0?Hi=2*(Ti-Ja):Hi=(2*Ti-ci-Ja)*2/3:Ti===void 0?ci===void 0?Hi=0:Hi=(2*Ja-wi-ci)*2/3:ci===void 0?Hi=(2*Ti-wi-Ja)*2/3:Hi=Ti+Ja-wi-ci,qt(Ja+Qn.frac*Ra+Qa.frac*(Qi+Qn.frac*Hi))}if(wt!=="default"){var lt=0,yt;try{yt=new Uint8Array(te*Kt*4)}catch{yt=new Array(te*Kt*4)}if(wt==="smooth"){var St=G||N,Ht=rt||j,Yt=new Array(St.length),se=new Array(Ht.length),ke=new Array(Ct),Ee=G?S:y,Ue=rt?S:y,ir,ar,Ye;for(nt=0;nt<St.length;nt++)Yt[nt]=Math.round(b.c2p(St[nt])-Q);for(nt=0;nt<Ht.length;nt++)se[nt]=Math.round(_.c2p(Ht[nt])-q);for(nt=0;nt<Ct;nt++)ke[nt]=Ee(nt,Yt);for(dt=0;dt<Nt;dt++)for(ir=Ue(dt,se),ar=F[ir.bin0],Ye=F[ir.bin1],nt=0;nt<Ct;nt++,lt+=4)Dt=_t(ar,Ye,ke[nt],ir),k(yt,lt,Dt)}else for(dt=0;dt<et;dt++)for(de=F[dt],ue=re(dt),nt=0;nt<K;nt++)Dt=qt(de[nt],1),lt=(ue*K+Ut(nt))*4,k(yt,lt,Dt);var Er=bt.createImageData(te,Kt);try{Er.data.set(yt)}catch{var pn=Er.data,dn=pn.length;for(dt=0;dt<dn;dt++)pn[dt]=yt[dt]}bt.putImageData(Er,0,0)}else{var bn=Math.floor(R/2),Zn=Math.floor(I/2);for(dt=0;dt<et;dt++)if(de=F[dt],ue.reverse(),ue[Ce]=re(dt+1),!(ue[0]===ue[1]||ue[0]===void 0||ue[1]===void 0))for(Mr=Ut(0),er=[Mr,Mr],nt=0;nt<K;nt++)er.reverse(),er[Me]=Ut(nt+1),!(er[0]===er[1]||er[0]===void 0||er[1]===void 0)&&(Ir=de[nt],Dt=qt(Ir,(er[1]-er[0])*(ue[1]-ue[0])),bt.fillStyle="rgba("+Dt.join(",")+")",bt.fillRect(er[0]+bn,ue[0]+Zn,er[1]-er[0]-R,ue[1]-ue[0]-I))}qe=Math.round(qe/We),vr=Math.round(vr/We),_r=Math.round(_r/We);var En=d("rgb("+qe+","+vr+","+_r+")");M._hmpixcount=(M._hmpixcount||0)+We,M._hmlumcount=(M._hmlumcount||0)+We*En.getLuminance();var gn=L.selectAll("image").data(P);gn.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),gn.attr({height:Nt,width:Ct,x:Q,y:q,"xlink:href":mt.toDataURL("image/png")}),wt==="fast"&&!st&&gn.attr("style",m),x(L);var da=B.texttemplate;if(da){var ra=o(B),Se={type:"linear",range:[ra.min,ra.max],_separators:b._separators,_numFormat:b._numFormat},Re=B.type==="histogram2dcontour",Ze=B.type==="contour",tr=Ze?1:0,zr=Ze?et-1:et,tn=Ze?1:0,Yr=Ze?K-1:K,$r=[];for(nt=tr;nt<zr;nt++){var In;if(Ze)In=D.y[nt];else if(Re){if(nt===0||nt===et-1)continue;In=D.y[nt]}else if(D.yCenter)In=D.yCenter[nt];else{if(nt+1===et&&D.y[nt+1]===void 0)continue;In=(D.y[nt]+D.y[nt+1])/2}var Nn=Math.round(_.c2p(In));if(!(0>Nn||Nn>_._length))for(dt=tn;dt<Yr;dt++){var Kn;if(Ze)Kn=D.x[dt];else if(Re){if(dt===0||dt===K-1)continue;Kn=D.x[dt]}else if(D.xCenter)Kn=D.xCenter[dt];else{if(dt+1===K&&D.x[dt+1]===void 0)continue;Kn=(D.x[dt]+D.x[dt+1])/2}var $n=Math.round(b.c2p(Kn));if(!(0>$n||$n>b._length)){var ia=i({x:Kn,y:In},B,M._fullLayout);ia.x=Kn,ia.y=In;var Cn=D.z[nt][dt];Cn===void 0?(ia.z="",ia.zLabel=""):(ia.z=Cn,ia.zLabel=t.tickText(Se,Cn,"hover").text);var Fa=D.text&&D.text[nt]&&D.text[nt][dt];(Fa===void 0||Fa===!1)&&(Fa=""),ia.text=Fa;var Ga=e.texttemplateString({data:[ia,B._meta],fallback:B.texttemplatefallback,labels:ia,locale:M._fullLayout._d3locale,template:da});if(Ga){var ve=Ga.split("<br>"),ge=ve.length,dr=0;for(Tt=0;Tt<ge;Tt++)dr=Math.max(dr,ve[Tt].length);$r.push({l:ge,c:dr,t:Ga,x:$n,y:Nn,z:Cn})}}}}var br=B.textfont,Tr=br.size,mr=M._fullLayout.font.size;if(!Tr||Tr==="auto"){var kr=1/0,Ur=1/0,Or=0,pe=0;for(Tt=0;Tt<$r.length;Tt++){var Ke=$r[Tt];if(Or=Math.max(Or,Ke.l),pe=Math.max(pe,Ke.c),Tt<$r.length-1){var xr=$r[Tt+1],Gr=Math.abs(xr.x-Ke.x),ln=Math.abs(xr.y-Ke.y);Gr&&(kr=Math.min(kr,Gr)),ln&&(Ur=Math.min(Ur,ln))}}!isFinite(kr)||!isFinite(Ur)?Tr=mr:(kr-=R,Ur-=I,kr/=pe,Ur/=Or,kr/=v/2,Ur/=v,Tr=Math.min(Math.floor(kr),Math.floor(Ur),mr))}if(Tr<=0||!isFinite(Tr))return;var wn=function(vn){return vn.x},rn=function(vn){return vn.y-Tr*(vn.l*v/2-1)},Qr=l(L).data($r);Qr.enter().append("g").classed(w,1).append("text").attr("text-anchor","middle").each(function(vn){var Oa=u.select(this),Qn=br.color;(!Qn||Qn==="auto")&&(Qn=n.contrast(vn.z===void 0?M._fullLayout.plot_bgcolor:"rgba("+vt(vn.z).join()+")")),Oa.attr("data-notex",1).call(r.positionText,wn(vn),rn(vn)).call(A.font,{family:br.family,size:Tr,color:Qn,weight:br.weight,style:br.style,variant:br.variant,textcase:br.textcase,lineposition:br.lineposition,shadow:br.shadow}).text(vn.t).call(r.convertToTspans,M)})}})};function y(M,T){var c=T.length-2,h=e.constrain(e.findBin(M,T),0,c),b=T[h],_=T[h+1],P=e.constrain(h+(M-b)/(_-b)-.5,0,c),L=Math.round(P),D=Math.abs(P-L);return!P||P===c||!D?{bin0:L,bin1:L,frac:0}:{bin0:L,frac:D,bin1:Math.round(L+D/(P-L))}}function S(M,T){var c=T.length-1,h=e.constrain(e.findBin(M,T),0,c),b=T[h],_=T[h+1],P=(M-b)/(_-b)||0;return P<=0?{bin0:h,bin1:h,frac:0}:P<.5?{bin0:h,bin1:h+1,frac:P}:{bin0:h+1,bin1:h,frac:1-P}}function k(M,T,c){M[T]=c[0],M[T+1]=c[1],M[T+2]=c[2],M[T+3]=Math.round(c[3]*255)}}),Ed=Vt((Z,V)=>{V.exports={min:"zmin",max:"zmax"}}),b1=Vt((Z,V)=>{var u=Ni();V.exports=function(d){u.select(d).selectAll(".hm image").style("opacity",function(E){return E.trace.opacity})}}),w1=Vt((Z,V)=>{var u=hc(),d=Xr(),E=d.isArrayOrTypedArray,A=yo(),t=xu().extractOpts;V.exports=function(e,r,i,n,o){o||(o={});var a=o.isContour,s=e.cd[0],f=s.trace,v=e.xa,g=e.ya,m=s.x,w=s.y,l=s.z,x=s.xCenter,y=s.yCenter,S=s.zmask,k=f.zhoverformat,M=m,T=w,c,h,b,_;if(e.index!==!1){try{b=Math.round(e.index[1]),_=Math.round(e.index[0])}catch{d.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index);return}if(b<0||b>=l[0].length||_<0||_>l.length)return}else{if(u.inbox(r-m[0],r-m[m.length-1],0)>0||u.inbox(i-w[0],i-w[w.length-1],0)>0)return;if(a){var P;for(M=[2*m[0]-m[1]],P=1;P<m.length;P++)M.push((m[P]+m[P-1])/2);for(M.push([2*m[m.length-1]-m[m.length-2]]),T=[2*w[0]-w[1]],P=1;P<w.length;P++)T.push((w[P]+w[P-1])/2);T.push([2*w[w.length-1]-w[w.length-2]])}b=Math.max(0,Math.min(M.length-2,d.findBin(r,M))),_=Math.max(0,Math.min(T.length-2,d.findBin(i,T)))}var L=v.c2p(m[b]),D=v.c2p(m[b+1]),B=g.c2p(w[_]),R=g.c2p(w[_+1]),I,F;a?(I=s.orig_x||m,F=s.orig_y||w,D=L,c=I[b],R=B,h=F[_]):(I=s.orig_x||x||m,F=s.orig_y||y||w,c=x?I[b]:(I[b]+I[b+1])/2,h=y?F[_]:(F[_]+F[_+1])/2,v&&v.type==="category"&&(c=m[b]),g&&g.type==="category"&&(h=w[_]),f.zsmooth&&(L=D=v.c2p(c),B=R=g.c2p(h)));var N=l[_][b];if(S&&!S[_][b]&&(N=void 0),!(N===void 0&&!f.hoverongaps)){var j;E(s.hovertext)&&E(s.hovertext[_])?j=s.hovertext[_][b]:E(s.text)&&E(s.text[_])&&(j=s.text[_][b]);var G=t(f),rt={type:"linear",range:[G.min,G.max],hoverformat:k,_separators:v._separators,_numFormat:v._numFormat},ct=A.tickText(rt,N,"hover").text;return[d.extendFlat(e,{index:f._after2before?f._after2before[_][b]:[_,b],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:L,x1:D,y0:B,y1:R,xLabelVal:c,yLabelVal:h,zLabelVal:N,zLabel:ct,text:j})]}}}),j6=Vt((Z,V)=>{V.exports={attributes:zm(),supplyDefaults:R6(),calc:y1(),plot:_1(),colorbar:Ed(),style:b1(),hoverPoints:w1(),moduleType:"trace",name:"heatmap",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),U6=Vt((Z,V)=>{V.exports=j6()}),o2=Vt((Z,V)=>{V.exports=function(u,d){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),V6=Vt((Z,V)=>{V.exports={eventDataKeys:["binNumber"]}}),T1=Vt((Z,V)=>{var u=yp(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,texttemplateAttrs:A,templatefallbackAttrs:t}=kl(),e=yu(),r=o2(),i=V6(),n=So().extendFlat;V.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:d("x"),yhoverformat:d("y"),text:n({},u.text,{}),hovertext:n({},u.hovertext,{}),orientation:u.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:r("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:r("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:i.eventDataKeys}),hovertemplatefallback:t(),texttemplate:A({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:t({editType:"plot"}),textposition:n({},u.textposition,{arrayOk:!1}),textfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:u.insidetextanchor,textangle:u.textangle,cliponaxis:u.cliponaxis,constraintext:u.constraintext,marker:u.marker,offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,selected:u.selected,unselected:u.unselected,zorder:u.zorder}}),H6=Vt((Z,V)=>{var u=ji(),d=Xr(),E=Pi(),A=Lh().handleText,t=s1(),e=T1();V.exports=function(r,i,n,o){function a(T,c){return d.coerce(r,i,e,T,c)}var s=a("x"),f=a("y"),v=a("cumulative.enabled");v&&(a("cumulative.direction"),a("cumulative.currentbin")),a("text");var g=a("textposition");A(r,i,o,a,g,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("xhoverformat"),a("yhoverformat");var m=a("orientation",f&&!s?"h":"v"),w=m==="v"?"x":"y",l=m==="v"?"y":"x",x=s&&f?Math.min(d.minRowLength(s)&&d.minRowLength(f)):d.minRowLength(i[w]||[]);if(!x){i.visible=!1;return}i._length=x;var y=u.getComponentMethod("calendars","handleTraceDefaults");y(r,i,["x","y"],o);var S=i[l];S&&a("histfunc"),a("histnorm"),a("autobin"+w),t(r,i,a,n,o),d.coerceSelectionMarkerOpacity(i,a);var k=(i.marker.line||{}).color,M=u.getComponentMethod("errorbars","supplyDefaults");M(r,i,k||E.defaultLine,{axis:"y"}),M(r,i,k||E.defaultLine,{axis:"x",inherit:"y"}),a("zorder")}}),k1=Vt((Z,V)=>{var u=Xr(),d=cc(),E=ji().traceIs,A=u0(),t=Lh().validateCornerradius,e=u.nestedProperty,r=s0().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={},f=[],v={},g=[],m,w,l,x,y,S,k;function M(ct,st){return u.coerce(m._input,m,m._module.attributes,ct,st)}function T(ct){return ct.orientation==="v"?"x":"y"}function c(ct,st){var et=d.getFromTrace({_fullLayout:a},ct,st);return et.type}function h(ct,st,et){var K=ct.uid+"__"+et;st||(st=K);var ot=c(ct,et),X=ct[et+"calendar"]||"",Q=s[st],ut=!0;Q&&(ot===Q.axType&&X===Q.calendar?(ut=!1,Q.traces.push(ct),Q.dirs.push(et)):(st=K,ot!==Q.axType&&u.warn(["Attempted to group the bins of trace",ct.index,"set on a","type:"+ot,"axis","with bins on","type:"+Q.axType,"axis."].join(" ")),X!==Q.calendar&&u.warn(["Attempted to group the bins of trace",ct.index,"set with a",X,"calendar","with bins",Q.calendar?"on a "+Q.calendar+" calendar":"w/o a set calendar"].join(" ")))),ut&&(s[st]={traces:[ct],dirs:[et],axType:ot,calendar:ct[et+"calendar"]||""}),ct["_"+et+"bingroup"]=st}for(y=0;y<o.length;y++)if(m=o[y],E(m,"histogram")){if(f.push(m),delete m._xautoBinFinished,delete m._yautoBinFinished,m.type==="histogram"){var b=M("marker.cornerradius",a.barcornerradius);m.marker&&(m.marker.cornerradius=t(b))}E(m,"2dMap")||A(m._input,m,a,M,a.barmode)}var _=a._alignmentOpts||{};for(y=0;y<f.length;y++){if(m=f[y],l="",!E(m,"2dMap")){if(x=T(m),a.barmode==="group"&&m.alignmentgroup){var P=m[x+"axis"],L=r(a,P)+m.orientation;(_[L]||{})[m.alignmentgroup]&&(l=L)}!l&&a.barmode!=="overlay"&&(l=r(a,m.xaxis)+r(a,m.yaxis)+T(m))}l?(v[l]||(v[l]=[]),v[l].push(m)):g.push(m)}for(l in v){if(w=v[l],w.length===1){g.push(w[0]);continue}var D=!1;for(w.length&&(m=w[0],D=M("bingroup")),l=D||l,y=0;y<w.length;y++){m=w[y];var B=m._input.bingroup;B&&B!==l&&u.warn(["Trace",m.index,"must match","within bingroup",l+".","Ignoring its bingroup:",B,"setting."].join(" ")),m.bingroup=l,h(m,l,T(m))}}for(y=0;y<g.length;y++){m=g[y];var R=M("bingroup");if(E(m,"2dMap"))for(k=0;k<2;k++){x=n[k];var I=M(x+"bingroup",R?R+"__"+x:null);h(m,I,x)}else h(m,R,T(m))}for(l in s){var F=s[l];for(w=F.traces,S=0;S<i.length;S++){var N=i[S],j=N.name,G,rt;if(!(j==="nbins"&&F.sizeFound)){for(y=0;y<w.length;y++){if(m=w[y],x=F.dirs[y],G=N.aStr[x],e(m._input,G).get()!==void 0){F[j]=M(G),F[j+"Found"]=!0;break}rt=(m._autoBin||{})[x]||{},rt[j]&&e(m,G).set(rt[j])}if(j==="start"||j==="end")for(;y<w.length;y++)m=w[y],m["_"+x+"bingroup"]&&(rt=(m._autoBin||{})[x]||{},M(G,rt[j]));j==="nbins"&&!F.sizeFound&&!F.nbinsFound&&(m=w[0],F[j]=M(G))}}}}}),q6=Vt((Z,V)=>{var u=Sm().hoverPoints,d=yo().hoverLabelText;V.exports=function(E,A,t,e,r){var i=u(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"]=d(E[a+"a"],[n.ph0,n.ph1],o[a+"hoverformat"])}return i}}}),s2=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){if(u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,"zLabelVal"in d&&(u.z=d.zLabelVal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),!(E.cumulative||{}).enabled){var e=Array.isArray(t)?A[0].pts[t[0]][t[1]]:A[t].pts;u.pointNumbers=e,u.binNumber=u.pointNumber,delete u.pointNumber,delete u.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;u.pointIndices=r}return u}}),W6=Vt((Z,V)=>{V.exports={attributes:T1(),layoutAttributes:o1(),supplyDefaults:H6(),crossTraceDefaults:k1(),supplyLayoutDefaults:Kb(),calc:n2().calc,crossTraceCalc:c0().crossTraceCalc,plot:h0().plot,layerName:"barlayer",style:Vh().style,styleOnSelect:Vh().styleOnSelect,colorbar:Gf(),hoverPoints:q6(),selectPoints:Em(),eventData:s2(),moduleType:"trace",name:"histogram",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),G6=Vt((Z,V)=>{V.exports=W6()}),A1=Vt((Z,V)=>{var u=T1(),d=o2(),E=zm(),A=Tl(),t=fc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:r,templatefallbackAttrs:i}=kl(),n=Wl(),o=So().extendFlat;V.exports=o({x:u.x,y:u.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:u.histnorm,histfunc:u.histfunc,nbinsx:u.nbinsx,xbins:d("x"),nbinsy:u.nbinsy,ybins:d("y"),autobinx:u.autobinx,autobiny:u.autobiny,bingroup:o({},u.bingroup,{}),xbingroup:o({},u.bingroup,{}),ybingroup:o({},u.bingroup,{}),xgap:E.xgap,ygap:E.ygap,zsmooth:E.zsmooth,xhoverformat:t("x"),yhoverformat:t("y"),zhoverformat:t("z",1),hovertemplate:e({},{keys:["z"]}),hovertemplatefallback:i(),texttemplate:r({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:i({editType:"plot"}),textfont:E.textfont,showlegend:o({},A.showlegend,{dflt:!1})},n("",{cLetter:"z",autoColorDflt:!1}))}),l2=Vt((Z,V)=>{var u=ji(),d=Xr();V.exports=function(E,A,t,e){var r=t("x"),i=t("y"),n=d.minRowLength(r),o=d.minRowLength(i);if(!n||!o){A.visible=!1;return}A._length=Math.min(n,o);var a=u.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")}}),Z6=Vt((Z,V)=>{var u=Xr(),d=l2(),E=Jb(),A=gf(),t=Kg(),e=A1();V.exports=function(r,i,n,o){function a(s,f){return u.coerce(r,i,e,s,f)}d(r,i,a,o),i.visible!==!1&&(E(r,i,a,o),A(r,i,o,a,{prefix:"",cLetter:"z"}),a("hovertemplate"),a("hovertemplatefallback"),t(a,o),a("xhoverformat"),a("yhoverformat"))}}),K6=Vt((Z,V)=>{var u=w1(),d=yo().hoverLabelText;V.exports=function(E,A,t,e,r){var i=u(E,A,t,e,r);if(i){E=i[0];var n=E.index,o=n[0],a=n[1],s=E.cd[0],f=s.trace,v=s.xRanges[a],g=s.yRanges[o];return E.xLabel=d(E.xa,[v[0],v[1]],f.xhoverformat),E.yLabel=d(E.ya,[g[0],g[1]],f.yhoverformat),i}}}),Y6=Vt((Z,V)=>{V.exports={attributes:A1(),supplyDefaults:Z6(),crossTraceDefaults:k1(),calc:y1(),plot:_1(),layerName:"heatmaplayer",colorbar:Ed(),style:b1(),hoverPoints:K6(),eventData:s2(),moduleType:"trace",name:"histogram2d",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),X6=Vt((Z,V)=>{V.exports=Y6()}),M1=Vt((Z,V)=>{V.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Yg=Vt((Z,V)=>{var u=zm(),d=pc(),E=fc(),A=E.axisHoverFormat,t=E.descriptionOnlyNumbers,e=Wl(),r=Cf().dash,i=yu(),n=So().extendFlat,o=M1(),a=o.COMPARISON_OPS2,s=o.INTERVAL_OPS,f=d.line;V.exports=n({z:u.z,x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,text:u.text,hovertext:u.hovertext,transpose:u.transpose,xtype:u.xtype,ytype:u.ytype,xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:u.hovertemplate,hovertemplatefallback:u.hovertemplatefallback,texttemplate:n({},u.texttemplate,{}),texttemplatefallback:u.texttemplatefallback,textfont:n({},u.textfont,{}),hoverongaps:u.hoverongaps,connectgaps:n({},u.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({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:n({},f.smoothing,{}),editType:"plot"},zorder:d.zorder},e("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),u2=Vt((Z,V)=>{var u=A1(),d=Yg(),E=Wl(),A=fc().axisHoverFormat,t=So().extendFlat;V.exports=t({x:u.x,y:u.y,z:u.z,marker:u.marker,histnorm:u.histnorm,histfunc:u.histfunc,nbinsx:u.nbinsx,xbins:u.xbins,nbinsy:u.nbinsy,ybins:u.ybins,autobinx:u.autobinx,autobiny:u.autobiny,bingroup:u.bingroup,xbingroup:u.xbingroup,ybingroup:u.ybingroup,autocontour:d.autocontour,ncontours:d.ncontours,contours:d.contours,line:{color:d.line.color,width:t({},d.line.width,{dflt:.5}),dash:d.line.dash,smoothing:d.line.smoothing,editType:"plot"},xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z",1),hovertemplate:u.hovertemplate,hovertemplatefallback:u.hovertemplatefallback,texttemplate:d.texttemplate,texttemplatefallback:d.texttemplatefallback,textfont:d.textfont},E("",{cLetter:"z",editTypeOverride:"calc"}))}),S1=Vt((Z,V)=>{V.exports=function(u,d,E,A){var t=A("contours.start"),e=A("contours.end"),r=t===!1||e===!1,i=E("contours.size"),n;r?n=d.autocontour=!0:n=E("autocontour",!1),(n||!i)&&E("ncontours")}}),c2=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E,A,t){t||(t={});var e=d("contours.showlabels");if(e){var r=E.font;u.coerceFont(d,"contours.labelfont",r,{overrideDflt:{color:A}}),d("contours.labelformat")}t.hasHover!==!1&&d("zhoverformat")}}),E1=Vt((Z,V)=>{var u=gf(),d=c2();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,u(E,A,e,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),d(t,e,o,r)}}),$6=Vt((Z,V)=>{var u=Xr(),d=l2(),E=S1(),A=E1(),t=Kg(),e=u2();V.exports=function(r,i,n,o){function a(f,v){return u.coerce(r,i,e,f,v)}function s(f){return u.coerce2(r,i,e,f)}d(r,i,a,o),i.visible!==!1&&(E(r,i,a,s),A(r,i,a,o),a("xhoverformat"),a("yhoverformat"),a("hovertemplate"),a("hovertemplatefallback"),i.contours&&i.contours.coloring==="heatmap"&&t(a,o))}}),f2=Vt((Z,V)=>{var u=yo(),d=Xr();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=d.aggNums(Math.min,null,t)),(A.zauto||i===void 0)&&(i=d.aggNums(Math.max,null,t));var n=E(r,i,A.ncontours);e.size=n.dtick,e.start=u.tickFirst(n),n.range.reverse(),e.end=u.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={}),d.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 f;o===a?f=1:f=E(o,a,A.ncontours).dtick,s.size=e.size=f}}};function E(A,t,e){var r={type:"linear",range:[A,t]};return u.autoTicks(r,(t-A)/(e||15)),r}}),Xg=Vt((Z,V)=>{V.exports=function(u){return u.end+u.size/1e6}}),h2=Vt((Z,V)=>{var u=xu(),d=y1(),E=f2(),A=Xg();V.exports=function(t,e){var r=d(t,e),i=r[0].z;E(e,i);var n=e.contours,o=u.extractOpts(e),a;if(n.coloring==="heatmap"&&o.auto&&e.autocontour===!1){var s=n.start,f=A(n),v=n.size||1,g=Math.floor((f-s)/v)+1;isFinite(v)||(v=1,g=1);var m=s-v/2,w=m+g*v;a=[m,w]}else a=i;return u.calc(t,e,{vals:a,cLetter:"z"}),r}}),$g=Vt((Z,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}}}),p2=Vt((Z,V)=>{var u=$g();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,f,v,g,m;for(n=0;n<t-1;n++)for(a=[],n===0&&(a=a.concat(u.BOTTOMSTART)),n===t-2&&(a=a.concat(u.TOPSTART)),i=0;i<e-1;i++)for(o=a.slice(),i===0&&(o=o.concat(u.LEFTSTART)),i===e-2&&(o=o.concat(u.RIGHTSTART)),s=i+","+n,f=[[A[n][i],A[n][i+1]],[A[n+1][i],A[n+1][i+1]]],m=0;m<E.length;m++)g=E[m],v=d(g.level,f),v&&(g.crossings[s]=v,o.indexOf(v)!==-1&&(g.starts.push([i,n]),r&&o.indexOf(v,o.indexOf(v)+1)!==-1&&g.starts.push([i,n])))};function d(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}}),d2=Vt((Z,V)=>{var u=Xr(),d=$g();V.exports=function(i,n,o){var a,s,f,v,g;for(n=n||.01,o=o||.01,f=0;f<i.length;f++){for(v=i[f],g=0;g<v.starts.length;g++)s=v.starts[g],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&&u.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 f=n.join(","),v=i.crossings[f],g=e(v,o,n),m=[r(i,n,[-g[0],-g[1]])],w=i.z.length,l=i.z[0].length,x=n.slice(),y=g.slice(),S;for(S=0;S<1e4;S++){if(v>20?(v=d.CHOOSESADDLE[v][(g[0]||g[1])<0?0:1],i.crossings[f]=d.SADDLEREMAINDER[v]):delete i.crossings[f],g=d.NEWDELTA[v],!g){u.log("Found bad marching index:",v,n,i.level);break}m.push(r(i,n,g)),n[0]+=g[0],n[1]+=g[1],f=n.join(","),E(m[m.length-1],m[m.length-2],a,s)&&m.pop();var k=g[0]&&(n[0]<0||n[0]>l-2)||g[1]&&(n[1]<0||n[1]>w-2),M=n[0]===x[0]&&n[1]===x[1]&&g[0]===y[0]&&g[1]===y[1];if(M||o&&k)break;v=i.crossings[f]}S===1e4&&u.log("Infinite loop in contour?");var T=E(m[0],m[m.length-1],a,s),c=0,h=.2*i.smoothing,b=[],_=0,P,L,D,B,R,I,F,N,j,G,rt;for(S=1;S<m.length;S++)F=A(m[S],m[S-1]),c+=F,b.push(F);var ct=c/b.length*h;function st(ot){return m[ot%m.length]}for(S=m.length-2;S>=_;S--)if(P=b[S],P<ct){for(D=0,L=S-1;L>=_&&P+b[L]<ct;L--)P+=b[L];if(T&&S===m.length-2)for(D=0;D<L&&P+b[D]<ct;D++)P+=b[D];R=S-L+D+1,I=Math.floor((S+L+D+2)/2),!T&&S===m.length-2?B=m[m.length-1]:!T&&L===-1?B=m[0]:R%2?B=st(I):B=[(st(I)[0]+st(I+1)[0])/2,(st(I)[1]+st(I+1)[1])/2],m.splice(L+1,S-L+1,B),S=L+1,D&&(_=D),T&&(S===m.length-2?m[D]=m[m.length-1]:S===0&&(m[m.length-1]=m[0]))}for(m.splice(0,_),S=0;S<m.length;S++)m[S].length=2;if(!(m.length<2))if(T)m.pop(),i.paths.push(m);else{o||u.log("Unclosed interior contour?",i.level,x.join(","),m.join("L"));var et=!1;for(N=0;N<i.edgepaths.length;N++)if(G=i.edgepaths[N],!et&&E(G[0],m[m.length-1],a,s)){m.pop(),et=!0;var K=!1;for(j=0;j<i.edgepaths.length;j++)if(rt=i.edgepaths[j],E(rt[rt.length-1],m[0],a,s)){K=!0,m.shift(),i.edgepaths.splice(N,1),j===N?i.paths.push(m.concat(rt)):(j>N&&j--,i.edgepaths[j]=rt.concat(m,G));break}K||(i.edgepaths[N]=m.concat(G))}for(N=0;N<i.edgepaths.length&&!et;N++)G=i.edgepaths[N],E(G[G.length-1],m[0],a,s)&&(m.shift(),i.edgepaths[N]=G.concat(m),et=!0);et||i.edgepaths.push(m)}}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:d.BOTTOMSTART.indexOf(i)!==-1?s=1:d.LEFTSTART.indexOf(i)!==-1?a=1:d.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),f=i.z[s][a],v=i.xaxis,g=i.yaxis;if(o[1]){var m=(i.level-f)/(i.z[s][a+1]-f),w=(m!==1?(1-m)*v.c2l(i.x[a]):0)+(m!==0?m*v.c2l(i.x[a+1]):0);return[v.c2p(v.l2c(w),!0),g.c2p(i.y[s],!0),a+m,s]}else{var l=(i.level-f)/(i.z[s+1][a]-f),x=(l!==1?(1-l)*g.c2l(i.y[s]):0)+(l!==0?l*g.c2l(i.y[s+1]):0);return[v.c2p(i.x[a],!0),g.c2p(g.l2c(x),!0),a,s+l]}}}),J6=Vt((Z,V)=>{var u=M1(),d=Lo();V.exports={"[]":A("[]"),"][":A("]["),">":t(">"),"<":t("<"),"=":t("=")};function E(e,r){var i=Array.isArray(r),n;function o(a){return d(a)?+a:null}return u.COMPARISON_OPS2.indexOf(e)!==-1?n=o(i?r[0]:r):u.INTERVAL_OPS.indexOf(e)!==-1?n=i?[o(r[0]),o(r[1])]:[o(r),o(r)]:u.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}}}}),m2=Vt((Z,V)=>{var u=Xr(),d=J6(),E=Xg();V.exports=function(A,t,e){for(var r=A.type==="constraint"?d[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},f=r.start;f<o;f+=i)if(n.push(u.extendFlat({level:f,crossings:{},starts:[],edgepaths:[],paths:[],z:e.z,smoothing:e.trace.line.smoothing},s)),n.length>1e3){u.warn("Too many contours, clipping at 1000",A);break}return n}}),g2=Vt((Z,V)=>{var u=Xr();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&&u.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&&u.warn("Contour data invalid for the specified inequality range operation."),e=d(E[0]),r=d(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 d(E){return u.extendFlat({},E,{edgepaths:u.extendDeep([],E.edgepaths),paths:u.extendDeep([],E.paths),starts:u.extendDeep([],E.starts)})}}),v2=Vt((Z,V)=>{V.exports=function(u,d){var E=u[0],A=E.z,t;switch(d.type){case"levels":var e=Math.min(A[0][0],A[0][1]);for(t=0;t<u.length;t++){var r=u[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=d.value,f,v;switch(d._operation){case">":s>o&&(E.prefixBoundary=!0);break;case"<":(s<a||E.starts.length&&s===a)&&(E.prefixBoundary=!0);break;case"[]":f=Math.min(s[0],s[1]),v=Math.max(s[0],s[1]),(v<a||f>o||E.starts.length&&v===a)&&(E.prefixBoundary=!0);break;case"][":f=Math.min(s[0],s[1]),v=Math.max(s[0],s[1]),f<a&&v>o&&(E.prefixBoundary=!0);break}break}}}),z1=Vt(Z=>{var V=Ni(),u=Xr(),d=Eo(),E=xu(),A=Dl(),t=yo(),e=mp(),r=_1(),i=p2(),n=d2(),o=m2(),a=g2(),s=v2(),f=$g(),v=f.LABELOPTIMIZER;Z.plot=function(k,M,T,c){var h=M.xaxis,b=M.yaxis;u.makeTraceGroups(c,T,"contour").each(function(_){var P=V.select(this),L=_[0],D=L.trace,B=L.x,R=L.y,I=D.contours,F=o(I,M,L),N=u.ensureSingle(P,"g","heatmapcoloring"),j=[];I.coloring==="heatmap"&&(j=[_]),r(k,M,j,N),i(F),n(F);var G=h.c2p(B[0],!0),rt=h.c2p(B[B.length-1],!0),ct=b.c2p(R[0],!0),st=b.c2p(R[R.length-1],!0),et=[[G,st],[rt,st],[rt,ct],[G,ct]],K=F;I.type==="constraint"&&(K=a(F,I._operation)),g(P,et,I),m(P,K,et,I),l(P,F,k,L,I),y(P,M,k,L,et)})};function g(k,M,T){var c=u.ensureSingle(k,"g","contourbg"),h=c.selectAll("path").data(T.coloring==="fill"?[0]:[]);h.enter().append("path"),h.exit().remove(),h.attr("d","M"+M.join("L")+"Z").style("stroke","none")}function m(k,M,T,c){var h=c.coloring==="fill"||c.type==="constraint"&&c._operation!=="=",b="M"+T.join("L")+"Z";h&&s(M,c);var _=u.ensureSingle(k,"g","contourfill"),P=_.selectAll("path").data(h?M:[]);P.enter().append("path"),P.exit().remove(),P.each(function(L){var D=(L.prefixBoundary?b:"")+w(L,T);D?V.select(this).attr("d",D).style("stroke","none"):V.select(this).remove()})}function w(k,M){var T="",c=0,h=k.edgepaths.map(function(rt,ct){return ct}),b=!0,_,P,L,D,B,R;function I(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(;h.length;){for(R=d.smoothopen(k.edgepaths[c],k.smoothing),T+=b?R:R.replace(/^M/,"L"),h.splice(h.indexOf(c),1),_=k.edgepaths[c][k.edgepaths[c].length-1],D=-1,L=0;L<4;L++){if(!_){u.log("Missing end?",c,k);break}for(I(_)&&!j(_)?P=M[1]:N(_)?P=M[0]:F(_)?P=M[3]:j(_)&&(P=M[2]),B=0;B<k.edgepaths.length;B++){var G=k.edgepaths[B][0];Math.abs(_[0]-P[0])<.01?Math.abs(_[0]-G[0])<.01&&(G[1]-_[1])*(P[1]-G[1])>=0&&(P=G,D=B):Math.abs(_[1]-P[1])<.01?Math.abs(_[1]-G[1])<.01&&(G[0]-_[0])*(P[0]-G[0])>=0&&(P=G,D=B):u.log("endpt to newendpt is not vert. or horz.",_,P,G)}if(_=P,D>=0)break;T+="L"+P}if(D===k.edgepaths.length){u.log("unclosed perimeter path");break}c=D,b=h.indexOf(c)===-1,b&&(c=h[0],T+="Z")}for(c=0;c<k.paths.length;c++)T+=d.smoothclosed(k.paths[c],k.smoothing);return T}function l(k,M,T,c,h){var b=T._context.staticPlot,_=u.ensureSingle(k,"g","contourlines"),P=h.showlines!==!1,L=h.showlabels,D=P&&L,B=Z.createLines(_,P||L,M,b),R=Z.createLineClip(_,D,T,c.trace.uid),I=k.selectAll("g.contourlabels").data(L?[0]:[]);if(I.exit().remove(),I.enter().append("g").classed("contourlabels",!0),L){var F=[],N=[];u.clearLocationCache();var j=Z.labelFormatter(T,c),G=d.tester.append("text").attr("data-notex",1).call(d.font,h.labelfont),rt=M[0].xaxis,ct=M[0].yaxis,st=rt._length,et=ct._length,K=rt.range,ot=ct.range,X=u.aggNums(Math.min,null,c.x),Q=u.aggNums(Math.max,null,c.x),ut=u.aggNums(Math.min,null,c.y),J=u.aggNums(Math.max,null,c.y),q=Math.max(rt.c2p(X,!0),0),it=Math.min(rt.c2p(Q,!0),st),nt=Math.max(ct.c2p(J,!0),0),dt=Math.min(ct.c2p(ut,!0),et),Tt={};K[0]<K[1]?(Tt.left=q,Tt.right=it):(Tt.left=it,Tt.right=q),ot[0]<ot[1]?(Tt.top=nt,Tt.bottom=dt):(Tt.top=dt,Tt.bottom=nt),Tt.middle=(Tt.top+Tt.bottom)/2,Tt.center=(Tt.left+Tt.right)/2,F.push([[Tt.left,Tt.top],[Tt.right,Tt.top],[Tt.right,Tt.bottom],[Tt.left,Tt.bottom]]);var wt=Math.sqrt(st*st+et*et),It=f.LABELDISTANCE*wt/Math.max(1,M.length/f.LABELINCREASE);B.each(function(Ct){var Nt=Z.calcTextOpts(Ct.level,j,G,T);V.select(this).selectAll("path").each(function(){var ee=this,Jt=u.getVisibleSegment(ee,Tt,Nt.height/2);if(Jt&&!(Jt.len<(Nt.width+Nt.height)*f.LABELMIN))for(var te=Math.min(Math.ceil(Jt.len/It),f.LABELMAX),Kt=0;Kt<te;Kt++){var mt=Z.findBestTextLocation(ee,Jt,Nt,N,Tt);if(!mt)break;Z.addLabelData(mt,Nt,N,F)}})}),G.remove(),Z.drawLabels(I,N,T,R,D?F:null)}L&&!P&&B.remove()}Z.createLines=function(k,M,T,c){var h=T[0].smoothing,b=k.selectAll("g.contourlevel").data(M?T:[]);if(b.exit().remove(),b.enter().append("g").classed("contourlevel",!0),M){var _=b.selectAll("path.openline").data(function(L){return L.pedgepaths||L.edgepaths});_.exit().remove(),_.enter().append("path").classed("openline",!0),_.attr("d",function(L){return d.smoothopen(L,h)}).style("stroke-miterlimit",1).style("vector-effect",c?"none":"non-scaling-stroke");var P=b.selectAll("path.closedline").data(function(L){return L.ppaths||L.paths});P.exit().remove(),P.enter().append("path").classed("closedline",!0),P.attr("d",function(L){return d.smoothclosed(L,h)}).style("stroke-miterlimit",1).style("vector-effect",c?"none":"non-scaling-stroke")}return b},Z.createLineClip=function(k,M,T,c){var h=T._fullLayout._clips,b=M?"clipline"+c:null,_=h.selectAll("#"+b).data(M?[0]:[]);return _.exit().remove(),_.enter().append("clipPath").classed("contourlineclip",!0).attr("id",b),d.setClipUrl(k,b,T),_},Z.labelFormatter=function(k,M){var T=k._fullLayout,c=M.trace,h=c.contours,b={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(h.labelformat)b.tickformat=h.labelformat,e(b,T);else{var _=E.extractOpts(c);if(_&&_.colorbar&&_.colorbar._axis)b=_.colorbar._axis;else{if(h.type==="constraint"){var P=h.value;u.isArrayOrTypedArray(P)?b.range=[P[0],P[P.length-1]]:b.range=[P,P]}else b.range=[h.start,h.end],b.nticks=(h.end-h.start)/h.size;b.range[0]===b.range[1]&&(b.range[1]+=b.range[0]||1),b.nticks||(b.nticks=1e3),e(b,T),t.prepTicks(b),b._tmin=null,b._tmax=null}}return function(L){return t.tickText(b,L).text}},Z.calcTextOpts=function(k,M,T,c){var h=M(k);T.text(h).call(A.convertToTspans,c);var b=T.node(),_=d.bBox(b,!0);return{text:h,width:_.width,height:_.height,fontSize:+b.style["font-size"].replace("px",""),level:k,dy:(_.top+_.bottom)/2}},Z.findBestTextLocation=function(k,M,T,c,h){var b=T.width,_,P,L,D,B;M.isClosed?(P=M.len/v.INITIALSEARCHPOINTS,_=M.min+P/2,L=M.max):(P=(M.len-b)/(v.INITIALSEARCHPOINTS+1),_=M.min+P+b/2,L=M.max-(P+b)/2);for(var R=1/0,I=0;I<v.ITERATIONS;I++){for(var F=_;F<L;F+=P){var N=u.getTextLocation(k,M.total,F,b),j=x(N,T,c,h);j<R&&(R=j,B=N,D=F)}if(R>v.MAXCOST*2)break;I&&(P/=2),_=D-P/2,L=_+P*1.5}if(R<=v.MAXCOST)return B};function x(k,M,T,c){var h=M.width/2,b=M.height/2,_=k.x,P=k.y,L=k.theta,D=Math.cos(L)*h,B=Math.sin(L)*h,R=(_>c.center?c.right-_:_-c.left)/(D+Math.abs(Math.sin(L)*b)),I=(P>c.middle?c.bottom-P:P-c.top)/(Math.abs(B)+Math.cos(L)*b);if(R<1||I<1)return 1/0;var F=v.EDGECOST*(1/(R-1)+1/(I-1));F+=v.ANGLECOST*L*L;for(var N=_-D,j=P-B,G=_+D,rt=P+B,ct=0;ct<T.length;ct++){var st=T[ct],et=Math.cos(st.theta)*st.width/2,K=Math.sin(st.theta)*st.width/2,ot=u.segmentDistance(N,j,G,rt,st.x-et,st.y-K,st.x+et,st.y+K)*2/(M.height+st.height),X=st.level===M.level,Q=X?v.SAMELEVELDISTANCE:1;if(ot<=Q)return 1/0;var ut=v.NEIGHBORCOST*(X?v.SAMELEVELFACTOR:1);F+=ut/(ot-Q)}return F}Z.addLabelData=function(k,M,T,c){var h=M.fontSize,b=M.width+h/3,_=Math.max(0,M.height-h/3),P=k.x,L=k.y,D=k.theta,B=Math.sin(D),R=Math.cos(D),I=function(N,j){return[P+N*R-j*B,L+N*B+j*R]},F=[I(-b/2,-_/2),I(-b/2,_/2),I(b/2,_/2),I(b/2,-_/2)];T.push({text:M.text,x:P,y:L,dy:M.dy,theta:D,level:M.level,width:b,height:_}),c.push(F)},Z.drawLabels=function(k,M,T,c,h){var b=k.selectAll("text").data(M,function(D){return D.text+","+D.x+","+D.y+","+D.theta});if(b.exit().remove(),b.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(D){var B=D.x+Math.sin(D.theta)*D.dy,R=D.y-Math.cos(D.theta)*D.dy;V.select(this).text(D.text).attr({x:B,y:R,transform:"rotate("+180*D.theta/Math.PI+" "+B+" "+R+")"}).call(A.convertToTspans,T)}),h){for(var _="",P=0;P<h.length;P++)_+="M"+h[P].join("L")+"Z";var L=u.ensureSingle(c,"path","");L.attr("d",_)}};function y(k,M,T,c,h){var b=c.trace,_=T._fullLayout._clips,P="clip"+b.uid,L=_.selectAll("#"+P).data(b.connectgaps?[]:[0]);if(L.enter().append("clipPath").classed("contourclip",!0).attr("id",P),L.exit().remove(),b.connectgaps===!1){var D={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:M.xaxis,yaxis:M.yaxis,x:c.x,y:c.y,z:S(c),smoothing:0};i([D]),n([D]),s([D],{type:"levels"});var B=u.ensureSingle(L,"path","");B.attr("d",(D.prefixBoundary?"M"+h.join("L")+"Z":"")+w(D,h))}else P=null;d.setClipUrl(k,P,T)}function S(k){var M=k.trace._emptypoints,T=[],c=k.z.length,h=k.z[0].length,b,_=[],P;for(b=0;b<h;b++)_.push(1);for(b=0;b<c;b++)T.push(_.slice());for(b=0;b<M.length;b++)P=M[b],T[P[0]][P[1]]=0;return k.zmask=T,T}}),y2=Vt((Z,V)=>{var u=Ni(),d=xu(),E=Xg();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=d.extractOpts(A);isFinite(i)||(i=1,n=1);var s=a.reversescale?d.flipScale(a.colorscale):a.colorscale,f=s.length,v=new Array(f),g=new Array(f),m,w,l=a.min,x=a.max;if(t.coloring==="heatmap"){for(w=0;w<f;w++)m=s[w],v[w]=m[0]*(x-l)+l,g[w]=m[1];var y=u.extent([l,x,t.start,t.start+i*(n-1)]),S=y[l<x?0:1],k=y[l<x?1:0];S!==l&&(v.splice(0,0,S),g.splice(0,0,g[0])),k!==x&&(v.push(k),g.push(g[g.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),w=0;w<f;w++)m=s[w],v[w]=(m[0]*(n+o-1)-o/2)*i+e,g[w]=m[1];(M||A.autocontour)&&(v[0]>l&&(v.unshift(l),g.unshift(g[0])),v[v.length-1]<x&&(v.push(x),g.push(g[g.length-1])))}return d.makeColorScaleFunc({domain:v,range:g},{noNumericCheck:!0})}}),L1=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=b1(),A=y2();V.exports=function(t){var e=u.select(t).selectAll("g.contour");e.style("opacity",function(r){return r[0].trace.opacity}),e.each(function(r){var i=u.select(this),n=r[0].trace,o=n.contours,a=n.line,s=o.size||1,f=o.start,v=o.type==="constraint",g=!v&&o.coloring==="lines",m=!v&&o.coloring==="fill",w=g||m?A(n):null;i.selectAll("g.contourlevel").each(function(y){u.select(this).selectAll("path").call(d.lineGroupStyle,a.width,g?w(y.level):a.color,a.dash)});var l=o.labelfont;if(i.selectAll("g.contourlabels text").each(function(y){d.font(u.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||(g?w(y.level):a.color)})}),v)i.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(m){var x;i.selectAll("g.contourfill path").style("fill",function(y){return x===void 0&&(x=y.level),w(y.level+.5*s)}),x===void 0&&(x=f),i.selectAll("g.contourbg path").style("fill",w(x-.5*s))}}),E(t)}}),C1=Vt((Z,V)=>{var u=xu(),d=y2(),E=Xg();function A(t,e,r){var i=e.contours,n=e.line,o=i.size||1,a=i.coloring,s=d(e,{isColorbar:!0});if(a==="heatmap"){var f=u.extractOpts(e);r._fillgradient=f.reversescale?u.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.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}}),x2=Vt((Z,V)=>{var u=Pi(),d=w1();V.exports=function(E,A,t,e,r){r||(r={}),r.isContour=!0;var i=d(E,A,t,e,r);return i&&i.forEach(function(n){var o=n.trace;o.contours.type==="constraint"&&(o.fillcolor&&u.opacity(o.fillcolor)?n.color=u.addOpacity(o.fillcolor,1):o.contours.showlines&&u.opacity(o.line.color)&&(n.color=u.addOpacity(o.line.color,1)))}),i}}),Q6=Vt((Z,V)=>{V.exports={attributes:u2(),supplyDefaults:$6(),crossTraceDefaults:k1(),calc:h2(),plot:z1().plot,layerName:"contourlayer",style:L1(),colorbar:C1(),hoverPoints:x2(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),tA=Vt((Z,V)=>{V.exports=Q6()}),_2=Vt((Z,V)=>{var u=Lo(),d=c2(),E=Pi(),A=E.addOpacity,t=E.opacity,e=M1(),r=Xr().isArrayOrTypedArray,i=e.CONSTRAINT_REDUCTION,n=e.COMPARISON_OPS2;V.exports=function(a,s,f,v,g,m){var w=s.contours,l,x,y,S=f("contours.operation");if(w._operation=i[S],o(f,w),S==="="?l=w.showlines=!0:(l=f("contours.showlines"),y=f("fillcolor",A((a.line||{}).color||g,.5))),l){var k=y&&t(y)?A(s.fillcolor,1):g;x=f("line.color",k),f("line.width",2),f("line.dash")}f("line.smoothing"),d(f,v,x,m)};function o(a,s){var f;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?(f=parseFloat(s.value[0]),s.value=[f,f+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:u(s.value)&&(f=parseFloat(s.value),s.value=[f,f+1])):(a("contours.value",0),u(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}),eA=Vt((Z,V)=>{var u=Xr(),d=p1(),E=tp(),A=_2(),t=S1(),e=E1(),r=Kg(),i=Yg();V.exports=function(n,o,a,s){function f(w,l){return u.coerce(n,o,i,w,l)}function v(w){return u.coerce2(n,o,i,w)}var g=d(n,o,f,s);if(!g){o.visible=!1;return}E(n,o,s,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate"),f("hovertemplatefallback");var m=f("contours.type")==="constraint";f("connectgaps",u.isArray1D(o.z)),m?A(n,o,f,s,a):(t(n,o,f,v),e(n,o,f,s)),o.contours&&o.contours.coloring==="heatmap"&&r(f,s),f("zorder")}}),rA=Vt((Z,V)=>{V.exports={attributes:Yg(),supplyDefaults:eA(),calc:h2(),plot:z1().plot,style:L1(),colorbar:C1(),hoverPoints:x2(),moduleType:"trace",name:"contour",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),nA=Vt((Z,V)=>{V.exports=rA()}),b2=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Qh(),t=pc(),e=Tl(),r=Wl(),i=Cf().dash,n=So().extendFlat,o=t.marker,a=t.line,s=o.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:n({},t.mode,{dflt:"markers"}),text:n({},t.text,{}),texttemplate:d({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:n({},t.hovertext,{}),line:{color:a.color,width:a.width,dash:i,backoff:a.backoff,shape:n({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:t.connectgaps,cliponaxis:t.cliponaxis,fill:n({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:n({symbol:o.symbol,opacity:o.opacity,angle:o.angle,angleref:o.angleref,standoff:o.standoff,maxdisplayed:o.maxdisplayed,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:n({width:s.width,editType:"calc"},r("marker.line")),gradient:o.gradient,editType:"calc"},r("marker")),textfont:t.textfont,textposition:t.textposition,selected:t.selected,unselected:t.unselected,hoverinfo:n({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:t.hoveron,hovertemplate:u(),hovertemplatefallback:E()}}),aA=Vt((Z,V)=>{var u=Xr(),d=gp(),E=nu(),A=zh(),t=Bh(),e=wm(),r=Rh(),i=ep(),n=b2();V.exports=function(o,a,s,f){function v(S,k){return u.coerce(o,a,n,S,k)}var g=v("a"),m=v("b"),w=v("c"),l;if(g?(l=g.length,m?(l=Math.min(l,m.length),w&&(l=Math.min(l,w.length))):w?l=Math.min(l,w.length):l=0):m&&w&&(l=Math.min(m.length,w.length)),!l){a.visible=!1;return}a._length=l,v("sum"),v("text"),v("hovertext"),a.hoveron!=="fills"&&(v("hovertemplate"),v("hovertemplatefallback"));var x=l<d.PTS_LINESONLY?"lines+markers":"lines";v("mode",x),E.hasMarkers(a)&&A(o,a,s,f,v,{gradient:!0}),E.hasLines(a)&&(t(o,a,s,f,v,{backoff:!0}),e(o,a,v),v("connectgaps")),E.hasText(a)&&(v("texttemplate"),v("texttemplatefallback"),r(o,a,f,v));var y=[];(E.hasMarkers(a)||E.hasText(a))&&(v("cliponaxis"),v("marker.maxdisplayed"),y.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")&&y.push("fills"),v("hoveron",y.join("+")||"points"),u.coerceSelectionMarkerOpacity(a,v)}}),iA=Vt((Z,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot;return t.aLabel=u.tickText(e.aaxis,d.a,!0).text,t.bLabel=u.tickText(e.baxis,d.b,!0).text,t.cLabel=u.tickText(e.caxis,d.c,!0).text,t}}),oA=Vt((Z,V)=>{var u=Lo(),d=Nh(),E=vp(),A=jh(),t=Uh().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,f={a:n.a,b:n.b,c:n.c},v=n.ids,g,m,w,l,x,y;for(g=0;g<e.length;g++)if(w=e[g],!f[w]){for(x=f[r[w][0]],y=f[r[w][1]],l=new Array(x.length),m=0;m<x.length;m++)l[m]=s-x[m]-y[m];f[w]=l}var S=n._length,k=new Array(S),M,T,c,h,b,_;for(g=0;g<S;g++)M=f.a[g],T=f.b[g],c=f.c[g],u(M)&&u(T)&&u(c)?(M=+M,T=+T,c=+c,h=a/(M+T+c),h!==1&&(M*=h,T*=h,c*=h),_=M,b=c-T,k[g]={x:b,y:_,a:M,b:T,c},v&&(k[g].id=v[g])):k[g]={x:!1,y:!1};return t(n,S),d(i,n),E(k,n),A(k,n),k}}),sA=Vt((Z,V)=>{var u=Tm();V.exports=function(d,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)}u(d,i,A,n)}}),lA=Vt((Z,V)=>{var u=Am();V.exports=function(d,E,A,t){var e=u(d,E,A,t);if(!e||e[0].index===!1)return;var r=e[0];if(r.index===void 0){var i=1-r.y0/d.ya._length,n=d.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],f=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 g={};g[f.subplot]={_subplot:v};var m=f._module.formatLabels(s,f,g);r.aLabel=m.aLabel,r.bLabel=m.bLabel,r.cLabel=m.cLabel;var w=s.hi||f.hoverinfo,l=[];function x(S,k){l.push(S._hovertitle+": "+k)}if(!f.hovertemplate){var y=w.split("+");y.indexOf("all")!==-1&&(y=["a","b","c"]),y.indexOf("a")!==-1&&x(v.aaxis,r.aLabel),y.indexOf("b")!==-1&&x(v.baxis,r.bLabel),y.indexOf("c")!==-1&&x(v.caxis,r.cLabel)}return r.extraText=l.join("<br>"),r.hovertemplate=f.hovertemplate,e}}),uA=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){if(d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),A[t]){var e=A[t];u.a=e.a,u.b=e.b,u.c=e.c}else u.a=d.a,u.b=d.b,u.c=d.c;return u}}),cA=Vt((Z,V)=>{var u=Ni(),d=kf(),E=ji(),A=Xr(),t=A.strTranslate,e=A._,r=Pi(),i=Eo(),n=mp(),o=So().extendFlat,a=Uu(),s=yo(),f=ih(),v=hc(),g=Jh(),m=g.freeMode,w=g.rectMode,l=o0(),x=Sc().prepSelect,y=Sc().selectOnClick,S=Sc().clearOutline,k=Sc().clearSelectionsCache,M=Af();function T(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=T;var c=T.prototype;c.init=function(F){this.container=F._ternarylayer,this.defs=F._defs,this.layoutId=F._uid,this.traceHash={},this.layers={}},c.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 st=F[ct][0].trace;if(st.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)},c.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(st){st.append("path").attr("d","M0,0Z")}),N.clipDefRelative=A.ensureSingleById(F._clips,"clipPath",ct,function(st){st.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)},c.updateFx=function(F){F._ternarylayer.selectAll("g.toplevel").style("cursor",F.dragmode==="pan"?"move":"crosshair")},c.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(st){return"toplevel "+st}).each(function(st){var et=u.select(this);j[st]=et,st==="frontplot"?et.append("g").classed("scatterlayer",!0):st==="backplot"?et.append("g").classed("maplayer",!0):st==="plotbg"?et.append("path").attr("d","M0,0Z"):st==="aline"||st==="bline"||st==="cline"?et.append("path"):st==="grids"&&ct.forEach(function(K){j[K]=et.append("g").classed("grid "+K,!0)})}),rt.order()};var h=Math.sqrt(4/3);c.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,st=G.x[1]-G.x[0],et=G.y[1]-G.y[0],K=st*N.w,ot=et*N.h,X=F.sum,Q=F.aaxis.min,ut=F.baxis.min,J=F.caxis.min,q,it,nt,dt,Tt,wt;K>h*ot?(dt=ot,nt=dt*h):(nt=K,dt=nt/h),Tt=st*nt/K,wt=et*dt/ot,q=N.l+N.w*rt-nt/2,it=N.t+N.h*(1-ct)-dt/2,j.x0=q,j.y0=it,j.w=nt,j.h=dt,j.sum=X,j.xaxis={type:"linear",range:[Q+2*J-X,X-Q-2*ut],domain:[rt-Tt/2,rt+Tt/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,X-ut-J],domain:[ct-wt/2,ct+wt/2],_id:"y"},n(j.yaxis,j.graphDiv._fullLayout),j.yaxis.setScale(),j.yaxis.isPtWithinRange=function(){return!0};var It=j.yaxis.domain[0],Ct=j.aaxis=o({},F.aaxis,{range:[Q,X-ut-J],side:"left",tickangle:(+F.aaxis.tickangle||0)-30,domain:[It,It+wt*h],anchor:"free",position:0,_id:"y",_length:nt});n(Ct,j.graphDiv._fullLayout),Ct.setScale();var Nt=j.baxis=o({},F.baxis,{range:[X-Q-J,ut],side:"bottom",domain:j.xaxis.domain,anchor:"free",position:0,_id:"x",_length:nt});n(Nt,j.graphDiv._fullLayout),Nt.setScale();var ee=j.caxis=o({},F.caxis,{range:[X-Q-ut,J],side:"right",tickangle:(+F.caxis.tickangle||0)+30,domain:[It,It+wt*h],anchor:"free",position:0,_id:"y",_length:nt});n(ee,j.graphDiv._fullLayout),ee.setScale();var Jt="M"+q+","+(it+dt)+"h"+nt+"l-"+nt/2+",-"+dt+"Z";j.clipDef.select("path").attr("d",Jt),j.layers.plotbg.select("path").attr("d",Jt);var te="M0,"+dt+"h"+nt+"l-"+nt/2+",-"+dt+"Z";j.clipDefRelative.select("path").attr("d",te);var Kt=t(q,it);j.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Kt),j.clipDefRelative.select("path").attr("transform",null);var mt=t(q-Nt._offset,it+dt);j.layers.baxis.attr("transform",mt),j.layers.bgrid.attr("transform",mt);var bt=t(q+nt/2,it)+"rotate(30)"+t(0,-Ct._offset);j.layers.aaxis.attr("transform",bt),j.layers.agrid.attr("transform",bt);var vt=t(q+nt/2,it)+"rotate(-30)"+t(0,-ee._offset);j.layers.caxis.attr("transform",vt),j.layers.cgrid.attr("transform",vt),j.drawAxes(!0),j.layers.aline.select("path").attr("d",Ct.showline?"M"+q+","+(it+dt)+"l"+nt/2+",-"+dt:"M0,0").call(r.stroke,Ct.linecolor||"#000").style("stroke-width",(Ct.linewidth||0)+"px"),j.layers.bline.select("path").attr("d",Nt.showline?"M"+q+","+(it+dt)+"h"+nt:"M0,0").call(r.stroke,Nt.linecolor||"#000").style("stroke-width",(Nt.linewidth||0)+"px"),j.layers.cline.select("path").attr("d",ee.showline?"M"+(q+nt/2)+","+it+"l"+nt/2+","+dt:"M0,0").call(r.stroke,ee.linecolor||"#000").style("stroke-width",(ee.linewidth||0)+"px"),j.graphDiv._context.staticPlot||j.initInteractions(),i.setClipUrl(j.layers.frontplot,j._hasClipOnAxisFalse?null:j.clipId,j.graphDiv)},c.drawAxes=function(F){var N=this,j=N.graphDiv,G=N.id.substr(7)+"title",rt=N.layers,ct=N.aaxis,st=N.baxis,et=N.caxis;if(N.drawAx(ct),N.drawAx(st),N.drawAx(et),F){var K=Math.max(ct.showticklabels?ct.tickfont.size/2:0,(et.showticklabels?et.tickfont.size*.75:0)+(et.ticks==="outside"?et.ticklen*.87:0)),ot=(st.showticklabels?st.tickfont.size:0)+(st.ticks==="outside"?st.ticklen:0)+3;rt["a-title"]=l.draw(j,"a"+G,{propContainer:ct,propName:N.id+".aaxis.title.text",placeholder:e(j,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-ct.title.font.size/3-K,"text-anchor":"middle"}}),rt["b-title"]=l.draw(j,"b"+G,{propContainer:st,propName:N.id+".baxis.title.text",placeholder:e(j,"Click to enter Component B title"),attributes:{x:N.x0-ot,y:N.y0+N.h+st.title.font.size*.83+ot,"text-anchor":"middle"}}),rt["c-title"]=l.draw(j,"c"+G,{propContainer:et,propName:N.id+".caxis.title.text",placeholder:e(j,"Click to enter Component C title"),attributes:{x:N.x0+N.w+ot,y:N.y0+N.h+et.title.font.size*.83+ot,"text-anchor":"middle"}})}},c.drawAx=function(F){var N=this,j=N.graphDiv,G=F._name,rt=G.charAt(0),ct=F._id,st=N.layers[G],et=30,K=rt+"tickLayout",ot=b(F);N[K]!==ot&&(st.selectAll("."+ct+"tick").remove(),N[K]=ot),F.setScale();var X=s.calcTicks(F),Q=s.clipEnds(F,X),ut=s.makeTransTickFn(F),J=s.getTickSigns(F)[2],q=A.deg2rad(et),it=J*(F.linewidth||1)/2,nt=J*F.ticklen,dt=N.w,Tt=N.h,wt=rt==="b"?"M0,"+it+"l"+Math.sin(q)*nt+","+Math.cos(q)*nt:"M"+it+",0l"+Math.cos(q)*nt+","+-Math.sin(q)*nt,It={a:"M0,0l"+Tt+",-"+dt/2,b:"M0,0l-"+dt/2+",-"+Tt,c:"M0,0l-"+Tt+","+dt/2}[rt];s.drawTicks(j,F,{vals:F.ticks==="inside"?Q:X,layer:st,path:wt,transFn:ut,crisp:!1}),s.drawGrid(j,F,{vals:Q,layer:N.layers[rt+"grid"],path:It,transFn:ut,crisp:!1}),s.drawLabels(j,F,{vals:X,layer:st,transFn:ut,labelFns:s.makeLabelFns(F,0,et)})};function b(F){return F.ticks+String(F.ticklen)+String(F.showticklabels)}var _=M.MINZOOM/2+.87,P="m-0.87,.5h"+_+"v3h-"+(_+5.2)+"l"+(_/2+2.6)+",-"+(_*.87+4.5)+"l2.6,1.5l-"+_/2+","+_*.87+"Z",L="m0.87,.5h-"+_+"v3h"+(_+5.2)+"l-"+(_/2+2.6)+",-"+(_*.87+4.5)+"l-2.6,1.5l"+_/2+","+_*.87+"Z",D="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;c.clearOutline=function(){k(this.dragOptions),S(this.dragOptions.gd)},c.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(mt,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;m(Ut)?F.dragOptions.minDrag=1:F.dragOptions.minDrag=void 0,Ut==="zoom"?(F.dragOptions.moveFn=Nt,F.dragOptions.clickFn=dt,F.dragOptions.doneFn=ee,Tt(mt,bt,vt)):Ut==="pan"?(F.dragOptions.moveFn=te,F.dragOptions.clickFn=dt,F.dragOptions.doneFn=Kt,Jt(),F.clearOutline(j)):(w(Ut)||m(Ut))&&x(mt,bt,vt,F.dragOptions,Ut)}};var st,et,K,ot,X,Q,ut,J,q,it;function nt(mt){var bt={};return bt[F.id+".aaxis.min"]=mt.a,bt[F.id+".baxis.min"]=mt.b,bt[F.id+".caxis.min"]=mt.c,bt}function dt(mt,bt){var vt=j._fullLayout.clickmode;I(j),mt===2&&(j.emit("plotly_doubleclick",null),E.call("_guiRelayout",j,nt({a:0,b:0,c:0}))),vt.indexOf("select")>-1&&mt===1&&y(bt,j,[F.xaxis],[F.yaxis],F.id,F.dragOptions),vt.indexOf("event")>-1&&v.click(j,bt,F.id)}function Tt(mt,bt,vt){var Ut=N.getBoundingClientRect();st=bt-Ut.left,et=vt-Ut.top,j._fullLayout._calcInverseTransform(j);var re=j._fullLayout._invTransform,Zt=A.apply3DTransform(re)(st,et);st=Zt[0],et=Zt[1],K={a:F.aaxis.range[0],b:F.baxis.range[1],c:F.caxis.range[1]},X=K,ot=F.aaxis.range[1]-K.a,Q=d(F.graphDiv._fullLayout[F.id].bgcolor).getLuminance(),ut="M0,"+F.h+"L"+F.w/2+", 0L"+F.w+","+F.h+"Z",J=!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",ut),it=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 wt(mt,bt){return 1-bt/F.h}function It(mt,bt){return 1-(mt+(F.h-bt)/Math.sqrt(3))/F.w}function Ct(mt,bt){return(mt-(F.h-bt)/Math.sqrt(3))/F.w}function Nt(mt,bt){var vt=st+mt*rt,Ut=et+bt*ct,re=Math.max(0,Math.min(1,wt(st,et),wt(vt,Ut))),Zt=Math.max(0,Math.min(1,It(st,et),It(vt,Ut))),ue=Math.max(0,Math.min(1,Ct(st,et),Ct(vt,Ut))),Me=(re/2+ue)*F.w,Ce=(1-re/2-Zt)*F.w,We=(Me+Ce)/2,qe=Ce-Me,vr=(1-re)*F.h,_r=vr-qe/h;qe<M.MINZOOM?(X=K,q.attr("d",ut),it.attr("d","M0,0Z")):(X={a:K.a+re*ot,b:K.b+Zt*ot,c:K.c+ue*ot},q.attr("d",ut+"M"+Me+","+vr+"H"+Ce+"L"+We+","+_r+"L"+Me+","+vr+"Z"),it.attr("d","M"+st+","+et+B+"M"+Me+","+vr+P+"M"+Ce+","+vr+L+"M"+We+","+_r+D)),J||(q.transition().style("fill",Q>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),it.transition().style("opacity",1).duration(200),J=!0),j.emit("plotly_relayouting",nt(X))}function ee(){I(j),X!==K&&(E.call("_guiRelayout",j,nt(X)),R&&j.data&&j._context.showTips&&(A.notifier(e(j,"Double-click to zoom back out"),"long"),R=!1))}function Jt(){K={a:F.aaxis.range[0],b:F.baxis.range[1],c:F.caxis.range[1]},X=K}function te(mt,bt){var vt=mt/F.xaxis._m,Ut=bt/F.yaxis._m;X={a:K.a-Ut,b:K.b+(vt+Ut)/2,c:K.c-(vt-Ut)/2};var re=[X.a,X.b,X.c].sort(A.sorterAsc),Zt={a:re.indexOf(X.a),b:re.indexOf(X.b),c:re.indexOf(X.c)};re[0]<0&&(re[1]+re[0]/2<0?(re[2]+=re[0]+re[1],re[0]=re[1]=0):(re[2]+=re[0]/2,re[1]+=re[0]/2,re[0]=0),X={a:re[Zt.a],b:re[Zt.b],c:re[Zt.c]},bt=(K.a-X.a)*F.yaxis._m,mt=(K.c-X.c-K.b+X.b)*F.xaxis._m);var ue=t(F.x0+mt,F.y0+bt);F.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ue);var Me=t(-mt,-bt);F.clipDefRelative.select("path").attr("transform",Me),F.aaxis.range=[X.a,F.sum-X.b-X.c],F.baxis.range=[F.sum-X.a-X.c,X.b],F.caxis.range=[F.sum-X.a-X.b,X.c],F.drawAxes(!1),F._hasClipOnAxisFalse&&F.plotContainer.select(".scatterlayer").selectAll(".trace").call(i.hideOutsideRangePoints,F),j.emit("plotly_relayouting",nt(X))}function Kt(){E.call("_guiRelayout",j,nt(X))}N.onmousemove=function(mt){v.hover(j,mt,F.id),j._fullLayout._lasthover=N,j._fullLayout._hoversubplot=F.id},N.onmouseout=function(mt){j._dragging||f.unhover(j,mt)},f.init(this.dragOptions)};function I(F){u.select(F).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),w2=Vt((Z,V)=>{var u=nf(),d=Vu().attributes,E=Pf(),A=Cu().overrideAll,t=So().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:d({name:"ternary"}),bgcolor:{valType:"color",dflt:u.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"}}),zd=Vt((Z,V)=>{var u=Xr(),d=cl(),E=Vu().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],f=s.length,v=f&&s[0].replace(/\d+$/,""),g,m;function w(S,k){return u.coerce(g,m,n,S,k)}for(var l=0;l<f;l++){var x=s[l];A[x]?g=A[x]:g=A[x]={},m=d.newContainer(t,x,v),r.noUirevision||w("uirevision",t.uirevision);var y={};y[a]=[l/f,(l+1)/f],E(m,t,w,y),r.id=x,o(g,m,w,r)}}}),fA=Vt((Z,V)=>{var u=Pi(),d=cl(),E=Xr(),A=zd(),t=Td(),e=kd(),r=vm(),i=i0(),n=Ug(),o=w2(),a=["aaxis","baxis","caxis"];V.exports=function(v,g,m){A(v,g,m,{type:"ternary",attributes:o,handleDefaults:s,font:g.font,paper_bgcolor:g.paper_bgcolor})};function s(v,g,m,w){var l=m("bgcolor"),x=m("sum");w.bgColor=u.combine(l,w.paper_bgcolor);for(var y,S,k,M=0;M<a.length;M++)y=a[M],S=v[y]||{},k=d.newContainer(g,y),k._name=y,f(S,k,w,g);var T=g.aaxis,c=g.baxis,h=g.caxis;T.min+c.min+h.min>=x&&(T.min=0,c.min=0,h.min=0,v.aaxis&&delete v.aaxis.min,v.baxis&&delete v.baxis.min,v.caxis&&delete v.caxis.min)}function f(v,g,m,w){var l=o[g._name];function x(b,_){return E.coerce(v,g,l,b,_)}x("uirevision",w.uirevision),g.type="linear";var y=x("color"),S=y!==l.color.dflt?y:m.font.color,k=g._name,M=k.charAt(0).toUpperCase(),T="Component "+M,c=x("title.text",T);g._hovertitle=c===T?c:M,E.coerceFont(x,"title.font",m.font,{overrideDflt:{size:E.bigFont(m.font.size),color:S}}),x("min"),i(v,g,x,"linear"),e(v,g,x,"linear"),t(v,g,x,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(v,g,x,{outerTicks:!0});var h=x("showticklabels");h&&(E.coerceFont(x,"tickfont",m.font,{overrideDflt:{color:S}}),x("tickangle"),x("tickformat")),n(v,g,x,{dfltColor:y,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),x("hoverformat"),x("layer")}}),hA=Vt(Z=>{var V=cA(),u=If().getSubplotCalcData,d=Xr().counterRegex,E="ternary";Z.name=E;var A=Z.attr="subplot";Z.idRoot=E,Z.idRegex=Z.attrRegex=d(E);var t=Z.attributes={};t[A]={valType:"subplotid",dflt:"ternary",editType:"calc"},Z.layoutAttributes=w2(),Z.supplyLayoutDefaults=fA(),Z.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=u(i,E,a),f=r[a]._subplot;f||(f=new V({id:a,graphDiv:e,container:r._ternarylayer.node()},r),r[a]._subplot=f),f.plot(s,r,e._promises)}},Z.clean=function(e,r,i,n){for(var o=n._subplots[E]||[],a=0;a<o.length;a++){var s=o[a],f=n[s]._subplot;!r[s]&&f&&(f.plotContainer.remove(),f.clipDef.remove(),f.clipDefRelative.remove(),f.layers["a-title"].remove(),f.layers["b-title"].remove(),f.layers["c-title"].remove())}},Z.updateFx=function(e){var r=e._fullLayout;r._ternarylayer.selectAll("g.toplevel").style("cursor",r.dragmode==="pan"?"move":"crosshair")}}),pA=Vt((Z,V)=>{V.exports={attributes:b2(),supplyDefaults:aA(),colorbar:Gf(),formatLabels:iA(),calc:oA(),plot:sA(),style:mh().style,styleOnSelect:mh().styleOnSelect,hoverPoints:lA(),selectPoints:Mm(),eventData:uA(),moduleType:"trace",name:"scatterternary",basePlotModule:hA(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),dA=Vt((Z,V)=>{V.exports=pA()}),T2=Vt((Z,V)=>{var u=Wg(),d=So().extendFlat,E=fc().axisHoverFormat;V.exports={y:u.y,x:u.x,x0:u.x0,y0:u.y0,xhoverformat:E("x"),yhoverformat:E("y"),name:d({},u.name,{}),orientation:d({},u.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:u.fillcolor,points:d({},u.boxpoints,{}),jitter:d({},u.jitter,{}),pointpos:d({},u.pointpos,{}),width:d({},u.width,{}),marker:u.marker,text:u.text,hovertext:u.hovertext,hovertemplate:u.hovertemplate,hovertemplatefallback:u.hovertemplatefallback,quartilemethod:u.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:u.offsetgroup,alignmentgroup:u.alignmentgroup,selected:u.selected,unselected:u.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:u.zorder}}),k2=Vt((Z,V)=>{var u=Gg(),d=Xr().extendFlat;V.exports={violinmode:d({},u.boxmode,{}),violingap:d({},u.boxgap,{}),violingroupgap:d({},u.boxgroupgap,{})}}),mA=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=Zg(),A=T2();V.exports=function(t,e,r,i){function n(c,h){return u.coerce(t,e,A,c,h)}function o(c,h){return u.coerce2(t,e,A,c,h)}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"),f;Array.isArray(s)&&(f="manual"),n("spanmode",f);var v=n("line.color",(t.marker||{}).color||r),g=n("line.width"),m=n("fillcolor",d.addOpacity(e.line.color,.5));E.handlePointsDefaults(t,e,n,{prefix:""});var w=o("box.width"),l=o("box.fillcolor",m),x=o("box.line.color",v),y=o("box.line.width",g),S=n("box.visible",!!(w||l||x||y));S||(e.box={visible:!1});var k=o("meanline.color",v),M=o("meanline.width",g),T=n("meanline.visible",!!(k||M));T||(e.meanline={visible:!1}),n("quartilemethod"),n("zorder")}}}),gA=Vt((Z,V)=>{var u=Xr(),d=k2(),E=u1();V.exports=function(A,t,e){function r(i,n){return u.coerce(A,t,d,i,n)}E._supply(A,t,e,r,"violin")}}),I1=Vt(Z=>{var V=Xr(),u={gaussian:function(d){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*d*d)}};Z.makeKDE=function(d,E,A){var t=A.length,e=u.gaussian,r=d.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}},Z.getPositionOnKdePath=function(d,E,A){var t,e;E.orientation==="h"?(t="y",e="x"):(t="x",e="y");var r=V.findPointOnPath(d.path,A,e,{pathLength:d.pathLength}),i=d.posCenterPx,n=r[t],o=E.side==="both"?2*i-n:i;return[n,o]},Z.getKdeValue=function(d,E,A){var t=d.pts.map(Z.extractVal),e=Z.makeKDE(d,E,t);return e(A)/d.posDensityScale},Z.extractVal=function(d){return d.v}}),vA=Vt((Z,V)=>{var u=Xr(),d=yo(),E=Yb(),A=I1(),t=ks().BADNUM;V.exports=function(n,o){var a=E(n,o);if(a[0].t.empty)return a;for(var s=n._fullLayout,f=d.getFromId(n,o[o.orientation==="h"?"xaxis":"yaxis"]),v=1/0,g=-1/0,m=0,w=0,l=0;l<a.length;l++){var x=a[l],y=x.pts.map(A.extractVal),S=x.bandwidth=r(o,x,y),k=x.span=i(o,x,f,S);if(x.min===x.max&&S===0)k=x.span=[x.min,x.max],x.density=[{v:1,t:k[0]}],x.bandwidth=S,m=Math.max(m,1);else{var M=k[1]-k[0],T=Math.ceil(M/(S/3)),c=M/T;if(!isFinite(c)||!isFinite(T))return u.error("Something went wrong with computing the violin span"),a[0].t.empty=!0,a;var h=A.makeKDE(x,o,y);x.density=new Array(T);for(var b=0,_=k[0];_<k[1]+c/2;b++,_+=c){var P=h(_);x.density[b]={v:P,t:_},m=Math.max(m,P)}}w=Math.max(w,y.length),v=Math.min(v,k[0]),g=Math.max(g,k[1])}var L=d.findExtremes(f,[v,g],{padded:!0});if(o._extremes[f._id]=L,o.width)a[0].t.maxKDE=m;else{var D=s._violinScaleGroupStats,B=o.scalegroup,R=D[B];R?(R.maxKDE=Math.max(R.maxKDE,m),R.maxCount=Math.max(R.maxCount,w)):D[B]={maxKDE:m,maxCount:w}}return a[0].t.labels.kde=u._(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 f=a.length,v=u.stdev(a,f-1,o.mean);return Math.max(e(f,v,o.q3-o.q1),s/100)}function i(n,o,a,s){var f=n.spanmode,v=n.span||[],g=[o.min,o.max],m=[o.min-2*s,o.max+2*s],w;function l(y){var S=v[y],k=a.type==="multicategory"?a.r2c(S):a.d2c(S,0,n[o.valLetter+"calendar"]);return k===t?m[y]:k}f==="soft"?w=m:f==="hard"?w=g:w=[l(0),l(1)];var x={type:"linear",range:w};return d.setConvert(x),x.cleanRange(),w}}),yA=Vt((Z,V)=>{var u=c1().setPositionOffset,d=["v","h"];V.exports=function(E,A){for(var t=E.calcdata,e=A.xaxis,r=A.yaxis,i=0;i<d.length;i++){for(var n=d[i],o=n==="h"?r:e,a=[],s=0;s<t.length;s++){var f=t[s],v=f[0].t,g=f[0].trace;g.visible===!0&&g.type==="violin"&&!v.empty&&g.orientation===n&&g.xaxis===e._id&&g.yaxis===r._id&&a.push(s)}u("violin",E,a,o)}}}),xA=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=f1(),t=Pb(),e=I1();V.exports=function(r,i,n,o){var a=r._context.staticPlot,s=r._fullLayout,f=i.xaxis,v=i.yaxis;function g(m,w){var l=t(m,{xaxis:f,yaxis:v,trace:w,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return E.smoothopen(l[0],1)}d.makeTraceGroups(o,n,"trace violins").each(function(m){var w=u.select(this),l=m[0],x=l.t,y=l.trace;if(y.visible!==!0||x.empty){w.remove();return}var S=x.bPos,k=x.bdPos,M=i[x.valLetter+"axis"],T=i[x.posLetter+"axis"],c=y.side==="both",h=c||y.side==="positive",b=c||y.side==="negative",_=w.selectAll("path.violin").data(d.identity);_.enter().append("path").style("vector-effect",a?"none":"non-scaling-stroke").attr("class","violin"),_.exit().remove(),_.each(function(N){var j=u.select(this),G=N.density,rt=G.length,ct=T.c2l(N.pos+S,!0),st=T.l2p(ct),et;if(y.width)et=x.maxKDE/k;else{var K=s._violinScaleGroupStats[y.scalegroup];et=y.scalemode==="count"?K.maxKDE/k*(K.maxCount/N.pts.length):K.maxKDE/k}var ot,X,Q,ut,J,q,it;if(h){for(q=new Array(rt),ut=0;ut<rt;ut++)it=q[ut]={},it[x.posLetter]=ct+G[ut].v/et,it[x.valLetter]=M.c2l(G[ut].t,!0);ot=g(q,y)}if(b){for(q=new Array(rt),J=0,ut=rt-1;J<rt;J++,ut--)it=q[J]={},it[x.posLetter]=ct-G[ut].v/et,it[x.valLetter]=M.c2l(G[ut].t,!0);X=g(q,y)}if(c)Q=ot+"L"+X.substr(1)+"Z";else{var nt=[st,M.c2p(G[0].t)],dt=[st,M.c2p(G[rt-1].t)];y.orientation==="h"&&(nt.reverse(),dt.reverse()),h?Q="M"+nt+"L"+ot.substr(1)+"L"+dt:Q="M"+dt+"L"+X.substr(1)+"L"+nt}j.attr("d",Q),N.posCenterPx=st,N.posDensityScale=et*k,N.path=j.node(),N.pathLength=N.path.getTotalLength()/(c?2:1)});var P=y.box,L=P.width,D=(P.line||{}).width,B,R;c?(B=k*L,R=0):h?(B=[0,k*L/2],R=D*{x:1,y:-1}[x.posLetter]):(B=[k*L/2,0],R=D*{x:-1,y:1}[x.posLetter]),A.plotBoxAndWhiskers(w,{pos:T,val:M},y,{bPos:S,bdPos:B,bPosPxOffset:R}),A.plotBoxMean(w,{pos:T,val:M},y,{bPos:S,bdPos:B,bPosPxOffset:R});var I;!y.box.visible&&y.meanline.visible&&(I=d.identity);var F=w.selectAll("path.meanline").data(I||[]);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,y,j);u.select(this).attr("d",y.orientation==="h"?"M"+j+","+G[0]+"V"+G[1]:"M"+G[0]+","+j+"H"+G[1])}),A.plotPoints(w,{x:f,y:v},y,x)})}}),_A=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=mh().stylePoints;V.exports=function(A){var t=u.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=u.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(d.stroke,r.line.color).call(d.fill,r.fillcolor),i.selectAll("path.box").style("stroke-width",o.width+"px").call(d.stroke,o.color).call(d.fill,n.fillcolor);var f={"stroke-width":s+"px","stroke-dasharray":2*s+"px,"+s+"px"};i.selectAll("path.mean").style(f).call(d.stroke,a.color),i.selectAll("path.meanline").style(f).call(d.stroke,a.color),E(i,r,A)})}}),bA=Vt((Z,V)=>{var u=Pi(),d=Xr(),E=yo(),A=Xb(),t=I1();V.exports=function(e,r,i,n,o){o||(o={});var a=o.hoverLayer,s=e.cd,f=s[0].trace,v=f.hoveron,g=v.indexOf("violins")!==-1,m=v.indexOf("kde")!==-1,w=[],l,x;if(g||m){var y=A.hoverOnBoxes(e,r,i,n);if(m&&y.length>0){var S=e.xa,k=e.ya,M,T,c,h,b;f.orientation==="h"?(b=r,M="y",c=k,T="x",h=S):(b=i,M="x",c=S,T="y",h=k);var _=s[e.index];if(b>=_.span[0]&&b<=_.span[1]){var P=d.extendFlat({},e),L=h.c2p(b,!0),D=t.getKdeValue(_,f,b),B=t.getPositionOnKdePath(_,f,L),R=c._offset,I=c._length;P[M+"0"]=B[0],P[M+"1"]=B[1],P[T+"0"]=P[T+"1"]=L,P[T+"Label"]=T+": "+E.hoverLabelText(h,b,f[T+"hoverformat"])+", "+s[0].t.labels.kde+" "+D.toFixed(3);for(var F=0,N=0;N<y.length;N++)if(y[N].attr==="med"){F=N;break}P.spikeDistance=y[F].spikeDistance;var j=M+"Spike";P[j]=y[F][j],y[F].spikeDistance=void 0,y[F][j]=void 0,P.hovertemplate=!1,w.push(P),x={},x[M+"1"]=d.constrain(R+B[0],R,R+I),x[M+"2"]=d.constrain(R+B[1],R,R+I),x[T+"1"]=x[T+"2"]=h._offset+L}}g&&(w=w.concat(y))}v.indexOf("points")!==-1&&(l=A.hoverOnPoints(e,r,i));var G=a.selectAll(".violinline-"+f.uid).data(x?[0]:[]);return G.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),G.exit().remove(),G.attr(x).call(u.stroke,e.color),n==="closest"?l?[l]:w:(l&&w.push(l),w)}}),wA=Vt((Z,V)=>{V.exports={attributes:T2(),layoutAttributes:k2(),supplyDefaults:mA(),crossTraceDefaults:Zg().crossTraceDefaults,supplyLayoutDefaults:gA(),calc:vA(),crossTraceCalc:yA(),plot:xA(),style:_A(),styleOnSelect:mh().styleOnSelect,hoverPoints:bA(),selectPoints:$b(),moduleType:"trace",name:"violin",basePlotModule:Kc(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),TA=Vt((Z,V)=>{V.exports=wA()}),kA=Vt((Z,V)=>{V.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),A2=Vt((Z,V)=>{var u=yp(),d=pc().line,E=Tl(),A=fc().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=kA(),n=So().extendFlat,o=Pi();V.exports={x:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:u.xperiod0,yperiod0:u.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),hovertext:u.hovertext,hovertemplate:t({},{keys:i.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},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:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:r({editType:"plot"}),text:u.text,textposition:u.textposition,insidetextanchor:n({},u.insidetextanchor,{dflt:"middle"}),textangle:n({},u.textangle,{dflt:0}),textfont:u.textfont,insidetextfont:u.insidetextfont,outsidetextfont:u.outsidetextfont,constraintext:u.constraintext,cliponaxis:u.cliponaxis,orientation:n({},u.orientation,{}),offset:n({},u.offset,{arrayOk:!1}),width:n({},u.width,{arrayOk:!1}),marker:a(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:n({},d.color,{dflt:o.defaultLine}),width:n({},d.width,{dflt:0,editType:"plot"}),dash:d.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,zorder:u.zorder};function a(){var s=n({},u.marker);return delete s.pattern,delete s.cornerradius,s}}),M2=Vt((Z,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"}}}),S2=Vt((Z,V)=>{var u=Xr(),d=u0(),E=Lh().handleText,A=bm(),t=tp(),e=A2(),r=Pi();function i(a,s,f,v){function g(k,M){return u.coerce(a,s,e,k,M)}var m=A(a,s,v,g);if(!m){s.visible=!1;return}t(a,s,v,g),g("xhoverformat"),g("yhoverformat"),g("orientation",s.y&&!s.x?"v":"h"),g("offset"),g("width");var w=g("text");g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var l=g("textposition");E(a,s,v,g,l,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s.textposition!=="none"&&!s.texttemplate&&g("textinfo",u.isArrayOrTypedArray(w)?"text+value":"value");var x=g("marker.color",f);g("marker.line.color",r.defaultLine),g("marker.line.width");var y=g("connector.visible");if(y){g("connector.fillcolor",n(x));var S=g("connector.line.width");S&&(g("connector.line.color"),g("connector.line.dash"))}g("zorder")}function n(a){var s=u.isArrayOrTypedArray(a)?"#000":a;return r.addOpacity(s,.5*r.opacity(s))}function o(a,s){var f,v;function g(w){return u.coerce(v._input,v,e,w)}for(var m=0;m<a.length;m++)v=a[m],v.type==="funnel"&&(f=v._input,d(f,v,s,g,s.funnelmode))}V.exports={supplyDefaults:i,crossTraceDefaults:o}}),AA=Vt((Z,V)=>{var u=Xr(),d=M2();V.exports=function(E,A,t){var e=!1;function r(o,a){return u.coerce(E,A,d,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"))}}),MA=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){for(var A=0;A<d.length;A++)d[A].i=A;u.mergeArray(E.text,d,"tx"),u.mergeArray(E.hovertext,d,"htx");var t=E.marker;if(t){u.mergeArray(t.opacity,d,"mo"),u.mergeArray(t.color,d,"mc");var e=t.line;e&&(u.mergeArray(e.color,d,"mlc"),u.mergeArrayCastPositive(e.width,d,"mlw"))}}}),SA=Vt((Z,V)=>{var u=yo(),d=rp(),E=MA(),A=jh(),t=ks().BADNUM;V.exports=function(r,i){var n=u.getFromId(r,i.xaxis||"x"),o=u.getFromId(r,i.yaxis||"y"),a,s,f,v,g,m,w,l;i.orientation==="h"?(a=n.makeCalcdata(i,"x"),f=o.makeCalcdata(i,"y"),v=d(i,o,"y",f),g=!!i.yperiodalignment,m="y"):(a=o.makeCalcdata(i,"y"),f=n.makeCalcdata(i,"x"),v=d(i,n,"x",f),g=!!i.xperiodalignment,m="x"),s=v.vals;var x=Math.min(s.length,a.length),y=new Array(x);for(i._base=[],w=0;w<x;w++){a[w]<0&&(a[w]=t);var S=!1;a[w]!==t&&w+1<x&&a[w+1]!==t&&(S=!0),l=y[w]={p:s[w],s:a[w],cNext:S},i._base[w]=-.5*l.s,g&&(y[w].orig_p=f[w],y[w][m+"End"]=v.ends[w],y[w][m+"Start"]=v.starts[w]),i.ids&&(l.id=String(i.ids[w])),w===0&&(y[0].vTotal=0),y[0].vTotal+=e(l.s),l.begR=e(l.s)/e(y[0].s)}var k;for(w=0;w<x;w++)l=y[w],l.s!==t&&(l.sumR=l.s/y[0].vTotal,l.difR=k!==void 0?l.s/k:1,k=l.s);return E(y,i),A(y,i),y};function e(r){return r===t?0:r}}),EA=Vt((Z,V)=>{var u=c0().setGroupPositions;V.exports=function(d,E){var A=d._fullLayout,t=d._fullData,e=d.calcdata,r=E.xaxis,i=E.yaxis,n=[],o=[],a=[],s,f;for(f=0;f<t.length;f++){var v=t[f],g=v.orientation==="h";v.visible===!0&&v.xaxis===r._id&&v.yaxis===i._id&&v.type==="funnel"&&(s=e[f],g?a.push(s):o.push(s),n.push(s))}var m={mode:A.funnelmode,norm:A.funnelnorm,gap:A.funnelgap,groupgap:A.funnelgroupgap};for(u(d,r,i,o,m),u(d,i,r,a,m),f=0;f<n.length;f++){s=n[f];for(var w=0;w<s.length;w++)w+1<s.length&&(s[w].nextP0=s[w+1].p0,s[w].nextS0=s[w+1].s0,s[w].nextP1=s[w+1].p1,s[w].nextS1=s[w+1].s1)}}}),zA=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=ks().BADNUM,t=h0(),e=oh().clearMinTextSize;V.exports=function(o,a,s,f){var v=o._fullLayout;e("funnel",v),r(o,a,s,f),i(o,a,s,f),t.plot(o,a,s,f,{mode:v.funnelmode,norm:v.funnelmode,gap:v.funnelgap,groupgap:v.funnelgroupgap})};function r(o,a,s,f){var v=a.xaxis,g=a.yaxis;d.makeTraceGroups(f,s,"trace bars").each(function(m){var w=u.select(this),l=m[0].trace,x=d.ensureSingle(w,"g","regions");if(!l.connector||!l.connector.visible){x.remove();return}var y=l.orientation==="h",S=x.selectAll("g.region").data(d.identity);S.enter().append("g").classed("region",!0),S.exit().remove();var k=S.size();S.each(function(M,T){if(!(T!==k-1&&!M.cNext)){var c=n(M,v,g,y),h=c[0],b=c[1],_="";h[0]!==A&&b[0]!==A&&h[1]!==A&&b[1]!==A&&h[2]!==A&&b[2]!==A&&h[3]!==A&&b[3]!==A&&(y?_+="M"+h[0]+","+b[1]+"L"+h[2]+","+b[2]+"H"+h[3]+"L"+h[1]+","+b[1]+"Z":_+="M"+h[1]+","+b[1]+"L"+h[2]+","+b[3]+"V"+b[2]+"L"+h[1]+","+b[0]+"Z"),_===""&&(_="M0,0Z"),d.ensureSingle(u.select(this),"path").attr("d",_).call(E.setClipUrl,a.layerClipId,o)}})})}function i(o,a,s,f){var v=a.xaxis,g=a.yaxis;d.makeTraceGroups(f,s,"trace bars").each(function(m){var w=u.select(this),l=m[0].trace,x=d.ensureSingle(w,"g","lines");if(!l.connector||!l.connector.visible||!l.connector.line.width){x.remove();return}var y=l.orientation==="h",S=x.selectAll("g.line").data(d.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var k=S.size();S.each(function(M,T){if(!(T!==k-1&&!M.cNext)){var c=n(M,v,g,y),h=c[0],b=c[1],_="";h[3]!==void 0&&b[3]!==void 0&&(y?(_+="M"+h[0]+","+b[1]+"L"+h[2]+","+b[2],_+="M"+h[1]+","+b[1]+"L"+h[3]+","+b[2]):(_+="M"+h[1]+","+b[1]+"L"+h[2]+","+b[3],_+="M"+h[1]+","+b[0]+"L"+h[2]+","+b[2])),_===""&&(_="M0,0Z"),d.ensureSingle(u.select(this),"path").attr("d",_).call(E.setClipUrl,a.layerClipId,o)}})})}function n(o,a,s,f){var v=[],g=[],m=f?a:s,w=f?s:a;return v[0]=m.c2p(o.s0,!0),g[0]=w.c2p(o.p0,!0),v[1]=m.c2p(o.s1,!0),g[1]=w.c2p(o.p1,!0),v[2]=m.c2p(o.nextS0,!0),g[2]=w.c2p(o.nextP0,!0),v[3]=m.c2p(o.nextS1,!0),g[3]=w.c2p(o.nextP1,!0),f?[v,g]:[g,v]}}),LA=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=Pi(),A=xd().DESELECTDIM,t=Vh(),e=oh().resizeText,r=t.styleTextPoints;function i(n,o,a){var s=a||u.select(n).selectAll('g[class^="funnellayer"]').selectAll("g.trace");e(n,s,"funnel"),s.style("opacity",function(f){return f[0].trace.opacity}),s.each(function(f){var v=u.select(this),g=f[0].trace;v.selectAll(".point > path").each(function(m){if(!m.isBlank){var w=g.marker;u.select(this).call(E.fill,m.mc||w.color).call(E.stroke,m.mlc||w.line.color).call(d.dashLine,w.line.dash,m.mlw||w.line.width).style("opacity",g.selectedpoints&&!m.selected?A:1)}}),r(v,g,n),v.selectAll(".regions").each(function(){u.select(this).selectAll("path").style("stroke-width",0).call(E.fill,g.connector.fillcolor)}),v.selectAll(".lines").each(function(){var m=g.connector.line;d.lineGroupStyle(u.select(this).selectAll("path"),m.width,m.color,m.dash)})})}V.exports={style:i}}),CA=Vt((Z,V)=>{var u=Pi().opacity,d=Sm().hoverOnBars,E=Xr().formatPercent;V.exports=function(t,e,r,i,n){var o=d(t,e,r,i,n);if(o){var a=o.cd,s=a[0].trace,f=s.orientation==="h",v=o.index,g=a[v],m=f?"x":"y";o[m+"LabelVal"]=g.s,o.percentInitial=g.begR,o.percentInitialLabel=E(g.begR,1),o.percentPrevious=g.difR,o.percentPreviousLabel=E(g.difR,1),o.percentTotal=g.sumR,o.percentTotalLabel=E(g.sumR,1);var w=g.hi||s.hoverinfo,l=[];if(w&&w!=="none"&&w!=="skip"){var x=w==="all",y=w.split("+"),S=function(k){return x||y.indexOf(k)!==-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,g),[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(u(i))return i;if(u(n)&&o)return n}}),IA=Vt((Z,V)=>{V.exports=function(u,d){return u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,"percentInitial"in d&&(u.percentInitial=d.percentInitial),"percentPrevious"in d&&(u.percentPrevious=d.percentPrevious),"percentTotal"in d&&(u.percentTotal=d.percentTotal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u}}),PA=Vt((Z,V)=>{V.exports={attributes:A2(),layoutAttributes:M2(),supplyDefaults:S2().supplyDefaults,crossTraceDefaults:S2().crossTraceDefaults,supplyLayoutDefaults:AA(),calc:SA(),crossTraceCalc:EA(),plot:zA(),style:LA().style,hoverPoints:CA(),eventData:IA(),selectPoints:Em(),moduleType:"trace",name:"funnel",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),OA=Vt((Z,V)=>{V.exports=PA()}),DA=Vt((Z,V)=>{V.exports={eventDataKeys:["initial","delta","final"]}}),E2=Vt((Z,V)=>{var u=yp(),d=pc().line,E=Tl(),A=fc().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=DA(),n=So().extendFlat,o=Pi();function a(s){return{marker:{color:n({},u.marker.color,{arrayOk:!1,editType:"style"}),line:{color:n({},u.marker.line.color,{arrayOk:!1,editType:"style"}),width:n({},u.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:u.x,x0:u.x0,dx:u.dx,y:u.y,y0:u.y0,dy:u.dy,xperiod:u.xperiod,yperiod:u.yperiod,xperiod0:u.xperiod0,yperiod0:u.yperiod0,xperiodalignment:u.xperiodalignment,yperiodalignment:u.yperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),hovertext:u.hovertext,hovertemplate:t({},{keys:i.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},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:i.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:u.text,textposition:u.textposition,insidetextanchor:u.insidetextanchor,textangle:u.textangle,textfont:u.textfont,insidetextfont:u.insidetextfont,outsidetextfont:u.outsidetextfont,constraintext:u.constraintext,cliponaxis:u.cliponaxis,orientation:u.orientation,offset:u.offset,width:u.width,increasing:a(),decreasing:a(),totals:a(),connector:{line:{color:n({},d.color,{dflt:o.defaultLine}),width:n({},d.width,{editType:"plot"}),dash:d.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:u.offsetgroup,alignmentgroup:u.alignmentgroup,zorder:u.zorder}}),z2=Vt((Z,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"}}}),Lm=Vt((Z,V)=>{V.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),L2=Vt((Z,V)=>{var u=Xr(),d=u0(),E=Lh().handleText,A=bm(),t=tp(),e=E2(),r=Pi(),i=Lm(),n=i.INCREASING.COLOR,o=i.DECREASING.COLOR,a="#4499FF";function s(g,m,w){g(m+".marker.color",w),g(m+".marker.line.color",r.defaultLine),g(m+".marker.line.width")}function f(g,m,w,l){function x(T,c){return u.coerce(g,m,e,T,c)}var y=A(g,m,l,x);if(!y){m.visible=!1;return}t(g,m,l,x),x("xhoverformat"),x("yhoverformat"),x("measure"),x("orientation",m.x&&!m.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var S=x("textposition");E(g,m,l,x,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),m.textposition!=="none"&&(x("texttemplate"),x("texttemplatefallback"),m.texttemplate||x("textinfo")),s(x,"increasing",n),s(x,"decreasing",o),s(x,"totals",a);var k=x("connector.visible");if(k){x("connector.mode");var M=x("connector.line.width");M&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function v(g,m){var w,l;function x(S){return u.coerce(l._input,l,e,S)}if(m.waterfallmode==="group")for(var y=0;y<g.length;y++)l=g[y],w=l._input,d(w,l,m,x,m.waterfallmode)}V.exports={supplyDefaults:f,crossTraceDefaults:v}}),FA=Vt((Z,V)=>{var u=Xr(),d=z2();V.exports=function(E,A,t){var e=!1;function r(o,a){return u.coerce(E,A,d,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"))}}),BA=Vt((Z,V)=>{var u=yo(),d=rp(),E=Xr().mergeArray,A=jh(),t=ks().BADNUM;function e(i){return i==="a"||i==="absolute"}function r(i){return i==="t"||i==="total"}V.exports=function(i,n){var o=u.getFromId(i,n.xaxis||"x"),a=u.getFromId(i,n.yaxis||"y"),s,f,v,g,m,w;n.orientation==="h"?(s=o.makeCalcdata(n,"x"),v=a.makeCalcdata(n,"y"),g=d(n,a,"y",v),m=!!n.yperiodalignment,w="y"):(s=a.makeCalcdata(n,"y"),v=o.makeCalcdata(n,"x"),g=d(n,o,"x",v),m=!!n.xperiodalignment,w="x"),f=g.vals;for(var l=Math.min(f.length,s.length),x=new Array(l),y=0,S,k=!1,M=0;M<l;M++){var T=s[M]||0,c=!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]))&&(c=!0);var h=x[M]={i:M,p:f[M],s:T,rawS:T,cNext:c};e(n.measure[M])?(y=h.s,h.isSum=!0,h.dir="totals",h.s=y):r(n.measure[M])?(h.isSum=!0,h.dir="totals",h.s=y):(h.isSum=!1,h.dir=h.rawS<0?"decreasing":"increasing",S=h.s,h.s=y+S,y+=S),h.dir==="totals"&&(k=!0),m&&(x[M].orig_p=v[M],x[M][w+"End"]=g.ends[M],x[M][w+"Start"]=g.starts[M]),n.ids&&(h.id=String(n.ids[M])),h.v=(n.base||0)+y}return x.length&&(x[0].hasTotals=k),E(n.text,x,"tx"),E(n.hovertext,x,"htx"),A(x,n),x}}),RA=Vt((Z,V)=>{var u=c0().setGroupPositions;V.exports=function(d,E){var A=d._fullLayout,t=d._fullData,e=d.calcdata,r=E.xaxis,i=E.yaxis,n=[],o=[],a=[],s,f;for(f=0;f<t.length;f++){var v=t[f];v.visible===!0&&v.xaxis===r._id&&v.yaxis===i._id&&v.type==="waterfall"&&(s=e[f],v.orientation==="h"?a.push(s):o.push(s),n.push(s))}var g={mode:A.waterfallmode,norm:A.waterfallnorm,gap:A.waterfallgap,groupgap:A.waterfallgroupgap};for(u(d,r,i,o,g),u(d,i,r,a,g),f=0;f<n.length;f++){s=n[f];for(var m=0;m<s.length;m++){var w=s[m];w.isSum===!1&&(w.s0+=m===0?0:s[m-1].s),m+1<s.length&&(s[m].nextP0=s[m+1].p0,s[m].nextS0=s[m+1].s0)}}}}),NA=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=ks().BADNUM,t=h0(),e=oh().clearMinTextSize;V.exports=function(n,o,a,s){var f=n._fullLayout;e("waterfall",f),t.plot(n,o,a,s,{mode:f.waterfallmode,norm:f.waterfallmode,gap:f.waterfallgap,groupgap:f.waterfallgroupgap}),r(n,o,a,s)};function r(n,o,a,s){var f=o.xaxis,v=o.yaxis;d.makeTraceGroups(s,a,"trace bars").each(function(g){var m=u.select(this),w=g[0].trace,l=d.ensureSingle(m,"g","lines");if(!w.connector||!w.connector.visible){l.remove();return}var x=w.orientation==="h",y=w.connector.mode,S=l.selectAll("g.line").data(d.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var k=S.size();S.each(function(M,T){if(!(T!==k-1&&!M.cNext)){var c=i(M,f,v,x),h=c[0],b=c[1],_="";h[0]!==A&&b[0]!==A&&h[1]!==A&&b[1]!==A&&(y==="spanning"&&!M.isSum&&T>0&&(x?_+="M"+h[0]+","+b[1]+"V"+b[0]:_+="M"+h[1]+","+b[0]+"H"+h[0]),y!=="between"&&(M.isSum||T<k-1)&&(x?_+="M"+h[1]+","+b[0]+"V"+b[1]:_+="M"+h[0]+","+b[1]+"H"+h[1]),h[2]!==A&&b[2]!==A&&(x?_+="M"+h[1]+","+b[1]+"V"+b[2]:_+="M"+h[1]+","+b[1]+"H"+h[2])),_===""&&(_="M0,0Z"),d.ensureSingle(u.select(this),"path").attr("d",_).call(E.setClipUrl,o.layerClipId,n)}})})}function i(n,o,a,s){var f=[],v=[],g=s?o:a,m=s?a:o;return f[0]=g.c2p(n.s0,!0),v[0]=m.c2p(n.p0,!0),f[1]=g.c2p(n.s1,!0),v[1]=m.c2p(n.p1,!0),f[2]=g.c2p(n.nextS0,!0),v[2]=m.c2p(n.nextP0,!0),s?[f,v]:[v,f]}}),jA=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=Pi(),A=xd().DESELECTDIM,t=Vh(),e=oh().resizeText,r=t.styleTextPoints;function i(n,o,a){var s=a||u.select(n).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");e(n,s,"waterfall"),s.style("opacity",function(f){return f[0].trace.opacity}),s.each(function(f){var v=u.select(this),g=f[0].trace;v.selectAll(".point > path").each(function(m){if(!m.isBlank){var w=g[m.dir].marker;u.select(this).call(E.fill,w.color).call(E.stroke,w.line.color).call(d.dashLine,w.line.dash,w.line.width).style("opacity",g.selectedpoints&&!m.selected?A:1)}}),r(v,g,n),v.selectAll(".lines").each(function(){var m=g.connector.line;d.lineGroupStyle(u.select(this).selectAll("path"),m.width,m.color,m.dash)})})}V.exports={style:i}}),UA=Vt((Z,V)=>{var u=yo().hoverLabelText,d=Pi().opacity,E=Sm().hoverOnBars,A=Lm(),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 f=s.cd,v=f[0].trace,g=v.orientation==="h",m=g?"x":"y",w=g?r.xa:r.ya;function l(_){return u(w,_,v[m+"hoverformat"])}var x=s.index,y=f[x],S=y.isSum?y.b+y.s:y.rawS;s.initial=y.b+y.s-S,s.delta=S,s.final=s.initial+s.delta;var k=l(Math.abs(s.delta));s.deltaLabel=S<0?"("+k+")":k,s.finalLabel=l(s.final),s.initialLabel=l(s.initial);var M=y.hi||v.hoverinfo,T=[];if(M&&M!=="none"&&M!=="skip"){var c=M==="all",h=M.split("+"),b=function(_){return c||h.indexOf(_)!==-1};y.isSum||(b("final")&&(g?!b("x"):!b("y"))&&T.push(s.finalLabel),b("delta")&&(S<0?T.push(s.deltaLabel+" "+t.decreasing):T.push(s.deltaLabel+" "+t.increasing)),b("initial")&&T.push("Initial: "+s.initialLabel))}return T.length&&(s.extraText=T.join("<br>")),s.color=e(v,y),[s]};function e(r,i){var n=r[i.dir].marker,o=n.color,a=n.line.color,s=n.line.width;if(d(o))return o;if(d(a)&&s)return a}}),VA=Vt((Z,V)=>{V.exports=function(u,d){return u.x="xVal"in d?d.xVal:d.x,u.y="yVal"in d?d.yVal:d.y,"initial"in d&&(u.initial=d.initial),"delta"in d&&(u.delta=d.delta),"final"in d&&(u.final=d.final),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u}}),HA=Vt((Z,V)=>{V.exports={attributes:E2(),layoutAttributes:z2(),supplyDefaults:L2().supplyDefaults,crossTraceDefaults:L2().crossTraceDefaults,supplyLayoutDefaults:FA(),calc:BA(),crossTraceCalc:RA(),plot:NA(),style:jA().style,hoverPoints:UA(),eventData:VA(),selectPoints:Em(),moduleType:"trace",name:"waterfall",basePlotModule:Kc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),qA=Vt((Z,V)=>{V.exports=HA()}),Cm=Vt((Z,V)=>{V.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(u){return u.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(u){return u.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(u){return u.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(u){var d=u.slice(0,3);return d[1]=d[1]+"%",d[2]=d[2]+"%",d},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(u){var d=u.slice(0,4);return d[1]=d[1]+"%",d[2]=d[2]+"%",d},suffix:["°","%","%",""]}}}}),C2=Vt((Z,V)=>{var u=Tl(),d=pc().zorder,{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=So().extendFlat,e=Cm().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],i=[],n=[];for(a=0;a<r.length;a++)o=e[r[a]],i.push("For the `"+r[a]+"` colormodel, it is ["+(o.zminDflt||o.min).join(", ")+"]."),n.push("For the `"+r[a]+"` colormodel, it is ["+(o.zmaxDflt||o.max).join(", ")+"].");var o,a;V.exports=t({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:r,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",description:"Set the pixel's horizontal size."},dy:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's vertical size"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:t({},u.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:E({},{keys:["z","color","colormodel"]}),hovertemplatefallback:A(),zorder:d})}),WA=Vt((Z,V)=>{var u=Xr(),d=C2(),E=Cm(),A=Bp().IMAGE_URL_PREFIX;V.exports=function(t,e){function r(o,a){return u.coerce(t,e,d,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"),r("hovertemplatefallback"),e._length=null,r("zorder")}}),Rp=Vt((Z,V)=>{typeof Object.create=="function"?V.exports=function(u,d){d&&(u.super_=d,u.prototype=Object.create(d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}))}:V.exports=function(u,d){if(d){u.super_=d;var E=function(){};E.prototype=d.prototype,u.prototype=new E,u.prototype.constructor=u}}}),I2=Vt((Z,V)=>{V.exports=a0().EventEmitter}),GA=Vt(Z=>{Z.byteLength=r,Z.toByteArray=n,Z.fromByteArray=s;var V=[],u=[],d=typeof Uint8Array<"u"?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(A=0,t=E.length;A<t;++A)V[A]=E[A],u[E.charCodeAt(A)]=A;var A,t;u[45]=62,u[95]=63;function e(f){var v=f.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=v);var m=g===v?0:4-g%4;return[g,m]}function r(f){var v=e(f),g=v[0],m=v[1];return(g+m)*3/4-m}function i(f,v,g){return(v+g)*3/4-g}function n(f){var v,g=e(f),m=g[0],w=g[1],l=new d(i(f,m,w)),x=0,y=w>0?m-4:m,S;for(S=0;S<y;S+=4)v=u[f.charCodeAt(S)]<<18|u[f.charCodeAt(S+1)]<<12|u[f.charCodeAt(S+2)]<<6|u[f.charCodeAt(S+3)],l[x++]=v>>16&255,l[x++]=v>>8&255,l[x++]=v&255;return w===2&&(v=u[f.charCodeAt(S)]<<2|u[f.charCodeAt(S+1)]>>4,l[x++]=v&255),w===1&&(v=u[f.charCodeAt(S)]<<10|u[f.charCodeAt(S+1)]<<4|u[f.charCodeAt(S+2)]>>2,l[x++]=v>>8&255,l[x++]=v&255),l}function o(f){return V[f>>18&63]+V[f>>12&63]+V[f>>6&63]+V[f&63]}function a(f,v,g){for(var m,w=[],l=v;l<g;l+=3)m=(f[l]<<16&16711680)+(f[l+1]<<8&65280)+(f[l+2]&255),w.push(o(m));return w.join("")}function s(f){for(var v,g=f.length,m=g%3,w=[],l=16383,x=0,y=g-m;x<y;x+=l)w.push(a(f,x,x+l>y?y:x+l));return m===1?(v=f[g-1],w.push(V[v>>2]+V[v<<4&63]+"==")):m===2&&(v=(f[g-2]<<8)+f[g-1],w.push(V[v>>10]+V[v>>4&63]+V[v<<2&63]+"=")),w.join("")}}),ZA=Vt(Z=>{Z.read=function(V,u,d,E,A){var t,e,r=A*8-E-1,i=(1<<r)-1,n=i>>1,o=-7,a=d?A-1:0,s=d?-1:1,f=V[u+a];for(a+=s,t=f&(1<<-o)-1,f>>=-o,o+=r;o>0;t=t*256+V[u+a],a+=s,o-=8);for(e=t&(1<<-o)-1,t>>=-o,o+=E;o>0;e=e*256+V[u+a],a+=s,o-=8);if(t===0)t=1-n;else{if(t===i)return e?NaN:(f?-1:1)*(1/0);e=e+Math.pow(2,E),t=t-n}return(f?-1:1)*e*Math.pow(2,t-E)},Z.write=function(V,u,d,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,f=E?0:t-1,v=E?1:-1,g=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(r=isNaN(u)?1:0,e=o):(e=Math.floor(Math.log(u)/Math.LN2),u*(i=Math.pow(2,-e))<1&&(e--,i*=2),e+a>=1?u+=s/i:u+=s*Math.pow(2,1-a),u*i>=2&&(e++,i/=2),e+a>=o?(r=0,e=o):e+a>=1?(r=(u*i-1)*Math.pow(2,A),e=e+a):(r=u*Math.pow(2,a-1)*Math.pow(2,A),e=0));A>=8;V[d+f]=r&255,f+=v,r/=256,A-=8);for(e=e<<A|r,n+=A;n>0;V[d+f]=e&255,f+=v,e/=256,n-=8);V[d+f-v]|=g*128}}),p0=Vt(Z=>{var V=GA(),u=ZA(),d=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Z.Buffer=e,Z.SlowBuffer=w,Z.INSPECT_MAX_BYTES=50;var E=2147483647;Z.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 mt=new Uint8Array(1),bt={foo:function(){return 42}};return Object.setPrototypeOf(bt,Uint8Array.prototype),Object.setPrototypeOf(mt,bt),mt.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(mt){if(mt>E)throw new RangeError('The value "'+mt+'" is invalid for option "size"');let bt=new Uint8Array(mt);return Object.setPrototypeOf(bt,e.prototype),bt}function e(mt,bt,vt){if(typeof mt=="number"){if(typeof bt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return o(mt)}return r(mt,bt,vt)}e.poolSize=8192;function r(mt,bt,vt){if(typeof mt=="string")return a(mt,bt);if(ArrayBuffer.isView(mt))return f(mt);if(mt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof mt);if(Nt(mt,ArrayBuffer)||mt&&Nt(mt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Nt(mt,SharedArrayBuffer)||mt&&Nt(mt.buffer,SharedArrayBuffer)))return v(mt,bt,vt);if(typeof mt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let Ut=mt.valueOf&&mt.valueOf();if(Ut!=null&&Ut!==mt)return e.from(Ut,bt,vt);let re=g(mt);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof mt[Symbol.toPrimitive]=="function")return e.from(mt[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 mt)}e.from=function(mt,bt,vt){return r(mt,bt,vt)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array);function i(mt){if(typeof mt!="number")throw new TypeError('"size" argument must be of type number');if(mt<0)throw new RangeError('The value "'+mt+'" is invalid for option "size"')}function n(mt,bt,vt){return i(mt),mt<=0?t(mt):bt!==void 0?typeof vt=="string"?t(mt).fill(bt,vt):t(mt).fill(bt):t(mt)}e.alloc=function(mt,bt,vt){return n(mt,bt,vt)};function o(mt){return i(mt),t(mt<0?0:m(mt)|0)}e.allocUnsafe=function(mt){return o(mt)},e.allocUnsafeSlow=function(mt){return o(mt)};function a(mt,bt){if((typeof bt!="string"||bt==="")&&(bt="utf8"),!e.isEncoding(bt))throw new TypeError("Unknown encoding: "+bt);let vt=l(mt,bt)|0,Ut=t(vt),re=Ut.write(mt,bt);return re!==vt&&(Ut=Ut.slice(0,re)),Ut}function s(mt){let bt=mt.length<0?0:m(mt.length)|0,vt=t(bt);for(let Ut=0;Ut<bt;Ut+=1)vt[Ut]=mt[Ut]&255;return vt}function f(mt){if(Nt(mt,Uint8Array)){let bt=new Uint8Array(mt);return v(bt.buffer,bt.byteOffset,bt.byteLength)}return s(mt)}function v(mt,bt,vt){if(bt<0||mt.byteLength<bt)throw new RangeError('"offset" is outside of buffer bounds');if(mt.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(mt):vt===void 0?Ut=new Uint8Array(mt,bt):Ut=new Uint8Array(mt,bt,vt),Object.setPrototypeOf(Ut,e.prototype),Ut}function g(mt){if(e.isBuffer(mt)){let bt=m(mt.length)|0,vt=t(bt);return vt.length===0||mt.copy(vt,0,0,bt),vt}if(mt.length!==void 0)return typeof mt.length!="number"||ee(mt.length)?t(0):s(mt);if(mt.type==="Buffer"&&Array.isArray(mt.data))return s(mt.data)}function m(mt){if(mt>=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return mt|0}function w(mt){return+mt!=mt&&(mt=0),e.alloc(+mt)}e.isBuffer=function(mt){return mt!=null&&mt._isBuffer===!0&&mt!==e.prototype},e.compare=function(mt,bt){if(Nt(mt,Uint8Array)&&(mt=e.from(mt,mt.offset,mt.byteLength)),Nt(bt,Uint8Array)&&(bt=e.from(bt,bt.offset,bt.byteLength)),!e.isBuffer(mt)||!e.isBuffer(bt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(mt===bt)return 0;let vt=mt.length,Ut=bt.length;for(let re=0,Zt=Math.min(vt,Ut);re<Zt;++re)if(mt[re]!==bt[re]){vt=mt[re],Ut=bt[re];break}return vt<Ut?-1:Ut<vt?1:0},e.isEncoding=function(mt){switch(String(mt).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(mt,bt){if(!Array.isArray(mt))throw new TypeError('"list" argument must be an Array of Buffers');if(mt.length===0)return e.alloc(0);let vt;if(bt===void 0)for(bt=0,vt=0;vt<mt.length;++vt)bt+=mt[vt].length;let Ut=e.allocUnsafe(bt),re=0;for(vt=0;vt<mt.length;++vt){let Zt=mt[vt];if(Nt(Zt,Uint8Array))re+Zt.length>Ut.length?(e.isBuffer(Zt)||(Zt=e.from(Zt)),Zt.copy(Ut,re)):Uint8Array.prototype.set.call(Ut,Zt,re);else if(e.isBuffer(Zt))Zt.copy(Ut,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=Zt.length}return Ut};function l(mt,bt){if(e.isBuffer(mt))return mt.length;if(ArrayBuffer.isView(mt)||Nt(mt,ArrayBuffer))return mt.byteLength;if(typeof mt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof mt);let vt=mt.length,Ut=arguments.length>2&&arguments[2]===!0;if(!Ut&&vt===0)return 0;let re=!1;for(;;)switch(bt){case"ascii":case"latin1":case"binary":return vt;case"utf8":case"utf-8":return dt(mt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt*2;case"hex":return vt>>>1;case"base64":return It(mt).length;default:if(re)return Ut?-1:dt(mt).length;bt=(""+bt).toLowerCase(),re=!0}}e.byteLength=l;function x(mt,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(mt||(mt="utf8");;)switch(mt){case"hex":return I(this,bt,vt);case"utf8":case"utf-8":return P(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: "+mt);mt=(mt+"").toLowerCase(),Ut=!0}}e.prototype._isBuffer=!0;function y(mt,bt,vt){let Ut=mt[bt];mt[bt]=mt[vt],mt[vt]=Ut}e.prototype.swap16=function(){let mt=this.length;if(mt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let bt=0;bt<mt;bt+=2)y(this,bt,bt+1);return this},e.prototype.swap32=function(){let mt=this.length;if(mt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let bt=0;bt<mt;bt+=4)y(this,bt,bt+3),y(this,bt+1,bt+2);return this},e.prototype.swap64=function(){let mt=this.length;if(mt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let bt=0;bt<mt;bt+=8)y(this,bt,bt+7),y(this,bt+1,bt+6),y(this,bt+2,bt+5),y(this,bt+3,bt+4);return this},e.prototype.toString=function(){let mt=this.length;return mt===0?"":arguments.length===0?P(this,0,mt):x.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(mt){if(!e.isBuffer(mt))throw new TypeError("Argument must be a Buffer");return this===mt?!0:e.compare(this,mt)===0},e.prototype.inspect=function(){let mt="",bt=Z.INSPECT_MAX_BYTES;return mt=this.toString("hex",0,bt).replace(/(.{2})/g,"$1 ").trim(),this.length>bt&&(mt+=" ... "),"<Buffer "+mt+">"},d&&(e.prototype[d]=e.prototype.inspect),e.prototype.compare=function(mt,bt,vt,Ut,re){if(Nt(mt,Uint8Array)&&(mt=e.from(mt,mt.offset,mt.byteLength)),!e.isBuffer(mt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof mt);if(bt===void 0&&(bt=0),vt===void 0&&(vt=mt?mt.length:0),Ut===void 0&&(Ut=0),re===void 0&&(re=this.length),bt<0||vt>mt.length||Ut<0||re>this.length)throw new RangeError("out of range index");if(Ut>=re&&bt>=vt)return 0;if(Ut>=re)return-1;if(bt>=vt)return 1;if(bt>>>=0,vt>>>=0,Ut>>>=0,re>>>=0,this===mt)return 0;let Zt=re-Ut,ue=vt-bt,Me=Math.min(Zt,ue),Ce=this.slice(Ut,re),We=mt.slice(bt,vt);for(let qe=0;qe<Me;++qe)if(Ce[qe]!==We[qe]){Zt=Ce[qe],ue=We[qe];break}return Zt<ue?-1:ue<Zt?1:0};function S(mt,bt,vt,Ut,re){if(mt.length===0)return-1;if(typeof vt=="string"?(Ut=vt,vt=0):vt>2147483647?vt=2147483647:vt<-2147483648&&(vt=-2147483648),vt=+vt,ee(vt)&&(vt=re?0:mt.length-1),vt<0&&(vt=mt.length+vt),vt>=mt.length){if(re)return-1;vt=mt.length-1}else if(vt<0)if(re)vt=0;else return-1;if(typeof bt=="string"&&(bt=e.from(bt,Ut)),e.isBuffer(bt))return bt.length===0?-1:k(mt,bt,vt,Ut,re);if(typeof bt=="number")return bt=bt&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(mt,bt,vt):Uint8Array.prototype.lastIndexOf.call(mt,bt,vt):k(mt,[bt],vt,Ut,re);throw new TypeError("val must be string, number or Buffer")}function k(mt,bt,vt,Ut,re){let Zt=1,ue=mt.length,Me=bt.length;if(Ut!==void 0&&(Ut=String(Ut).toLowerCase(),Ut==="ucs2"||Ut==="ucs-2"||Ut==="utf16le"||Ut==="utf-16le")){if(mt.length<2||bt.length<2)return-1;Zt=2,ue/=2,Me/=2,vt/=2}function Ce(qe,vr){return Zt===1?qe[vr]:qe.readUInt16BE(vr*Zt)}let We;if(re){let qe=-1;for(We=vt;We<ue;We++)if(Ce(mt,We)===Ce(bt,qe===-1?0:We-qe)){if(qe===-1&&(qe=We),We-qe+1===Me)return qe*Zt}else qe!==-1&&(We-=We-qe),qe=-1}else for(vt+Me>ue&&(vt=ue-Me),We=vt;We>=0;We--){let qe=!0;for(let vr=0;vr<Me;vr++)if(Ce(mt,We+vr)!==Ce(bt,vr)){qe=!1;break}if(qe)return We}return-1}e.prototype.includes=function(mt,bt,vt){return this.indexOf(mt,bt,vt)!==-1},e.prototype.indexOf=function(mt,bt,vt){return S(this,mt,bt,vt,!0)},e.prototype.lastIndexOf=function(mt,bt,vt){return S(this,mt,bt,vt,!1)};function M(mt,bt,vt,Ut){vt=Number(vt)||0;let re=mt.length-vt;Ut?(Ut=Number(Ut),Ut>re&&(Ut=re)):Ut=re;let Zt=bt.length;Ut>Zt/2&&(Ut=Zt/2);let ue;for(ue=0;ue<Ut;++ue){let Me=parseInt(bt.substr(ue*2,2),16);if(ee(Me))return ue;mt[vt+ue]=Me}return ue}function T(mt,bt,vt,Ut){return Ct(dt(bt,mt.length-vt),mt,vt,Ut)}function c(mt,bt,vt,Ut){return Ct(Tt(bt),mt,vt,Ut)}function h(mt,bt,vt,Ut){return Ct(It(bt),mt,vt,Ut)}function b(mt,bt,vt,Ut){return Ct(wt(bt,mt.length-vt),mt,vt,Ut)}e.prototype.write=function(mt,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 re=this.length-bt;if((vt===void 0||vt>re)&&(vt=re),mt.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,mt,bt,vt);case"utf8":case"utf-8":return T(this,mt,bt,vt);case"ascii":case"latin1":case"binary":return c(this,mt,bt,vt);case"base64":return h(this,mt,bt,vt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,mt,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 _(mt,bt,vt){return bt===0&&vt===mt.length?V.fromByteArray(mt):V.fromByteArray(mt.slice(bt,vt))}function P(mt,bt,vt){vt=Math.min(mt.length,vt);let Ut=[],re=bt;for(;re<vt;){let Zt=mt[re],ue=null,Me=Zt>239?4:Zt>223?3:Zt>191?2:1;if(re+Me<=vt){let Ce,We,qe,vr;switch(Me){case 1:Zt<128&&(ue=Zt);break;case 2:Ce=mt[re+1],(Ce&192)===128&&(vr=(Zt&31)<<6|Ce&63,vr>127&&(ue=vr));break;case 3:Ce=mt[re+1],We=mt[re+2],(Ce&192)===128&&(We&192)===128&&(vr=(Zt&15)<<12|(Ce&63)<<6|We&63,vr>2047&&(vr<55296||vr>57343)&&(ue=vr));break;case 4:Ce=mt[re+1],We=mt[re+2],qe=mt[re+3],(Ce&192)===128&&(We&192)===128&&(qe&192)===128&&(vr=(Zt&15)<<18|(Ce&63)<<12|(We&63)<<6|qe&63,vr>65535&&vr<1114112&&(ue=vr))}}ue===null?(ue=65533,Me=1):ue>65535&&(ue-=65536,Ut.push(ue>>>10&1023|55296),ue=56320|ue&1023),Ut.push(ue),re+=Me}return D(Ut)}var L=4096;function D(mt){let bt=mt.length;if(bt<=L)return String.fromCharCode.apply(String,mt);let vt="",Ut=0;for(;Ut<bt;)vt+=String.fromCharCode.apply(String,mt.slice(Ut,Ut+=L));return vt}function B(mt,bt,vt){let Ut="";vt=Math.min(mt.length,vt);for(let re=bt;re<vt;++re)Ut+=String.fromCharCode(mt[re]&127);return Ut}function R(mt,bt,vt){let Ut="";vt=Math.min(mt.length,vt);for(let re=bt;re<vt;++re)Ut+=String.fromCharCode(mt[re]);return Ut}function I(mt,bt,vt){let Ut=mt.length;(!bt||bt<0)&&(bt=0),(!vt||vt<0||vt>Ut)&&(vt=Ut);let re="";for(let Zt=bt;Zt<vt;++Zt)re+=Jt[mt[Zt]];return re}function F(mt,bt,vt){let Ut=mt.slice(bt,vt),re="";for(let Zt=0;Zt<Ut.length-1;Zt+=2)re+=String.fromCharCode(Ut[Zt]+Ut[Zt+1]*256);return re}e.prototype.slice=function(mt,bt){let vt=this.length;mt=~~mt,bt=bt===void 0?vt:~~bt,mt<0?(mt+=vt,mt<0&&(mt=0)):mt>vt&&(mt=vt),bt<0?(bt+=vt,bt<0&&(bt=0)):bt>vt&&(bt=vt),bt<mt&&(bt=mt);let Ut=this.subarray(mt,bt);return Object.setPrototypeOf(Ut,e.prototype),Ut};function N(mt,bt,vt){if(mt%1!==0||mt<0)throw new RangeError("offset is not uint");if(mt+bt>vt)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(mt,bt,vt){mt=mt>>>0,bt=bt>>>0,vt||N(mt,bt,this.length);let Ut=this[mt],re=1,Zt=0;for(;++Zt<bt&&(re*=256);)Ut+=this[mt+Zt]*re;return Ut},e.prototype.readUintBE=e.prototype.readUIntBE=function(mt,bt,vt){mt=mt>>>0,bt=bt>>>0,vt||N(mt,bt,this.length);let Ut=this[mt+--bt],re=1;for(;bt>0&&(re*=256);)Ut+=this[mt+--bt]*re;return Ut},e.prototype.readUint8=e.prototype.readUInt8=function(mt,bt){return mt=mt>>>0,bt||N(mt,1,this.length),this[mt]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(mt,bt){return mt=mt>>>0,bt||N(mt,2,this.length),this[mt]|this[mt+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(mt,bt){return mt=mt>>>0,bt||N(mt,2,this.length),this[mt]<<8|this[mt+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(mt,bt){return mt=mt>>>0,bt||N(mt,4,this.length),(this[mt]|this[mt+1]<<8|this[mt+2]<<16)+this[mt+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(mt,bt){return mt=mt>>>0,bt||N(mt,4,this.length),this[mt]*16777216+(this[mt+1]<<16|this[mt+2]<<8|this[mt+3])},e.prototype.readBigUInt64LE=te(function(mt){mt=mt>>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=bt+this[++mt]*2**8+this[++mt]*2**16+this[++mt]*2**24,re=this[++mt]+this[++mt]*2**8+this[++mt]*2**16+vt*2**24;return BigInt(Ut)+(BigInt(re)<<BigInt(32))}),e.prototype.readBigUInt64BE=te(function(mt){mt=mt>>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=bt*2**24+this[++mt]*2**16+this[++mt]*2**8+this[++mt],re=this[++mt]*2**24+this[++mt]*2**16+this[++mt]*2**8+vt;return(BigInt(Ut)<<BigInt(32))+BigInt(re)}),e.prototype.readIntLE=function(mt,bt,vt){mt=mt>>>0,bt=bt>>>0,vt||N(mt,bt,this.length);let Ut=this[mt],re=1,Zt=0;for(;++Zt<bt&&(re*=256);)Ut+=this[mt+Zt]*re;return re*=128,Ut>=re&&(Ut-=Math.pow(2,8*bt)),Ut},e.prototype.readIntBE=function(mt,bt,vt){mt=mt>>>0,bt=bt>>>0,vt||N(mt,bt,this.length);let Ut=bt,re=1,Zt=this[mt+--Ut];for(;Ut>0&&(re*=256);)Zt+=this[mt+--Ut]*re;return re*=128,Zt>=re&&(Zt-=Math.pow(2,8*bt)),Zt},e.prototype.readInt8=function(mt,bt){return mt=mt>>>0,bt||N(mt,1,this.length),this[mt]&128?(255-this[mt]+1)*-1:this[mt]},e.prototype.readInt16LE=function(mt,bt){mt=mt>>>0,bt||N(mt,2,this.length);let vt=this[mt]|this[mt+1]<<8;return vt&32768?vt|4294901760:vt},e.prototype.readInt16BE=function(mt,bt){mt=mt>>>0,bt||N(mt,2,this.length);let vt=this[mt+1]|this[mt]<<8;return vt&32768?vt|4294901760:vt},e.prototype.readInt32LE=function(mt,bt){return mt=mt>>>0,bt||N(mt,4,this.length),this[mt]|this[mt+1]<<8|this[mt+2]<<16|this[mt+3]<<24},e.prototype.readInt32BE=function(mt,bt){return mt=mt>>>0,bt||N(mt,4,this.length),this[mt]<<24|this[mt+1]<<16|this[mt+2]<<8|this[mt+3]},e.prototype.readBigInt64LE=te(function(mt){mt=mt>>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=this[mt+4]+this[mt+5]*2**8+this[mt+6]*2**16+(vt<<24);return(BigInt(Ut)<<BigInt(32))+BigInt(bt+this[++mt]*2**8+this[++mt]*2**16+this[++mt]*2**24)}),e.prototype.readBigInt64BE=te(function(mt){mt=mt>>>0,J(mt,"offset");let bt=this[mt],vt=this[mt+7];(bt===void 0||vt===void 0)&&q(mt,this.length-8);let Ut=(bt<<24)+this[++mt]*2**16+this[++mt]*2**8+this[++mt];return(BigInt(Ut)<<BigInt(32))+BigInt(this[++mt]*2**24+this[++mt]*2**16+this[++mt]*2**8+vt)}),e.prototype.readFloatLE=function(mt,bt){return mt=mt>>>0,bt||N(mt,4,this.length),u.read(this,mt,!0,23,4)},e.prototype.readFloatBE=function(mt,bt){return mt=mt>>>0,bt||N(mt,4,this.length),u.read(this,mt,!1,23,4)},e.prototype.readDoubleLE=function(mt,bt){return mt=mt>>>0,bt||N(mt,8,this.length),u.read(this,mt,!0,52,8)},e.prototype.readDoubleBE=function(mt,bt){return mt=mt>>>0,bt||N(mt,8,this.length),u.read(this,mt,!1,52,8)};function j(mt,bt,vt,Ut,re,Zt){if(!e.isBuffer(mt))throw new TypeError('"buffer" argument must be a Buffer instance');if(bt>re||bt<Zt)throw new RangeError('"value" argument is out of bounds');if(vt+Ut>mt.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,vt=vt>>>0,!Ut){let ue=Math.pow(2,8*vt)-1;j(this,mt,bt,vt,ue,0)}let re=1,Zt=0;for(this[bt]=mt&255;++Zt<vt&&(re*=256);)this[bt+Zt]=mt/re&255;return bt+vt},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,vt=vt>>>0,!Ut){let ue=Math.pow(2,8*vt)-1;j(this,mt,bt,vt,ue,0)}let re=vt-1,Zt=1;for(this[bt+re]=mt&255;--re>=0&&(Zt*=256);)this[bt+re]=mt/Zt&255;return bt+vt},e.prototype.writeUint8=e.prototype.writeUInt8=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,1,255,0),this[bt]=mt&255,bt+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,2,65535,0),this[bt]=mt&255,this[bt+1]=mt>>>8,bt+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,2,65535,0),this[bt]=mt>>>8,this[bt+1]=mt&255,bt+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,4,4294967295,0),this[bt+3]=mt>>>24,this[bt+2]=mt>>>16,this[bt+1]=mt>>>8,this[bt]=mt&255,bt+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,4,4294967295,0),this[bt]=mt>>>24,this[bt+1]=mt>>>16,this[bt+2]=mt>>>8,this[bt+3]=mt&255,bt+4};function G(mt,bt,vt,Ut,re){ut(bt,Ut,re,mt,vt,7);let Zt=Number(bt&BigInt(4294967295));mt[vt++]=Zt,Zt=Zt>>8,mt[vt++]=Zt,Zt=Zt>>8,mt[vt++]=Zt,Zt=Zt>>8,mt[vt++]=Zt;let ue=Number(bt>>BigInt(32)&BigInt(4294967295));return mt[vt++]=ue,ue=ue>>8,mt[vt++]=ue,ue=ue>>8,mt[vt++]=ue,ue=ue>>8,mt[vt++]=ue,vt}function rt(mt,bt,vt,Ut,re){ut(bt,Ut,re,mt,vt,7);let Zt=Number(bt&BigInt(4294967295));mt[vt+7]=Zt,Zt=Zt>>8,mt[vt+6]=Zt,Zt=Zt>>8,mt[vt+5]=Zt,Zt=Zt>>8,mt[vt+4]=Zt;let ue=Number(bt>>BigInt(32)&BigInt(4294967295));return mt[vt+3]=ue,ue=ue>>8,mt[vt+2]=ue,ue=ue>>8,mt[vt+1]=ue,ue=ue>>8,mt[vt]=ue,vt+8}e.prototype.writeBigUInt64LE=te(function(mt,bt=0){return G(this,mt,bt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=te(function(mt,bt=0){return rt(this,mt,bt,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,!Ut){let Me=Math.pow(2,8*vt-1);j(this,mt,bt,vt,Me-1,-Me)}let re=0,Zt=1,ue=0;for(this[bt]=mt&255;++re<vt&&(Zt*=256);)mt<0&&ue===0&&this[bt+re-1]!==0&&(ue=1),this[bt+re]=(mt/Zt>>0)-ue&255;return bt+vt},e.prototype.writeIntBE=function(mt,bt,vt,Ut){if(mt=+mt,bt=bt>>>0,!Ut){let Me=Math.pow(2,8*vt-1);j(this,mt,bt,vt,Me-1,-Me)}let re=vt-1,Zt=1,ue=0;for(this[bt+re]=mt&255;--re>=0&&(Zt*=256);)mt<0&&ue===0&&this[bt+re+1]!==0&&(ue=1),this[bt+re]=(mt/Zt>>0)-ue&255;return bt+vt},e.prototype.writeInt8=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,1,127,-128),mt<0&&(mt=255+mt+1),this[bt]=mt&255,bt+1},e.prototype.writeInt16LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,2,32767,-32768),this[bt]=mt&255,this[bt+1]=mt>>>8,bt+2},e.prototype.writeInt16BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,2,32767,-32768),this[bt]=mt>>>8,this[bt+1]=mt&255,bt+2},e.prototype.writeInt32LE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,4,2147483647,-2147483648),this[bt]=mt&255,this[bt+1]=mt>>>8,this[bt+2]=mt>>>16,this[bt+3]=mt>>>24,bt+4},e.prototype.writeInt32BE=function(mt,bt,vt){return mt=+mt,bt=bt>>>0,vt||j(this,mt,bt,4,2147483647,-2147483648),mt<0&&(mt=4294967295+mt+1),this[bt]=mt>>>24,this[bt+1]=mt>>>16,this[bt+2]=mt>>>8,this[bt+3]=mt&255,bt+4},e.prototype.writeBigInt64LE=te(function(mt,bt=0){return G(this,mt,bt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=te(function(mt,bt=0){return rt(this,mt,bt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ct(mt,bt,vt,Ut,re,Zt){if(vt+Ut>mt.length)throw new RangeError("Index out of range");if(vt<0)throw new RangeError("Index out of range")}function st(mt,bt,vt,Ut,re){return bt=+bt,vt=vt>>>0,re||ct(mt,bt,vt,4),u.write(mt,bt,vt,Ut,23,4),vt+4}e.prototype.writeFloatLE=function(mt,bt,vt){return st(this,mt,bt,!0,vt)},e.prototype.writeFloatBE=function(mt,bt,vt){return st(this,mt,bt,!1,vt)};function et(mt,bt,vt,Ut,re){return bt=+bt,vt=vt>>>0,re||ct(mt,bt,vt,8),u.write(mt,bt,vt,Ut,52,8),vt+8}e.prototype.writeDoubleLE=function(mt,bt,vt){return et(this,mt,bt,!0,vt)},e.prototype.writeDoubleBE=function(mt,bt,vt){return et(this,mt,bt,!1,vt)},e.prototype.copy=function(mt,bt,vt,Ut){if(!e.isBuffer(mt))throw new TypeError("argument should be a Buffer");if(vt||(vt=0),!Ut&&Ut!==0&&(Ut=this.length),bt>=mt.length&&(bt=mt.length),bt||(bt=0),Ut>0&&Ut<vt&&(Ut=vt),Ut===vt||mt.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),mt.length-bt<Ut-vt&&(Ut=mt.length-bt+vt);let re=Ut-vt;return this===mt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(bt,vt,Ut):Uint8Array.prototype.set.call(mt,this.subarray(vt,Ut),bt),re},e.prototype.fill=function(mt,bt,vt,Ut){if(typeof mt=="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(mt.length===1){let Zt=mt.charCodeAt(0);(Ut==="utf8"&&Zt<128||Ut==="latin1")&&(mt=Zt)}}else typeof mt=="number"?mt=mt&255:typeof mt=="boolean"&&(mt=Number(mt));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,mt||(mt=0);let re;if(typeof mt=="number")for(re=bt;re<vt;++re)this[re]=mt;else{let Zt=e.isBuffer(mt)?mt:e.from(mt,Ut),ue=Zt.length;if(ue===0)throw new TypeError('The value "'+mt+'" is invalid for argument "value"');for(re=0;re<vt-bt;++re)this[re+bt]=Zt[re%ue]}return this};var K={};function ot(mt,bt,vt){K[mt]=class extends vt{constructor(){super(),Object.defineProperty(this,"message",{value:bt.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${mt}]`,this.stack,delete this.name}get code(){return mt}set code(Ut){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ut,writable:!0})}toString(){return`${this.name} [${mt}]: ${this.message}`}}}ot("ERR_BUFFER_OUT_OF_BOUNDS",function(mt){return mt?`${mt} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ot("ERR_INVALID_ARG_TYPE",function(mt,bt){return`The "${mt}" argument must be of type number. Received type ${typeof bt}`},TypeError),ot("ERR_OUT_OF_RANGE",function(mt,bt,vt){let Ut=`The value of "${mt}" is out of range.`,re=vt;return Number.isInteger(vt)&&Math.abs(vt)>2**32?re=X(String(vt)):typeof vt=="bigint"&&(re=String(vt),(vt>BigInt(2)**BigInt(32)||vt<-(BigInt(2)**BigInt(32)))&&(re=X(re)),re+="n"),Ut+=` It must be ${bt}. Received ${re}`,Ut},RangeError);function X(mt){let bt="",vt=mt.length,Ut=mt[0]==="-"?1:0;for(;vt>=Ut+4;vt-=3)bt=`_${mt.slice(vt-3,vt)}${bt}`;return`${mt.slice(0,vt)}${bt}`}function Q(mt,bt,vt){J(bt,"offset"),(mt[bt]===void 0||mt[bt+vt]===void 0)&&q(bt,mt.length-(vt+1))}function ut(mt,bt,vt,Ut,re,Zt){if(mt>vt||mt<bt){let ue=typeof bt=="bigint"?"n":"",Me;throw bt===0||bt===BigInt(0)?Me=`>= 0${ue} and < 2${ue} ** ${(Zt+1)*8}${ue}`:Me=`>= -(2${ue} ** ${(Zt+1)*8-1}${ue}) and < 2 ** ${(Zt+1)*8-1}${ue}`,new K.ERR_OUT_OF_RANGE("value",Me,mt)}Q(Ut,re,Zt)}function J(mt,bt){if(typeof mt!="number")throw new K.ERR_INVALID_ARG_TYPE(bt,"number",mt)}function q(mt,bt,vt){throw Math.floor(mt)!==mt?(J(mt,vt),new K.ERR_OUT_OF_RANGE("offset","an integer",mt)):bt<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${bt}`,mt)}var it=/[^+/0-9A-Za-z-_]/g;function nt(mt){if(mt=mt.split("=")[0],mt=mt.trim().replace(it,""),mt.length<2)return"";for(;mt.length%4!==0;)mt=mt+"=";return mt}function dt(mt,bt){bt=bt||1/0;let vt,Ut=mt.length,re=null,Zt=[];for(let ue=0;ue<Ut;++ue){if(vt=mt.charCodeAt(ue),vt>55295&&vt<57344){if(!re){if(vt>56319){(bt-=3)>-1&&Zt.push(239,191,189);continue}else if(ue+1===Ut){(bt-=3)>-1&&Zt.push(239,191,189);continue}re=vt;continue}if(vt<56320){(bt-=3)>-1&&Zt.push(239,191,189),re=vt;continue}vt=(re-55296<<10|vt-56320)+65536}else re&&(bt-=3)>-1&&Zt.push(239,191,189);if(re=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 Tt(mt){let bt=[];for(let vt=0;vt<mt.length;++vt)bt.push(mt.charCodeAt(vt)&255);return bt}function wt(mt,bt){let vt,Ut,re,Zt=[];for(let ue=0;ue<mt.length&&!((bt-=2)<0);++ue)vt=mt.charCodeAt(ue),Ut=vt>>8,re=vt%256,Zt.push(re),Zt.push(Ut);return Zt}function It(mt){return V.toByteArray(nt(mt))}function Ct(mt,bt,vt,Ut){let re;for(re=0;re<Ut&&!(re+vt>=bt.length||re>=mt.length);++re)bt[re+vt]=mt[re];return re}function Nt(mt,bt){return mt instanceof bt||mt!=null&&mt.constructor!=null&&mt.constructor.name!=null&&mt.constructor.name===bt.name}function ee(mt){return mt!==mt}var Jt=function(){let mt="0123456789abcdef",bt=new Array(256);for(let vt=0;vt<16;++vt){let Ut=vt*16;for(let re=0;re<16;++re)bt[Ut+re]=mt[vt]+mt[re]}return bt}();function te(mt){return typeof BigInt>"u"?Kt:mt}function Kt(){throw new Error("BigInt not supported")}}),P1=Vt((Z,V)=>{V.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var u={},d=Symbol("test"),E=Object(d);if(typeof d=="string"||Object.prototype.toString.call(d)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var A=42;u[d]=A;for(var t in u)return!1;if(typeof Object.keys=="function"&&Object.keys(u).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(u).length!==0)return!1;var e=Object.getOwnPropertySymbols(u);if(e.length!==1||e[0]!==d||!Object.prototype.propertyIsEnumerable.call(u,d))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(u,d);if(r.value!==A||r.enumerable!==!0)return!1}return!0}}),Jg=Vt((Z,V)=>{var u=P1();V.exports=function(){return u()&&!!Symbol.toStringTag}}),P2=Vt((Z,V)=>{V.exports=Object}),KA=Vt((Z,V)=>{V.exports=Error}),YA=Vt((Z,V)=>{V.exports=EvalError}),XA=Vt((Z,V)=>{V.exports=RangeError}),$A=Vt((Z,V)=>{V.exports=ReferenceError}),O2=Vt((Z,V)=>{V.exports=SyntaxError}),Im=Vt((Z,V)=>{V.exports=TypeError}),JA=Vt((Z,V)=>{V.exports=URIError}),QA=Vt((Z,V)=>{V.exports=Math.abs}),tM=Vt((Z,V)=>{V.exports=Math.floor}),eM=Vt((Z,V)=>{V.exports=Math.max}),rM=Vt((Z,V)=>{V.exports=Math.min}),nM=Vt((Z,V)=>{V.exports=Math.pow}),aM=Vt((Z,V)=>{V.exports=Math.round}),iM=Vt((Z,V)=>{V.exports=Number.isNaN||function(u){return u!==u}}),oM=Vt((Z,V)=>{var u=iM();V.exports=function(d){return u(d)||d===0?d:d<0?-1:1}}),sM=Vt((Z,V)=>{V.exports=Object.getOwnPropertyDescriptor}),d0=Vt((Z,V)=>{var u=sM();if(u)try{u([],"length")}catch{u=null}V.exports=u}),Qg=Vt((Z,V)=>{var u=Object.defineProperty||!1;if(u)try{u({},"a",{value:1})}catch{u=!1}V.exports=u}),lM=Vt((Z,V)=>{var u=typeof Symbol<"u"&&Symbol,d=P1();V.exports=function(){return typeof u!="function"||typeof Symbol!="function"||typeof u("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:d()}}),D2=Vt((Z,V)=>{V.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),F2=Vt((Z,V)=>{var u=P2();V.exports=u.getPrototypeOf||null}),uM=Vt((Z,V)=>{var u="Function.prototype.bind called on incompatible ",d=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"||d.apply(n)!==A)throw new TypeError(u+n);for(var o=e(arguments,1),a,s=function(){if(this instanceof a){var w=n.apply(this,t(o,arguments));return Object(w)===w?w:this}return n.apply(i,t(o,arguments))},f=E(0,n.length-o.length),v=[],g=0;g<f;g++)v[g]="$"+g;if(a=Function("binder","return function ("+r(v,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var m=function(){};m.prototype=n.prototype,a.prototype=new m,m.prototype=null}return a}}),Pm=Vt((Z,V)=>{var u=uM();V.exports=Function.prototype.bind||u}),O1=Vt((Z,V)=>{V.exports=Function.prototype.call}),B2=Vt((Z,V)=>{V.exports=Function.prototype.apply}),cM=Vt((Z,V)=>{V.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),fM=Vt((Z,V)=>{var u=Pm(),d=B2(),E=O1(),A=cM();V.exports=A||u.call(E,d)}),hM=Vt((Z,V)=>{var u=Pm(),d=Im(),E=O1(),A=fM();V.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new d("a function is required");return A(u,E,t)}}),pM=Vt((Z,V)=>{var u=hM(),d=d0(),E;try{E=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var A=!!E&&d&&d(Object.prototype,"__proto__"),t=Object,e=t.getPrototypeOf;V.exports=A&&typeof A.get=="function"?u([A.get]):typeof e=="function"?function(r){return e(r==null?r:t(r))}:!1}),dM=Vt((Z,V)=>{var u=D2(),d=F2(),E=pM();V.exports=u?function(A){return u(A)}:d?function(A){if(!A||typeof A!="object"&&typeof A!="function")throw new TypeError("getProto: not an object");return d(A)}:E?function(A){return E(A)}:null}),mM=Vt((Z,V)=>{var u=Function.prototype.call,d=Object.prototype.hasOwnProperty,E=Pm();V.exports=E.call(u,d)}),D1=Vt((Z,V)=>{var u,d=P2(),E=KA(),A=YA(),t=XA(),e=$A(),r=O2(),i=Im(),n=JA(),o=QA(),a=tM(),s=eM(),f=rM(),v=nM(),g=aM(),m=oM(),w=Function,l=function(Q){try{return w('"use strict"; return ('+Q+").constructor;")()}catch{}},x=d0(),y=Qg(),S=function(){throw new i},k=x?function(){try{return arguments.callee,S}catch{try{return x(arguments,"callee").get}catch{return S}}}():S,M=lM()(),T=dM(),c=F2(),h=D2(),b=B2(),_=O1(),P={},L=typeof Uint8Array>"u"||!T?u:T(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?u:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?u:ArrayBuffer,"%ArrayIteratorPrototype%":M&&T?T([][Symbol.iterator]()):u,"%AsyncFromSyncIteratorPrototype%":u,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?u:Atomics,"%BigInt%":typeof BigInt>"u"?u:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?u:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?u:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?u:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":E,"%eval%":eval,"%EvalError%":A,"%Float16Array%":typeof Float16Array>"u"?u:Float16Array,"%Float32Array%":typeof Float32Array>"u"?u:Float32Array,"%Float64Array%":typeof Float64Array>"u"?u:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?u:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?u:Int8Array,"%Int16Array%":typeof Int16Array>"u"?u:Int16Array,"%Int32Array%":typeof Int32Array>"u"?u:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&T?T(T([][Symbol.iterator]())):u,"%JSON%":typeof JSON=="object"?JSON:u,"%Map%":typeof Map>"u"?u:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!T?u:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":d,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?u:Promise,"%Proxy%":typeof Proxy>"u"?u:Proxy,"%RangeError%":t,"%ReferenceError%":e,"%Reflect%":typeof Reflect>"u"?u:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?u:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!T?u:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?u:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&T?T(""[Symbol.iterator]()):u,"%Symbol%":M?Symbol:u,"%SyntaxError%":r,"%ThrowTypeError%":k,"%TypedArray%":L,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?u:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?u:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?u:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?u:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?u:WeakMap,"%WeakRef%":typeof WeakRef>"u"?u:WeakRef,"%WeakSet%":typeof WeakSet>"u"?u:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":b,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":c,"%Math.abs%":o,"%Math.floor%":a,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":v,"%Math.round%":g,"%Math.sign%":m,"%Reflect.getPrototypeOf%":h};if(T)try{null.error}catch(Q){B=T(T(Q)),D["%Error.prototype%"]=B}var B,R=function Q(ut){var J;if(ut==="%AsyncFunction%")J=l("async function () {}");else if(ut==="%GeneratorFunction%")J=l("function* () {}");else if(ut==="%AsyncGeneratorFunction%")J=l("async function* () {}");else if(ut==="%AsyncGenerator%"){var q=Q("%AsyncGeneratorFunction%");q&&(J=q.prototype)}else if(ut==="%AsyncIteratorPrototype%"){var it=Q("%AsyncGenerator%");it&&T&&(J=T(it.prototype))}return D[ut]=J,J},I={__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"]},F=Pm(),N=mM(),j=F.call(_,Array.prototype.concat),G=F.call(b,Array.prototype.splice),rt=F.call(_,String.prototype.replace),ct=F.call(_,String.prototype.slice),st=F.call(_,RegExp.prototype.exec),et=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,ot=function(Q){var ut=ct(Q,0,1),J=ct(Q,-1);if(ut==="%"&&J!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(J==="%"&&ut!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var q=[];return rt(Q,et,function(it,nt,dt,Tt){q[q.length]=dt?rt(Tt,K,"$1"):nt||it}),q},X=function(Q,ut){var J=Q,q;if(N(I,J)&&(q=I[J],J="%"+q[0]+"%"),N(D,J)){var it=D[J];if(it===P&&(it=R(J)),typeof it>"u"&&!ut)throw new i("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:q,name:J,value:it}}throw new r("intrinsic "+Q+" does not exist!")};V.exports=function(Q,ut){if(typeof Q!="string"||Q.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ut!="boolean")throw new i('"allowMissing" argument must be a boolean');if(st(/^%?[^%]*%?$/,Q)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var J=ot(Q),q=J.length>0?J[0]:"",it=X("%"+q+"%",ut),nt=it.name,dt=it.value,Tt=!1,wt=it.alias;wt&&(q=wt[0],G(J,j([0,1],wt)));for(var It=1,Ct=!0;It<J.length;It+=1){var Nt=J[It],ee=ct(Nt,0,1),Jt=ct(Nt,-1);if((ee==='"'||ee==="'"||ee==="`"||Jt==='"'||Jt==="'"||Jt==="`")&&ee!==Jt)throw new r("property names with quotes must have matching quotes");if((Nt==="constructor"||!Ct)&&(Tt=!0),q+="."+Nt,nt="%"+q+"%",N(D,nt))dt=D[nt];else if(dt!=null){if(!(Nt in dt)){if(!ut)throw new i("base intrinsic for "+Q+" exists, but the property is not available.");return}if(x&&It+1>=J.length){var te=x(dt,Nt);Ct=!!te,Ct&&"get"in te&&!("originalValue"in te.get)?dt=te.get:dt=dt[Nt]}else Ct=N(dt,Nt),dt=dt[Nt];Ct&&!Tt&&(D[nt]=dt)}}return dt}}),gM=Vt((Z,V)=>{var u=Qg(),d=O2(),E=Im(),A=d0();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(u)u(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 d("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),R2=Vt((Z,V)=>{var u=Qg(),d=function(){return!!u};d.hasArrayLengthDefineBug=function(){if(!u)return null;try{return u([],"length",{value:1}).length!==1}catch{return!0}},V.exports=d}),vM=Vt((Z,V)=>{var u=D1(),d=gM(),E=R2()(),A=d0(),t=Im(),e=u("%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?d(r,"length",i,!0,!0):d(r,"length",i)),r}}),tv=Vt((Z,V)=>{var u=Pm(),d=D1(),E=vM(),A=Im(),t=d("%Function.prototype.apply%"),e=d("%Function.prototype.call%"),r=d("%Reflect.apply%",!0)||u.call(e,t),i=Qg(),n=d("%Math.max%");V.exports=function(a){if(typeof a!="function")throw new A("a function is required");var s=r(u,e,arguments);return E(s,1+n(0,a.length-(arguments.length-1)),!0)};var o=function(){return r(u,t,arguments)};i?i(V.exports,"apply",{value:o}):V.exports.apply=o}),Om=Vt((Z,V)=>{var u=D1(),d=tv(),E=d(u("String.prototype.indexOf"));V.exports=function(A,t){var e=u(A,!!t);return typeof e=="function"&&E(A,".prototype.")>-1?d(e):e}}),yM=Vt((Z,V)=>{var u=Jg()(),d=Om(),E=d("Object.prototype.toString"),A=function(r){return u&&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((Z,V)=>{var u=Object.prototype.toString,d=Function.prototype.toString,E=/^\s*(?:function)?\*/,A=Jg()(),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(d.call(i)))return!0;if(!A){var n=u.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((Z,V)=>{var u=Function.prototype.toString,d=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,E,A;if(typeof d=="function"&&typeof Object.defineProperty=="function")try{E=Object.defineProperty({},"length",{get:function(){throw A}}),A={},d(function(){throw 42},null,E)}catch(x){x!==A&&(d=null)}else d=null;var t=/^\s*class\b/,e=function(x){try{var y=u.call(x);return t.test(y)}catch{return!1}},r=function(x){try{return e(x)?!1:(u.call(x),!0)}catch{return!1}},i=Object.prototype.toString,n="[object Object]",o="[object Function]",a="[object GeneratorFunction]",s="[object HTMLAllCollection]",f="[object HTML document.all class]",v="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),w=function(){return!1};typeof document=="object"&&(l=document.all,i.call(l)===i.call(document.all)&&(w=function(x){if((m||!x)&&(typeof x>"u"||typeof x=="object"))try{var y=i.call(x);return(y===s||y===f||y===v||y===n)&&x("")==null}catch{}return!1}));var l;V.exports=d?function(x){if(w(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{d(x,null,E)}catch(y){if(y!==A)return!1}return!e(x)&&r(x)}:function(x){if(w(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(g)return r(x);if(e(x))return!1;var y=i.call(x);return y!==o&&y!==a&&!/^\[object HTML/.test(y)?!1:r(x)}}),N2=Vt((Z,V)=>{var u=_M(),d=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(!u(n))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=o),d.call(i)==="[object Array]"?A(i,n,a):typeof i=="string"?t(i,n,a):e(i,n,a)};V.exports=r}),j2=Vt((Z,V)=>{var u=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],d=typeof globalThis>"u"?window:globalThis;V.exports=function(){for(var E=[],A=0;A<u.length;A++)typeof d[u[A]]=="function"&&(E[E.length]=u[A]);return E}}),bM=Vt((Z,V)=>{var u=N2(),d=j2(),E=tv(),A=Om(),t=d0(),e=A("Object.prototype.toString"),r=Jg()(),i=typeof globalThis>"u"?window:globalThis,n=d(),o=A("String.prototype.slice"),a=Object.getPrototypeOf,s=A("Array.prototype.indexOf",!0)||function(m,w){for(var l=0;l<m.length;l+=1)if(m[l]===w)return l;return-1},f={__proto__:null};r&&t&&a?u(n,function(m){var w=new i[m];if(Symbol.toStringTag in w){var l=a(w),x=t(l,Symbol.toStringTag);if(!x){var y=a(l);x=t(y,Symbol.toStringTag)}f["$"+m]=E(x.get)}}):u(n,function(m){var w=new i[m],l=w.slice||w.set;l&&(f["$"+m]=E(l))});var v=function(m){var w=!1;return u(f,function(l,x){if(!w)try{"$"+l(m)===x&&(w=o(x,1))}catch{}}),w},g=function(m){var w=!1;return u(f,function(l,x){if(!w)try{l(m),w=o(x,1)}catch{}}),w};V.exports=function(m){if(!m||typeof m!="object")return!1;if(!r){var w=o(e(m),8,-1);return s(n,w)>-1?w:w!=="Object"?!1:g(m)}return t?v(m):null}}),wM=Vt((Z,V)=>{var u=N2(),d=j2(),E=Om(),A=E("Object.prototype.toString"),t=Jg()(),e=d0(),r=typeof globalThis>"u"?window:globalThis,i=d(),n=E("Array.prototype.indexOf",!0)||function(v,g){for(var m=0;m<v.length;m+=1)if(v[m]===g)return m;return-1},o=E("String.prototype.slice"),a={},s=Object.getPrototypeOf;t&&e&&s&&u(i,function(v){var g=new r[v];if(Symbol.toStringTag in g){var m=s(g),w=e(m,Symbol.toStringTag);if(!w){var l=s(m);w=e(l,Symbol.toStringTag)}a[v]=w.get}});var f=function(v){var g=!1;return u(a,function(m,w){if(!g)try{g=m.call(v)===w}catch{}}),g};V.exports=function(v){if(!v||typeof v!="object")return!1;if(!t||!(Symbol.toStringTag in v)){var g=o(A(v),8,-1);return n(i,g)>-1}return e?f(v):!1}}),U2=Vt(Z=>{var V=yM(),u=xM(),d=bM(),E=wM();function A(wt){return wt.call.bind(wt)}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 f(wt,It){if(typeof wt!="object")return!1;try{return It(wt),!0}catch{return!1}}Z.isArgumentsObject=V,Z.isGeneratorFunction=u,Z.isTypedArray=E;function v(wt){return typeof Promise<"u"&&wt instanceof Promise||wt!==null&&typeof wt=="object"&&typeof wt.then=="function"&&typeof wt.catch=="function"}Z.isPromise=v;function g(wt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(wt):E(wt)||G(wt)}Z.isArrayBufferView=g;function m(wt){return d(wt)==="Uint8Array"}Z.isUint8Array=m;function w(wt){return d(wt)==="Uint8ClampedArray"}Z.isUint8ClampedArray=w;function l(wt){return d(wt)==="Uint16Array"}Z.isUint16Array=l;function x(wt){return d(wt)==="Uint32Array"}Z.isUint32Array=x;function y(wt){return d(wt)==="Int8Array"}Z.isInt8Array=y;function S(wt){return d(wt)==="Int16Array"}Z.isInt16Array=S;function k(wt){return d(wt)==="Int32Array"}Z.isInt32Array=k;function M(wt){return d(wt)==="Float32Array"}Z.isFloat32Array=M;function T(wt){return d(wt)==="Float64Array"}Z.isFloat64Array=T;function c(wt){return d(wt)==="BigInt64Array"}Z.isBigInt64Array=c;function h(wt){return d(wt)==="BigUint64Array"}Z.isBigUint64Array=h;function b(wt){return r(wt)==="[object Map]"}b.working=typeof Map<"u"&&b(new Map);function _(wt){return typeof Map>"u"?!1:b.working?b(wt):wt instanceof Map}Z.isMap=_;function P(wt){return r(wt)==="[object Set]"}P.working=typeof Set<"u"&&P(new Set);function L(wt){return typeof Set>"u"?!1:P.working?P(wt):wt instanceof Set}Z.isSet=L;function D(wt){return r(wt)==="[object WeakMap]"}D.working=typeof WeakMap<"u"&&D(new WeakMap);function B(wt){return typeof WeakMap>"u"?!1:D.working?D(wt):wt instanceof WeakMap}Z.isWeakMap=B;function R(wt){return r(wt)==="[object WeakSet]"}R.working=typeof WeakSet<"u"&&R(new WeakSet);function I(wt){return R(wt)}Z.isWeakSet=I;function F(wt){return r(wt)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer<"u"&&F(new ArrayBuffer);function N(wt){return typeof ArrayBuffer>"u"?!1:F.working?F(wt):wt instanceof ArrayBuffer}Z.isArrayBuffer=N;function j(wt){return r(wt)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function G(wt){return typeof DataView>"u"?!1:j.working?j(wt):wt instanceof DataView}Z.isDataView=G;var rt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ct(wt){return r(wt)==="[object SharedArrayBuffer]"}function st(wt){return typeof rt>"u"?!1:(typeof ct.working>"u"&&(ct.working=ct(new rt)),ct.working?ct(wt):wt instanceof rt)}Z.isSharedArrayBuffer=st;function et(wt){return r(wt)==="[object AsyncFunction]"}Z.isAsyncFunction=et;function K(wt){return r(wt)==="[object Map Iterator]"}Z.isMapIterator=K;function ot(wt){return r(wt)==="[object Set Iterator]"}Z.isSetIterator=ot;function X(wt){return r(wt)==="[object Generator]"}Z.isGeneratorObject=X;function Q(wt){return r(wt)==="[object WebAssembly.Module]"}Z.isWebAssemblyCompiledModule=Q;function ut(wt){return f(wt,i)}Z.isNumberObject=ut;function J(wt){return f(wt,n)}Z.isStringObject=J;function q(wt){return f(wt,o)}Z.isBooleanObject=q;function it(wt){return t&&f(wt,a)}Z.isBigIntObject=it;function nt(wt){return e&&f(wt,s)}Z.isSymbolObject=nt;function dt(wt){return ut(wt)||J(wt)||q(wt)||it(wt)||nt(wt)}Z.isBoxedPrimitive=dt;function Tt(wt){return typeof Uint8Array<"u"&&(N(wt)||st(wt))}Z.isAnyArrayBuffer=Tt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(wt){Object.defineProperty(Z,wt,{enumerable:!1,value:function(){throw new Error(wt+" is not supported in userland")}})})}),V2=Vt((Z,V)=>{V.exports=function(u){return u&&typeof u=="object"&&typeof u.copy=="function"&&typeof u.fill=="function"&&typeof u.readUInt8=="function"}}),H2=Vt(Z=>{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},u=/%[sdj%]/g;Z.format=function(j){if(!y(j)){for(var G=[],rt=0;rt<arguments.length;rt++)G.push(t(arguments[rt]));return G.join(" ")}for(var rt=1,ct=arguments,st=ct.length,et=String(j).replace(u,function(X){if(X==="%%")return"%";if(rt>=st)return X;switch(X){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 X}}),K=ct[rt];rt<st;K=ct[++rt])w(K)||!T(K)?et+=" "+K:et+=" "+t(K);return et},Z.deprecate=function(j,G){if(typeof process<"u"&&process.noDeprecation===!0)return j;if(typeof process>"u")return function(){return Z.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 d={},E=/^$/;A="false",A=A.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),E=new RegExp("^"+A+"$","i");var A;Z.debuglog=function(j){if(j=j.toUpperCase(),!d[j])if(E.test(j)){var G=process.pid;d[j]=function(){var rt=Z.format.apply(Z,arguments);console.error("%s %d: %s",j,G,rt)}}else d[j]=function(){};return d[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]),m(G)?rt.showHidden=G:G&&Z._extend(rt,G),k(rt.showHidden)&&(rt.showHidden=!1),k(rt.depth)&&(rt.depth=2),k(rt.colors)&&(rt.colors=!1),k(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=e),n(rt,j,rt.depth)}Z.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&&b(G.inspect)&&G.inspect!==Z.inspect&&!(G.constructor&&G.constructor.prototype===G)){var ct=G.inspect(rt,j);return y(ct)||(ct=n(j,ct,rt)),ct}var st=o(j,G);if(st)return st;var et=Object.keys(G),K=i(et);if(j.showHidden&&(et=Object.getOwnPropertyNames(G)),h(G)&&(et.indexOf("message")>=0||et.indexOf("description")>=0))return a(G);if(et.length===0){if(b(G)){var ot=G.name?": "+G.name:"";return j.stylize("[Function"+ot+"]","special")}if(M(G))return j.stylize(RegExp.prototype.toString.call(G),"regexp");if(c(G))return j.stylize(Date.prototype.toString.call(G),"date");if(h(G))return a(G)}var X="",Q=!1,ut=["{","}"];if(g(G)&&(Q=!0,ut=["[","]"]),b(G)){var J=G.name?": "+G.name:"";X=" [Function"+J+"]"}if(M(G)&&(X=" "+RegExp.prototype.toString.call(G)),c(G)&&(X=" "+Date.prototype.toUTCString.call(G)),h(G)&&(X=" "+a(G)),et.length===0&&(!Q||G.length==0))return ut[0]+X+ut[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,K,et):q=et.map(function(it){return f(j,G,rt,K,it,Q)}),j.seen.pop(),v(q,X,ut)}function o(j,G){if(k(G))return j.stylize("undefined","undefined");if(y(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(m(G))return j.stylize(""+G,"boolean");if(w(G))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,G,rt,ct,st){for(var et=[],K=0,ot=G.length;K<ot;++K)R(G,String(K))?et.push(f(j,G,rt,ct,String(K),!0)):et.push("");return st.forEach(function(X){X.match(/^\d+$/)||et.push(f(j,G,rt,ct,X,!0))}),et}function f(j,G,rt,ct,st,et){var K,ot,X;if(X=Object.getOwnPropertyDescriptor(G,st)||{value:G[st]},X.get?X.set?ot=j.stylize("[Getter/Setter]","special"):ot=j.stylize("[Getter]","special"):X.set&&(ot=j.stylize("[Setter]","special")),R(ct,st)||(K="["+st+"]"),ot||(j.seen.indexOf(X.value)<0?(w(rt)?ot=n(j,X.value,null):ot=n(j,X.value,rt-1),ot.indexOf(`
`)>-1&&(et?ot=ot.split(`
`).map(function(Q){return" "+Q}).join(`
`).slice(2):ot=`
`+ot.split(`
`).map(function(Q){return" "+Q}).join(`
`))):ot=j.stylize("[Circular]","special")),k(K)){if(et&&st.match(/^\d+$/))return ot;K=JSON.stringify(""+st),K.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(K=K.slice(1,-1),K=j.stylize(K,"name")):(K=K.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),K=j.stylize(K,"string"))}return K+": "+ot}function v(j,G,rt){var ct=0,st=j.reduce(function(et,K){return ct++,K.indexOf(`
`)>=0&&ct++,et+K.replace(/\u001b\[\d\d?m/g,"").length+1},0);return st>60?rt[0]+(G===""?"":G+`
`)+" "+j.join(`,
`)+" "+rt[1]:rt[0]+G+" "+j.join(", ")+" "+rt[1]}Z.types=U2();function g(j){return Array.isArray(j)}Z.isArray=g;function m(j){return typeof j=="boolean"}Z.isBoolean=m;function w(j){return j===null}Z.isNull=w;function l(j){return j==null}Z.isNullOrUndefined=l;function x(j){return typeof j=="number"}Z.isNumber=x;function y(j){return typeof j=="string"}Z.isString=y;function S(j){return typeof j=="symbol"}Z.isSymbol=S;function k(j){return j===void 0}Z.isUndefined=k;function M(j){return T(j)&&P(j)==="[object RegExp]"}Z.isRegExp=M,Z.types.isRegExp=M;function T(j){return typeof j=="object"&&j!==null}Z.isObject=T;function c(j){return T(j)&&P(j)==="[object Date]"}Z.isDate=c,Z.types.isDate=c;function h(j){return T(j)&&(P(j)==="[object Error]"||j instanceof Error)}Z.isError=h,Z.types.isNativeError=h;function b(j){return typeof j=="function"}Z.isFunction=b;function _(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}Z.isPrimitive=_,Z.isBuffer=V2();function P(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var j=new Date,G=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),D[j.getMonth()],G].join(" ")}Z.log=function(){console.log("%s - %s",B(),Z.format.apply(Z,arguments))},Z.inherits=Rp(),Z._extend=function(j,G){if(!G||!T(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 I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&j[I]){var G=j[I];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,I,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var rt,ct,st=new Promise(function(ot,X){rt=ot,ct=X}),et=[],K=0;K<arguments.length;K++)et.push(arguments[K]);et.push(function(ot,X){ot?ct(ot):rt(X)});try{j.apply(this,et)}catch(ot){ct(ot)}return st}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),I&&Object.defineProperty(G,I,{value:G,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(G,V(j))},Z.promisify.custom=I;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 st=rt.pop();if(typeof st!="function")throw new TypeError("The last argument must be of type Function");var et=this,K=function(){return st.apply(et,arguments)};j.apply(this,rt).then(function(ot){process.nextTick(K.bind(null,null,ot))},function(ot){process.nextTick(F.bind(null,ot,K))})}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),Object.defineProperties(G,V(j)),G}Z.callbackify=N}),TM=Vt((Z,V)=>{function u(f,v){var g=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);v&&(m=m.filter(function(w){return Object.getOwnPropertyDescriptor(f,w).enumerable})),g.push.apply(g,m)}return g}function d(f){for(var v=1;v<arguments.length;v++){var g=arguments[v]!=null?arguments[v]:{};v%2?u(Object(g),!0).forEach(function(m){E(f,m,g[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(g)):u(Object(g)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(g,m))})}return f}function E(f,v,g){return v in f?Object.defineProperty(f,v,{value:g,enumerable:!0,configurable:!0,writable:!0}):f[v]=g,f}function A(f,v){if(!(f instanceof v))throw new TypeError("Cannot call a class as a function")}function t(f,v){for(var g=0;g<v.length;g++){var m=v[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}function e(f,v,g){return v&&t(f.prototype,v),f}var r=p0(),i=r.Buffer,n=H2(),o=n.inspect,a=o&&o.custom||"inspect";function s(f,v,g){i.prototype.copy.call(f,v,g)}V.exports=function(){function f(){A(this,f),this.head=null,this.tail=null,this.length=0}return e(f,[{key:"push",value:function(v){var g={data:v,next:null};this.length>0?this.tail.next=g:this.head=g,this.tail=g,++this.length}},{key:"unshift",value:function(v){var g={data:v,next:this.head};this.length===0&&(this.tail=g),this.head=g,++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 g=this.head,m=""+g.data;g=g.next;)m+=v+g.data;return m}},{key:"concat",value:function(v){if(this.length===0)return i.alloc(0);for(var g=i.allocUnsafe(v>>>0),m=this.head,w=0;m;)s(m.data,g,w),w+=m.data.length,m=m.next;return g}},{key:"consume",value:function(v,g){var m;return v<this.head.data.length?(m=this.head.data.slice(0,v),this.head.data=this.head.data.slice(v)):v===this.head.data.length?m=this.shift():m=g?this._getString(v):this._getBuffer(v),m}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(v){var g=this.head,m=1,w=g.data;for(v-=w.length;g=g.next;){var l=g.data,x=v>l.length?l.length:v;if(x===l.length?w+=l:w+=l.slice(0,v),v-=x,v===0){x===l.length?(++m,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=l.slice(x));break}++m}return this.length-=m,w}},{key:"_getBuffer",value:function(v){var g=i.allocUnsafe(v),m=this.head,w=1;for(m.data.copy(g),v-=m.data.length;m=m.next;){var l=m.data,x=v>l.length?l.length:v;if(l.copy(g,g.length-v,0,x),v-=x,v===0){x===l.length?(++w,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=l.slice(x));break}++w}return this.length-=w,g}},{key:a,value:function(v,g){return o(this,d({},g,{depth:0,customInspect:!1}))}}]),f}()}),q2=Vt((Z,V)=>{function u(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(d,n,s)):process.nextTick(d,n,s):i?(process.nextTick(E,n),i(s)):process.nextTick(E,n)}),this)}function d(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:u,undestroy:A,errorOrDestroy:e}}),m0=Vt((Z,V)=>{function u(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.__proto__=n}var d={};function E(i,n,o){o||(o=Error);function a(f,v,g){return typeof n=="string"?n:n(f,v,g)}var s=function(f){u(v,f);function v(g,m,w){return f.call(this,a(g,m,w))||this}return v}(o);s.prototype.name=o.name,s.prototype.code=i,d[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 f=r(i,".")?"property":"argument";s='The "'.concat(i,'" ').concat(f," ").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=d}),W2=Vt((Z,V)=>{var u=m0().codes.ERR_INVALID_OPT_VALUE;function d(A,t,e){return A.highWaterMark!=null?A.highWaterMark:t?A[e]:null}function E(A,t,e,r){var i=d(t,r,e);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var n=r?e:"highWaterMark";throw new u(n,i)}return Math.floor(i)}return A.objectMode?16:16*1024}V.exports={getHighWaterMark:E}}),kM=Vt((Z,V)=>{V.exports=u;function u(E,A){if(d("noDeprecation"))return E;var t=!1;function e(){if(!t){if(d("throwDeprecation"))throw new Error(A);d("traceDeprecation")?console.trace(A):console.warn(A),t=!0}return E.apply(this,arguments)}return e}function d(E){try{if(!window.localStorage)return!1}catch{return!1}var A=window.localStorage[E];return A==null?!1:String(A).toLowerCase()==="true"}}),G2=Vt((Z,V)=>{V.exports=c;function u(K){var ot=this;this.next=null,this.entry=null,this.finish=function(){et(ot,K)}}var d;c.WritableState=M;var E={deprecate:kM()},A=I2(),t=p0().Buffer,e=window.Uint8Array||function(){};function r(K){return t.from(K)}function i(K){return t.isBuffer(K)||K instanceof e}var n=q2(),o=W2(),a=o.getHighWaterMark,s=m0().codes,f=s.ERR_INVALID_ARG_TYPE,v=s.ERR_METHOD_NOT_IMPLEMENTED,g=s.ERR_MULTIPLE_CALLBACK,m=s.ERR_STREAM_CANNOT_PIPE,w=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,x=s.ERR_STREAM_WRITE_AFTER_END,y=s.ERR_UNKNOWN_ENCODING,S=n.errorOrDestroy;Rp()(c,A);function k(){}function M(K,ot,X){d=d||g0(),K=K||{},typeof X!="boolean"&&(X=ot instanceof d),this.objectMode=!!K.objectMode,X&&(this.objectMode=this.objectMode||!!K.writableObjectMode),this.highWaterMark=a(this,K,"writableHighWaterMark",X),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=K.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=K.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ut){R(ot,ut)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=K.emitClose!==!1,this.autoDestroy=!!K.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new u(this)}M.prototype.getBuffer=function(){for(var K=this.bufferedRequest,ot=[];K;)ot.push(K),K=K.next;return ot},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 T;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(K){return T.call(this,K)?!0:this!==c?!1:K&&K._writableState instanceof M}})):T=function(K){return K instanceof this};function c(K){d=d||g0();var ot=this instanceof d;if(!ot&&!T.call(c,this))return new c(K);this._writableState=new M(K,this,ot),this.writable=!0,K&&(typeof K.write=="function"&&(this._write=K.write),typeof K.writev=="function"&&(this._writev=K.writev),typeof K.destroy=="function"&&(this._destroy=K.destroy),typeof K.final=="function"&&(this._final=K.final)),A.call(this)}c.prototype.pipe=function(){S(this,new m)};function h(K,ot){var X=new x;S(K,X),process.nextTick(ot,X)}function b(K,ot,X,Q){var ut;return X===null?ut=new l:typeof X!="string"&&!ot.objectMode&&(ut=new f("chunk",["string","Buffer"],X)),ut?(S(K,ut),process.nextTick(Q,ut),!1):!0}c.prototype.write=function(K,ot,X){var Q=this._writableState,ut=!1,J=!Q.objectMode&&i(K);return J&&!t.isBuffer(K)&&(K=r(K)),typeof ot=="function"&&(X=ot,ot=null),J?ot="buffer":ot||(ot=Q.defaultEncoding),typeof X!="function"&&(X=k),Q.ending?h(this,X):(J||b(this,Q,K,X))&&(Q.pendingcb++,ut=P(this,Q,J,K,ot,X)),ut},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var K=this._writableState;K.corked&&(K.corked--,!K.writing&&!K.corked&&!K.bufferProcessing&&K.bufferedRequest&&N(this,K))},c.prototype.setDefaultEncoding=function(K){if(typeof K=="string"&&(K=K.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((K+"").toLowerCase())>-1))throw new y(K);return this._writableState.defaultEncoding=K,this},Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function _(K,ot,X){return!K.objectMode&&K.decodeStrings!==!1&&typeof ot=="string"&&(ot=t.from(ot,X)),ot}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function P(K,ot,X,Q,ut,J){if(!X){var q=_(ot,Q,ut);Q!==q&&(X=!0,ut="buffer",Q=q)}var it=ot.objectMode?1:Q.length;ot.length+=it;var nt=ot.length<ot.highWaterMark;if(nt||(ot.needDrain=!0),ot.writing||ot.corked){var dt=ot.lastBufferedRequest;ot.lastBufferedRequest={chunk:Q,encoding:ut,isBuf:X,callback:J,next:null},dt?dt.next=ot.lastBufferedRequest:ot.bufferedRequest=ot.lastBufferedRequest,ot.bufferedRequestCount+=1}else L(K,ot,!1,it,Q,ut,J);return nt}function L(K,ot,X,Q,ut,J,q){ot.writelen=Q,ot.writecb=q,ot.writing=!0,ot.sync=!0,ot.destroyed?ot.onwrite(new w("write")):X?K._writev(ut,ot.onwrite):K._write(ut,J,ot.onwrite),ot.sync=!1}function D(K,ot,X,Q,ut){--ot.pendingcb,X?(process.nextTick(ut,Q),process.nextTick(ct,K,ot),K._writableState.errorEmitted=!0,S(K,Q)):(ut(Q),K._writableState.errorEmitted=!0,S(K,Q),ct(K,ot))}function B(K){K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0}function R(K,ot){var X=K._writableState,Q=X.sync,ut=X.writecb;if(typeof ut!="function")throw new g;if(B(X),ot)D(K,X,Q,ot,ut);else{var J=j(X)||K.destroyed;!J&&!X.corked&&!X.bufferProcessing&&X.bufferedRequest&&N(K,X),Q?process.nextTick(I,K,X,J,ut):I(K,X,J,ut)}}function I(K,ot,X,Q){X||F(K,ot),ot.pendingcb--,Q(),ct(K,ot)}function F(K,ot){ot.length===0&&ot.needDrain&&(ot.needDrain=!1,K.emit("drain"))}function N(K,ot){ot.bufferProcessing=!0;var X=ot.bufferedRequest;if(K._writev&&X&&X.next){var Q=ot.bufferedRequestCount,ut=new Array(Q),J=ot.corkedRequestsFree;J.entry=X;for(var q=0,it=!0;X;)ut[q]=X,X.isBuf||(it=!1),X=X.next,q+=1;ut.allBuffers=it,L(K,ot,!0,ot.length,ut,"",J.finish),ot.pendingcb++,ot.lastBufferedRequest=null,J.next?(ot.corkedRequestsFree=J.next,J.next=null):ot.corkedRequestsFree=new u(ot),ot.bufferedRequestCount=0}else{for(;X;){var nt=X.chunk,dt=X.encoding,Tt=X.callback,wt=ot.objectMode?1:nt.length;if(L(K,ot,!1,wt,nt,dt,Tt),X=X.next,ot.bufferedRequestCount--,ot.writing)break}X===null&&(ot.lastBufferedRequest=null)}ot.bufferedRequest=X,ot.bufferProcessing=!1}c.prototype._write=function(K,ot,X){X(new v("_write()"))},c.prototype._writev=null,c.prototype.end=function(K,ot,X){var Q=this._writableState;return typeof K=="function"?(X=K,K=null,ot=null):typeof ot=="function"&&(X=ot,ot=null),K!=null&&this.write(K,ot),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||st(this,Q,X),this},Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function j(K){return K.ending&&K.length===0&&K.bufferedRequest===null&&!K.finished&&!K.writing}function G(K,ot){K._final(function(X){ot.pendingcb--,X&&S(K,X),ot.prefinished=!0,K.emit("prefinish"),ct(K,ot)})}function rt(K,ot){!ot.prefinished&&!ot.finalCalled&&(typeof K._final=="function"&&!ot.destroyed?(ot.pendingcb++,ot.finalCalled=!0,process.nextTick(G,K,ot)):(ot.prefinished=!0,K.emit("prefinish")))}function ct(K,ot){var X=j(ot);if(X&&(rt(K,ot),ot.pendingcb===0&&(ot.finished=!0,K.emit("finish"),ot.autoDestroy))){var Q=K._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&K.destroy()}return X}function st(K,ot,X){ot.ending=!0,ct(K,ot),X&&(ot.finished?process.nextTick(X):K.once("finish",X)),ot.ended=!0,K.writable=!1}function et(K,ot,X){var Q=K.entry;for(K.entry=null;Q;){var ut=Q.callback;ot.pendingcb--,ut(X),Q=Q.next}ot.corkedRequestsFree.next=K}Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(K){this._writableState&&(this._writableState.destroyed=K)}}),c.prototype.destroy=n.destroy,c.prototype._undestroy=n.undestroy,c.prototype._destroy=function(K,ot){ot(K)}}),g0=Vt((Z,V)=>{var u=Object.keys||function(o){var a=[];for(var s in o)a.push(s);return a};V.exports=r;var d=K2(),E=G2();for(Rp()(r,d),A=u(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);d.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)}})}),AM=Vt((Z,V)=>{var u=p0(),d=u.Buffer;function E(t,e){for(var r in t)e[r]=t[r]}d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?V.exports=u:(E(u,Z),Z.Buffer=A);function A(t,e,r){return d(t,e,r)}A.prototype=Object.create(d.prototype),E(d,A),A.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return d(t,e,r)},A.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=d(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 d(t)},A.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(t)}}),Z2=Vt(Z=>{var V=AM().Buffer,u=V.isEncoding||function(w){switch(w=""+w,w&&w.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 d(w){if(!w)return"utf8";for(var l;;)switch(w){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 w;default:if(l)return;w=(""+w).toLowerCase(),l=!0}}function E(w){var l=d(w);if(typeof l!="string"&&(V.isEncoding===u||!u(w)))throw new Error("Unknown encoding: "+w);return l||w}Z.StringDecoder=A;function A(w){this.encoding=E(w);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=f,this.end=v,l=3;break;default:this.write=g,this.end=m;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(l)}A.prototype.write=function(w){if(w.length===0)return"";var l,x;if(this.lastNeed){if(l=this.fillLast(w),l===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<w.length?l?l+this.text(w,x):this.text(w,x):l||""},A.prototype.end=o,A.prototype.text=n,A.prototype.fillLast=function(w){if(this.lastNeed<=w.length)return w.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,this.lastTotal-this.lastNeed,0,w.length),this.lastNeed-=w.length};function t(w){return w<=127?0:w>>5===6?2:w>>4===14?3:w>>3===30?4:w>>6===2?-1:-2}function e(w,l,x){var y=l.length-1;if(y<x)return 0;var S=t(l[y]);return S>=0?(S>0&&(w.lastNeed=S-1),S):--y<x||S===-2?0:(S=t(l[y]),S>=0?(S>0&&(w.lastNeed=S-2),S):--y<x||S===-2?0:(S=t(l[y]),S>=0?(S>0&&(S===2?S=0:w.lastNeed=S-3),S):0))}function r(w,l,x){if((l[0]&192)!==128)return w.lastNeed=0,"";if(w.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return w.lastNeed=1,"";if(w.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return w.lastNeed=2,""}}function i(w){var l=this.lastTotal-this.lastNeed,x=r(this,w);if(x!==void 0)return x;if(this.lastNeed<=w.length)return w.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,l,0,w.length),this.lastNeed-=w.length}function n(w,l){var x=e(this,w,l);if(!this.lastNeed)return w.toString("utf8",l);this.lastTotal=x;var y=w.length-(x-this.lastNeed);return w.copy(this.lastChar,0,y),w.toString("utf8",l,y)}function o(w){var l=w&&w.length?this.write(w):"";return this.lastNeed?l+"":l}function a(w,l){if((w.length-l)%2===0){var x=w.toString("utf16le",l);if(x){var y=x.charCodeAt(x.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=w[w.length-1],w.toString("utf16le",l,w.length-1)}function s(w){var l=w&&w.length?this.write(w):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,x)}return l}function f(w,l){var x=(w.length-l)%3;return x===0?w.toString("base64",l):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=w[w.length-1]:(this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1]),w.toString("base64",l,w.length-x))}function v(w){var l=w&&w.length?this.write(w):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function g(w){return w.toString(this.encoding)}function m(w){return w&&w.length?this.write(w):""}}),F1=Vt((Z,V)=>{var u=m0().codes.ERR_STREAM_PREMATURE_CLOSE;function d(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=d(i||E);var n=r.readable||r.readable!==!1&&e.readable,o=r.writable||r.writable!==!1&&e.writable,a=function(){e.writable||f()},s=e._writableState&&e._writableState.finished,f=function(){o=!1,s=!0,n||i.call(e)},v=e._readableState&&e._readableState.endEmitted,g=function(){n=!1,v=!0,o||i.call(e)},m=function(x){i.call(e,x)},w=function(){var x;if(n&&!v)return(!e._readableState||!e._readableState.ended)&&(x=new u),i.call(e,x);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(x=new u),i.call(e,x)},l=function(){e.req.on("finish",f)};return A(e)?(e.on("complete",f),e.on("abort",w),e.req?l():e.on("request",l)):o&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",g),e.on("finish",f),r.error!==!1&&e.on("error",m),e.on("close",w),function(){e.removeListener("complete",f),e.removeListener("abort",w),e.removeListener("request",l),e.req&&e.req.removeListener("finish",f),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",f),e.removeListener("end",g),e.removeListener("error",m),e.removeListener("close",w)}}V.exports=t}),MM=Vt((Z,V)=>{var u;function d(l,x,y){return x in l?Object.defineProperty(l,x,{value:y,enumerable:!0,configurable:!0,writable:!0}):l[x]=y,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 y=l[o].read();y!==null&&(l[i]=null,l[A]=null,l[t]=null,x(a(y,!1)))}}function f(l){process.nextTick(s,l)}function v(l,x){return function(y,S){l.then(function(){if(x[r]){y(a(void 0,!0));return}x[n](y,S)},S)}}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((u={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,T){process.nextTick(function(){l[e]?T(l[e]):M(a(void 0,!0))})});var y=this[i],S;if(y)S=new Promise(v(y,this));else{var k=this[o].read();if(k!==null)return Promise.resolve(a(k,!1));S=new Promise(this[n])}return this[i]=S,S}},d(u,Symbol.asyncIterator,function(){return this}),d(u,"return",function(){var l=this;return new Promise(function(x,y){l[o].destroy(null,function(S){if(S){y(S);return}x(a(void 0,!0))})})}),u),g),w=function(l){var x,y=Object.create(m,(x={},d(x,o,{value:l,writable:!0}),d(x,A,{value:null,writable:!0}),d(x,t,{value:null,writable:!0}),d(x,e,{value:null,writable:!0}),d(x,r,{value:l._readableState.endEmitted,writable:!0}),d(x,n,{value:function(S,k){var M=y[o].read();M?(y[i]=null,y[A]=null,y[t]=null,S(a(M,!1))):(y[A]=S,y[t]=k)},writable:!0}),x));return y[i]=null,E(l,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var k=y[t];k!==null&&(y[i]=null,y[A]=null,y[t]=null,k(S)),y[e]=S;return}var M=y[A];M!==null&&(y[i]=null,y[A]=null,y[t]=null,M(a(void 0,!0))),y[r]=!0}),l.on("readable",f.bind(null,y)),y};V.exports=w}),SM=Vt((Z,V)=>{V.exports=function(){throw new Error("Readable.from is not available in the browser")}}),K2=Vt((Z,V)=>{V.exports=h;var u;h.ReadableState=c,a0().EventEmitter;var d=function(J,q){return J.listeners(q).length},E=I2(),A=p0().Buffer,t=window.Uint8Array||function(){};function e(J){return A.from(J)}function r(J){return A.isBuffer(J)||J instanceof t}var i=H2(),n;i&&i.debuglog?n=i.debuglog("stream"):n=function(){};var o=TM(),a=q2(),s=W2(),f=s.getHighWaterMark,v=m0().codes,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,l=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,y,S;Rp()(h,E);var k=a.errorOrDestroy,M=["error","close","destroy","pause","resume"];function T(J,q,it){if(typeof J.prependListener=="function")return J.prependListener(q,it);!J._events||!J._events[q]?J.on(q,it):Array.isArray(J._events[q])?J._events[q].unshift(it):J._events[q]=[it,J._events[q]]}function c(J,q,it){u=u||g0(),J=J||{},typeof it!="boolean"&&(it=q instanceof u),this.objectMode=!!J.objectMode,it&&(this.objectMode=this.objectMode||!!J.readableObjectMode),this.highWaterMark=f(this,J,"readableHighWaterMark",it),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=J.emitClose!==!1,this.autoDestroy=!!J.autoDestroy,this.destroyed=!1,this.defaultEncoding=J.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,J.encoding&&(x||(x=Z2().StringDecoder),this.decoder=new x(J.encoding),this.encoding=J.encoding)}function h(J){if(u=u||g0(),!(this instanceof h))return new h(J);var q=this instanceof u;this._readableState=new c(J,this,q),this.readable=!0,J&&(typeof J.read=="function"&&(this._read=J.read),typeof J.destroy=="function"&&(this._destroy=J.destroy)),E.call(this)}Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(J){this._readableState&&(this._readableState.destroyed=J)}}),h.prototype.destroy=a.destroy,h.prototype._undestroy=a.undestroy,h.prototype._destroy=function(J,q){q(J)},h.prototype.push=function(J,q){var it=this._readableState,nt;return it.objectMode?nt=!0:typeof J=="string"&&(q=q||it.defaultEncoding,q!==it.encoding&&(J=A.from(J,q),q=""),nt=!0),b(this,J,q,!1,nt)},h.prototype.unshift=function(J){return b(this,J,null,!0,!1)};function b(J,q,it,nt,dt){n("readableAddChunk",q);var Tt=J._readableState;if(q===null)Tt.reading=!1,R(J,Tt);else{var wt;if(dt||(wt=P(Tt,q)),wt)k(J,wt);else if(Tt.objectMode||q&&q.length>0)if(typeof q!="string"&&!Tt.objectMode&&Object.getPrototypeOf(q)!==A.prototype&&(q=e(q)),nt)Tt.endEmitted?k(J,new l):_(J,Tt,q,!0);else if(Tt.ended)k(J,new m);else{if(Tt.destroyed)return!1;Tt.reading=!1,Tt.decoder&&!it?(q=Tt.decoder.write(q),Tt.objectMode||q.length!==0?_(J,Tt,q,!1):N(J,Tt)):_(J,Tt,q,!1)}else nt||(Tt.reading=!1,N(J,Tt))}return!Tt.ended&&(Tt.length<Tt.highWaterMark||Tt.length===0)}function _(J,q,it,nt){q.flowing&&q.length===0&&!q.sync?(q.awaitDrain=0,J.emit("data",it)):(q.length+=q.objectMode?1:it.length,nt?q.buffer.unshift(it):q.buffer.push(it),q.needReadable&&I(J)),N(J,q)}function P(J,q){var it;return!r(q)&&typeof q!="string"&&q!==void 0&&!J.objectMode&&(it=new g("chunk",["string","Buffer","Uint8Array"],q)),it}h.prototype.isPaused=function(){return this._readableState.flowing===!1},h.prototype.setEncoding=function(J){x||(x=Z2().StringDecoder);var q=new x(J);this._readableState.decoder=q,this._readableState.encoding=this._readableState.decoder.encoding;for(var it=this._readableState.buffer.head,nt="";it!==null;)nt+=q.write(it.data),it=it.next;return this._readableState.buffer.clear(),nt!==""&&this._readableState.buffer.push(nt),this._readableState.length=nt.length,this};var L=1073741824;function D(J){return J>=L?J=L:(J--,J|=J>>>1,J|=J>>>2,J|=J>>>4,J|=J>>>8,J|=J>>>16,J++),J}function B(J,q){return J<=0||q.length===0&&q.ended?0:q.objectMode?1:J!==J?q.flowing&&q.length?q.buffer.head.data.length:q.length:(J>q.highWaterMark&&(q.highWaterMark=D(J)),J<=q.length?J:q.ended?q.length:(q.needReadable=!0,0))}h.prototype.read=function(J){n("read",J),J=parseInt(J,10);var q=this._readableState,it=J;if(J!==0&&(q.emittedReadable=!1),J===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?X(this):I(this),null;if(J=B(J,q),J===0&&q.ended)return q.length===0&&X(this),null;var nt=q.needReadable;n("need readable",nt),(q.length===0||q.length-J<q.highWaterMark)&&(nt=!0,n("length less than watermark",nt)),q.ended||q.reading?(nt=!1,n("reading or ended",nt)):nt&&(n("do read"),q.reading=!0,q.sync=!0,q.length===0&&(q.needReadable=!0),this._read(q.highWaterMark),q.sync=!1,q.reading||(J=B(it,q)));var dt;return J>0?dt=ot(J,q):dt=null,dt===null?(q.needReadable=q.length<=q.highWaterMark,J=0):(q.length-=J,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),it!==J&&q.ended&&X(this)),dt!==null&&this.emit("data",dt),dt};function R(J,q){if(n("onEofChunk"),!q.ended){if(q.decoder){var it=q.decoder.end();it&&it.length&&(q.buffer.push(it),q.length+=q.objectMode?1:it.length)}q.ended=!0,q.sync?I(J):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,F(J)))}}function I(J){var q=J._readableState;n("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(n("emitReadable",q.flowing),q.emittedReadable=!0,process.nextTick(F,J))}function F(J){var q=J._readableState;n("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(J.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,K(J)}function N(J,q){q.readingMore||(q.readingMore=!0,process.nextTick(j,J,q))}function j(J,q){for(;!q.reading&&!q.ended&&(q.length<q.highWaterMark||q.flowing&&q.length===0);){var it=q.length;if(n("maybeReadMore read 0"),J.read(0),it===q.length)break}q.readingMore=!1}h.prototype._read=function(J){k(this,new w("_read()"))},h.prototype.pipe=function(J,q){var it=this,nt=this._readableState;switch(nt.pipesCount){case 0:nt.pipes=J;break;case 1:nt.pipes=[nt.pipes,J];break;default:nt.pipes.push(J);break}nt.pipesCount+=1,n("pipe count=%d opts=%j",nt.pipesCount,q);var dt=(!q||q.end!==!1)&&J!==process.stdout&&J!==process.stderr,Tt=dt?It:bt;nt.endEmitted?process.nextTick(Tt):it.once("end",Tt),J.on("unpipe",wt);function wt(vt,Ut){n("onunpipe"),vt===it&&Ut&&Ut.hasUnpiped===!1&&(Ut.hasUnpiped=!0,ee())}function It(){n("onend"),J.end()}var Ct=G(it);J.on("drain",Ct);var Nt=!1;function ee(){n("cleanup"),J.removeListener("close",Kt),J.removeListener("finish",mt),J.removeListener("drain",Ct),J.removeListener("error",te),J.removeListener("unpipe",wt),it.removeListener("end",It),it.removeListener("end",bt),it.removeListener("data",Jt),Nt=!0,nt.awaitDrain&&(!J._writableState||J._writableState.needDrain)&&Ct()}it.on("data",Jt);function Jt(vt){n("ondata");var Ut=J.write(vt);n("dest.write",Ut),Ut===!1&&((nt.pipesCount===1&&nt.pipes===J||nt.pipesCount>1&&ut(nt.pipes,J)!==-1)&&!Nt&&(n("false write response, pause",nt.awaitDrain),nt.awaitDrain++),it.pause())}function te(vt){n("onerror",vt),bt(),J.removeListener("error",te),d(J,"error")===0&&k(J,vt)}T(J,"error",te);function Kt(){J.removeListener("finish",mt),bt()}J.once("close",Kt);function mt(){n("onfinish"),J.removeListener("close",Kt),bt()}J.once("finish",mt);function bt(){n("unpipe"),it.unpipe(J)}return J.emit("pipe",it),nt.flowing||(n("pipe resume"),it.resume()),J};function G(J){return function(){var q=J._readableState;n("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&d(J,"data")&&(q.flowing=!0,K(J))}}h.prototype.unpipe=function(J){var q=this._readableState,it={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return J&&J!==q.pipes?this:(J||(J=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,J&&J.emit("unpipe",this,it),this);if(!J){var nt=q.pipes,dt=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var Tt=0;Tt<dt;Tt++)nt[Tt].emit("unpipe",this,{hasUnpiped:!1});return this}var wt=ut(q.pipes,J);return wt===-1?this:(q.pipes.splice(wt,1),q.pipesCount-=1,q.pipesCount===1&&(q.pipes=q.pipes[0]),J.emit("unpipe",this,it),this)},h.prototype.on=function(J,q){var it=E.prototype.on.call(this,J,q),nt=this._readableState;return J==="data"?(nt.readableListening=this.listenerCount("readable")>0,nt.flowing!==!1&&this.resume()):J==="readable"&&!nt.endEmitted&&!nt.readableListening&&(nt.readableListening=nt.needReadable=!0,nt.flowing=!1,nt.emittedReadable=!1,n("on readable",nt.length,nt.reading),nt.length?I(this):nt.reading||process.nextTick(ct,this)),it},h.prototype.addListener=h.prototype.on,h.prototype.removeListener=function(J,q){var it=E.prototype.removeListener.call(this,J,q);return J==="readable"&&process.nextTick(rt,this),it},h.prototype.removeAllListeners=function(J){var q=E.prototype.removeAllListeners.apply(this,arguments);return(J==="readable"||J===void 0)&&process.nextTick(rt,this),q};function rt(J){var q=J._readableState;q.readableListening=J.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:J.listenerCount("data")>0&&J.resume()}function ct(J){n("readable nexttick read 0"),J.read(0)}h.prototype.resume=function(){var J=this._readableState;return J.flowing||(n("resume"),J.flowing=!J.readableListening,st(this,J)),J.paused=!1,this};function st(J,q){q.resumeScheduled||(q.resumeScheduled=!0,process.nextTick(et,J,q))}function et(J,q){n("resume",q.reading),q.reading||J.read(0),q.resumeScheduled=!1,J.emit("resume"),K(J),q.flowing&&!q.reading&&J.read(0)}h.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 K(J){var q=J._readableState;for(n("flow",q.flowing);q.flowing&&J.read()!==null;);}h.prototype.wrap=function(J){var q=this,it=this._readableState,nt=!1;J.on("end",function(){if(n("wrapped end"),it.decoder&&!it.ended){var wt=it.decoder.end();wt&&wt.length&&q.push(wt)}q.push(null)}),J.on("data",function(wt){if(n("wrapped data"),it.decoder&&(wt=it.decoder.write(wt)),!(it.objectMode&&wt==null)&&!(!it.objectMode&&(!wt||!wt.length))){var It=q.push(wt);It||(nt=!0,J.pause())}});for(var dt in J)this[dt]===void 0&&typeof J[dt]=="function"&&(this[dt]=function(wt){return function(){return J[wt].apply(J,arguments)}}(dt));for(var Tt=0;Tt<M.length;Tt++)J.on(M[Tt],this.emit.bind(this,M[Tt]));return this._read=function(wt){n("wrapped _read",wt),nt&&(nt=!1,J.resume())},this},typeof Symbol=="function"&&(h.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=MM()),y(this)}),Object.defineProperty(h.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(h.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(h.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(J){this._readableState&&(this._readableState.flowing=J)}}),h._fromList=ot,Object.defineProperty(h.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ot(J,q){if(q.length===0)return null;var it;return q.objectMode?it=q.buffer.shift():!J||J>=q.length?(q.decoder?it=q.buffer.join(""):q.buffer.length===1?it=q.buffer.first():it=q.buffer.concat(q.length),q.buffer.clear()):it=q.buffer.consume(J,q.decoder),it}function X(J){var q=J._readableState;n("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,process.nextTick(Q,q,J))}function Q(J,q){if(n("endReadableNT",J.endEmitted,J.length),!J.endEmitted&&J.length===0&&(J.endEmitted=!0,q.readable=!1,q.emit("end"),J.autoDestroy)){var it=q._writableState;(!it||it.autoDestroy&&it.finished)&&q.destroy()}}typeof Symbol=="function"&&(h.from=function(J,q){return S===void 0&&(S=SM()),S(h,J,q)});function ut(J,q){for(var it=0,nt=J.length;it<nt;it++)if(J[it]===q)return it;return-1}}),Y2=Vt((Z,V)=>{V.exports=i;var u=m0().codes,d=u.ERR_METHOD_NOT_IMPLEMENTED,E=u.ERR_MULTIPLE_CALLBACK,A=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,t=u.ERR_TRANSFORM_WITH_LENGTH_0,e=g0();Rp()(i,e);function r(a,s){var f=this._transformState;f.transforming=!1;var v=f.writecb;if(v===null)return this.emit("error",new E);f.writechunk=null,f.writecb=null,s!=null&&this.push(s),v(a);var g=this._readableState;g.reading=!1,(g.needReadable||g.length<g.highWaterMark)&&this._read(g.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,f){o(a,s,f)}):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,f){f(new d("_transform()"))},i.prototype._write=function(a,s,f){var v=this._transformState;if(v.writecb=f,v.writechunk=a,v.writeencoding=s,!v.transforming){var g=this._readableState;(v.needTransform||g.needReadable||g.length<g.highWaterMark)&&this._read(g.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(f){s(f)})};function o(a,s,f){if(s)return a.emit("error",s);if(f!=null&&a.push(f),a._writableState.length)throw new t;if(a._transformState.transforming)throw new A;return a.push(null)}}),EM=Vt((Z,V)=>{V.exports=d;var u=Y2();Rp()(d,u);function d(E){if(!(this instanceof d))return new d(E);u.call(this,E)}d.prototype._transform=function(E,A,t){t(null,E)}}),zM=Vt((Z,V)=>{var u;function d(f){var v=!1;return function(){v||(v=!0,f.apply(void 0,arguments))}}var E=m0().codes,A=E.ERR_MISSING_ARGS,t=E.ERR_STREAM_DESTROYED;function e(f){if(f)throw f}function r(f){return f.setHeader&&typeof f.abort=="function"}function i(f,v,g,m){m=d(m);var w=!1;f.on("close",function(){w=!0}),u===void 0&&(u=F1()),u(f,{readable:v,writable:g},function(x){if(x)return m(x);w=!0,m()});var l=!1;return function(x){if(!w&&!l){if(l=!0,r(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();m(x||new t("pipe"))}}}function n(f){f()}function o(f,v){return f.pipe(v)}function a(f){return!f.length||typeof f[f.length-1]!="function"?e:f.pop()}function s(){for(var f=arguments.length,v=new Array(f),g=0;g<f;g++)v[g]=arguments[g];var m=a(v);if(Array.isArray(v[0])&&(v=v[0]),v.length<2)throw new A("streams");var w,l=v.map(function(x,y){var S=y<v.length-1,k=y>0;return i(x,S,k,function(M){w||(w=M),M&&l.forEach(n),!S&&(l.forEach(n),m(w))})});return v.reduce(o)}V.exports=s}),LM=Vt((Z,V)=>{V.exports=E;var u=a0().EventEmitter,d=Rp();d(E,u),E.Readable=K2(),E.Writable=G2(),E.Duplex=g0(),E.Transform=Y2(),E.PassThrough=EM(),E.finished=F1(),E.pipeline=zM(),E.Stream=E;function E(){u.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(f(),u.listenerCount(this,"error")===0)throw v}e.on("error",s),A.on("error",s);function f(){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",f),e.removeListener("close",f),A.removeListener("close",f)}return e.on("end",f),e.on("close",f),A.on("close",f),A.emit("pipe",e),A}}),Dm=Vt(Z=>{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},u=/%[sdj%]/g;Z.format=function(j){if(!y(j)){for(var G=[],rt=0;rt<arguments.length;rt++)G.push(t(arguments[rt]));return G.join(" ")}for(var rt=1,ct=arguments,st=ct.length,et=String(j).replace(u,function(X){if(X==="%%")return"%";if(rt>=st)return X;switch(X){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 X}}),K=ct[rt];rt<st;K=ct[++rt])w(K)||!T(K)?et+=" "+K:et+=" "+t(K);return et},Z.deprecate=function(j,G){if(typeof process<"u"&&process.noDeprecation===!0)return j;if(typeof process>"u")return function(){return Z.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 d={},E=/^$/;A="false",A=A.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),E=new RegExp("^"+A+"$","i");var A;Z.debuglog=function(j){if(j=j.toUpperCase(),!d[j])if(E.test(j)){var G=process.pid;d[j]=function(){var rt=Z.format.apply(Z,arguments);console.error("%s %d: %s",j,G,rt)}}else d[j]=function(){};return d[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]),m(G)?rt.showHidden=G:G&&Z._extend(rt,G),k(rt.showHidden)&&(rt.showHidden=!1),k(rt.depth)&&(rt.depth=2),k(rt.colors)&&(rt.colors=!1),k(rt.customInspect)&&(rt.customInspect=!0),rt.colors&&(rt.stylize=e),n(rt,j,rt.depth)}Z.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&&b(G.inspect)&&G.inspect!==Z.inspect&&!(G.constructor&&G.constructor.prototype===G)){var ct=G.inspect(rt,j);return y(ct)||(ct=n(j,ct,rt)),ct}var st=o(j,G);if(st)return st;var et=Object.keys(G),K=i(et);if(j.showHidden&&(et=Object.getOwnPropertyNames(G)),h(G)&&(et.indexOf("message")>=0||et.indexOf("description")>=0))return a(G);if(et.length===0){if(b(G)){var ot=G.name?": "+G.name:"";return j.stylize("[Function"+ot+"]","special")}if(M(G))return j.stylize(RegExp.prototype.toString.call(G),"regexp");if(c(G))return j.stylize(Date.prototype.toString.call(G),"date");if(h(G))return a(G)}var X="",Q=!1,ut=["{","}"];if(g(G)&&(Q=!0,ut=["[","]"]),b(G)){var J=G.name?": "+G.name:"";X=" [Function"+J+"]"}if(M(G)&&(X=" "+RegExp.prototype.toString.call(G)),c(G)&&(X=" "+Date.prototype.toUTCString.call(G)),h(G)&&(X=" "+a(G)),et.length===0&&(!Q||G.length==0))return ut[0]+X+ut[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,K,et):q=et.map(function(it){return f(j,G,rt,K,it,Q)}),j.seen.pop(),v(q,X,ut)}function o(j,G){if(k(G))return j.stylize("undefined","undefined");if(y(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(m(G))return j.stylize(""+G,"boolean");if(w(G))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,G,rt,ct,st){for(var et=[],K=0,ot=G.length;K<ot;++K)R(G,String(K))?et.push(f(j,G,rt,ct,String(K),!0)):et.push("");return st.forEach(function(X){X.match(/^\d+$/)||et.push(f(j,G,rt,ct,X,!0))}),et}function f(j,G,rt,ct,st,et){var K,ot,X;if(X=Object.getOwnPropertyDescriptor(G,st)||{value:G[st]},X.get?X.set?ot=j.stylize("[Getter/Setter]","special"):ot=j.stylize("[Getter]","special"):X.set&&(ot=j.stylize("[Setter]","special")),R(ct,st)||(K="["+st+"]"),ot||(j.seen.indexOf(X.value)<0?(w(rt)?ot=n(j,X.value,null):ot=n(j,X.value,rt-1),ot.indexOf(`
`)>-1&&(et?ot=ot.split(`
`).map(function(Q){return" "+Q}).join(`
`).slice(2):ot=`
`+ot.split(`
`).map(function(Q){return" "+Q}).join(`
`))):ot=j.stylize("[Circular]","special")),k(K)){if(et&&st.match(/^\d+$/))return ot;K=JSON.stringify(""+st),K.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(K=K.slice(1,-1),K=j.stylize(K,"name")):(K=K.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),K=j.stylize(K,"string"))}return K+": "+ot}function v(j,G,rt){var ct=0,st=j.reduce(function(et,K){return ct++,K.indexOf(`
`)>=0&&ct++,et+K.replace(/\u001b\[\d\d?m/g,"").length+1},0);return st>60?rt[0]+(G===""?"":G+`
`)+" "+j.join(`,
`)+" "+rt[1]:rt[0]+G+" "+j.join(", ")+" "+rt[1]}Z.types=U2();function g(j){return Array.isArray(j)}Z.isArray=g;function m(j){return typeof j=="boolean"}Z.isBoolean=m;function w(j){return j===null}Z.isNull=w;function l(j){return j==null}Z.isNullOrUndefined=l;function x(j){return typeof j=="number"}Z.isNumber=x;function y(j){return typeof j=="string"}Z.isString=y;function S(j){return typeof j=="symbol"}Z.isSymbol=S;function k(j){return j===void 0}Z.isUndefined=k;function M(j){return T(j)&&P(j)==="[object RegExp]"}Z.isRegExp=M,Z.types.isRegExp=M;function T(j){return typeof j=="object"&&j!==null}Z.isObject=T;function c(j){return T(j)&&P(j)==="[object Date]"}Z.isDate=c,Z.types.isDate=c;function h(j){return T(j)&&(P(j)==="[object Error]"||j instanceof Error)}Z.isError=h,Z.types.isNativeError=h;function b(j){return typeof j=="function"}Z.isFunction=b;function _(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}Z.isPrimitive=_,Z.isBuffer=V2();function P(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var j=new Date,G=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),D[j.getMonth()],G].join(" ")}Z.log=function(){console.log("%s - %s",B(),Z.format.apply(Z,arguments))},Z.inherits=Rp(),Z._extend=function(j,G){if(!G||!T(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 I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Z.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&j[I]){var G=j[I];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,I,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var rt,ct,st=new Promise(function(ot,X){rt=ot,ct=X}),et=[],K=0;K<arguments.length;K++)et.push(arguments[K]);et.push(function(ot,X){ot?ct(ot):rt(X)});try{j.apply(this,et)}catch(ot){ct(ot)}return st}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),I&&Object.defineProperty(G,I,{value:G,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(G,V(j))},Z.promisify.custom=I;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 st=rt.pop();if(typeof st!="function")throw new TypeError("The last argument must be of type Function");var et=this,K=function(){return st.apply(et,arguments)};j.apply(this,rt).then(function(ot){process.nextTick(K.bind(null,null,ot))},function(ot){process.nextTick(F.bind(null,ot,K))})}return Object.setPrototypeOf(G,Object.getPrototypeOf(j)),Object.defineProperties(G,V(j)),G}Z.callbackify=N}),X2=Vt((Z,V)=>{function u(x){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},u(x)}function d(x,y,S){return Object.defineProperty(x,"prototype",{writable:!1}),x}function E(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function A(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),Object.defineProperty(x,"prototype",{writable:!1}),y&&t(x,y)}function t(x,y){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,k){return S.__proto__=k,S},t(x,y)}function e(x){var y=n();return function(){var S=o(x),k;if(y){var M=o(this).constructor;k=Reflect.construct(S,arguments,M)}else k=S.apply(this,arguments);return r(this,k)}}function r(x,y){if(y&&(u(y)==="object"||typeof y=="function"))return y;if(y!==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(y){return y.__proto__||Object.getPrototypeOf(y)},o(x)}var a={},s,f;function v(x,y,S){S||(S=Error);function k(T,c,h){return typeof y=="string"?y:y(T,c,h)}var M=function(T){A(h,T);var c=e(h);function h(b,_,P){var L;return E(this,h),L=c.call(this,k(b,_,P)),L.code=x,L}return d(h)}(S);a[x]=M}function g(x,y){if(Array.isArray(x)){var S=x.length;return x=x.map(function(k){return String(k)}),S>2?"one of ".concat(y," ").concat(x.slice(0,S-1).join(", "),", or ")+x[S-1]:S===2?"one of ".concat(y," ").concat(x[0]," or ").concat(x[1]):"of ".concat(y," ").concat(x[0])}else return"of ".concat(y," ").concat(String(x))}function m(x,y,S){return x.substr(0,y.length)===y}function w(x,y,S){return(S===void 0||S>x.length)&&(S=x.length),x.substring(S-y.length,S)===y}function l(x,y,S){return typeof S!="number"&&(S=0),S+y.length>x.length?!1:x.indexOf(y,S)!==-1}v("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),v("ERR_INVALID_ARG_TYPE",function(x,y,S){s===void 0&&(s=rv()),s(typeof x=="string","'name' must be a string");var k;typeof y=="string"&&m(y,"not ")?(k="must not be",y=y.replace(/^not /,"")):k="must be";var M;if(w(x," argument"))M="The ".concat(x," ").concat(k," ").concat(g(y,"type"));else{var T=l(x,".")?"property":"argument";M='The "'.concat(x,'" ').concat(T," ").concat(k," ").concat(g(y,"type"))}return M+=". Received type ".concat(u(S)),M},TypeError),v("ERR_INVALID_ARG_VALUE",function(x,y){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=Dm());var k=f.inspect(y);return k.length>128&&(k="".concat(k.slice(0,128),"...")),"The argument '".concat(x,"' ").concat(S,". Received ").concat(k)},TypeError),v("ERR_INVALID_RETURN_VALUE",function(x,y,S){var k;return S&&S.constructor&&S.constructor.name?k="instance of ".concat(S.constructor.name):k="type ".concat(u(S)),"Expected ".concat(x,' to be returned from the "').concat(y,'"')+" function but got ".concat(k,".")},TypeError),v("ERR_MISSING_ARGS",function(){for(var x=arguments.length,y=new Array(x),S=0;S<x;S++)y[S]=arguments[S];s===void 0&&(s=rv()),s(y.length>0,"At least one arg needs to be specified");var k="The ",M=y.length;switch(y=y.map(function(T){return'"'.concat(T,'"')}),M){case 1:k+="".concat(y[0]," argument");break;case 2:k+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:k+=y.slice(0,M-1).join(", "),k+=", and ".concat(y[M-1]," arguments");break}return"".concat(k," must be specified")},TypeError),V.exports.codes=a}),CM=Vt((Z,V)=>{function u(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 d(N){for(var j=1;j<arguments.length;j++){var G=arguments[j]!=null?arguments[j]:{};j%2?u(Object(G),!0).forEach(function(rt){E(N,rt,G[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(N,Object.getOwnPropertyDescriptors(G)):u(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);if(x(rt)!=="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(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&&w(N,j)}function o(N){var j=g();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 f(N){var j=typeof Map=="function"?new Map:void 0;return f=function(G){if(G===null||!m(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}}),w(rt,G)},f(N)}function v(N,j,G){return g()?v=Reflect.construct.bind():v=function(rt,ct,st){var et=[null];et.push.apply(et,ct);var K=Function.bind.apply(rt,et),ot=new K;return st&&w(ot,st.prototype),ot},v.apply(null,arguments)}function g(){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 m(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function w(N,j){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(G,rt){return G.__proto__=rt,G},w(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 y=Dm(),S=y.inspect,k=X2(),M=k.codes.ERR_INVALID_ARG_TYPE;function T(N,j,G){return(G===void 0||G>N.length)&&(G=N.length),N.substring(G-j.length,G)===j}function c(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 h="",b="",_="",P="",L={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:"},D=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 I(N,j,G){var rt="",ct="",st=0,et="",K=!1,ot=R(N),X=ot.split(`
`),Q=R(j).split(`
`),ut=0,J="";if(G==="strictEqual"&&x(N)==="object"&&x(j)==="object"&&N!==null&&j!==null&&(G="strictEqualObject"),X.length===1&&Q.length===1&&X[0]!==Q[0]){var q=X[0].length+Q[0].length;if(q<=D){if((x(N)!=="object"||N===null)&&(x(j)!=="object"||j===null)&&(N!==0||j!==0))return"".concat(L[G],`
`)+"".concat(X[0]," !== ").concat(Q[0],`
`)}else if(G!=="strictEqualObject"){var it=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(q<it){for(;X[0][ut]===Q[0][ut];)ut++;ut>2&&(J=`
`.concat(c(" ",ut),"^"),ut=0)}}}for(var nt=X[X.length-1],dt=Q[Q.length-1];nt===dt&&(ut++<2?et=`
`.concat(nt).concat(et):rt=nt,X.pop(),Q.pop(),!(X.length===0||Q.length===0));)nt=X[X.length-1],dt=Q[Q.length-1];var Tt=Math.max(X.length,Q.length);if(Tt===0){var wt=ot.split(`
`);if(wt.length>30)for(wt[26]="".concat(h,"...").concat(P);wt.length>27;)wt.pop();return"".concat(L.notIdentical,`
`).concat(wt.join(`
`),`
`)}ut>3&&(et=`
`.concat(h,"...").concat(P).concat(et),K=!0),rt!==""&&(et=`
`.concat(rt).concat(et),rt="");var It=0,Ct=L[G]+`
`.concat(b,"+ actual").concat(P," ").concat(_,"- expected").concat(P),Nt=" ".concat(h,"...").concat(P," Lines skipped");for(ut=0;ut<Tt;ut++){var ee=ut-st;if(X.length<ut+1)ee>1&&ut>2&&(ee>4?(ct+=`
`.concat(h,"...").concat(P),K=!0):ee>3&&(ct+=`
`.concat(Q[ut-2]),It++),ct+=`
`.concat(Q[ut-1]),It++),st=ut,rt+=`
`.concat(_,"-").concat(P," ").concat(Q[ut]),It++;else if(Q.length<ut+1)ee>1&&ut>2&&(ee>4?(ct+=`
`.concat(h,"...").concat(P),K=!0):ee>3&&(ct+=`
`.concat(X[ut-2]),It++),ct+=`
`.concat(X[ut-1]),It++),st=ut,ct+=`
`.concat(b,"+").concat(P," ").concat(X[ut]),It++;else{var Jt=Q[ut],te=X[ut],Kt=te!==Jt&&(!T(te,",")||te.slice(0,-1)!==Jt);Kt&&T(Jt,",")&&Jt.slice(0,-1)===te&&(Kt=!1,te+=","),Kt?(ee>1&&ut>2&&(ee>4?(ct+=`
`.concat(h,"...").concat(P),K=!0):ee>3&&(ct+=`
`.concat(X[ut-2]),It++),ct+=`
`.concat(X[ut-1]),It++),st=ut,ct+=`
`.concat(b,"+").concat(P," ").concat(te),rt+=`
`.concat(_,"-").concat(P," ").concat(Jt),It+=2):(ct+=rt,rt="",(ee===1||ut===0)&&(ct+=`
`.concat(te),It++))}if(It>20&&ut<Tt-2)return"".concat(Ct).concat(Nt,`
`).concat(ct,`
`).concat(h,"...").concat(P).concat(rt,`
`)+"".concat(h,"...").concat(P)}return"".concat(Ct).concat(K?Nt:"",`
`).concat(ct).concat(rt).concat(et).concat(J)}var F=function(N,j){n(rt,N);var G=o(rt);function rt(ct){var st;if(A(this,rt),x(ct)!=="object"||ct===null)throw new M("options","Object",ct);var et=ct.message,K=ct.operator,ot=ct.stackStartFn,X=ct.actual,Q=ct.expected,ut=Error.stackTraceLimit;if(Error.stackTraceLimit=0,et!=null)st=G.call(this,String(et));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(h="\x1B[34m",b="\x1B[32m",P="\x1B[39m",_="\x1B[31m"):(h="",b="",P="",_="")),x(X)==="object"&&X!==null&&x(Q)==="object"&&Q!==null&&"stack"in X&&X instanceof Error&&"stack"in Q&&Q instanceof Error&&(X=B(X),Q=B(Q)),K==="deepStrictEqual"||K==="strictEqual")st=G.call(this,I(X,Q,K));else if(K==="notDeepStrictEqual"||K==="notStrictEqual"){var J=L[K],q=R(X).split(`
`);if(K==="notStrictEqual"&&x(X)==="object"&&X!==null&&(J=L.notStrictEqualObject),q.length>30)for(q[26]="".concat(h,"...").concat(P);q.length>27;)q.pop();q.length===1?st=G.call(this,"".concat(J," ").concat(q[0])):st=G.call(this,"".concat(J,`
`).concat(q.join(`
`),`
`))}else{var it=R(X),nt="",dt=L[K];K==="notDeepEqual"||K==="notEqual"?(it="".concat(L[K],`
`).concat(it),it.length>1024&&(it="".concat(it.slice(0,1021),"..."))):(nt="".concat(R(Q)),it.length>512&&(it="".concat(it.slice(0,509),"...")),nt.length>512&&(nt="".concat(nt.slice(0,509),"...")),K==="deepEqual"||K==="equal"?it="".concat(dt,`
`).concat(it,`
should equal
`):nt=" ".concat(K," ").concat(nt)),st=G.call(this,"".concat(it).concat(nt))}return Error.stackTraceLimit=ut,st.generatedMessage=!et,Object.defineProperty(s(st),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),st.code="ERR_ASSERTION",st.actual=X,st.expected=Q,st.operator=K,Error.captureStackTrace&&Error.captureStackTrace(s(st),ot),st.stack,st.name="AssertionError",a(st)}return e(rt,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:j,value:function(ct,st){return S(this,d(d({},st),{},{customInspect:!1,depth:0}))}}]),rt}(f(Error),S.custom);V.exports=F}),$2=Vt((Z,V)=>{var u=Object.prototype.toString;V.exports=function(d){var E=u.call(d),A=E==="[object Arguments]";return A||(A=E!=="[object Array]"&&d!==null&&typeof d=="object"&&typeof d.length=="number"&&d.length>=0&&u.call(d.callee)==="[object Function]"),A}}),IM=Vt((Z,V)=>{var u;Object.keys||(d=Object.prototype.hasOwnProperty,E=Object.prototype.toString,A=$2(),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(f){var v=f.constructor;return v&&v.prototype===f},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 f in window)try{if(!o["$"+f]&&d.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{n(window[f])}catch{return!0}}catch{return!0}return!1}(),s=function(f){if(typeof window>"u"||!a)return n(f);try{return n(f)}catch{return!1}},u=function(f){var v=f!==null&&typeof f=="object",g=E.call(f)==="[object Function]",m=A(f),w=v&&E.call(f)==="[object String]",l=[];if(!v&&!g&&!m)throw new TypeError("Object.keys called on a non-object");var x=r&&g;if(w&&f.length>0&&!d.call(f,0))for(var y=0;y<f.length;++y)l.push(String(y));if(m&&f.length>0)for(var S=0;S<f.length;++S)l.push(String(S));else for(var k in f)!(x&&k==="prototype")&&d.call(f,k)&&l.push(String(k));if(e)for(var M=s(f),T=0;T<i.length;++T)!(M&&i[T]==="constructor")&&d.call(f,i[T])&&l.push(i[T]);return l});var d,E,A,t,e,r,i,n,o,a,s;V.exports=u}),J2=Vt((Z,V)=>{var u=Array.prototype.slice,d=$2(),E=Object.keys,A=E?function(e){return E(e)}:IM(),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 d(r)?t(u.call(r)):t(r)})}else Object.keys=A;return Object.keys||A},V.exports=A}),PM=Vt((Z,V)=>{var u=J2(),d=P1()(),E=Om(),A=Object,t=E("Array.prototype.push"),e=E("Object.prototype.propertyIsEnumerable"),r=d?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]),f=u(s),v=d&&(Object.getOwnPropertySymbols||r);if(v)for(var g=v(s),m=0;m<g.length;++m){var w=g[m];e(s,w)&&t(f,w)}for(var l=0;l<f.length;++l){var x=f[l];if(e(s,x)){var y=s[x];o[x]=y}}}return o}}),OM=Vt((Z,V)=>{var u=PM(),d=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||d()||E()?u:Object.assign}}),Q2=Vt((Z,V)=>{var u=function(d){return d!==d};V.exports=function(d,E){return d===0&&E===0?1/d===1/E:!!(d===E||u(d)&&u(E))}}),B1=Vt((Z,V)=>{var u=Q2();V.exports=function(){return typeof Object.is=="function"?Object.is:u}}),ev=Vt((Z,V)=>{var u=J2(),d=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=R2()(),i=t&&r,n=function(a,s,f,v){if(s in a){if(v===!0){if(a[s]===f)return}else if(!e(v)||!v())return}i?t(a,s,{configurable:!0,enumerable:!1,value:f,writable:!0}):a[s]=f},o=function(a,s){var f=arguments.length>2?arguments[2]:{},v=u(s);d&&(v=A.call(v,Object.getOwnPropertySymbols(s)));for(var g=0;g<v.length;g+=1)n(a,v[g],s[v[g]],f[v[g]])};o.supportsDescriptors=!!i,V.exports=o}),DM=Vt((Z,V)=>{var u=B1(),d=ev();V.exports=function(){var E=u();return d(Object,{is:E},{is:function(){return Object.is!==E}}),E}}),FM=Vt((Z,V)=>{var u=ev(),d=tv(),E=Q2(),A=B1(),t=DM(),e=d(A(),Object);u(e,{getPolyfill:A,implementation:E,shim:t}),V.exports=e}),tw=Vt((Z,V)=>{V.exports=function(u){return u!==u}}),ew=Vt((Z,V)=>{var u=tw();V.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:u}}),BM=Vt((Z,V)=>{var u=ev(),d=ew();V.exports=function(){var E=d();return u(Number,{isNaN:E},{isNaN:function(){return Number.isNaN!==E}}),E}}),RM=Vt((Z,V)=>{var u=tv(),d=ev(),E=tw(),A=ew(),t=BM(),e=u(A(),Number);d(e,{getPolyfill:A,implementation:E,shim:t}),V.exports=e}),NM=Vt((Z,V)=>{function u(Kt,mt){return e(Kt)||t(Kt,mt)||E(Kt,mt)||d()}function d(){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(Kt,mt){if(Kt){if(typeof Kt=="string")return A(Kt,mt);var bt=Object.prototype.toString.call(Kt).slice(8,-1);if(bt==="Object"&&Kt.constructor&&(bt=Kt.constructor.name),bt==="Map"||bt==="Set")return Array.from(Kt);if(bt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bt))return A(Kt,mt)}}function A(Kt,mt){(mt==null||mt>Kt.length)&&(mt=Kt.length);for(var bt=0,vt=new Array(mt);bt<mt;bt++)vt[bt]=Kt[bt];return vt}function t(Kt,mt){var bt=Kt==null?null:typeof Symbol<"u"&&Kt[Symbol.iterator]||Kt["@@iterator"];if(bt!=null){var vt,Ut,re,Zt,ue=[],Me=!0,Ce=!1;try{if(re=(bt=bt.call(Kt)).next,mt!==0)for(;!(Me=(vt=re.call(bt)).done)&&(ue.push(vt.value),ue.length!==mt);Me=!0);}catch(We){Ce=!0,Ut=We}finally{try{if(!Me&&bt.return!=null&&(Zt=bt.return(),Object(Zt)!==Zt))return}finally{if(Ce)throw Ut}}return ue}}function e(Kt){if(Array.isArray(Kt))return Kt}function r(Kt){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mt){return typeof mt}:function(mt){return mt&&typeof Symbol=="function"&&mt.constructor===Symbol&&mt!==Symbol.prototype?"symbol":typeof mt},r(Kt)}var i=/a/g.flags!==void 0,n=function(Kt){var mt=[];return Kt.forEach(function(bt){return mt.push(bt)}),mt},o=function(Kt){var mt=[];return Kt.forEach(function(bt,vt){return mt.push([vt,bt])}),mt},a=Object.is?Object.is:FM(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:RM();function v(Kt){return Kt.call.bind(Kt)}var g=v(Object.prototype.hasOwnProperty),m=v(Object.prototype.propertyIsEnumerable),w=v(Object.prototype.toString),l=Dm().types,x=l.isAnyArrayBuffer,y=l.isArrayBufferView,S=l.isDate,k=l.isMap,M=l.isRegExp,T=l.isSet,c=l.isNativeError,h=l.isBoxedPrimitive,b=l.isNumberObject,_=l.isStringObject,P=l.isBooleanObject,L=l.isBigIntObject,D=l.isSymbolObject,B=l.isFloat32Array,R=l.isFloat64Array;function I(Kt){if(Kt.length===0||Kt.length>10)return!0;for(var mt=0;mt<Kt.length;mt++){var bt=Kt.charCodeAt(mt);if(bt<48||bt>57)return!0}return Kt.length===10&&Kt>=Math.pow(2,32)}function F(Kt){return Object.keys(Kt).filter(I).concat(s(Kt).filter(Object.prototype.propertyIsEnumerable.bind(Kt)))}function N(Kt,mt){if(Kt===mt)return 0;for(var bt=Kt.length,vt=mt.length,Ut=0,re=Math.min(bt,vt);Ut<re;++Ut)if(Kt[Ut]!==mt[Ut]){bt=Kt[Ut],vt=mt[Ut];break}return bt<vt?-1:vt<bt?1:0}var j=!0,G=!1,rt=0,ct=1,st=2,et=3;function K(Kt,mt){return i?Kt.source===mt.source&&Kt.flags===mt.flags:RegExp.prototype.toString.call(Kt)===RegExp.prototype.toString.call(mt)}function ot(Kt,mt){if(Kt.byteLength!==mt.byteLength)return!1;for(var bt=0;bt<Kt.byteLength;bt++)if(Kt[bt]!==mt[bt])return!1;return!0}function X(Kt,mt){return Kt.byteLength!==mt.byteLength?!1:N(new Uint8Array(Kt.buffer,Kt.byteOffset,Kt.byteLength),new Uint8Array(mt.buffer,mt.byteOffset,mt.byteLength))===0}function Q(Kt,mt){return Kt.byteLength===mt.byteLength&&N(new Uint8Array(Kt),new Uint8Array(mt))===0}function ut(Kt,mt){return b(Kt)?b(mt)&&a(Number.prototype.valueOf.call(Kt),Number.prototype.valueOf.call(mt)):_(Kt)?_(mt)&&String.prototype.valueOf.call(Kt)===String.prototype.valueOf.call(mt):P(Kt)?P(mt)&&Boolean.prototype.valueOf.call(Kt)===Boolean.prototype.valueOf.call(mt):L(Kt)?L(mt)&&BigInt.prototype.valueOf.call(Kt)===BigInt.prototype.valueOf.call(mt):D(mt)&&Symbol.prototype.valueOf.call(Kt)===Symbol.prototype.valueOf.call(mt)}function J(Kt,mt,bt,vt){if(Kt===mt)return Kt!==0?!0:bt?a(Kt,mt):!0;if(bt){if(r(Kt)!=="object")return typeof Kt=="number"&&f(Kt)&&f(mt);if(r(mt)!=="object"||Kt===null||mt===null||Object.getPrototypeOf(Kt)!==Object.getPrototypeOf(mt))return!1}else{if(Kt===null||r(Kt)!=="object")return mt===null||r(mt)!=="object"?Kt==mt:!1;if(mt===null||r(mt)!=="object")return!1}var Ut=w(Kt),re=w(mt);if(Ut!==re)return!1;if(Array.isArray(Kt)){if(Kt.length!==mt.length)return!1;var Zt=F(Kt),ue=F(mt);return Zt.length!==ue.length?!1:it(Kt,mt,bt,vt,ct,Zt)}if(Ut==="[object Object]"&&(!k(Kt)&&k(mt)||!T(Kt)&&T(mt)))return!1;if(S(Kt)){if(!S(mt)||Date.prototype.getTime.call(Kt)!==Date.prototype.getTime.call(mt))return!1}else if(M(Kt)){if(!M(mt)||!K(Kt,mt))return!1}else if(c(Kt)||Kt instanceof Error){if(Kt.message!==mt.message||Kt.name!==mt.name)return!1}else if(y(Kt)){if(!bt&&(B(Kt)||R(Kt))){if(!ot(Kt,mt))return!1}else if(!X(Kt,mt))return!1;var Me=F(Kt),Ce=F(mt);return Me.length!==Ce.length?!1:it(Kt,mt,bt,vt,rt,Me)}else{if(T(Kt))return!T(mt)||Kt.size!==mt.size?!1:it(Kt,mt,bt,vt,st);if(k(Kt))return!k(mt)||Kt.size!==mt.size?!1:it(Kt,mt,bt,vt,et);if(x(Kt)){if(!Q(Kt,mt))return!1}else if(h(Kt)&&!ut(Kt,mt))return!1}return it(Kt,mt,bt,vt,rt)}function q(Kt,mt){return mt.filter(function(bt){return m(Kt,bt)})}function it(Kt,mt,bt,vt,Ut,re){if(arguments.length===5){re=Object.keys(Kt);var Zt=Object.keys(mt);if(re.length!==Zt.length)return!1}for(var ue=0;ue<re.length;ue++)if(!g(mt,re[ue]))return!1;if(bt&&arguments.length===5){var Me=s(Kt);if(Me.length!==0){var Ce=0;for(ue=0;ue<Me.length;ue++){var We=Me[ue];if(m(Kt,We)){if(!m(mt,We))return!1;re.push(We),Ce++}else if(m(mt,We))return!1}var qe=s(mt);if(Me.length!==qe.length&&q(mt,qe).length!==Ce)return!1}else{var vr=s(mt);if(vr.length!==0&&q(mt,vr).length!==0)return!1}}if(re.length===0&&(Ut===rt||Ut===ct&&Kt.length===0||Kt.size===0))return!0;if(vt===void 0)vt={val1:new Map,val2:new Map,position:0};else{var _r=vt.val1.get(Kt);if(_r!==void 0){var er=vt.val2.get(mt);if(er!==void 0)return _r===er}vt.position++}vt.val1.set(Kt,vt.position),vt.val2.set(mt,vt.position);var Mr=ee(Kt,mt,bt,re,vt,Ut);return vt.val1.delete(Kt),vt.val2.delete(mt),Mr}function nt(Kt,mt,bt,vt){for(var Ut=n(Kt),re=0;re<Ut.length;re++){var Zt=Ut[re];if(J(mt,Zt,bt,vt))return Kt.delete(Zt),!0}return!1}function dt(Kt){switch(r(Kt)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":Kt=+Kt;case"number":if(f(Kt))return!1}return!0}function Tt(Kt,mt,bt){var vt=dt(bt);return vt??(mt.has(vt)&&!Kt.has(vt))}function wt(Kt,mt,bt,vt,Ut){var re=dt(bt);if(re!=null)return re;var Zt=mt.get(re);return Zt===void 0&&!mt.has(re)||!J(vt,Zt,!1,Ut)?!1:!Kt.has(re)&&J(vt,Zt,!1,Ut)}function It(Kt,mt,bt,vt){for(var Ut=null,re=n(Kt),Zt=0;Zt<re.length;Zt++){var ue=re[Zt];if(r(ue)==="object"&&ue!==null)Ut===null&&(Ut=new Set),Ut.add(ue);else if(!mt.has(ue)){if(bt||!Tt(Kt,mt,ue))return!1;Ut===null&&(Ut=new Set),Ut.add(ue)}}if(Ut!==null){for(var Me=n(mt),Ce=0;Ce<Me.length;Ce++){var We=Me[Ce];if(r(We)==="object"&&We!==null){if(!nt(Ut,We,bt,vt))return!1}else if(!bt&&!Kt.has(We)&&!nt(Ut,We,bt,vt))return!1}return Ut.size===0}return!0}function Ct(Kt,mt,bt,vt,Ut,re){for(var Zt=n(Kt),ue=0;ue<Zt.length;ue++){var Me=Zt[ue];if(J(bt,Me,Ut,re)&&J(vt,mt.get(Me),Ut,re))return Kt.delete(Me),!0}return!1}function Nt(Kt,mt,bt,vt){for(var Ut=null,re=o(Kt),Zt=0;Zt<re.length;Zt++){var ue=u(re[Zt],2),Me=ue[0],Ce=ue[1];if(r(Me)==="object"&&Me!==null)Ut===null&&(Ut=new Set),Ut.add(Me);else{var We=mt.get(Me);if(We===void 0&&!mt.has(Me)||!J(Ce,We,bt,vt)){if(bt||!wt(Kt,mt,Me,Ce,vt))return!1;Ut===null&&(Ut=new Set),Ut.add(Me)}}}if(Ut!==null){for(var qe=o(mt),vr=0;vr<qe.length;vr++){var _r=u(qe[vr],2),er=_r[0],Mr=_r[1];if(r(er)==="object"&&er!==null){if(!Ct(Ut,Kt,er,Mr,bt,vt))return!1}else if(!bt&&(!Kt.has(er)||!J(Kt.get(er),Mr,!1,vt))&&!Ct(Ut,Kt,er,Mr,!1,vt))return!1}return Ut.size===0}return!0}function ee(Kt,mt,bt,vt,Ut,re){var Zt=0;if(re===st){if(!It(Kt,mt,bt,Ut))return!1}else if(re===et){if(!Nt(Kt,mt,bt,Ut))return!1}else if(re===ct)for(;Zt<Kt.length;Zt++)if(g(Kt,Zt)){if(!g(mt,Zt)||!J(Kt[Zt],mt[Zt],bt,Ut))return!1}else{if(g(mt,Zt))return!1;for(var ue=Object.keys(Kt);Zt<ue.length;Zt++){var Me=ue[Zt];if(!g(mt,Me)||!J(Kt[Me],mt[Me],bt,Ut))return!1}return ue.length===Object.keys(mt).length}for(Zt=0;Zt<vt.length;Zt++){var Ce=vt[Zt];if(!J(Kt[Ce],mt[Ce],bt,Ut))return!1}return!0}function Jt(Kt,mt){return J(Kt,mt,G)}function te(Kt,mt){return J(Kt,mt,j)}V.exports={isDeepEqual:Jt,isDeepStrictEqual:te}}),rv=Vt((Z,V)=>{function u(st){"@babel/helpers - typeof";return u=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},u(st)}function d(st,et,K){return Object.defineProperty(st,"prototype",{writable:!1}),st}function E(st,et){if(!(st instanceof et))throw new TypeError("Cannot call a class as a function")}var A=X2(),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=CM(),s=Dm(),f=s.inspect,v=Dm().types,g=v.isPromise,m=v.isRegExp,w=OM()(),l=B1()(),x=Om()("RegExp.prototype.test"),y,S;function k(){var st=NM();y=st.isDeepEqual,S=st.isDeepStrictEqual}var M=!1,T=V.exports=P,c={};function h(st){throw st.message instanceof Error?st.message:new a(st)}function b(st,et,K,ot,X){var Q=arguments.length,ut;if(Q===0)ut="Failed";else if(Q===1)K=st,st=void 0;else{if(M===!1){M=!0;var J=process.emitWarning?process.emitWarning:console.warn.bind(console);J("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Q===2&&(ot="!=")}if(K instanceof Error)throw K;var q={actual:st,expected:et,operator:ot===void 0?"fail":ot,stackStartFn:X||b};K!==void 0&&(q.message=K);var it=new a(q);throw ut&&(it.message=ut,it.generatedMessage=!0),it}T.fail=b,T.AssertionError=a;function _(st,et,K,ot){if(!K){var X=!1;if(et===0)X=!0,ot="No value argument passed to `assert.ok()`";else if(ot instanceof Error)throw ot;var Q=new a({actual:K,expected:!0,message:ot,operator:"==",stackStartFn:st});throw Q.generatedMessage=X,Q}}function P(){for(var st=arguments.length,et=new Array(st),K=0;K<st;K++)et[K]=arguments[K];_.apply(void 0,[P,et.length].concat(et))}T.ok=P,T.equal=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");et!=K&&h({actual:et,expected:K,message:ot,operator:"==",stackStartFn:st})},T.notEqual=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");et==K&&h({actual:et,expected:K,message:ot,operator:"!=",stackStartFn:st})},T.deepEqual=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");y===void 0&&k(),y(et,K)||h({actual:et,expected:K,message:ot,operator:"deepEqual",stackStartFn:st})},T.notDeepEqual=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");y===void 0&&k(),y(et,K)&&h({actual:et,expected:K,message:ot,operator:"notDeepEqual",stackStartFn:st})},T.deepStrictEqual=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");y===void 0&&k(),S(et,K)||h({actual:et,expected:K,message:ot,operator:"deepStrictEqual",stackStartFn:st})},T.notDeepStrictEqual=L;function L(st,et,K){if(arguments.length<2)throw new o("actual","expected");y===void 0&&k(),S(st,et)&&h({actual:st,expected:et,message:K,operator:"notDeepStrictEqual",stackStartFn:L})}T.strictEqual=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");l(et,K)||h({actual:et,expected:K,message:ot,operator:"strictEqual",stackStartFn:st})},T.notStrictEqual=function st(et,K,ot){if(arguments.length<2)throw new o("actual","expected");l(et,K)&&h({actual:et,expected:K,message:ot,operator:"notStrictEqual",stackStartFn:st})};var D=d(function st(et,K,ot){var X=this;E(this,st),K.forEach(function(Q){Q in et&&(ot!==void 0&&typeof ot[Q]=="string"&&m(et[Q])&&x(et[Q],ot[Q])?X[Q]=ot[Q]:X[Q]=et[Q])})});function B(st,et,K,ot,X,Q){if(!(K in st)||!S(st[K],et[K])){if(!ot){var ut=new D(st,X),J=new D(et,X,st),q=new a({actual:ut,expected:J,operator:"deepStrictEqual",stackStartFn:Q});throw q.actual=st,q.expected=et,q.operator=Q.name,q}h({actual:st,expected:et,message:ot,operator:Q.name,stackStartFn:Q})}}function R(st,et,K,ot){if(typeof et!="function"){if(m(et))return x(et,st);if(arguments.length===2)throw new r("expected",["Function","RegExp"],et);if(u(st)!=="object"||st===null){var X=new a({actual:st,expected:et,message:K,operator:"deepStrictEqual",stackStartFn:ot});throw X.operator=ot.name,X}var Q=Object.keys(et);if(et instanceof Error)Q.push("name","message");else if(Q.length===0)throw new i("error",et,"may not be an empty object");return y===void 0&&k(),Q.forEach(function(ut){typeof st[ut]=="string"&&m(et[ut])&&x(et[ut],st[ut])||B(st,et,ut,K,Q,ot)}),!0}return et.prototype!==void 0&&st instanceof et?!0:Error.isPrototypeOf(et)?!1:et.call({},st)===!0}function I(st){if(typeof st!="function")throw new r("fn","Function",st);try{st()}catch(et){return et}return c}function F(st){return g(st)||st!==null&&u(st)==="object"&&typeof st.then=="function"&&typeof st.catch=="function"}function N(st){return Promise.resolve().then(function(){var et;if(typeof st=="function"){if(et=st(),!F(et))throw new n("instance of Promise","promiseFn",et)}else if(F(st))et=st;else throw new r("promiseFn",["Function","Promise"],st);return Promise.resolve().then(function(){return et}).then(function(){return c}).catch(function(K){return K})})}function j(st,et,K,ot){if(typeof K=="string"){if(arguments.length===4)throw new r("error",["Object","Error","Function","RegExp"],K);if(u(et)==="object"&&et!==null){if(et.message===K)throw new e("error/message",'The error message "'.concat(et.message,'" is identical to the message.'))}else if(et===K)throw new e("error/message",'The error "'.concat(et,'" is identical to the message.'));ot=K,K=void 0}else if(K!=null&&u(K)!=="object"&&typeof K!="function")throw new r("error",["Object","Error","Function","RegExp"],K);if(et===c){var X="";K&&K.name&&(X+=" (".concat(K.name,")")),X+=ot?": ".concat(ot):".";var Q=st.name==="rejects"?"rejection":"exception";h({actual:void 0,expected:K,operator:st.name,message:"Missing expected ".concat(Q).concat(X),stackStartFn:st})}if(K&&!R(et,K,ot,st))throw et}function G(st,et,K,ot){if(et!==c){if(typeof K=="string"&&(ot=K,K=void 0),!K||R(et,K)){var X=ot?": ".concat(ot):".",Q=st.name==="doesNotReject"?"rejection":"exception";h({actual:et,expected:K,operator:st.name,message:"Got unwanted ".concat(Q).concat(X,`
`)+'Actual message: "'.concat(et&&et.message,'"'),stackStartFn:st})}throw et}}T.throws=function st(et){for(var K=arguments.length,ot=new Array(K>1?K-1:0),X=1;X<K;X++)ot[X-1]=arguments[X];j.apply(void 0,[st,I(et)].concat(ot))},T.rejects=function st(et){for(var K=arguments.length,ot=new Array(K>1?K-1:0),X=1;X<K;X++)ot[X-1]=arguments[X];return N(et).then(function(Q){return j.apply(void 0,[st,Q].concat(ot))})},T.doesNotThrow=function st(et){for(var K=arguments.length,ot=new Array(K>1?K-1:0),X=1;X<K;X++)ot[X-1]=arguments[X];G.apply(void 0,[st,I(et)].concat(ot))},T.doesNotReject=function st(et){for(var K=arguments.length,ot=new Array(K>1?K-1:0),X=1;X<K;X++)ot[X-1]=arguments[X];return N(et).then(function(Q){return G.apply(void 0,[st,Q].concat(ot))})},T.ifError=function st(et){if(et!=null){var K="ifError got unwanted exception: ";u(et)==="object"&&typeof et.message=="string"?et.message.length===0&&et.constructor?K+=et.constructor.name:K+=et.message:K+=f(et);var ot=new a({actual:et,expected:null,operator:"ifError",message:K,stackStartFn:st}),X=et.stack;if(typeof X=="string"){var Q=X.split(`
`);Q.shift();for(var ut=ot.stack.split(`
`),J=0;J<Q.length;J++){var q=ut.indexOf(Q[J]);if(q!==-1){ut=ut.slice(0,q);break}}ot.stack="".concat(ut.join(`
`),`
`).concat(Q.join(`
`))}throw ot}};function rt(st,et,K,ot,X){if(!m(et))throw new r("regexp","RegExp",et);var Q=X==="match";if(typeof st!="string"||x(et,st)!==Q){if(K instanceof Error)throw K;var ut=!K;K=K||(typeof st!="string"?'The "string" argument must be of type string. Received type '+"".concat(u(st)," (").concat(f(st),")"):(Q?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(f(et),`. Input:
`).concat(f(st),`
`));var J=new a({actual:st,expected:et,message:K,operator:X,stackStartFn:ot});throw J.generatedMessage=ut,J}}T.match=function st(et,K,ot){rt(et,K,ot,st,"match")},T.doesNotMatch=function st(et,K,ot){rt(et,K,ot,st,"doesNotMatch")};function ct(){for(var st=arguments.length,et=new Array(st),K=0;K<st;K++)et[K]=arguments[K];_.apply(void 0,[ct,et.length].concat(et))}T.strict=w(ct,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict}),jM=Vt((Z,V)=>{var u=1e3,d=u*60,E=d*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]),f=(a[2]||"ms").toLowerCase();switch(f){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*d;case"seconds":case"second":case"secs":case"sec":case"s":return s*u;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>=d?Math.round(o/d)+"m":o>=u?Math.round(o/u)+"s":o+"ms"}function i(o){return n(o,A,"day")||n(o,E,"hour")||n(o,d,"minute")||n(o,u,"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"}}),UM=Vt((Z,V)=>{Z=V.exports=E.debug=E.default=E,Z.coerce=r,Z.disable=t,Z.enable=A,Z.enabled=e,Z.humanize=jM(),Z.names=[],Z.skips=[],Z.formatters={};var u;function d(i){var n=0,o;for(o in i)n=(n<<5)-n+i.charCodeAt(o),n|=0;return Z.colors[Math.abs(n)%Z.colors.length]}function E(i){function n(){if(n.enabled){var o=n,a=+new Date,s=a-(u||a);o.diff=s,o.prev=u,o.curr=a,u=a;for(var f=new Array(arguments.length),v=0;v<f.length;v++)f[v]=arguments[v];f[0]=Z.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");var g=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,function(w,l){if(w==="%%")return w;g++;var x=Z.formatters[l];if(typeof x=="function"){var y=f[g];w=x.call(o,y),f.splice(g,1),g--}return w}),Z.formatArgs.call(o,f);var m=n.log||Z.log||console.log.bind(console);m.apply(o,f)}}return n.namespace=i,n.enabled=Z.enabled(i),n.useColors=Z.useColors(),n.color=d(i),typeof Z.init=="function"&&Z.init(n),n}function A(i){Z.save(i),Z.names=[],Z.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]==="-"?Z.skips.push(new RegExp("^"+i.substr(1)+"$")):Z.names.push(new RegExp("^"+i+"$")))}function t(){Z.enable("")}function e(i){var n,o;for(n=0,o=Z.skips.length;n<o;n++)if(Z.skips[n].test(i))return!1;for(n=0,o=Z.names.length;n<o;n++)if(Z.names[n].test(i))return!0;return!1}function r(i){return i instanceof Error?i.stack||i.message:i}}),VM=Vt((Z,V)=>{Z=V.exports=UM(),Z.log=E,Z.formatArgs=d,Z.save=A,Z.load=t,Z.useColors=u,Z.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:e(),Z.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function u(){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+)/)}Z.formatters.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}};function d(r){var i=this.useColors;if(r[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+r[0]+(i?"%c ":" ")+"+"+Z.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?Z.storage.removeItem("debug"):Z.storage.debug=r}catch{}}function t(){var r;try{r=Z.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=Mg.DEBUG),r}Z.enable(t());function e(){try{return window.localStorage}catch{}}}),HM=Vt((Z,V)=>{var u=rv(),d=VM()("stream-parser");V.exports=r;var E=-1,A=0,t=1,e=2;function r(l){var x=l&&typeof l._transform=="function",y=l&&typeof l._write=="function";if(!x&&!y)throw new Error("must pass a Writable or Transform stream in");d("extending Parser into stream"),l._bytes=n,l._skipBytes=o,x&&(l._passthrough=a),x?l._transform=f:l._write=s}function i(l){d("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){u(!this._parserCallback,'there is already a "callback" set!'),u(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||i(this),d("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=A}function o(l,x){u(!this._parserCallback,'there is already a "callback" set!'),u(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||i(this),d("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=t}function a(l,x){u(!this._parserCallback,'There is already a "callback" set!'),u(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||i(this),d("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=x,this._parserState=e}function s(l,x,y){this._parserInit||i(this),d("write(%o bytes)",l.length),typeof x=="function"&&(y=x),m(this,l,null,y)}function f(l,x,y){this._parserInit||i(this),d("transform(%o bytes)",l.length),typeof x!="function"&&(x=this._parserOutput),m(this,l,x,y)}function v(l,x,y,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):x.length<=l._parserBytesLeft?function(){return g(l,x,y,S)}:function(){var k=x.slice(0,l._parserBytesLeft);return g(l,k,y,function(M){if(M)return S(M);if(x.length>k.length)return function(){return v(l,x.slice(k.length),y,S)}})}}function g(l,x,y,S){if(l._parserBytesLeft-=x.length,d("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===A?(l._parserBuffers.push(x),l._parserBuffered+=x.length):l._parserState===e&&y(x),l._parserBytesLeft===0){var k=l._parserCallback;if(k&&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),k){var M=[];x&&M.push(x),y&&M.push(y);var T=k.length>M.length;T&&M.push(w(S));var c=k.apply(l,M);if(!T||S===c)return S}}else return S}var m=w(v);function w(l){return function(){for(var x=l.apply(this,arguments);typeof x=="function";)x=x();return x}}}),_u=Vt(Z=>{var V=LM().Transform,u=HM();function d(){V.call(this,{readableObjectMode:!0})}d.prototype=Object.create(V.prototype),d.prototype.constructor=d,u(d.prototype),Z.ParserStream=d,Z.sliceEq=function(A,t,e){for(var r=t,i=0;i<e.length;)if(A[r++]!==e[i++])return!1;return!0},Z.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},Z.readUInt16LE=function(A,t){return A[t]|A[t+1]<<8},Z.readUInt16BE=function(A,t){return A[t+1]|A[t]<<8},Z.readUInt32LE=function(A,t){return A[t]|A[t+1]<<8|A[t+2]<<16|A[t+3]*16777216},Z.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,Z.ProbeError=E}),qM=Vt((Z,V)=>{var u=_u().readUInt16BE,d=_u().readUInt32BE;function E(a,s){if(a.length<4+s)return null;var f=d(a,s);return a.length<f+s||f<8?null:{boxtype:String.fromCharCode.apply(null,a.slice(s+4,s+8)),data:a.slice(s+8,s+f),end:s+f}}V.exports.unbox=E;function A(a,s){for(var f=0;;){var v=E(a,f);if(!v)break;switch(v.boxtype){case"ispe":s.sizes.push({width:d(v.data,4),height:d(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}f=v.end}}function t(a,s,f){for(var v=0,g=0;g<f;g++)v=v*256+(a[s+g]||0);return v}function e(a,s){for(var f=a[4]>>4&15,v=a[4]&15,g=a[5]>>4&15,m=u(a,6),w=8,l=0;l<m;l++){var x=u(a,w);w+=2;var y=u(a,w);w+=2;var S=t(a,w,g);w+=g;var k=u(a,w);if(w+=2,y===0&&k===1){var M=t(a,w,f),T=t(a,w+f,v);s.item_loc[x]={length:T,offset:M+S}}w+=k*(f+v)}}function r(a,s){for(var f=u(a,4),v=6,g=0;g<f;g++){var m=E(a,v);if(!m)break;if(m.boxtype==="infe"){for(var w=u(m.data,4),l="",x=8;x<m.data.length&&m.data[x];x++)l+=String.fromCharCode(m.data[x]);s.item_inf[l]=w}v=m.end}}function i(a,s){for(var f=0;;){var v=E(a,f);if(!v)break;v.boxtype==="ipco"&&A(v.data,s),f=v.end}}function n(a,s){for(var f=4;;){var v=E(a,f);if(!v)break;v.boxtype==="iprp"&&i(v.data,s),v.boxtype==="iloc"&&e(v.data,s),v.boxtype==="iinf"&&r(v.data,s),f=v.end}}function o(a){var s=a.reduce(function(g,m){return g.width>m.width||g.width===m.width&&g.height>m.height?g:m}),f=a.reduce(function(g,m){return g.height>m.height||g.height===m.height&&g.width>m.width?g:m}),v;return s.width>f.height||s.width===f.height&&s.height>f.width?v=s:v=f,v}V.exports.readSizeFromMeta=function(a){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(a,s),!!s.sizes.length){var f=o(s.sizes),v=1;s.transforms.forEach(function(m){var w={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(m.type==="imir"&&(m.value===0?v=l[v]:(v=l[v],v=w[v],v=w[v])),m.type==="irot")for(var x=0;x<m.value;x++)v=w[v]});var g=null;return s.item_inf.Exif&&(g=s.item_loc[s.item_inf.Exif]),{width:f.width,height:f.height,orientation:s.transforms.length?v:null,variants:s.sizes,exif_location:g}}},V.exports.getMimeType=function(a){var s=String.fromCharCode.apply(null,a.slice(0,4)),f={};f[s]=!0;for(var v=8;v<a.length;v+=4)f[String.fromCharCode.apply(null,a.slice(v,v+4))]=!0;if(!(!f.mif1&&!f.msf1&&!f.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"}:f.avif||f.avis?{type:"avif",mime:"image/avif"}:f.heic||f.heix||f.hevc||f.hevx||f.heis?f.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}),R1=Vt((Z,V)=>{function u(A,t){var e=new Error(A);return e.code=t,e}function d(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 u("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 u("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 u("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),f=a*s,v=f<=4?t+8:this.read_uint32(t+8),g=!1;if(v+f>this.input.length)throw u("unexpected EOF","EBADDATA");for(var m=[],w=v,l=0;l<a;l++,w+=s){var x=this.exif_format_read(o,w);if(x===null){m=null;break}m.push(x)}Array.isArray(m)&&o===2&&(m=d(String.fromCharCode.apply(null,m)),m&&m[m.length-1]==="\0"&&(m=m.slice(0,-1))),this.is_subifd_link(A,n)&&Array.isArray(m)&&Number.isInteger(m[0])&&m[0]>0&&(this.ifds_to_read.push({id:n,offset:m[0]}),g=!0);var y={is_big_endian:this.big_endian,ifd:A,tag:n,format:o,count:a,entry_offset:t+this.start,data_length:f,data_offset:v+this.start,value:m,is_subifd_link:g};if(e(y)===!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}}}),WM=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt32BE,A=qM(),t=R1(),e=u("ftyp");V.exports=function(r){if(d(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 f=A.readSizeFromMeta(o);if(f){var v={width:f.width,height:f.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(v.variants=f.variants),f.orientation&&(v.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=r.length){var g=E(r,f.exif_location.offset),m=r.slice(f.exif_location.offset+g+4,f.exif_location.offset+f.exif_location.length),w=t.get_orientation(m);w>0&&(v.orientation=w)}return v}}}}}}}),GM=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=u("BM");V.exports=function(t){if(!(t.length<26)&&d(t,0,A))return{width:E(t,18),height:E(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),ZM=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=u("GIF87a"),t=u("GIF89a");V.exports=function(e){if(!(e.length<10)&&!(!d(e,0,A)&&!d(e,0,t)))return{width:E(e,6),height:E(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),KM=Vt((Z,V)=>{var u=_u().readUInt16LE,d=0,E=1,A=16;V.exports=function(t){var e=u(t,0),r=u(t,2),i=u(t,4);if(!(e!==d||r!==E||!i)){for(var n=[],o={width:0,height:0},a=0;a<i;a++){var s=t[6+A*a]||256,f=t[6+A*a+1]||256,v={width:s,height:f};n.push(v),(s>o.width||f>o.height)&&(o=v)}return{width:o.width,height:o.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),YM=Vt((Z,V)=>{var u=_u().readUInt16BE,d=_u().str2arr,E=_u().sliceEq,A=R1(),t=d("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=u(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:u(e,r+3),height:u(e,r+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return o>0&&(a.orientation=o),a}r+=n}}}),XM=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt32BE,A=u(`‰PNG\r

`),t=u("IHDR");V.exports=function(e){if(!(e.length<24)&&d(e,0,A)&&d(e,12,t))return{width:E(e,16),height:E(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),$M=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt32BE,A=u("8BPS\0");V.exports=function(t){if(!(t.length<22)&&d(t,0,A))return{width:E(t,18),height:E(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),JM=Vt((Z,V)=>{function u(s){return s===32||s===9||s===13||s===10}function d(s){return typeof s=="number"&&isFinite(s)&&s>0}function E(s){var f=0,v=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(f=3);f<v&&u(s[f]);)f++;return f===v?!1:s[f]===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 f=s.match(e),v=s.match(r),g=s.match(i);return{width:f&&(f[1]||f[2]),height:v&&(v[1]||v[2]),viewbox:g&&(g[1]||g[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}V.exports=function(s){if(E(s)){for(var f="",v=0;v<s.length;v++)f+=String.fromCharCode(s[v]);var g=(f.match(A)||[""])[0];if(t.test(g)){var m=o(g),w=parseFloat(m.width),l=parseFloat(m.height);if(m.width&&m.height)return!d(w)||!d(l)?void 0:{width:w,height:l,type:"svg",mime:"image/svg+xml",wUnits:a(m.width),hUnits:a(m.height)};var x=(m.viewbox||"").split(" "),y={width:x[2],height:x[3]},S=parseFloat(y.width),k=parseFloat(y.height);if(!(!d(S)||!d(k))&&a(y.width)===a(y.height)){var M=S/k;return m.width?d(w)?{width:w,height:w/M,type:"svg",mime:"image/svg+xml",wUnits:a(m.width),hUnits:a(m.width)}:void 0:m.height?d(l)?{width:l*M,height:l,type:"svg",mime:"image/svg+xml",wUnits:a(m.height),hUnits:a(m.height)}:void 0:{width:S,height:k,type:"svg",mime:"image/svg+xml",wUnits:a(y.width),hUnits:a(y.height)}}}}}}),QM=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=_u().readUInt16BE,t=_u().readUInt32LE,e=_u().readUInt32BE,r=u("II*\0"),i=u("MM\0*");function n(s,f,v){return v?A(s,f):E(s,f)}function o(s,f,v){return v?e(s,f):t(s,f)}function a(s,f,v){var g=n(s,f+2,v),m=o(s,f+4,v);return m!==1||g!==3&&g!==4?null:g===3?n(s,f+8,v):o(s,f+8,v)}V.exports=function(s){if(!(s.length<8)&&!(!d(s,0,r)&&!d(s,0,i))){var f=s[0]===77,v=o(s,4,f)-8;if(!(v<0)){var g=v+8;if(!(s.length-g<2)){var m=n(s,g+0,f)*12;if(!(m<=0)&&(g+=2,!(s.length-g<m))){var w,l,x,y;for(w=0;w<m;w+=12)y=n(s,g+w,f),y===256?l=a(s,g+w,f):y===257&&(x=a(s,g+w,f));if(l&&x)return{width:l,height:x,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),t8=Vt((Z,V)=>{var u=_u().str2arr,d=_u().sliceEq,E=_u().readUInt16LE,A=_u().readUInt32LE,t=R1(),e=u("RIFF"),r=u("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 f=A(a,s+1);return{width:(f&16383)+1,height:(f>>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)&&!(!d(a,0,e)&&!d(a,8,r))){var s=12,f=null,v=0,g=A(a,4)+8;if(!(g>a.length)){for(;s+8<g;){if(a[s]===0){s++;continue}var m=String.fromCharCode.apply(null,a.slice(s,s+4)),w=A(a,s+4);m==="VP8 "&&w>=10?f=f||i(a,s+8):m==="VP8L"&&w>=9?f=f||n(a,s+8):m==="VP8X"&&w>=10?f=f||o(a,s+8):m==="EXIF"&&(v=t.get_orientation(a.slice(s+8,s+8+w)),s=1/0),s+=8+w}if(f)return v>0&&(f.orientation=v),f}}}}),e8=Vt((Z,V)=>{V.exports={avif:WM(),bmp:GM(),gif:ZM(),ico:KM(),jpeg:YM(),png:XM(),psd:$M(),svg:JM(),tiff:QM(),webp:t8()}}),r8=Vt((Z,V)=>{var u=e8();function d(E){for(var A=Object.keys(u),t=0;t<A.length;t++){var e=u[A[t]](E);if(e)return e}return null}V.exports=function(E){return d(E)},V.exports.parsers=u}),n8=Vt(Z=>{var V=r8(),u=Bp().IMAGE_URL_PREFIX,d=p0().Buffer;Z.getImageSize=function(E){var A=E.replace(u,""),t=new d(A,"base64");return V(t)}}),a8=Vt((Z,V)=>{var u=Xr(),d=Cm(),E=Lo(),A=yo(),t=Xr().maxRowLength,e=n8().getImageSize;V.exports=function(o,a){var s,f;if(a._hasZ)s=a.z.length,f=t(a.z);else if(a._hasSource){var v=e(a.source);s=v.height,f=v.width}var g=A.getFromId(o,a.xaxis||"x"),m=A.getFromId(o,a.yaxis||"y"),w=g.d2c(a.x0)-a.dx/2,l=m.d2c(a.y0)-a.dy/2,x,y=[w,w+f*a.dx],S=[l,l+s*a.dy];if(g&&g.type==="log")for(x=0;x<f;x++)y.push(w+x*a.dx);if(m&&m.type==="log")for(x=0;x<s;x++)S.push(l+x*a.dy);a._extremes[g._id]=A.findExtremes(g,y),a._extremes[m._id]=A.findExtremes(m,S),a._scaler=n(a);var k={x0:w,y0:l,z:a.z,w:f,h:s};return[k]};function r(o,a,s,f){return function(v){return u.constrain((v-o)*a,s,f)}}function i(o,a){return function(s){return u.constrain(s,o,a)}}function n(o){var a=d.colormodel[o.colormodel],s=a.colormodel||o.colormodel,f=s.length;o._sArray=[];for(var v=0;v<f;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(g){for(var m=g.slice(0,f),w=0;w<f;w++){var l=m[w];if(!E(l))return!1;m[w]=o._sArray[w](l)}return m}}}),i8=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=d.strTranslate,A=Eh(),t=Cm(),e=i2(),r=x1().STYLE;V.exports=function(i,n,o,a){var s=n.xaxis,f=n.yaxis,v=!i._context._exportedPlot&&e();d.makeTraceGroups(a,o,"im").each(function(g){var m=u.select(this),w=g[0],l=w.trace,x=(l.zsmooth==="fast"||l.zsmooth===!1&&v)&&!l._hasZ&&l._hasSource&&s.type==="linear"&&f.type==="linear";l._realImage=x;var y=w.z,S=w.x0,k=w.y0,M=w.w,T=w.h,c=l.dx,h=l.dy,b,_,P,L,D,B;for(B=0;b===void 0&&B<M;)b=s.c2p(S+B*c),B++;for(B=M;_===void 0&&B>0;)_=s.c2p(S+B*c),B--;for(B=0;L===void 0&&B<T;)L=f.c2p(k+B*h),B++;for(B=T;D===void 0&&B>0;)D=f.c2p(k+B*h),B--;if(_<b&&(P=_,_=b,b=P),D<L&&(P=L,L=D,D=P),!x){var R=.5;b=Math.max(-R*s._length,b),_=Math.min((1+R)*s._length,_),L=Math.max(-R*f._length,L),D=Math.min((1+R)*f._length,D)}var I=Math.round(_-b),F=Math.round(D-L),N=I<=0||F<=0;if(N){var j=m.selectAll("image").data([]);j.exit().remove();return}function G(J){var q=document.createElement("canvas");q.width=I,q.height=F;var it=q.getContext("2d",{willReadFrequently:!0}),nt=function(mt){return d.constrain(Math.round(s.c2p(S+mt*c)-b),0,I)},dt=function(mt){return d.constrain(Math.round(f.c2p(k+mt*h)-L),0,F)},Tt=t.colormodel[l.colormodel],wt=Tt.colormodel||l.colormodel,It=Tt.fmt,Ct;for(B=0;B<w.w;B++){var Nt=nt(B),ee=nt(B+1);if(!(ee===Nt||isNaN(ee)||isNaN(Nt)))for(var Jt=0;Jt<w.h;Jt++){var te=dt(Jt),Kt=dt(Jt+1);Kt===te||isNaN(Kt)||isNaN(te)||!J(B,Jt)||(Ct=l._scaler(J(B,Jt)),Ct?it.fillStyle=wt+"("+It(Ct).join(",")+")":it.fillStyle="rgba(0,0,0,0)",it.fillRect(Nt,te,ee-Nt,Kt-te))}}return q}var rt=m.selectAll("image").data([g]);rt.enter().append("svg:image").attr({xmlns:A.svg,preserveAspectRatio:"none"}),rt.exit().remove();var ct=l.zsmooth===!1?r:"";if(x){var st=d.simpleMap(s.range,s.r2l),et=d.simpleMap(f.range,f.r2l),K=st[1]<st[0],ot=et[1]>et[0];if(K||ot){var X=b+I/2,Q=L+F/2;ct+="transform:"+E(X+"px",Q+"px")+"scale("+(K?-1:1)+","+(ot?-1:1)+")"+E(-X+"px",-Q+"px")+";"}}rt.attr("style",ct);var ut=new Promise(function(J){if(l._hasZ)J();else if(l._hasSource)if(l._canvas&&l._canvas.el.width===M&&l._canvas.el.height===T&&l._canvas.source===l.source)J();else{var q=document.createElement("canvas");q.width=M,q.height=T;var it=q.getContext("2d",{willReadFrequently:!0});l._image=l._image||new Image;var nt=l._image;nt.onload=function(){it.drawImage(nt,0,0),l._canvas={el:q,source:l.source},J()},nt.setAttribute("src",l.source)}}).then(function(){var J,q;if(l._hasZ)q=G(function(dt,Tt){var wt=y[Tt][dt];return d.isTypedArray(wt)&&(wt=Array.from(wt)),wt}),J=q.toDataURL("image/png");else if(l._hasSource)if(x)J=l.source;else{var it=l._canvas.el.getContext("2d",{willReadFrequently:!0}),nt=it.getImageData(0,0,M,T).data;q=G(function(dt,Tt){var wt=4*(Tt*M+dt);return[nt[wt],nt[wt+1],nt[wt+2],nt[wt+3]]}),J=q.toDataURL("image/png")}rt.attr({"xlink:href":J,height:F,width:I,x:b,y:L})});i._promises.push(ut)})}}),o8=Vt((Z,V)=>{var u=Ni();V.exports=function(d){u.select(d).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}),s8=Vt((Z,V)=>{var u=hc(),d=Xr(),E=d.isArrayOrTypedArray,A=Cm();V.exports=function(t,e,r){var i=t.cd[0],n=i.trace,o=t.xa,a=t.ya;if(!(u.inbox(e-i.x0,e-(i.x0+i.w*n.dx),0)>0||u.inbox(r-i.y0,r-(i.y0+i.h*n.dy),0)>0)){var s=Math.floor((e-i.x0)/n.dx),f=Math.floor(Math.abs(r-i.y0)/n.dy),v;if(n._hasZ?v=i.z[f][s]:n._hasSource&&(v=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(s,f,1,1).data),!!v){var g=i.hi||n.hoverinfo,m;if(g){var w=g.split("+");w.indexOf("all")!==-1&&(w=["color"]),w.indexOf("color")!==-1&&(m=!0)}var l=A.colormodel[n.colormodel],x=l.colormodel||n.colormodel,y=x.length,S=n._scaler(v),k=l.suffix,M=[];(n.hovertemplate||m)&&(M.push("["+[S[0]+k[0],S[1]+k[1],S[2]+k[2]].join(", ")),y===4&&M.push(", "+S[3]+k[3]),M.push("]"),M=M.join(""),t.extraText=x.toUpperCase()+": "+M);var T;E(n.hovertext)&&E(n.hovertext[f])?T=n.hovertext[f][s]:E(n.text)&&E(n.text[f])&&(T=n.text[f][s]);var c=a.c2p(i.y0+(f+.5)*n.dy),h=i.x0+(s+.5)*n.dx,b=i.y0+(f+.5)*n.dy,_="["+v.slice(0,n.colormodel.length).join(", ")+"]";return[d.extendFlat(t,{index:[f,s],x0:o.c2p(i.x0+s*n.dx),x1:o.c2p(i.x0+(s+1)*n.dx),y0:c,y1:c,color:S,xVal:h,xLabelVal:h,yVal:b,yLabelVal:b,zLabelVal:_,text:T,hovertemplateLabels:{zLabel:_,colorLabel:M,"color[0]Label":S[0]+k[0],"color[1]Label":S[1]+k[1],"color[2]Label":S[2]+k[2],"color[3]Label":S[3]+k[3]}})]}}}}),l8=Vt((Z,V)=>{V.exports=function(u,d){return"xVal"in d&&(u.x=d.xVal),"yVal"in d&&(u.y=d.yVal),d.xa&&(u.xaxis=d.xa),d.ya&&(u.yaxis=d.ya),u.color=d.color,u.colormodel=d.trace.colormodel,u.z||(u.z=d.color),u}}),u8=Vt((Z,V)=>{V.exports={attributes:C2(),supplyDefaults:WA(),calc:a8(),plot:i8(),style:o8(),hoverPoints:s8(),eventData:l8(),moduleType:"trace",name:"image",basePlotModule:Kc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),c8=Vt((Z,V)=>{V.exports=u8()}),v0=Vt((Z,V)=>{var u=Tl(),d=Vu().attributes,E=yu(),A=nf(),{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=So().extendFlat,n=Cf().pattern,o=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:n,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:i({},u.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:t({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:e({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:i({},o,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:i({},o,{}),outsidetextfont:i({},o,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:i({},o,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:d({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"}}}),y0=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=v0(),A=Vu().defaults,t=Lh().handleText,e=Xr().coercePattern;function r(o,a){var s=d.isArrayOrTypedArray(o),f=d.isArrayOrTypedArray(a),v=Math.min(s?o.length:1/0,f?a.length:1/0);if(isFinite(v)||(v=0),v&&f){for(var g,m=0;m<v;m++){var w=a[m];if(u(w)&&w>0){g=!0;break}}g||(v=0)}return{hasLabels:s,hasValues:f,len:v}}function i(o,a,s,f,v){var g=f("marker.line.width");g&&f("marker.line.color",v?void 0:s.paper_bgcolor);var m=f("marker.colors");e(f,"marker.pattern",m),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,f){function v(_,P){return d.coerce(o,a,E,_,P)}var g=v("labels"),m=v("values"),w=r(g,m),l=w.len;if(a._hasLabels=w.hasLabels,a._hasValues=w.hasValues,!a._hasLabels&&a._hasValues&&(v("label0"),v("dlabel")),!l){a.visible=!1;return}a._length=l,i(o,a,f,v,!0),v("scalegroup");var x=v("text"),y=v("texttemplate");v("texttemplatefallback");var S;if(y||(S=v("textinfo",d.isArrayOrTypedArray(x)?"text+percent":"percent")),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),y||S&&S!=="none"){var k=v("textposition");t(o,a,f,v,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var M=Array.isArray(k)||k==="auto",T=M||k==="outside";T&&v("automargin"),(k==="inside"||k==="auto"||Array.isArray(k))&&v("insidetextorientation")}else S==="none"&&v("textposition","none");A(a,f,v);var c=v("hole"),h=v("title.text");if(h){var b=v("title.position",c?"middle center":"top center");!c&&b==="middle center"&&(a.title.position="top center"),d.coerceFont(v,"title.font",f.font)}v("sort"),v("direction"),v("rotation"),v("pull")}V.exports={handleLabelsAndValues:r,handleMarkerDefaults:i,supplyDefaults:n}}),N1=Vt((Z,V)=>{V.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),f8=Vt((Z,V)=>{var u=Xr(),d=N1();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("hiddenlabels"),t("piecolorway",A.colorway),t("extendpiecolors")}}),Fm=Vt((Z,V)=>{var u=Lo(),d=kf(),E=Pi(),A={};function t(n,o){var a=[],s=n._fullLayout,f=s.hiddenlabels||[],v=o.labels,g=o.marker.colors||[],m=o.values,w=o._length,l=o._hasValues&&w,x,y;if(o.dlabel)for(v=new Array(w),x=0;x<w;x++)v[x]=String(o.label0+x*o.dlabel);var S={},k=e(s["_"+o.type+"colormap"]),M=0,T=!1;for(x=0;x<w;x++){var c,h,b;if(l){if(c=m[x],!u(c))continue;c=+c}else c=1;h=v[x],(h===void 0||h==="")&&(h=x),h=String(h);var _=S[h];_===void 0?(S[h]=a.length,b=f.indexOf(h)!==-1,b||(M+=c),a.push({v:c,label:h,color:k(g[x],h),i:x,pts:[x],hidden:b})):(T=!0,y=a[_],y.v+=c,y.pts.push(x),y.hidden||(M+=c),y.color===!1&&g[x]&&(y.color=k(g[x],h)))}a=a.filter(function(L){return L.v>=0});var P=o.type==="funnelarea"?T:o.sort;return P&&a.sort(function(L,D){return D.v-L.v}),a[0]&&(a[0].vTotal=M),a}function e(n){return function(o,a){return!o||(o=d(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,f=n.calcdata,v=s[a+"colorway"],g=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(v=i(v,A));for(var m=0,w=0;w<f.length;w++){var l=f[w],x=l[0].trace.type;if(x===a)for(var y=0;y<l.length;y++){var S=l[y];S.color===!1&&(g[S.label]?S.color=g[S.label]:(g[S.label]=S.color=v[m%v.length],m++))}}}function i(n,o){var a,s=JSON.stringify(n),f=o[s];if(!f){for(f=n.slice(),a=0;a<n.length;a++)f.push(d(n[a]).lighten(20).toHexString());for(a=0;a<n.length;a++)f.push(d(n[a]).darken(20).toHexString());o[s]=f}return f}V.exports={calc:t,crossTraceCalc:r,makePullColorFn:e,generateExtendedColors:i}}),h8=Vt((Z,V)=>{var u=dh().appendArrayMultiPointValues;V.exports=function(d,E){var A={curveNumber:E.index,pointNumbers:d.pts,data:E._input,fullData:E,label:d.label,color:d.color,value:d.v,percent:d.percent,text:d.text,bbox:d.bbox,v:d.v};return d.pts.length===1&&(A.pointNumber=A.i=d.pts[0]),u(A,E,d.pts),E.type==="funnelarea"&&(delete A.v,delete A.i),A}}),j1=Vt((Z,V)=>{var u=Ni(),d=Uu(),E=hc(),A=Pi(),t=Eo(),e=Xr(),r=e.strScale,i=e.strTranslate,n=Dl(),o=oh(),a=o.recordMinTextSize,s=o.clearMinTextSize,f=f0().TEXTPAD,v=Ad(),g=h8(),m=Xr().isValidTextValue;function w(ot,X){var Q=ot._context.staticPlot,ut=ot._fullLayout,J=ut._size;s("pie",ut),k(X,ot),G(X,J);var q=e.makeTraceGroups(ut._pielayer,X,"trace").each(function(it){var nt=u.select(this),dt=it[0],Tt=dt.trace;ct(it),nt.attr("stroke-linejoin","round"),nt.each(function(){var wt=u.select(this).selectAll("g.slice").data(it);wt.enter().append("g").classed("slice",!0),wt.exit().remove();var It=[[[],[]],[[],[]]],Ct=!1;wt.each(function(vt,Ut){if(vt.hidden){u.select(this).selectAll("path,g").remove();return}vt.pointNumber=vt.i,vt.curveNumber=Tt.index,It[vt.pxmid[1]<0?0:1][vt.pxmid[0]<0?0:1].push(vt);var re=dt.cx,Zt=dt.cy,ue=u.select(this),Me=ue.selectAll("path.surface").data([vt]);if(Me.enter().append("path").classed("surface",!0).style({"pointer-events":Q?"none":"all"}),ue.call(x,ot,it),Tt.pull){var Ce=+v.castOption(Tt.pull,vt.pts)||0;Ce>0&&(re+=Ce*vt.pxmid[0],Zt+=Ce*vt.pxmid[1])}vt.cxFinal=re,vt.cyFinal=Zt;function We(de,Dt,qt,_t){var lt=_t*(Dt[0]-de[0]),yt=_t*(Dt[1]-de[1]);return"a"+_t*dt.r+","+_t*dt.r+" 0 "+vt.largeArc+(qt?" 1 ":" 0 ")+lt+","+yt}var qe=Tt.hole;if(vt.v===dt.vTotal){var vr="M"+(re+vt.px0[0])+","+(Zt+vt.px0[1])+We(vt.px0,vt.pxmid,!0,1)+We(vt.pxmid,vt.px0,!0,1)+"Z";qe?Me.attr("d","M"+(re+qe*vt.px0[0])+","+(Zt+qe*vt.px0[1])+We(vt.px0,vt.pxmid,!1,qe)+We(vt.pxmid,vt.px0,!1,qe)+"Z"+vr):Me.attr("d",vr)}else{var _r=We(vt.px0,vt.px1,!0,1);if(qe){var er=1-qe;Me.attr("d","M"+(re+qe*vt.px1[0])+","+(Zt+qe*vt.px1[1])+We(vt.px1,vt.px0,!1,qe)+"l"+er*vt.px0[0]+","+er*vt.px0[1]+_r+"Z")}else Me.attr("d","M"+re+","+Zt+"l"+vt.px0[0]+","+vt.px0[1]+_r+"Z")}et(ot,vt,dt);var Mr=v.castOption(Tt.textposition,vt.pts),Ir=ue.selectAll("g.slicetext").data(vt.text&&Mr!=="none"?[0]:[]);Ir.enter().append("g").classed("slicetext",!0),Ir.exit().remove(),Ir.each(function(){var de=e.ensureSingle(u.select(this),"text","",function(Yt){Yt.attr("data-notex",1)}),Dt=e.ensureUniformFontSize(ot,Mr==="outside"?y(Tt,vt,ut.font):S(Tt,vt,ut.font));de.text(vt.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(t.font,Dt).call(n.convertToTspans,ot);var qt=t.bBox(de.node()),_t;if(Mr==="outside")_t=D(qt,vt);else if(_t=M(qt,vt,dt),Mr==="auto"&&_t.scale<1){var lt=e.ensureUniformFontSize(ot,Tt.outsidetextfont);de.call(t.font,lt),qt=t.bBox(de.node()),_t=D(qt,vt)}var yt=_t.textPosAngle,St=yt===void 0?vt.pxmid:st(dt.r,yt);if(_t.targetX=re+St[0]*_t.rCenter+(_t.x||0),_t.targetY=Zt+St[1]*_t.rCenter+(_t.y||0),K(_t,qt),_t.outside){var Ht=_t.targetY;vt.yLabelMin=Ht-qt.height/2,vt.yLabelMid=Ht,vt.yLabelMax=Ht+qt.height/2,vt.labelExtraX=0,vt.labelExtraY=0,Ct=!0}_t.fontSize=Dt.size,a(Tt.type,_t,ut),it[Ut].transform=_t,e.setTransormAndDisplay(de,_t)})});var Nt=u.select(this).selectAll("g.titletext").data(Tt.title.text?[0]:[]);if(Nt.enter().append("g").classed("titletext",!0),Nt.exit().remove(),Nt.each(function(){var vt=e.ensureSingle(u.select(this),"text","",function(Zt){Zt.attr("data-notex",1)}),Ut=Tt.title.text;Tt._meta&&(Ut=e.templateString(Ut,Tt._meta)),vt.text(Ut).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(t.font,Tt.title.font).call(n.convertToTspans,ot);var re;Tt.title.position==="middle center"?re=B(dt):re=R(dt,J),vt.attr("transform",i(re.x,re.y)+r(Math.min(1,re.scale))+i(re.tx,re.ty))}),Ct&&j(It,Tt),l(wt,Tt),Ct&&Tt.automargin){var ee=t.bBox(nt.node()),Jt=Tt.domain,te=J.w*(Jt.x[1]-Jt.x[0]),Kt=J.h*(Jt.y[1]-Jt.y[0]),mt=(.5*te-dt.r)/J.w,bt=(.5*Kt-dt.r)/J.h;d.autoMargin(ot,"pie."+Tt.uid+".automargin",{xl:Jt.x[0]-mt,xr:Jt.x[1]+mt,yb:Jt.y[0]-bt,yt:Jt.y[1]+bt,l:Math.max(dt.cx-dt.r-ee.left,0),r:Math.max(ee.right-(dt.cx+dt.r),0),b:Math.max(ee.bottom-(dt.cy+dt.r),0),t:Math.max(dt.cy-dt.r-ee.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var it=u.select(this);it.attr("dy")&&it.attr("dy",it.attr("dy"))})},0)}function l(ot,X){ot.each(function(Q){var ut=u.select(this);if(!Q.labelExtraX&&!Q.labelExtraY){ut.select("path.textline").remove();return}var J=ut.select("g.slicetext text");Q.transform.targetX+=Q.labelExtraX,Q.transform.targetY+=Q.labelExtraY,e.setTransormAndDisplay(J,Q.transform);var q=Q.cxFinal+Q.pxmid[0],it=Q.cyFinal+Q.pxmid[1],nt="M"+q+","+it,dt=(Q.yLabelMax-Q.yLabelMin)*(Q.pxmid[0]<0?-1:1)/4;if(Q.labelExtraX){var Tt=Q.labelExtraX*Q.pxmid[1]/Q.pxmid[0],wt=Q.yLabelMid+Q.labelExtraY-(Q.cyFinal+Q.pxmid[1]);Math.abs(Tt)>Math.abs(wt)?nt+="l"+wt*Q.pxmid[0]/Q.pxmid[1]+","+wt+"H"+(q+Q.labelExtraX+dt):nt+="l"+Q.labelExtraX+","+Tt+"v"+(wt-Tt)+"h"+dt}else nt+="V"+(Q.yLabelMid+Q.labelExtraY)+"h"+dt;e.ensureSingle(ut,"path","textline").call(A.stroke,X.outsidetextfont.color).attr({"stroke-width":Math.min(2,X.outsidetextfont.size/8),d:nt,fill:"none"})})}function x(ot,X,Q){var ut=Q[0],J=ut.cx,q=ut.cy,it=ut.trace,nt=it.type==="funnelarea";"_hasHoverLabel"in it||(it._hasHoverLabel=!1),"_hasHoverEvent"in it||(it._hasHoverEvent=!1),ot.on("mouseover",function(dt){var Tt=X._fullLayout,wt=X._fullData[it.index];if(!(X._dragging||Tt.hovermode===!1)){var It=wt.hoverinfo;if(Array.isArray(It)&&(It=E.castHoverinfo({hoverinfo:[v.castOption(It,dt.pts)],_module:it._module},Tt,0)),It==="all"&&(It="label+text+value+percent+name"),wt.hovertemplate||It!=="none"&&It!=="skip"&&It){var Ct=dt.rInscribed||0,Nt=J+dt.pxmid[0]*(1-Ct),ee=q+dt.pxmid[1]*(1-Ct),Jt=Tt.separators,te=[];if(It&&It.indexOf("label")!==-1&&te.push(dt.label),dt.text=v.castOption(wt.hovertext||wt.text,dt.pts),It&&It.indexOf("text")!==-1){var Kt=dt.text;e.isValidTextValue(Kt)&&te.push(Kt)}dt.value=dt.v,dt.valueLabel=v.formatPieValue(dt.v,Jt),It&&It.indexOf("value")!==-1&&te.push(dt.valueLabel),dt.percent=dt.v/ut.vTotal,dt.percentLabel=v.formatPiePercent(dt.percent,Jt),It&&It.indexOf("percent")!==-1&&te.push(dt.percentLabel);var mt=wt.hoverlabel,bt=mt.font,vt=[];E.loneHover({trace:it,x0:Nt-Ct*ut.r,x1:Nt+Ct*ut.r,y:ee,_x0:nt?J+dt.TL[0]:Nt-Ct*ut.r,_x1:nt?J+dt.TR[0]:Nt+Ct*ut.r,_y0:nt?q+dt.TL[1]:ee-Ct*ut.r,_y1:nt?q+dt.BL[1]:ee+Ct*ut.r,text:te.join("<br>"),name:wt.hovertemplate||It.indexOf("name")!==-1?wt.name:void 0,idealAlign:dt.pxmid[0]<0?"left":"right",color:v.castOption(mt.bgcolor,dt.pts)||dt.color,borderColor:v.castOption(mt.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(mt.namelength,dt.pts),textAlign:v.castOption(mt.align,dt.pts),hovertemplate:v.castOption(wt.hovertemplate,dt.pts),hovertemplateLabels:dt,eventData:[g(dt,wt)]},{container:Tt._hoverlayer.node(),outerContainer:Tt._paper.node(),gd:X,inOut_bbox:vt}),dt.bbox=vt[0],it._hasHoverLabel=!0}it._hasHoverEvent=!0,X.emit("plotly_hover",{points:[g(dt,wt)],event:u.event})}}),ot.on("mouseout",function(dt){var Tt=X._fullLayout,wt=X._fullData[it.index],It=u.select(this).datum();it._hasHoverEvent&&(dt.originalEvent=u.event,X.emit("plotly_unhover",{points:[g(It,wt)],event:u.event}),it._hasHoverEvent=!1),it._hasHoverLabel&&(E.loneUnhover(Tt._hoverlayer.node()),it._hasHoverLabel=!1)}),ot.on("click",function(dt){var Tt=X._fullLayout,wt=X._fullData[it.index];X._dragging||Tt.hovermode===!1||(X._hoverdata=[g(dt,wt)],E.click(X,u.event))})}function y(ot,X,Q){var ut=v.castOption(ot.outsidetextfont.color,X.pts)||v.castOption(ot.textfont.color,X.pts)||Q.color,J=v.castOption(ot.outsidetextfont.family,X.pts)||v.castOption(ot.textfont.family,X.pts)||Q.family,q=v.castOption(ot.outsidetextfont.size,X.pts)||v.castOption(ot.textfont.size,X.pts)||Q.size,it=v.castOption(ot.outsidetextfont.weight,X.pts)||v.castOption(ot.textfont.weight,X.pts)||Q.weight,nt=v.castOption(ot.outsidetextfont.style,X.pts)||v.castOption(ot.textfont.style,X.pts)||Q.style,dt=v.castOption(ot.outsidetextfont.variant,X.pts)||v.castOption(ot.textfont.variant,X.pts)||Q.variant,Tt=v.castOption(ot.outsidetextfont.textcase,X.pts)||v.castOption(ot.textfont.textcase,X.pts)||Q.textcase,wt=v.castOption(ot.outsidetextfont.lineposition,X.pts)||v.castOption(ot.textfont.lineposition,X.pts)||Q.lineposition,It=v.castOption(ot.outsidetextfont.shadow,X.pts)||v.castOption(ot.textfont.shadow,X.pts)||Q.shadow;return{color:ut,family:J,size:q,weight:it,style:nt,variant:dt,textcase:Tt,lineposition:wt,shadow:It}}function S(ot,X,Q){var ut=v.castOption(ot.insidetextfont.color,X.pts);!ut&&ot._input.textfont&&(ut=v.castOption(ot._input.textfont.color,X.pts));var J=v.castOption(ot.insidetextfont.family,X.pts)||v.castOption(ot.textfont.family,X.pts)||Q.family,q=v.castOption(ot.insidetextfont.size,X.pts)||v.castOption(ot.textfont.size,X.pts)||Q.size,it=v.castOption(ot.insidetextfont.weight,X.pts)||v.castOption(ot.textfont.weight,X.pts)||Q.weight,nt=v.castOption(ot.insidetextfont.style,X.pts)||v.castOption(ot.textfont.style,X.pts)||Q.style,dt=v.castOption(ot.insidetextfont.variant,X.pts)||v.castOption(ot.textfont.variant,X.pts)||Q.variant,Tt=v.castOption(ot.insidetextfont.textcase,X.pts)||v.castOption(ot.textfont.textcase,X.pts)||Q.textcase,wt=v.castOption(ot.insidetextfont.lineposition,X.pts)||v.castOption(ot.textfont.lineposition,X.pts)||Q.lineposition,It=v.castOption(ot.insidetextfont.shadow,X.pts)||v.castOption(ot.textfont.shadow,X.pts)||Q.shadow;return{color:ut||A.contrast(X.color),family:J,size:q,weight:it,style:nt,variant:dt,textcase:Tt,lineposition:wt,shadow:It}}function k(ot,X){for(var Q,ut,J=0;J<ot.length;J++)if(Q=ot[J][0],ut=Q.trace,ut.title.text){var q=ut.title.text;ut._meta&&(q=e.templateString(q,ut._meta));var it=t.tester.append("text").attr("data-notex",1).text(q).call(t.font,ut.title.font).call(n.convertToTspans,X),nt=t.bBox(it.node(),!0);Q.titleBox={width:nt.width,height:nt.height},it.remove()}}function M(ot,X,Q){var ut=Q.r||X.rpx1,J=X.rInscribed,q=X.startangle===X.stopangle;if(q)return{rCenter:1-J,scale:0,rotate:0,textPosAngle:0};var it=X.ring,nt=it===1&&Math.abs(X.startangle-X.stopangle)===Math.PI*2,dt=X.halfangle,Tt=X.midangle,wt=Q.trace.insidetextorientation,It=wt==="horizontal",Ct=wt==="tangential",Nt=wt==="radial",ee=wt==="auto",Jt=[],te;if(!ee){var Kt=function(ue,Me){if(T(X,ue)){var Ce=Math.abs(ue-X.startangle),We=Math.abs(ue-X.stopangle),qe=Ce<We?Ce:We;Me==="tan"?te=h(ot,ut,it,qe,0):te=c(ot,ut,it,qe,Math.PI/2),te.textPosAngle=ue,Jt.push(te)}},mt;if(It||Ct){for(mt=4;mt>=-4;mt-=2)Kt(Math.PI*mt,"tan");for(mt=4;mt>=-4;mt-=2)Kt(Math.PI*(mt+1),"tan")}if(It||Nt){for(mt=4;mt>=-4;mt-=2)Kt(Math.PI*(mt+1.5),"rad");for(mt=4;mt>=-4;mt-=2)Kt(Math.PI*(mt+.5),"rad")}}if(nt||ee||It){var bt=Math.sqrt(ot.width*ot.width+ot.height*ot.height);if(te={scale:J*ut*2/bt,rCenter:1-J,rotate:0},te.textPosAngle=(X.startangle+X.stopangle)/2,te.scale>=1)return te;Jt.push(te)}(ee||Nt)&&(te=c(ot,ut,it,dt,Tt),te.textPosAngle=(X.startangle+X.stopangle)/2,Jt.push(te)),(ee||Ct)&&(te=h(ot,ut,it,dt,Tt),te.textPosAngle=(X.startangle+X.stopangle)/2,Jt.push(te));for(var vt=0,Ut=0,re=0;re<Jt.length;re++){var Zt=Jt[re].scale;if(Ut<Zt&&(Ut=Zt,vt=re),!ee&&Ut>=1)break}return Jt[vt]}function T(ot,X){var Q=ot.startangle,ut=ot.stopangle;return Q>X&&X>ut||Q<X&&X<ut}function c(ot,X,Q,ut,J){X=Math.max(0,X-2*f);var q=ot.width/ot.height,it=P(q,ut,X,Q);return{scale:it*2/ot.height,rCenter:b(q,it/X),rotate:_(J)}}function h(ot,X,Q,ut,J){X=Math.max(0,X-2*f);var q=ot.height/ot.width,it=P(q,ut,X,Q);return{scale:it*2/ot.width,rCenter:b(q,it/X),rotate:_(J+Math.PI/2)}}function b(ot,X){return Math.cos(X)-ot*X}function _(ot){return(180/Math.PI*ot+720)%180-90}function P(ot,X,Q,ut){var J=ot+1/(2*Math.tan(X));return Q*Math.min(1/(Math.sqrt(J*J+.5)+J),ut/(Math.sqrt(ot*ot+ut/2)+ot))}function L(ot,X){return ot.v===X.vTotal&&!X.trace.hole?1:Math.min(1/(1+1/Math.sin(ot.halfangle)),ot.ring/2)}function D(ot,X){var Q=X.pxmid[0],ut=X.pxmid[1],J=ot.width/2,q=ot.height/2;return Q<0&&(J*=-1),ut<0&&(q*=-1),{scale:1,rCenter:1,rotate:0,x:J+Math.abs(q)*(J>0?1:-1)/2,y:q/(1+Q*Q/(ut*ut)),outside:!0}}function B(ot){var X=Math.sqrt(ot.titleBox.width*ot.titleBox.width+ot.titleBox.height*ot.titleBox.height);return{x:ot.cx,y:ot.cy,scale:ot.trace.hole*ot.r*2/X,tx:0,ty:-ot.titleBox.height/2+ot.trace.title.font.size}}function R(ot,X){var Q=1,ut=1,J,q=ot.trace,it={x:ot.cx,y:ot.cy},nt={tx:0,ty:0};nt.ty+=q.title.font.size,J=N(q),q.title.position.indexOf("top")!==-1?(it.y-=(1+J)*ot.r,nt.ty-=ot.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(it.y+=(1+J)*ot.r);var dt=I(ot.r,ot.trace.aspectratio),Tt=X.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(Tt=Tt+dt,it.x-=(1+J)*dt,nt.tx+=ot.titleBox.width/2):q.title.position.indexOf("center")!==-1?Tt*=2:q.title.position.indexOf("right")!==-1&&(Tt=Tt+dt,it.x+=(1+J)*dt,nt.tx-=ot.titleBox.width/2),Q=Tt/ot.titleBox.width,ut=F(ot,X)/ot.titleBox.height,{x:it.x,y:it.y,scale:Math.min(Q,ut),tx:nt.tx,ty:nt.ty}}function I(ot,X){return ot/(X===void 0?1:X)}function F(ot,X){var Q=ot.trace,ut=X.h*(Q.domain.y[1]-Q.domain.y[0]);return Math.min(ot.titleBox.height,ut/2)}function N(ot){var X=ot.pull;if(!X)return 0;var Q;if(e.isArrayOrTypedArray(X))for(X=0,Q=0;Q<ot.pull.length;Q++)ot.pull[Q]>X&&(X=ot.pull[Q]);return X}function j(ot,X){var Q,ut,J,q,it,nt,dt,Tt,wt,It,Ct,Nt,ee;function Jt(bt,vt){return bt.pxmid[1]-vt.pxmid[1]}function te(bt,vt){return vt.pxmid[1]-bt.pxmid[1]}function Kt(bt,vt){vt||(vt={});var Ut=vt.labelExtraY+(ut?vt.yLabelMax:vt.yLabelMin),re=ut?bt.yLabelMin:bt.yLabelMax,Zt=ut?bt.yLabelMax:bt.yLabelMin,ue=bt.cyFinal+it(bt.px0[1],bt.px1[1]),Me=Ut-re,Ce,We,qe,vr,_r,er;if(Me*dt>0&&(bt.labelExtraY=Me),!!e.isArrayOrTypedArray(X.pull))for(We=0;We<It.length;We++)qe=It[We],!(qe===bt||(v.castOption(X.pull,bt.pts)||0)>=(v.castOption(X.pull,qe.pts)||0))&&((bt.pxmid[1]-qe.pxmid[1])*dt>0?(vr=qe.cyFinal+it(qe.px0[1],qe.px1[1]),Me=vr-re-bt.labelExtraY,Me*dt>0&&(bt.labelExtraY+=Me)):(Zt+bt.labelExtraY-ue)*dt>0&&(Ce=3*nt*Math.abs(We-It.indexOf(bt)),_r=qe.cxFinal+q(qe.px0[0],qe.px1[0]),er=_r+Ce-(bt.cxFinal+bt.pxmid[0])-bt.labelExtraX,er*nt>0&&(bt.labelExtraX+=er)))}for(ut=0;ut<2;ut++)for(J=ut?Jt:te,it=ut?Math.max:Math.min,dt=ut?1:-1,Q=0;Q<2;Q++){for(q=Q?Math.max:Math.min,nt=Q?1:-1,Tt=ot[ut][Q],Tt.sort(J),wt=ot[1-ut][Q],It=wt.concat(Tt),Nt=[],Ct=0;Ct<Tt.length;Ct++)Tt[Ct].yLabelMid!==void 0&&Nt.push(Tt[Ct]);for(ee=!1,Ct=0;ut&&Ct<wt.length;Ct++)if(wt[Ct].yLabelMid!==void 0){ee=wt[Ct];break}for(Ct=0;Ct<Nt.length;Ct++){var mt=Ct&&Nt[Ct-1];ee&&!Ct&&(mt=ee),Kt(Nt[Ct],mt)}}}function G(ot,X){for(var Q=[],ut=0;ut<ot.length;ut++){var J=ot[ut][0],q=J.trace,it=q.domain,nt=X.w*(it.x[1]-it.x[0]),dt=X.h*(it.y[1]-it.y[0]);q.title.text&&q.title.position!=="middle center"&&(dt-=F(J,X));var Tt=nt/2,wt=dt/2;q.type==="funnelarea"&&!q.scalegroup&&(wt/=q.aspectratio),J.r=Math.min(Tt,wt)/(1+N(q)),J.cx=X.l+X.w*(q.domain.x[1]+q.domain.x[0])/2,J.cy=X.t+X.h*(1-q.domain.y[0])-dt/2,q.title.text&&q.title.position.indexOf("bottom")!==-1&&(J.cy-=F(J,X)),q.scalegroup&&Q.indexOf(q.scalegroup)===-1&&Q.push(q.scalegroup)}rt(ot,Q)}function rt(ot,X){for(var Q,ut,J,q=0;q<X.length;q++){var it=1/0,nt=X[q];for(ut=0;ut<ot.length;ut++)if(Q=ot[ut][0],J=Q.trace,J.scalegroup===nt){var dt;if(J.type==="pie")dt=Q.r*Q.r;else if(J.type==="funnelarea"){var Tt,wt;J.aspectratio>1?(Tt=Q.r,wt=Tt/J.aspectratio):(wt=Q.r,Tt=wt*J.aspectratio),Tt*=(1+J.baseratio)/2,dt=Tt*wt}it=Math.min(it,dt/Q.vTotal)}for(ut=0;ut<ot.length;ut++)if(Q=ot[ut][0],J=Q.trace,J.scalegroup===nt){var It=it*Q.vTotal;J.type==="funnelarea"&&(It/=(1+J.baseratio)/2,It/=J.aspectratio),Q.r=Math.sqrt(It)}}}function ct(ot){var X=ot[0],Q=X.r,ut=X.trace,J=v.getRotationAngle(ut.rotation),q=2*Math.PI/X.vTotal,it="px0",nt="px1",dt,Tt,wt;if(ut.direction==="counterclockwise"){for(dt=0;dt<ot.length&&ot[dt].hidden;dt++);if(dt===ot.length)return;J+=q*ot[dt].v,q*=-1,it="px1",nt="px0"}for(wt=st(Q,J),dt=0;dt<ot.length;dt++)Tt=ot[dt],!Tt.hidden&&(Tt[it]=wt,Tt.startangle=J,J+=q*Tt.v/2,Tt.pxmid=st(Q,J),Tt.midangle=J,J+=q*Tt.v/2,wt=st(Q,J),Tt.stopangle=J,Tt[nt]=wt,Tt.largeArc=Tt.v>X.vTotal/2?1:0,Tt.halfangle=Math.PI*Math.min(Tt.v/X.vTotal,.5),Tt.ring=1-ut.hole,Tt.rInscribed=L(Tt,X))}function st(ot,X){return[ot*Math.sin(X),-ot*Math.cos(X)]}function et(ot,X,Q){var ut=ot._fullLayout,J=Q.trace,q=J.texttemplate,it=J.textinfo;if(!q&&it&&it!=="none"){var nt=it.split("+"),dt=function(vt){return nt.indexOf(vt)!==-1},Tt=dt("label"),wt=dt("text"),It=dt("value"),Ct=dt("percent"),Nt=ut.separators,ee;if(ee=Tt?[X.label]:[],wt){var Jt=v.getFirstFilled(J.text,X.pts);m(Jt)&&ee.push(Jt)}It&&ee.push(v.formatPieValue(X.v,Nt)),Ct&&ee.push(v.formatPiePercent(X.v/Q.vTotal,Nt)),X.text=ee.join("<br>")}function te(vt){return{label:vt.label,value:vt.v,valueLabel:v.formatPieValue(vt.v,ut.separators),percent:vt.v/Q.vTotal,percentLabel:v.formatPiePercent(vt.v/Q.vTotal,ut.separators),color:vt.color,text:vt.text,customdata:e.castOption(J,vt.i,"customdata")}}if(q){var Kt=e.castOption(J,X.i,"texttemplate");if(!Kt)X.text="";else{var mt=te(X),bt=v.getFirstFilled(J.text,X.pts);(m(bt)||bt==="")&&(mt.text=bt),X.text=e.texttemplateString({data:[mt,J._meta],fallback:J.texttemplatefallback,labels:mt,locale:ot._fullLayout._d3locale,template:Kt})}}}function K(ot,X){var Q=ot.rotate*Math.PI/180,ut=Math.cos(Q),J=Math.sin(Q),q=(X.left+X.right)/2,it=(X.top+X.bottom)/2;ot.textX=q*ut-it*J,ot.textY=q*J+it*ut,ot.noCenter=!0}V.exports={plot:w,formatSliceLabel:et,transformInsideText:M,determineInsideTextFont:S,positionTitleOutside:R,prerenderTitles:k,layoutAreas:G,attachFxHandlers:x,computeTransform:K}}),p8=Vt((Z,V)=>{var u=Ni(),d=_m(),E=oh().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=u.select(this);n.style({opacity:i.opacity}),n.selectAll("path.surface").each(function(o){u.select(this).call(d,o,i,A)})})}}),d8=Vt(Z=>{var V=Uu();Z.name="pie",Z.plot=function(u,d,E,A){V.plotBasePlot(Z.name,u,d,E,A)},Z.clean=function(u,d,E,A){V.cleanBasePlot(Z.name,u,d,E,A)}}),m8=Vt((Z,V)=>{V.exports={attributes:v0(),supplyDefaults:y0().supplyDefaults,supplyLayoutDefaults:f8(),layoutAttributes:N1(),calc:Fm().calc,crossTraceCalc:Fm().crossTraceCalc,plot:j1().plot,style:p8(),styleOne:_m(),moduleType:"trace",name:"pie",basePlotModule:d8(),categories:["pie-like","pie","showLegend"],meta:{}}}),g8=Vt((Z,V)=>{V.exports=m8()}),v8=Vt(Z=>{var V=Uu();Z.name="sunburst",Z.plot=function(u,d,E,A){V.plotBasePlot(Z.name,u,d,E,A)},Z.clean=function(u,d,E,A){V.cleanBasePlot(Z.name,u,d,E,A)}}),rw=Vt((Z,V)=>{V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),nv=Vt((Z,V)=>{var u=Tl(),{hovertemplateAttrs:d,texttemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Wl(),e=Vu().attributes,r=v0(),i=rw(),n=So().extendFlat,o=Cf().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:n({colors:{valType:"data_array",editType:"calc"},line:{color:n({},r.marker.line.color,{dflt:null}),width:n({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:o,editType:"calc"},t("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.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:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:A({editType:"plot"}),hovertext:r.hovertext,hoverinfo:n({},u.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:d({},{keys:i.eventDataKeys}),hovertemplatefallback:A(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:n({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:e({name:"sunburst",trace:!0,editType:"calc"})}}),nw=Vt((Z,V)=>{V.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),y8=Vt((Z,V)=>{var u=Xr(),d=nv(),E=Vu().defaults,A=Lh().handleText,t=y0().handleMarkerDefaults,e=xu(),r=e.hasColorscale,i=e.handleDefaults;V.exports=function(n,o,a,s){function f(y,S){return u.coerce(n,o,d,y,S)}var v=f("labels"),g=f("parents");if(!v||!v.length||!g||!g.length){o.visible=!1;return}var m=f("values");m&&m.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),t(n,o,s,f);var w=o._hasColorscale=r(n,"marker","colors")||(n.marker||{}).coloraxis;w&&i(n,o,s,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",w?1:.7);var l=f("text");f("texttemplate"),f("texttemplatefallback"),o.texttemplate||f("textinfo",u.isArrayOrTypedArray(l)?"text+label":"label"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback");var x="auto";A(n,o,s,f,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),E(o,s,f),o._length=null}}),x8=Vt((Z,V)=>{var u=Xr(),d=nw();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("sunburstcolorway",A.colorway),t("extendsunburstcolors")}}),av=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.d3=u.d3||{}))})(Z,function(u){function d(_t,lt){return _t.parent===lt.parent?1:2}function E(_t){return _t.reduce(A,0)/_t.length}function A(_t,lt){return _t+lt.x}function t(_t){return 1+_t.reduce(e,0)}function e(_t,lt){return Math.max(_t,lt.y)}function r(_t){for(var lt;lt=_t.children;)_t=lt[0];return _t}function i(_t){for(var lt;lt=_t.children;)_t=lt[lt.length-1];return _t}function n(){var _t=d,lt=1,yt=1,St=!1;function Ht(Yt){var se,ke=0;Yt.eachAfter(function(Ye){var Er=Ye.children;Er?(Ye.x=E(Er),Ye.y=t(Er)):(Ye.x=se?ke+=_t(Ye,se):0,Ye.y=0,se=Ye)});var Ee=r(Yt),Ue=i(Yt),ir=Ee.x-_t(Ee,Ue)/2,ar=Ue.x+_t(Ue,Ee)/2;return Yt.eachAfter(St?function(Ye){Ye.x=(Ye.x-Yt.x)*lt,Ye.y=(Yt.y-Ye.y)*yt}:function(Ye){Ye.x=(Ye.x-ir)/(ar-ir)*lt,Ye.y=(1-(Yt.y?Ye.y/Yt.y:1))*yt})}return Ht.separation=function(Yt){return arguments.length?(_t=Yt,Ht):_t},Ht.size=function(Yt){return arguments.length?(St=!1,lt=+Yt[0],yt=+Yt[1],Ht):St?null:[lt,yt]},Ht.nodeSize=function(Yt){return arguments.length?(St=!0,lt=+Yt[0],yt=+Yt[1],Ht):St?[lt,yt]:null},Ht}function o(_t){var lt=0,yt=_t.children,St=yt&&yt.length;if(!St)lt=1;else for(;--St>=0;)lt+=yt[St].value;_t.value=lt}function a(){return this.eachAfter(o)}function s(_t){var lt=this,yt,St=[lt],Ht,Yt,se;do for(yt=St.reverse(),St=[];lt=yt.pop();)if(_t(lt),Ht=lt.children,Ht)for(Yt=0,se=Ht.length;Yt<se;++Yt)St.push(Ht[Yt]);while(St.length);return this}function f(_t){for(var lt=this,yt=[lt],St,Ht;lt=yt.pop();)if(_t(lt),St=lt.children,St)for(Ht=St.length-1;Ht>=0;--Ht)yt.push(St[Ht]);return this}function v(_t){for(var lt=this,yt=[lt],St=[],Ht,Yt,se;lt=yt.pop();)if(St.push(lt),Ht=lt.children,Ht)for(Yt=0,se=Ht.length;Yt<se;++Yt)yt.push(Ht[Yt]);for(;lt=St.pop();)_t(lt);return this}function g(_t){return this.eachAfter(function(lt){for(var yt=+_t(lt.data)||0,St=lt.children,Ht=St&&St.length;--Ht>=0;)yt+=St[Ht].value;lt.value=yt})}function m(_t){return this.eachBefore(function(lt){lt.children&&lt.children.sort(_t)})}function w(_t){for(var lt=this,yt=l(lt,_t),St=[lt];lt!==yt;)lt=lt.parent,St.push(lt);for(var Ht=St.length;_t!==yt;)St.splice(Ht,0,_t),_t=_t.parent;return St}function l(_t,lt){if(_t===lt)return _t;var yt=_t.ancestors(),St=lt.ancestors(),Ht=null;for(_t=yt.pop(),lt=St.pop();_t===lt;)Ht=_t,_t=yt.pop(),lt=St.pop();return Ht}function x(){for(var _t=this,lt=[_t];_t=_t.parent;)lt.push(_t);return lt}function y(){var _t=[];return this.each(function(lt){_t.push(lt)}),_t}function S(){var _t=[];return this.eachBefore(function(lt){lt.children||_t.push(lt)}),_t}function k(){var _t=this,lt=[];return _t.each(function(yt){yt!==_t&&lt.push({source:yt.parent,target:yt})}),lt}function M(_t,lt){var yt=new _(_t),St=+_t.value&&(yt.value=_t.value),Ht,Yt=[yt],se,ke,Ee,Ue;for(lt==null&&(lt=c);Ht=Yt.pop();)if(St&&(Ht.value=+Ht.data.value),(ke=lt(Ht.data))&&(Ue=ke.length))for(Ht.children=new Array(Ue),Ee=Ue-1;Ee>=0;--Ee)Yt.push(se=Ht.children[Ee]=new _(ke[Ee])),se.parent=Ht,se.depth=Ht.depth+1;return yt.eachBefore(b)}function T(){return M(this).eachBefore(h)}function c(_t){return _t.children}function h(_t){_t.data=_t.data.data}function b(_t){var lt=0;do _t.height=lt;while((_t=_t.parent)&&_t.height<++lt)}function _(_t){this.data=_t,this.depth=this.height=0,this.parent=null}_.prototype=M.prototype={constructor:_,count:a,each:s,eachAfter:v,eachBefore:f,sum:g,sort:m,path:w,ancestors:x,descendants:y,leaves:S,links:k,copy:T};var P=Array.prototype.slice;function L(_t){for(var lt=_t.length,yt,St;lt;)St=Math.random()*lt--|0,yt=_t[lt],_t[lt]=_t[St],_t[St]=yt;return _t}function D(_t){for(var lt=0,yt=(_t=L(P.call(_t))).length,St=[],Ht,Yt;lt<yt;)Ht=_t[lt],Yt&&I(Yt,Ht)?++lt:(Yt=N(St=B(St,Ht)),lt=0);return Yt}function B(_t,lt){var yt,St;if(F(lt,_t))return[lt];for(yt=0;yt<_t.length;++yt)if(R(lt,_t[yt])&&F(G(_t[yt],lt),_t))return[_t[yt],lt];for(yt=0;yt<_t.length-1;++yt)for(St=yt+1;St<_t.length;++St)if(R(G(_t[yt],_t[St]),lt)&&R(G(_t[yt],lt),_t[St])&&R(G(_t[St],lt),_t[yt])&&F(rt(_t[yt],_t[St],lt),_t))return[_t[yt],_t[St],lt];throw new Error}function R(_t,lt){var yt=_t.r-lt.r,St=lt.x-_t.x,Ht=lt.y-_t.y;return yt<0||yt*yt<St*St+Ht*Ht}function I(_t,lt){var yt=_t.r-lt.r+1e-6,St=lt.x-_t.x,Ht=lt.y-_t.y;return yt>0&&yt*yt>St*St+Ht*Ht}function F(_t,lt){for(var yt=0;yt<lt.length;++yt)if(!I(_t,lt[yt]))return!1;return!0}function N(_t){switch(_t.length){case 1:return j(_t[0]);case 2:return G(_t[0],_t[1]);case 3:return rt(_t[0],_t[1],_t[2])}}function j(_t){return{x:_t.x,y:_t.y,r:_t.r}}function G(_t,lt){var yt=_t.x,St=_t.y,Ht=_t.r,Yt=lt.x,se=lt.y,ke=lt.r,Ee=Yt-yt,Ue=se-St,ir=ke-Ht,ar=Math.sqrt(Ee*Ee+Ue*Ue);return{x:(yt+Yt+Ee/ar*ir)/2,y:(St+se+Ue/ar*ir)/2,r:(ar+Ht+ke)/2}}function rt(_t,lt,yt){var St=_t.x,Ht=_t.y,Yt=_t.r,se=lt.x,ke=lt.y,Ee=lt.r,Ue=yt.x,ir=yt.y,ar=yt.r,Ye=St-se,Er=St-Ue,pn=Ht-ke,dn=Ht-ir,bn=Ee-Yt,Zn=ar-Yt,En=St*St+Ht*Ht-Yt*Yt,gn=En-se*se-ke*ke+Ee*Ee,da=En-Ue*Ue-ir*ir+ar*ar,ra=Er*pn-Ye*dn,Se=(pn*da-dn*gn)/(ra*2)-St,Re=(dn*bn-pn*Zn)/ra,Ze=(Er*gn-Ye*da)/(ra*2)-Ht,tr=(Ye*Zn-Er*bn)/ra,zr=Re*Re+tr*tr-1,tn=2*(Yt+Se*Re+Ze*tr),Yr=Se*Se+Ze*Ze-Yt*Yt,$r=-(zr?(tn+Math.sqrt(tn*tn-4*zr*Yr))/(2*zr):Yr/tn);return{x:St+Se+Re*$r,y:Ht+Ze+tr*$r,r:$r}}function ct(_t,lt,yt){var St=_t.x-lt.x,Ht,Yt,se=_t.y-lt.y,ke,Ee,Ue=St*St+se*se;Ue?(Yt=lt.r+yt.r,Yt*=Yt,Ee=_t.r+yt.r,Ee*=Ee,Yt>Ee?(Ht=(Ue+Ee-Yt)/(2*Ue),ke=Math.sqrt(Math.max(0,Ee/Ue-Ht*Ht)),yt.x=_t.x-Ht*St-ke*se,yt.y=_t.y-Ht*se+ke*St):(Ht=(Ue+Yt-Ee)/(2*Ue),ke=Math.sqrt(Math.max(0,Yt/Ue-Ht*Ht)),yt.x=lt.x+Ht*St-ke*se,yt.y=lt.y+Ht*se+ke*St)):(yt.x=lt.x+yt.r,yt.y=lt.y)}function st(_t,lt){var yt=_t.r+lt.r-1e-6,St=lt.x-_t.x,Ht=lt.y-_t.y;return yt>0&&yt*yt>St*St+Ht*Ht}function et(_t){var lt=_t._,yt=_t.next._,St=lt.r+yt.r,Ht=(lt.x*yt.r+yt.x*lt.r)/St,Yt=(lt.y*yt.r+yt.y*lt.r)/St;return Ht*Ht+Yt*Yt}function K(_t){this._=_t,this.next=null,this.previous=null}function ot(_t){if(!(Ht=_t.length))return 0;var lt,yt,St,Ht,Yt,se,ke,Ee,Ue,ir,ar;if(lt=_t[0],lt.x=0,lt.y=0,!(Ht>1))return lt.r;if(yt=_t[1],lt.x=-yt.r,yt.x=lt.r,yt.y=0,!(Ht>2))return lt.r+yt.r;ct(yt,lt,St=_t[2]),lt=new K(lt),yt=new K(yt),St=new K(St),lt.next=St.previous=yt,yt.next=lt.previous=St,St.next=yt.previous=lt;t:for(ke=3;ke<Ht;++ke){ct(lt._,yt._,St=_t[ke]),St=new K(St),Ee=yt.next,Ue=lt.previous,ir=yt._.r,ar=lt._.r;do if(ir<=ar){if(st(Ee._,St._)){yt=Ee,lt.next=yt,yt.previous=lt,--ke;continue t}ir+=Ee._.r,Ee=Ee.next}else{if(st(Ue._,St._)){lt=Ue,lt.next=yt,yt.previous=lt,--ke;continue t}ar+=Ue._.r,Ue=Ue.previous}while(Ee!==Ue.next);for(St.previous=lt,St.next=yt,lt.next=yt.previous=yt=St,Yt=et(lt);(St=St.next)!==yt;)(se=et(St))<Yt&&(lt=St,Yt=se);yt=lt.next}for(lt=[yt._],St=yt;(St=St.next)!==yt;)lt.push(St._);for(St=D(lt),ke=0;ke<Ht;++ke)lt=_t[ke],lt.x-=St.x,lt.y-=St.y;return St.r}function X(_t){return ot(_t),_t}function Q(_t){return _t==null?null:ut(_t)}function ut(_t){if(typeof _t!="function")throw new Error;return _t}function J(){return 0}function q(_t){return function(){return _t}}function it(_t){return Math.sqrt(_t.value)}function nt(){var _t=null,lt=1,yt=1,St=J;function Ht(Yt){return Yt.x=lt/2,Yt.y=yt/2,_t?Yt.eachBefore(dt(_t)).eachAfter(Tt(St,.5)).eachBefore(wt(1)):Yt.eachBefore(dt(it)).eachAfter(Tt(J,1)).eachAfter(Tt(St,Yt.r/Math.min(lt,yt))).eachBefore(wt(Math.min(lt,yt)/(2*Yt.r))),Yt}return Ht.radius=function(Yt){return arguments.length?(_t=Q(Yt),Ht):_t},Ht.size=function(Yt){return arguments.length?(lt=+Yt[0],yt=+Yt[1],Ht):[lt,yt]},Ht.padding=function(Yt){return arguments.length?(St=typeof Yt=="function"?Yt:q(+Yt),Ht):St},Ht}function dt(_t){return function(lt){lt.children||(lt.r=Math.max(0,+_t(lt)||0))}}function Tt(_t,lt){return function(yt){if(St=yt.children){var St,Ht,Yt=St.length,se=_t(yt)*lt||0,ke;if(se)for(Ht=0;Ht<Yt;++Ht)St[Ht].r+=se;if(ke=ot(St),se)for(Ht=0;Ht<Yt;++Ht)St[Ht].r-=se;yt.r=ke+se}}}function wt(_t){return function(lt){var yt=lt.parent;lt.r*=_t,yt&&(lt.x=yt.x+_t*lt.x,lt.y=yt.y+_t*lt.y)}}function It(_t){_t.x0=Math.round(_t.x0),_t.y0=Math.round(_t.y0),_t.x1=Math.round(_t.x1),_t.y1=Math.round(_t.y1)}function Ct(_t,lt,yt,St,Ht){for(var Yt=_t.children,se,ke=-1,Ee=Yt.length,Ue=_t.value&&(St-lt)/_t.value;++ke<Ee;)se=Yt[ke],se.y0=yt,se.y1=Ht,se.x0=lt,se.x1=lt+=se.value*Ue}function Nt(){var _t=1,lt=1,yt=0,St=!1;function Ht(se){var ke=se.height+1;return se.x0=se.y0=yt,se.x1=_t,se.y1=lt/ke,se.eachBefore(Yt(lt,ke)),St&&se.eachBefore(It),se}function Yt(se,ke){return function(Ee){Ee.children&&Ct(Ee,Ee.x0,se*(Ee.depth+1)/ke,Ee.x1,se*(Ee.depth+2)/ke);var Ue=Ee.x0,ir=Ee.y0,ar=Ee.x1-yt,Ye=Ee.y1-yt;ar<Ue&&(Ue=ar=(Ue+ar)/2),Ye<ir&&(ir=Ye=(ir+Ye)/2),Ee.x0=Ue,Ee.y0=ir,Ee.x1=ar,Ee.y1=Ye}}return Ht.round=function(se){return arguments.length?(St=!!se,Ht):St},Ht.size=function(se){return arguments.length?(_t=+se[0],lt=+se[1],Ht):[_t,lt]},Ht.padding=function(se){return arguments.length?(yt=+se,Ht):yt},Ht}var ee="$",Jt={depth:-1},te={};function Kt(_t){return _t.id}function mt(_t){return _t.parentId}function bt(){var _t=Kt,lt=mt;function yt(St){var Ht,Yt,se=St.length,ke,Ee,Ue,ir=new Array(se),ar,Ye,Er={};for(Yt=0;Yt<se;++Yt)Ht=St[Yt],Ue=ir[Yt]=new _(Ht),(ar=_t(Ht,Yt,St))!=null&&(ar+="")&&(Ye=ee+(Ue.id=ar),Er[Ye]=Ye in Er?te:Ue);for(Yt=0;Yt<se;++Yt)if(Ue=ir[Yt],ar=lt(St[Yt],Yt,St),ar==null||!(ar+="")){if(ke)throw new Error("multiple roots");ke=Ue}else{if(Ee=Er[ee+ar],!Ee)throw new Error("missing: "+ar);if(Ee===te)throw new Error("ambiguous: "+ar);Ee.children?Ee.children.push(Ue):Ee.children=[Ue],Ue.parent=Ee}if(!ke)throw new Error("no root");if(ke.parent=Jt,ke.eachBefore(function(pn){pn.depth=pn.parent.depth+1,--se}).eachBefore(b),ke.parent=null,se>0)throw new Error("cycle");return ke}return yt.id=function(St){return arguments.length?(_t=ut(St),yt):_t},yt.parentId=function(St){return arguments.length?(lt=ut(St),yt):lt},yt}function vt(_t,lt){return _t.parent===lt.parent?1:2}function Ut(_t){var lt=_t.children;return lt?lt[0]:_t.t}function re(_t){var lt=_t.children;return lt?lt[lt.length-1]:_t.t}function Zt(_t,lt,yt){var St=yt/(lt.i-_t.i);lt.c-=St,lt.s+=yt,_t.c+=St,lt.z+=yt,lt.m+=yt}function ue(_t){for(var lt=0,yt=0,St=_t.children,Ht=St.length,Yt;--Ht>=0;)Yt=St[Ht],Yt.z+=lt,Yt.m+=lt,lt+=Yt.s+(yt+=Yt.c)}function Me(_t,lt,yt){return _t.a.parent===lt.parent?_t.a:yt}function Ce(_t,lt){this._=_t,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=lt}Ce.prototype=Object.create(_.prototype);function We(_t){for(var lt=new Ce(_t,0),yt,St=[lt],Ht,Yt,se,ke;yt=St.pop();)if(Yt=yt._.children)for(yt.children=new Array(ke=Yt.length),se=ke-1;se>=0;--se)St.push(Ht=yt.children[se]=new Ce(Yt[se],se)),Ht.parent=yt;return(lt.parent=new Ce(null,0)).children=[lt],lt}function qe(){var _t=vt,lt=1,yt=1,St=null;function Ht(Ue){var ir=We(Ue);if(ir.eachAfter(Yt),ir.parent.m=-ir.z,ir.eachBefore(se),St)Ue.eachBefore(Ee);else{var ar=Ue,Ye=Ue,Er=Ue;Ue.eachBefore(function(En){En.x<ar.x&&(ar=En),En.x>Ye.x&&(Ye=En),En.depth>Er.depth&&(Er=En)});var pn=ar===Ye?1:_t(ar,Ye)/2,dn=pn-ar.x,bn=lt/(Ye.x+pn+dn),Zn=yt/(Er.depth||1);Ue.eachBefore(function(En){En.x=(En.x+dn)*bn,En.y=En.depth*Zn})}return Ue}function Yt(Ue){var ir=Ue.children,ar=Ue.parent.children,Ye=Ue.i?ar[Ue.i-1]:null;if(ir){ue(Ue);var Er=(ir[0].z+ir[ir.length-1].z)/2;Ye?(Ue.z=Ye.z+_t(Ue._,Ye._),Ue.m=Ue.z-Er):Ue.z=Er}else Ye&&(Ue.z=Ye.z+_t(Ue._,Ye._));Ue.parent.A=ke(Ue,Ye,Ue.parent.A||ar[0])}function se(Ue){Ue._.x=Ue.z+Ue.parent.m,Ue.m+=Ue.parent.m}function ke(Ue,ir,ar){if(ir){for(var Ye=Ue,Er=Ue,pn=ir,dn=Ye.parent.children[0],bn=Ye.m,Zn=Er.m,En=pn.m,gn=dn.m,da;pn=re(pn),Ye=Ut(Ye),pn&&Ye;)dn=Ut(dn),Er=re(Er),Er.a=Ue,da=pn.z+En-Ye.z-bn+_t(pn._,Ye._),da>0&&(Zt(Me(pn,Ue,ar),Ue,da),bn+=da,Zn+=da),En+=pn.m,bn+=Ye.m,gn+=dn.m,Zn+=Er.m;pn&&!re(Er)&&(Er.t=pn,Er.m+=En-Zn),Ye&&!Ut(dn)&&(dn.t=Ye,dn.m+=bn-gn,ar=Ue)}return ar}function Ee(Ue){Ue.x*=lt,Ue.y=Ue.depth*yt}return Ht.separation=function(Ue){return arguments.length?(_t=Ue,Ht):_t},Ht.size=function(Ue){return arguments.length?(St=!1,lt=+Ue[0],yt=+Ue[1],Ht):St?null:[lt,yt]},Ht.nodeSize=function(Ue){return arguments.length?(St=!0,lt=+Ue[0],yt=+Ue[1],Ht):St?[lt,yt]:null},Ht}function vr(_t,lt,yt,St,Ht){for(var Yt=_t.children,se,ke=-1,Ee=Yt.length,Ue=_t.value&&(Ht-yt)/_t.value;++ke<Ee;)se=Yt[ke],se.x0=lt,se.x1=St,se.y0=yt,se.y1=yt+=se.value*Ue}var _r=(1+Math.sqrt(5))/2;function er(_t,lt,yt,St,Ht,Yt){for(var se=[],ke=lt.children,Ee,Ue,ir=0,ar=0,Ye=ke.length,Er,pn,dn=lt.value,bn,Zn,En,gn,da,ra,Se;ir<Ye;){Er=Ht-yt,pn=Yt-St;do bn=ke[ar++].value;while(!bn&&ar<Ye);for(Zn=En=bn,ra=Math.max(pn/Er,Er/pn)/(dn*_t),Se=bn*bn*ra,da=Math.max(En/Se,Se/Zn);ar<Ye;++ar){if(bn+=Ue=ke[ar].value,Ue<Zn&&(Zn=Ue),Ue>En&&(En=Ue),Se=bn*bn*ra,gn=Math.max(En/Se,Se/Zn),gn>da){bn-=Ue;break}da=gn}se.push(Ee={value:bn,dice:Er<pn,children:ke.slice(ir,ar)}),Ee.dice?Ct(Ee,yt,St,Ht,dn?St+=pn*bn/dn:Yt):vr(Ee,yt,St,dn?yt+=Er*bn/dn:Ht,Yt),dn-=bn,ir=ar}return se}var Mr=function _t(lt){function yt(St,Ht,Yt,se,ke){er(lt,St,Ht,Yt,se,ke)}return yt.ratio=function(St){return _t((St=+St)>1?St:1)},yt}(_r);function Ir(){var _t=Mr,lt=!1,yt=1,St=1,Ht=[0],Yt=J,se=J,ke=J,Ee=J,Ue=J;function ir(Ye){return Ye.x0=Ye.y0=0,Ye.x1=yt,Ye.y1=St,Ye.eachBefore(ar),Ht=[0],lt&&Ye.eachBefore(It),Ye}function ar(Ye){var Er=Ht[Ye.depth],pn=Ye.x0+Er,dn=Ye.y0+Er,bn=Ye.x1-Er,Zn=Ye.y1-Er;bn<pn&&(pn=bn=(pn+bn)/2),Zn<dn&&(dn=Zn=(dn+Zn)/2),Ye.x0=pn,Ye.y0=dn,Ye.x1=bn,Ye.y1=Zn,Ye.children&&(Er=Ht[Ye.depth+1]=Yt(Ye)/2,pn+=Ue(Ye)-Er,dn+=se(Ye)-Er,bn-=ke(Ye)-Er,Zn-=Ee(Ye)-Er,bn<pn&&(pn=bn=(pn+bn)/2),Zn<dn&&(dn=Zn=(dn+Zn)/2),_t(Ye,pn,dn,bn,Zn))}return ir.round=function(Ye){return arguments.length?(lt=!!Ye,ir):lt},ir.size=function(Ye){return arguments.length?(yt=+Ye[0],St=+Ye[1],ir):[yt,St]},ir.tile=function(Ye){return arguments.length?(_t=ut(Ye),ir):_t},ir.padding=function(Ye){return arguments.length?ir.paddingInner(Ye).paddingOuter(Ye):ir.paddingInner()},ir.paddingInner=function(Ye){return arguments.length?(Yt=typeof Ye=="function"?Ye:q(+Ye),ir):Yt},ir.paddingOuter=function(Ye){return arguments.length?ir.paddingTop(Ye).paddingRight(Ye).paddingBottom(Ye).paddingLeft(Ye):ir.paddingTop()},ir.paddingTop=function(Ye){return arguments.length?(se=typeof Ye=="function"?Ye:q(+Ye),ir):se},ir.paddingRight=function(Ye){return arguments.length?(ke=typeof Ye=="function"?Ye:q(+Ye),ir):ke},ir.paddingBottom=function(Ye){return arguments.length?(Ee=typeof Ye=="function"?Ye:q(+Ye),ir):Ee},ir.paddingLeft=function(Ye){return arguments.length?(Ue=typeof Ye=="function"?Ye:q(+Ye),ir):Ue},ir}function de(_t,lt,yt,St,Ht){var Yt=_t.children,se,ke=Yt.length,Ee,Ue=new Array(ke+1);for(Ue[0]=Ee=se=0;se<ke;++se)Ue[se+1]=Ee+=Yt[se].value;ir(0,ke,_t.value,lt,yt,St,Ht);function ir(ar,Ye,Er,pn,dn,bn,Zn){if(ar>=Ye-1){var En=Yt[ar];En.x0=pn,En.y0=dn,En.x1=bn,En.y1=Zn;return}for(var gn=Ue[ar],da=Er/2+gn,ra=ar+1,Se=Ye-1;ra<Se;){var Re=ra+Se>>>1;Ue[Re]<da?ra=Re+1:Se=Re}da-Ue[ra-1]<Ue[ra]-da&&ar+1<ra&&--ra;var Ze=Ue[ra]-gn,tr=Er-Ze;if(bn-pn>Zn-dn){var zr=(pn*tr+bn*Ze)/Er;ir(ar,ra,Ze,pn,dn,zr,Zn),ir(ra,Ye,tr,zr,dn,bn,Zn)}else{var tn=(dn*tr+Zn*Ze)/Er;ir(ar,ra,Ze,pn,dn,bn,tn),ir(ra,Ye,tr,pn,tn,bn,Zn)}}}function Dt(_t,lt,yt,St,Ht){(_t.depth&1?vr:Ct)(_t,lt,yt,St,Ht)}var qt=function _t(lt){function yt(St,Ht,Yt,se,ke){if((Ee=St._squarify)&&Ee.ratio===lt)for(var Ee,Ue,ir,ar,Ye=-1,Er,pn=Ee.length,dn=St.value;++Ye<pn;){for(Ue=Ee[Ye],ir=Ue.children,ar=Ue.value=0,Er=ir.length;ar<Er;++ar)Ue.value+=ir[ar].value;Ue.dice?Ct(Ue,Ht,Yt,se,Yt+=(ke-Yt)*Ue.value/dn):vr(Ue,Ht,Yt,Ht+=(se-Ht)*Ue.value/dn,ke),dn-=Ue.value}else St._squarify=Ee=er(lt,St,Ht,Yt,se,ke),Ee.ratio=lt}return yt.ratio=function(St){return _t((St=+St)>1?St:1)},yt}(_r);u.cluster=n,u.hierarchy=M,u.pack=nt,u.packEnclose=D,u.packSiblings=X,u.partition=Nt,u.stratify=bt,u.tree=qe,u.treemap=Ir,u.treemapBinary=de,u.treemapDice=Ct,u.treemapResquarify=qt,u.treemapSlice=vr,u.treemapSliceDice=Dt,u.treemapSquarify=Mr,Object.defineProperty(u,"__esModule",{value:!0})})}),iv=Vt(Z=>{var V=av(),u=Lo(),d=Xr(),E=xu().makeColorScaleFuncFromTrace,A=Fm().makePullColorFn,t=Fm().generateExtendedColors,e=xu().calc,r=ks().ALMOST_EQUAL,i={},n={},o={};Z.calc=function(s,f){var v=s._fullLayout,g=f.ids,m=d.isArrayOrTypedArray(g),w=f.labels,l=f.parents,x=f.values,y=d.isArrayOrTypedArray(x),S=[],k={},M={},T=function(X,Q){k[X]?k[X].push(Q):k[X]=[Q],M[Q]=1},c=function(X){return X||typeof X=="number"},h=function(X){return!y||u(x[X])&&x[X]>=0},b,_,P;m?(b=Math.min(g.length,l.length),_=function(X){return c(g[X])&&h(X)},P=function(X){return String(g[X])}):(b=Math.min(w.length,l.length),_=function(X){return c(w[X])&&h(X)},P=function(X){return String(w[X])}),y&&(b=Math.min(b,x.length));for(var L=0;L<b;L++)if(_(L)){var D=P(L),B=c(l[L])?String(l[L]):"",R={i:L,id:D,pid:B,label:c(w[L])?String(w[L]):""};y&&(R.v=+x[L]),S.push(R),T(B,D)}if(k[""]){if(k[""].length>1){for(var I=d.randstr(),F=0;F<S.length;F++)S[F].pid===""&&(S[F].pid=I);S.unshift({hasMultipleRoots:!0,id:I,pid:"",label:""})}}else{var N=[],j;for(j in k)M[j]||N.push(j);if(N.length===1)j=N[0],S.unshift({hasImpliedRoot:!0,id:j,pid:"",label:j});else return d.warn(["Multiple implied roots, cannot build",f.type,"hierarchy of",f.name+".","These roots include:",N.join(", ")].join(" "))}var G;try{G=V.stratify().id(function(X){return X.id}).parentId(function(X){return X.pid})(S)}catch(X){return d.warn(["Failed to build",f.type,"hierarchy of",f.name+".","Error:",X.message].join(" "))}var rt=V.hierarchy(G),ct=!1;if(y)switch(f.branchvalues){case"remainder":rt.sum(function(X){return X.data.v});break;case"total":rt.each(function(X){var Q=X.data.data,ut=Q.v;if(X.children){var J=X.children.reduce(function(q,it){return q+it.data.data.v},0);if((Q.hasImpliedRoot||Q.hasMultipleRoots)&&(ut=J),ut<J*r)return ct=!0,d.warn(["Total value for node",X.data.data.id,"of",f.name,"is smaller than the sum of its children.",`
parent value =`,ut,`
children sum =`,J].join(" "))}X.value=ut});break}else a(rt,f,{branches:f.count.indexOf("branches")!==-1,leaves:f.count.indexOf("leaves")!==-1});if(!ct){f.sort&&rt.sort(function(X,Q){return Q.value-X.value});var st,et,K=f.marker.colors||[],ot=!!K.length;return f._hasColorscale?(ot||(K=y?f.values:f._values),e(s,f,{vals:K,containerStr:"marker",cLetter:"c"}),et=E(f.marker)):st=A(v["_"+f.type+"colormap"]),rt.each(function(X){var Q=X.data.data;Q.color=f._hasColorscale?et(K[Q.i]):st(K[Q.i],Q.id)}),S[0].hierarchy=rt,S}},Z._runCrossTraceCalc=function(s,f){var v=f._fullLayout,g=f.calcdata,m=v[s+"colorway"],w=v["_"+s+"colormap"];v["extend"+s+"colors"]&&(m=t(m,s==="icicle"?o:s==="treemap"?n:i));var l=0,x;function y(T){var c=T.data.data,h=c.id;c.color===!1&&(w[h]?c.color=w[h]:T.parent?T.parent.parent?c.color=T.parent.data.data.color:(w[h]=c.color=m[l%m.length],l++):c.color=x)}for(var S=0;S<g.length;S++){var k=g[S],M=k[0];M.trace.type===s&&M.hierarchy&&(x=M.trace.root.color,M.hierarchy.each(y))}},Z.crossTraceCalc=function(s){return Z._runCrossTraceCalc("sunburst",s)};function a(s,f,v){var g=0,m=s.children;if(m){for(var w=m.length,l=0;l<w;l++)g+=a(m[l],f,v);v.branches&&g++}else v.leaves&&g++;return s.value=s.data.data.value=g,f._values||(f._values=[]),f._values[s.data.data.i]=g,g}});function x0(Z,V,u){Z.prototype=V.prototype=u,u.constructor=Z}function Bm(Z,V){var u=Object.create(Z.prototype);for(var d in V)u[d]=V[d];return u}var U1=Bl(()=>{});function Np(){}function aw(){return this.rgb().formatHex()}function _8(){return this.rgb().formatHex8()}function b8(){return cw(this).formatHsl()}function iw(){return this.rgb().formatRgb()}function Rm(Z){var V,u;return Z=(Z+"").trim().toLowerCase(),(V=hw.exec(Z))?(u=V[1].length,V=parseInt(V[1],16),u===6?ow(V):u===3?new Of(V>>8&15|V>>4&240,V>>4&15|V&240,(V&15)<<4|V&15,1):u===8?ov(V>>24&255,V>>16&255,V>>8&255,(V&255)/255):u===4?ov(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=pw.exec(Z))?new Of(V[1],V[2],V[3],1):(V=dw.exec(Z))?new Of(V[1]*255/100,V[2]*255/100,V[3]*255/100,1):(V=mw.exec(Z))?ov(V[1],V[2],V[3],V[4]):(V=gw.exec(Z))?ov(V[1]*255/100,V[2]*255/100,V[3]*255/100,V[4]):(V=vw.exec(Z))?uw(V[1],V[2]/100,V[3]/100,1):(V=yw.exec(Z))?uw(V[1],V[2]/100,V[3]/100,V[4]):W1.hasOwnProperty(Z)?ow(W1[Z]):Z==="transparent"?new Of(NaN,NaN,NaN,0):null}function ow(Z){return new Of(Z>>16&255,Z>>8&255,Z&255,1)}function ov(Z,V,u,d){return d<=0&&(Z=V=u=NaN),new Of(Z,V,u,d)}function V1(Z){return Z instanceof Np||(Z=Rm(Z)),Z?(Z=Z.rgb(),new Of(Z.r,Z.g,Z.b,Z.opacity)):new Of}function sv(Z,V,u,d){return arguments.length===1?V1(Z):new Of(Z,V,u,d??1)}function Of(Z,V,u,d){this.r=+Z,this.g=+V,this.b=+u,this.opacity=+d}function sw(){return`#${Cd(this.r)}${Cd(this.g)}${Cd(this.b)}`}function w8(){return`#${Cd(this.r)}${Cd(this.g)}${Cd(this.b)}${Cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function lw(){let Z=lv(this.opacity);return`${Z===1?"rgb(":"rgba("}${Ld(this.r)}, ${Ld(this.g)}, ${Ld(this.b)}${Z===1?")":`, ${Z})`}`}function lv(Z){return isNaN(Z)?1:Math.max(0,Math.min(1,Z))}function Ld(Z){return Math.max(0,Math.min(255,Math.round(Z)||0))}function Cd(Z){return Z=Ld(Z),(Z<16?"0":"")+Z.toString(16)}function uw(Z,V,u,d){return d<=0?Z=V=u=NaN:u<=0||u>=1?Z=V=NaN:V<=0&&(Z=NaN),new Hh(Z,V,u,d)}function cw(Z){if(Z instanceof Hh)return new Hh(Z.h,Z.s,Z.l,Z.opacity);if(Z instanceof Np||(Z=Rm(Z)),!Z)return new Hh;if(Z instanceof Hh)return Z;Z=Z.rgb();var V=Z.r/255,u=Z.g/255,d=Z.b/255,E=Math.min(V,u,d),A=Math.max(V,u,d),t=NaN,e=A-E,r=(A+E)/2;return e?(V===A?t=(u-d)/e+(u<d)*6:u===A?t=(d-V)/e+2:t=(V-u)/e+4,e/=r<.5?A+E:2-A-E,t*=60):e=r>0&&r<1?0:t,new Hh(t,e,r,Z.opacity)}function H1(Z,V,u,d){return arguments.length===1?cw(Z):new Hh(Z,V,u,d??1)}function Hh(Z,V,u,d){this.h=+Z,this.s=+V,this.l=+u,this.opacity=+d}function fw(Z){return Z=(Z||0)%360,Z<0?Z+360:Z}function uv(Z){return Math.max(0,Math.min(1,Z||0))}function q1(Z,V,u){return(Z<60?V+(u-V)*Z/60:Z<180?u:Z<240?V+(u-V)*(240-Z)/60:V)*255}var jp,Id,Pd,_0,qh,hw,pw,dw,mw,gw,vw,yw,W1,G1=Bl(()=>{U1(),jp=.7,Id=1/jp,Pd="\\s*([+-]?\\d+)\\s*",_0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hw=/^#([0-9a-f]{3,8})$/,pw=new RegExp(`^rgb\\(${Pd},${Pd},${Pd}\\)$`),dw=new RegExp(`^rgb\\(${qh},${qh},${qh}\\)$`),mw=new RegExp(`^rgba\\(${Pd},${Pd},${Pd},${_0}\\)$`),gw=new RegExp(`^rgba\\(${qh},${qh},${qh},${_0}\\)$`),vw=new RegExp(`^hsl\\(${_0},${qh},${qh}\\)$`),yw=new RegExp(`^hsla\\(${_0},${qh},${qh},${_0}\\)$`),W1={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},x0(Np,Rm,{copy(Z){return Object.assign(new this.constructor,this,Z)},displayable(){return this.rgb().displayable()},hex:aw,formatHex:aw,formatHex8:_8,formatHsl:b8,formatRgb:iw,toString:iw}),x0(Of,sv,Bm(Np,{brighter(Z){return Z=Z==null?Id:Math.pow(Id,Z),new Of(this.r*Z,this.g*Z,this.b*Z,this.opacity)},darker(Z){return Z=Z==null?jp:Math.pow(jp,Z),new Of(this.r*Z,this.g*Z,this.b*Z,this.opacity)},rgb(){return this},clamp(){return new Of(Ld(this.r),Ld(this.g),Ld(this.b),lv(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:sw,formatHex:sw,formatHex8:w8,formatRgb:lw,toString:lw})),x0(Hh,H1,Bm(Np,{brighter(Z){return Z=Z==null?Id:Math.pow(Id,Z),new Hh(this.h,this.s,this.l*Z,this.opacity)},darker(Z){return Z=Z==null?jp:Math.pow(jp,Z),new Hh(this.h,this.s,this.l*Z,this.opacity)},rgb(){var Z=this.h%360+(this.h<0)*360,V=isNaN(Z)||isNaN(this.s)?0:this.s,u=this.l,d=u+(u<.5?u:1-u)*V,E=2*u-d;return new Of(q1(Z>=240?Z-240:Z+120,E,d),q1(Z,E,d),q1(Z<120?Z+240:Z-120,E,d),this.opacity)},clamp(){return new Hh(fw(this.h),uv(this.s),uv(this.l),lv(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 Z=lv(this.opacity);return`${Z===1?"hsl(":"hsla("}${fw(this.h)}, ${uv(this.s)*100}%, ${uv(this.l)*100}%${Z===1?")":`, ${Z})`}`}}))}),Z1,K1,xw=Bl(()=>{Z1=Math.PI/180,K1=180/Math.PI});function _w(Z){if(Z instanceof np)return new np(Z.l,Z.a,Z.b,Z.opacity);if(Z instanceof xp)return bw(Z);Z instanceof Of||(Z=V1(Z));var V=Q1(Z.r),u=Q1(Z.g),d=Q1(Z.b),E=X1((.2225045*V+.7168786*u+.0606169*d)/rx),A,t;return V===u&&u===d?A=t=E:(A=X1((.4360747*V+.3850649*u+.1430804*d)/ex),t=X1((.0139322*V+.0971045*u+.7141733*d)/nx)),new np(116*E-16,500*(A-E),200*(E-t),Z.opacity)}function Y1(Z,V,u,d){return arguments.length===1?_w(Z):new np(Z,V,u,d??1)}function np(Z,V,u,d){this.l=+Z,this.a=+V,this.b=+u,this.opacity=+d}function X1(Z){return Z>ww?Math.pow(Z,.3333333333333333):Z/ix+ax}function $1(Z){return Z>Od?Z*Z*Z:ix*(Z-ax)}function J1(Z){return 255*(Z<=.0031308?12.92*Z:1.055*Math.pow(Z,.4166666666666667)-.055)}function Q1(Z){return(Z/=255)<=.04045?Z/12.92:Math.pow((Z+.055)/1.055,2.4)}function T8(Z){if(Z instanceof xp)return new xp(Z.h,Z.c,Z.l,Z.opacity);if(Z instanceof np||(Z=_w(Z)),Z.a===0&&Z.b===0)return new xp(NaN,0<Z.l&&Z.l<100?0:NaN,Z.l,Z.opacity);var V=Math.atan2(Z.b,Z.a)*K1;return new xp(V<0?V+360:V,Math.sqrt(Z.a*Z.a+Z.b*Z.b),Z.l,Z.opacity)}function tx(Z,V,u,d){return arguments.length===1?T8(Z):new xp(Z,V,u,d??1)}function xp(Z,V,u,d){this.h=+Z,this.c=+V,this.l=+u,this.opacity=+d}function bw(Z){if(isNaN(Z.h))return new np(Z.l,0,0,Z.opacity);var V=Z.h*Z1;return new np(Z.l,Math.cos(V)*Z.c,Math.sin(V)*Z.c,Z.opacity)}var Nm,ex,rx,nx,ax,Od,ix,ww,k8=Bl(()=>{U1(),G1(),xw(),Nm=18,ex=.96422,rx=1,nx=.82521,ax=4/29,Od=6/29,ix=3*Od*Od,ww=Od*Od*Od,x0(np,Y1,Bm(Np,{brighter(Z){return new np(this.l+Nm*(Z??1),this.a,this.b,this.opacity)},darker(Z){return new np(this.l-Nm*(Z??1),this.a,this.b,this.opacity)},rgb(){var Z=(this.l+16)/116,V=isNaN(this.a)?Z:Z+this.a/500,u=isNaN(this.b)?Z:Z-this.b/200;return V=ex*$1(V),Z=rx*$1(Z),u=nx*$1(u),new Of(J1(3.1338561*V-1.6168667*Z-.4906146*u),J1(-.9787684*V+1.9161415*Z+.033454*u),J1(.0719453*V-.2289914*Z+1.4052427*u),this.opacity)}})),x0(xp,tx,Bm(Np,{brighter(Z){return new xp(this.h,this.c,this.l+Nm*(Z??1),this.opacity)},darker(Z){return new xp(this.h,this.c,this.l-Nm*(Z??1),this.opacity)},rgb(){return bw(this).rgb()}}))});function A8(Z){if(Z instanceof Dd)return new Dd(Z.h,Z.s,Z.l,Z.opacity);Z instanceof Of||(Z=V1(Z));var V=Z.r/255,u=Z.g/255,d=Z.b/255,E=(cx*d+lx*V-ux*u)/(cx+lx-ux),A=d-E,t=(b0*(u-E)-fv*A)/jm,e=Math.sqrt(t*t+A*A)/(b0*E*(1-E)),r=e?Math.atan2(t,A)*K1-120:NaN;return new Dd(r<0?r+360:r,e,E,Z.opacity)}function ox(Z,V,u,d){return arguments.length===1?A8(Z):new Dd(Z,V,u,d??1)}function Dd(Z,V,u,d){this.h=+Z,this.s=+V,this.l=+u,this.opacity=+d}var sx,cv,fv,jm,b0,lx,ux,cx,M8=Bl(()=>{U1(),G1(),xw(),sx=-.14861,cv=1.78277,fv=-.29227,jm=-.90649,b0=1.97294,lx=b0*jm,ux=b0*cv,cx=cv*fv-jm*sx,x0(Dd,ox,Bm(Np,{brighter(Z){return Z=Z==null?Id:Math.pow(Id,Z),new Dd(this.h,this.s,this.l*Z,this.opacity)},darker(Z){return Z=Z==null?jp:Math.pow(jp,Z),new Dd(this.h,this.s,this.l*Z,this.opacity)},rgb(){var Z=isNaN(this.h)?0:(this.h+120)*Z1,V=+this.l,u=isNaN(this.s)?0:this.s*V*(1-V),d=Math.cos(Z),E=Math.sin(Z);return new Of(255*(V+u*(sx*d+cv*E)),255*(V+u*(fv*d+jm*E)),255*(V+u*(b0*d)),this.opacity)}}))}),w0=Bl(()=>{G1(),k8(),M8()});function Tw(Z,V,u,d,E){var A=Z*Z,t=A*Z;return((1-3*Z+3*A-t)*V+(4-6*A+3*t)*u+(1+3*Z+3*A-3*t)*d+t*E)/6}function kw(Z){var V=Z.length-1;return function(u){var d=u<=0?u=0:u>=1?(u=1,V-1):Math.floor(u*V),E=Z[d],A=Z[d+1],t=d>0?Z[d-1]:2*E-A,e=d<V-1?Z[d+2]:2*A-E;return Tw((u-d/V)*V,t,E,A,e)}}var fx=Bl(()=>{});function Aw(Z){var V=Z.length;return function(u){var d=Math.floor(((u%=1)<0?++u:u)*V),E=Z[(d+V-1)%V],A=Z[d%V],t=Z[(d+1)%V],e=Z[(d+2)%V];return Tw((u-d/V)*V,E,A,t,e)}}var Mw=Bl(()=>{fx()}),Um,Sw=Bl(()=>{Um=Z=>()=>Z});function Ew(Z,V){return function(u){return Z+u*V}}function S8(Z,V,u){return Z=Math.pow(Z,u),V=Math.pow(V,u)-Z,u=1/u,function(d){return Math.pow(Z+d*V,u)}}function hv(Z,V){var u=V-Z;return u?Ew(Z,u>180||u<-180?u-360*Math.round(u/360):u):Um(isNaN(Z)?V:Z)}function E8(Z){return(Z=+Z)==1?Df:function(V,u){return u-V?S8(V,u,Z):Um(isNaN(V)?u:V)}}function Df(Z,V){var u=V-Z;return u?Ew(Z,u):Um(isNaN(Z)?V:Z)}var T0=Bl(()=>{Sw()});function zw(Z){return function(V){var u=V.length,d=new Array(u),E=new Array(u),A=new Array(u),t,e;for(t=0;t<u;++t)e=sv(V[t]),d[t]=e.r||0,E[t]=e.g||0,A[t]=e.b||0;return d=Z(d),E=Z(E),A=Z(A),e.opacity=1,function(r){return e.r=d(r),e.g=E(r),e.b=A(r),e+""}}}var pv,Lw,Cw,Iw=Bl(()=>{w0(),fx(),Mw(),T0(),pv=function Z(V){var u=E8(V);function d(E,A){var t=u((E=sv(E)).r,(A=sv(A)).r),e=u(E.g,A.g),r=u(E.b,A.b),i=Df(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 d.gamma=Z,d}(1),Lw=zw(kw),Cw=zw(Aw)});function hx(Z,V){V||(V=[]);var u=Z?Math.min(V.length,Z.length):0,d=V.slice(),E;return function(A){for(E=0;E<u;++E)d[E]=Z[E]*(1-A)+V[E]*A;return d}}function Pw(Z){return ArrayBuffer.isView(Z)&&!(Z instanceof DataView)}var px=Bl(()=>{});function z8(Z,V){return(Pw(V)?hx:Ow)(Z,V)}function Ow(Z,V){var u=V?V.length:0,d=Z?Math.min(u,Z.length):0,E=new Array(d),A=new Array(u),t;for(t=0;t<d;++t)E[t]=vv(Z[t],V[t]);for(;t<u;++t)A[t]=V[t];return function(e){for(t=0;t<d;++t)A[t]=E[t](e);return A}}var Dw=Bl(()=>{yv(),px()});function Fw(Z,V){var u=new Date;return Z=+Z,V=+V,function(d){return u.setTime(Z*(1-d)+V*d),u}}var Bw=Bl(()=>{});function ap(Z,V){return Z=+Z,V=+V,function(u){return Z*(1-u)+V*u}}var dv=Bl(()=>{});function Rw(Z,V){var u={},d={},E;(Z===null||typeof Z!="object")&&(Z={}),(V===null||typeof V!="object")&&(V={});for(E in V)E in Z?u[E]=vv(Z[E],V[E]):d[E]=V[E];return function(A){for(E in u)d[E]=u[E](A);return d}}var Nw=Bl(()=>{yv()});function L8(Z){return function(){return Z}}function C8(Z){return function(V){return Z(V)+""}}function jw(Z,V){var u=mv.lastIndex=gv.lastIndex=0,d,E,A,t=-1,e=[],r=[];for(Z=Z+"",V=V+"";(d=mv.exec(Z))&&(E=gv.exec(V));)(A=E.index)>u&&(A=V.slice(u,A),e[t]?e[t]+=A:e[++t]=A),(d=d[0])===(E=E[0])?e[t]?e[t]+=E:e[++t]=E:(e[++t]=null,r.push({i:t,x:ap(d,E)})),u=gv.lastIndex;return u<V.length&&(A=V.slice(u),e[t]?e[t]+=A:e[++t]=A),e.length<2?r[0]?C8(r[0].x):L8(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 mv,gv,Uw=Bl(()=>{dv(),mv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gv=new RegExp(mv.source,"g")});function vv(Z,V){var u=typeof V,d;return V==null||u==="boolean"?Um(V):(u==="number"?ap:u==="string"?(d=Rm(V))?(V=d,pv):jw:V instanceof Rm?pv:V instanceof Date?Fw:Pw(V)?hx:Array.isArray(V)?Ow:typeof V.valueOf!="function"&&typeof V.toString!="function"||isNaN(V)?Rw:ap)(Z,V)}var yv=Bl(()=>{w0(),Iw(),Dw(),Bw(),dv(),Nw(),Uw(),Sw(),px()});function I8(Z){var V=Z.length;return function(u){return Z[Math.max(0,Math.min(V-1,Math.floor(u*V)))]}}var P8=Bl(()=>{});function O8(Z,V){var u=hv(+Z,+V);return function(d){var E=u(d);return E-360*Math.floor(E/360)}}var D8=Bl(()=>{T0()});function F8(Z,V){return Z=+Z,V=+V,function(u){return Math.round(Z*(1-u)+V*u)}}var B8=Bl(()=>{});function Vw(Z,V,u,d,E,A){var t,e,r;return(t=Math.sqrt(Z*Z+V*V))&&(Z/=t,V/=t),(r=Z*u+V*d)&&(u-=Z*r,d-=V*r),(e=Math.sqrt(u*u+d*d))&&(u/=e,d/=e,r/=e),Z*d<V*u&&(Z=-Z,V=-V,r=-r,t=-t),{translateX:E,translateY:A,rotate:Math.atan2(V,Z)*dx,skewX:Math.atan(r)*dx,scaleX:t,scaleY:e}}var dx,xv,R8=Bl(()=>{dx=180/Math.PI,xv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function N8(Z){let V=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(Z+"");return V.isIdentity?xv:Vw(V.a,V.b,V.c,V.d,V.e,V.f)}function j8(Z){return Z==null?xv:(_v||(_v=document.createElementNS("http://www.w3.org/2000/svg","g")),_v.setAttribute("transform",Z),(Z=_v.transform.baseVal.consolidate())?(Z=Z.matrix,Vw(Z.a,Z.b,Z.c,Z.d,Z.e,Z.f)):xv)}var _v,U8=Bl(()=>{R8()});function Hw(Z,V,u,d){function E(i){return i.length?i.pop()+" ":""}function A(i,n,o,a,s,f){if(i!==o||n!==a){var v=s.push("translate(",null,V,null,u);f.push({i:v-4,x:ap(i,o)},{i:v-2,x:ap(n,a)})}else(o||a)&&s.push("translate("+o+V+a+u)}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,d)-2,x:ap(i,n)})):n&&o.push(E(o)+"rotate("+n+d)}function e(i,n,o,a){i!==n?a.push({i:o.push(E(o)+"skewX(",null,d)-2,x:ap(i,n)}):n&&o.push(E(o)+"skewX("+n+d)}function r(i,n,o,a,s,f){if(i!==o||n!==a){var v=s.push(E(s)+"scale(",null,",",null,")");f.push({i:v-4,x:ap(i,o)},{i:v-2,x:ap(n,a)})}else(o!==1||a!==1)&&s.push(E(s)+"scale("+o+","+a+")")}return function(i,n){var o=[],a=[];return i=Z(i),n=Z(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 f=-1,v=a.length,g;++f<v;)o[(g=a[f]).i]=g.x(s);return o.join("")}}}var qw,Ww,V8=Bl(()=>{dv(),U8(),qw=Hw(N8,"px, ","px)","deg)"),Ww=Hw(j8,", ",")",")")});function Gw(Z){return((Z=Math.exp(Z))+1/Z)/2}function H8(Z){return((Z=Math.exp(Z))-1/Z)/2}function q8(Z){return((Z=Math.exp(2*Z))-1)/(Z+1)}var Zw,Kw,W8=Bl(()=>{Zw=1e-12,Kw=function Z(V,u,d){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,f=o-r,v=s*s+f*f,g,m;if(v<Zw)m=Math.log(a/i)/V,g=function(k){return[e+k*s,r+k*f,i*Math.exp(V*k*m)]};else{var w=Math.sqrt(v),l=(a*a-i*i+d*v)/(2*i*u*w),x=(a*a-i*i-d*v)/(2*a*u*w),y=Math.log(Math.sqrt(l*l+1)-l),S=Math.log(Math.sqrt(x*x+1)-x);m=(S-y)/V,g=function(k){var M=k*m,T=Gw(y),c=i/(u*w)*(T*q8(V*M+y)-H8(y));return[e+c*s,r+c*f,i*T/Gw(V*M+y)]}}return g.duration=m*1e3*V/Math.SQRT2,g}return E.rho=function(A){var t=Math.max(.001,+A),e=t*t,r=e*e;return Z(t,e,r)},E}(Math.SQRT2,2,4)});function Yw(Z){return function(V,u){var d=Z((V=H1(V)).h,(u=H1(u)).h),E=Df(V.s,u.s),A=Df(V.l,u.l),t=Df(V.opacity,u.opacity);return function(e){return V.h=d(e),V.s=E(e),V.l=A(e),V.opacity=t(e),V+""}}}var Xw,$w,G8=Bl(()=>{w0(),T0(),Xw=Yw(hv),$w=Yw(Df)});function Z8(Z,V){var u=Df((Z=Y1(Z)).l,(V=Y1(V)).l),d=Df(Z.a,V.a),E=Df(Z.b,V.b),A=Df(Z.opacity,V.opacity);return function(t){return Z.l=u(t),Z.a=d(t),Z.b=E(t),Z.opacity=A(t),Z+""}}var K8=Bl(()=>{w0(),T0()});function Jw(Z){return function(V,u){var d=Z((V=tx(V)).h,(u=tx(u)).h),E=Df(V.c,u.c),A=Df(V.l,u.l),t=Df(V.opacity,u.opacity);return function(e){return V.h=d(e),V.c=E(e),V.l=A(e),V.opacity=t(e),V+""}}}var Qw,t3,Y8=Bl(()=>{w0(),T0(),Qw=Jw(hv),t3=Jw(Df)});function e3(Z){return function V(u){u=+u;function d(E,A){var t=Z((E=ox(E)).h,(A=ox(A)).h),e=Df(E.s,A.s),r=Df(E.l,A.l),i=Df(E.opacity,A.opacity);return function(n){return E.h=t(n),E.s=e(n),E.l=r(Math.pow(n,u)),E.opacity=i(n),E+""}}return d.gamma=V,d}(1)}var r3,n3,X8=Bl(()=>{w0(),T0(),r3=e3(hv),n3=e3(Df)});function $8(Z,V){V===void 0&&(V=Z,Z=vv);for(var u=0,d=V.length-1,E=V[0],A=new Array(d<0?0:d);u<d;)A[u]=Z(E,E=V[++u]);return function(t){var e=Math.max(0,Math.min(d-1,Math.floor(t*=d)));return A[e](t-e)}}var J8=Bl(()=>{yv()});function Q8(Z,V){for(var u=new Array(V),d=0;d<V;++d)u[d]=Z(d/(V-1));return u}var tS=Bl(()=>{}),Fd={};q_(Fd,{interpolate:()=>vv,interpolateArray:()=>z8,interpolateBasis:()=>kw,interpolateBasisClosed:()=>Aw,interpolateCubehelix:()=>r3,interpolateCubehelixLong:()=>n3,interpolateDate:()=>Fw,interpolateDiscrete:()=>I8,interpolateHcl:()=>Qw,interpolateHclLong:()=>t3,interpolateHsl:()=>Xw,interpolateHslLong:()=>$w,interpolateHue:()=>O8,interpolateLab:()=>Z8,interpolateNumber:()=>ap,interpolateNumberArray:()=>hx,interpolateObject:()=>Rw,interpolateRgb:()=>pv,interpolateRgbBasis:()=>Lw,interpolateRgbBasisClosed:()=>Cw,interpolateRound:()=>F8,interpolateString:()=>jw,interpolateTransformCss:()=>qw,interpolateTransformSvg:()=>Ww,interpolateZoom:()=>Kw,piecewise:()=>$8,quantize:()=>Q8});var k0=Bl(()=>{yv(),Dw(),fx(),Mw(),Bw(),P8(),D8(),dv(),px(),Nw(),B8(),Uw(),V8(),W8(),Iw(),G8(),K8(),Y8(),X8(),J8(),tS()}),mx=Vt((Z,V)=>{var u=Eo(),d=Pi();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),u.pointStyle(E,t,e,A)}else d.fill(E,o)}}),a3=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Xr(),A=oh().resizeText,t=mx();function e(i){var n=i._fullLayout._sunburstlayer.selectAll(".trace");A(i,n,"sunburst"),n.each(function(o){var a=u.select(this),s=o[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(v){u.select(this).call(r,v,f,i)})})}function r(i,n,o,a){var s=n.data.data,f=!n.children,v=s.i,g=E.castOption(o,v,"marker.line.color")||d.defaultLine,m=E.castOption(o,v,"marker.line.width")||0;i.call(t,n,o,a).style("stroke-width",m).call(d.stroke,g).style("opacity",f?o.leaf.opacity:null)}V.exports={style:e,styleOne:r}}),Up=Vt(Z=>{var V=Xr(),u=Pi(),d=$h(),E=Ad();Z.findEntryWithLevel=function(r,i){var n;return i&&r.eachAfter(function(o){if(Z.getPtId(o)===i)return n=o.copy()}),n||r},Z.findEntryWithChild=function(r,i){var n;return r.eachAfter(function(o){for(var a=o.children||[],s=0;s<a.length;s++){var f=a[s];if(Z.getPtId(f)===i)return n=o.copy()}}),n||r},Z.isEntry=function(r){return!r.parent},Z.isLeaf=function(r){return!r.children},Z.getPtId=function(r){return r.data.data.id},Z.getPtLabel=function(r){return r.data.data.label},Z.getValue=function(r){return r.value},Z.isHierarchyRoot=function(r){return e(r)===""},Z.setSliceCursor=function(r,i,n){var o=n.isTransitioning;if(!o){var a=r.datum();o=n.hideOnRoot&&Z.isHierarchyRoot(a)||n.hideOnLeaves&&Z.isLeaf(a)}d(r,o?null:"pointer")};function A(r,i,n){return{color:Z.getOutsideTextFontKey("color",r,i,n),family:Z.getOutsideTextFontKey("family",r,i,n),size:Z.getOutsideTextFontKey("size",r,i,n),weight:Z.getOutsideTextFontKey("weight",r,i,n),style:Z.getOutsideTextFontKey("style",r,i,n),variant:Z.getOutsideTextFontKey("variant",r,i,n),textcase:Z.getOutsideTextFontKey("textcase",r,i,n),lineposition:Z.getOutsideTextFontKey("lineposition",r,i,n),shadow:Z.getOutsideTextFontKey("shadow",r,i,n)}}function t(r,i,n,o){var a=(o||{}).onPathbar,s=i.data.data,f=s.i,v=V.castOption(r,f,(a?"pathbar.textfont":"insidetextfont")+".color");return!v&&r._input.textfont&&(v=V.castOption(r._input,f,"textfont.color")),{color:v||u.contrast(s.color),family:Z.getInsideTextFontKey("family",r,i,n,o),size:Z.getInsideTextFontKey("size",r,i,n,o),weight:Z.getInsideTextFontKey("weight",r,i,n,o),style:Z.getInsideTextFontKey("style",r,i,n,o),variant:Z.getInsideTextFontKey("variant",r,i,n,o),textcase:Z.getInsideTextFontKey("textcase",r,i,n,o),lineposition:Z.getInsideTextFontKey("lineposition",r,i,n,o),shadow:Z.getInsideTextFontKey("shadow",r,i,n,o)}}Z.getInsideTextFontKey=function(r,i,n,o,a){var s=(a||{}).onPathbar,f=s?"pathbar.textfont":"insidetextfont",v=n.data.data.i;return V.castOption(i,v,f+"."+r)||V.castOption(i,v,"textfont."+r)||o.size},Z.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},Z.isOutsideText=function(r,i){return!r._hasColorscale&&Z.isHierarchyRoot(i)},Z.determineTextFont=function(r,i,n,o){return Z.isOutsideText(r,i)?A(r,i,n):t(r,i,n,o)},Z.hasTransition=function(r){return!!(r&&r.duration>0)},Z.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Z.isHeader=function(r,i){return!(Z.isLeaf(r)||r.depth===i._maxDepth-1)};function e(r){return r.data.data.pid}Z.getParent=function(r,i){return Z.findEntryWithLevel(r,e(i))},Z.listPath=function(r,i){var n=r.parent;if(!n)return[];var o=i?[n.data[i]]:[n];return Z.listPath(n,i).concat(o)},Z.getPath=function(r){return Z.listPath(r,"label").join("/")+"/"},Z.formatValue=E.formatPieValue,Z.formatPercent=function(r,i){var n=V.formatPercent(r,0);return n==="0%"&&(n=E.formatPiePercent(r,i)),n}}),bv=Vt((Z,V)=>{var u=Ni(),d=ji(),E=dh().appendArrayPointValue,A=hc(),t=Xr(),e=mm(),r=Up(),i=Ad(),n=i.formatPieValue;V.exports=function(a,s,f,v,g){var m=v[0],w=m.trace,l=m.hierarchy,x=w.type==="sunburst",y=w.type==="treemap"||w.type==="icicle";"_hasHoverLabel"in w||(w._hasHoverLabel=!1),"_hasHoverEvent"in w||(w._hasHoverEvent=!1);var S=function(T){var c=f._fullLayout;if(!(f._dragging||c.hovermode===!1)){var h=f._fullData[w.index],b=T.data.data,_=b.i,P=r.isHierarchyRoot(T),L=r.getParent(l,T),D=r.getValue(T),B=function(q){return t.castOption(h,_,q)},R=B("hovertemplate"),I=A.castHoverinfo(h,c,_),F=c.separators,N;if(R||I&&I!=="none"&&I!=="skip"){var j,G;x&&(j=m.cx+T.pxmid[0]*(1-T.rInscribed),G=m.cy+T.pxmid[1]*(1-T.rInscribed)),y&&(j=T._hoverX,G=T._hoverY);var rt={},ct=[],st=[],et=function(q){return ct.indexOf(q)!==-1};I&&(ct=I==="all"?h._module.attributes.hoverinfo.flags:I.split("+")),rt.label=b.label,et("label")&&rt.label&&st.push(rt.label),b.hasOwnProperty("v")&&(rt.value=b.v,rt.valueLabel=n(rt.value,F),et("value")&&st.push(rt.valueLabel)),rt.currentPath=T.currentPath=r.getPath(T.data),et("current path")&&!P&&st.push(rt.currentPath);var K,ot=[],X=function(){ot.indexOf(K)===-1&&(st.push(K),ot.push(K))};rt.percentParent=T.percentParent=D/r.getValue(L),rt.parent=T.parentString=r.getPtLabel(L),et("percent parent")&&(K=r.formatPercent(rt.percentParent,F)+" of "+rt.parent,X()),rt.percentEntry=T.percentEntry=D/r.getValue(s),rt.entry=T.entry=r.getPtLabel(s),et("percent entry")&&!P&&!T.onPathbar&&(K=r.formatPercent(rt.percentEntry,F)+" of "+rt.entry,X()),rt.percentRoot=T.percentRoot=D/r.getValue(l),rt.root=T.root=r.getPtLabel(l),et("percent root")&&!P&&(K=r.formatPercent(rt.percentRoot,F)+" of "+rt.root,X()),rt.text=B("hovertext")||B("text"),et("text")&&(K=rt.text,t.isValidTextValue(K)&&st.push(K)),N=[o(T,h,g.eventDataKeys)];var Q={trace:h,y:G,_x0:T._x0,_x1:T._x1,_y0:T._y0,_y1:T._y1,text:st.join("<br>"),name:R||et("name")?h.name:void 0,color:B("hoverlabel.bgcolor")||b.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-T.rInscribed*T.rpx1,Q.x1=j+T.rInscribed*T.rpx1,Q.idealAlign=T.pxmid[0]<0?"left":"right"),y&&(Q.x=j,Q.idealAlign=j<0?"left":"right");var ut=[];A.loneHover(Q,{container:c._hoverlayer.node(),outerContainer:c._paper.node(),gd:f,inOut_bbox:ut}),N[0].bbox=ut[0],w._hasHoverLabel=!0}if(y){var J=a.select("path.surface");g.styleOne(J,T,h,f,{hovered:!0})}w._hasHoverEvent=!0,f.emit("plotly_hover",{points:N||[o(T,h,g.eventDataKeys)],event:u.event})}},k=function(T){var c=f._fullLayout,h=f._fullData[w.index],b=u.select(this).datum();if(w._hasHoverEvent&&(T.originalEvent=u.event,f.emit("plotly_unhover",{points:[o(b,h,g.eventDataKeys)],event:u.event}),w._hasHoverEvent=!1),w._hasHoverLabel&&(A.loneUnhover(c._hoverlayer.node()),w._hasHoverLabel=!1),y){var _=a.select("path.surface");g.styleOne(_,b,h,f,{hovered:!1})}},M=function(T){var c=f._fullLayout,h=f._fullData[w.index],b=x&&(r.isHierarchyRoot(T)||r.isLeaf(T)),_=r.getPtId(T),P=r.isEntry(T)?r.findEntryWithChild(l,_):r.findEntryWithLevel(l,_),L=r.getPtId(P),D={points:[o(T,h,g.eventDataKeys)],event:u.event};b||(D.nextLevel=L);var B=e.triggerHandler(f,"plotly_"+w.type+"click",D);if(B!==!1&&c.hovermode&&(f._hoverdata=[o(T,h,g.eventDataKeys)],A.click(f,u.event)),!b&&B!==!1&&!f._dragging&&!f._transitioning){d.call("_storeDirectGUIEdit",h,c._tracePreGUI[h.uid],{level:h.level});var R={data:[{level:L}],traces:[w.index]},I={frame:{redraw:!1,duration:g.transitionTime},transition:{duration:g.transitionTime,easing:g.transitionEasing},mode:"immediate",fromcurrent:!0};A.loneUnhover(c._hoverlayer.node()),d.call("animate",f,R,I)}};a.on("mouseover",S),a.on("mouseout",k),a.on("click",M)};function o(a,s,f){for(var v=a.data.data,g={curveNumber:s.index,pointNumber:v.i,data:s._input,fullData:s},m=0;m<f.length;m++){var w=f[m];w in a&&(g[w]=a[w])}return"parentString"in a&&!r.isHierarchyRoot(a)&&(g.parent=a.parentString),E(g,s,v.i),g}}),gx=Vt(Z=>{var V=Ni(),u=av(),d=(k0(),vd(Fd)).interpolate,E=Eo(),A=Xr(),t=Dl(),e=oh(),r=e.recordMinTextSize,i=e.clearMinTextSize,n=j1(),o=Ad().getRotationAngle,a=n.computeTransform,s=n.transformInsideText,f=a3().styleOne,v=Vh().resizeText,g=bv(),m=rw(),w=Up();Z.plot=function(M,T,c,h){var b=M._fullLayout,_=b._sunburstlayer,P,L,D=!c,B=!b.uniformtext.mode&&w.hasTransition(c);if(i("sunburst",b),P=_.selectAll("g.trace.sunburst").data(T,function(I){return I[0].trace.uid}),P.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),P.order(),B){h&&(L=h());var R=V.transition().duration(c.duration).ease(c.easing).each("end",function(){L&&L()}).each("interrupt",function(){L&&L()});R.each(function(){_.selectAll("g.trace").each(function(I){l(M,I,this,c)})})}else P.each(function(I){l(M,I,this,c)}),b.uniformtext.mode&&v(M,b._sunburstlayer.selectAll(".trace"),"sunburst");D&&P.exit().remove()};function l(M,T,c,h){var b=M._context.staticPlot,_=M._fullLayout,P=!_.uniformtext.mode&&w.hasTransition(h),L=V.select(c),D=L.selectAll("g.slice"),B=T[0],R=B.trace,I=B.hierarchy,F=w.findEntryWithLevel(I,R.level),N=w.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]),st=.5*Math.min(rt,ct),et=B.cx=j.l+j.w*(G.x[1]+G.x[0])/2,K=B.cy=j.t+j.h*(1-G.y[0])-ct/2;if(!F)return D.remove();var ot=null,X={};P&&D.each(function(vt){X[w.getPtId(vt)]={rpx0:vt.rpx0,rpx1:vt.rpx1,x0:vt.x0,x1:vt.x1,transform:vt.transform},!ot&&w.isEntry(vt)&&(ot=vt)});var Q=x(F).descendants(),ut=F.height+1,J=0,q=N;B.hasMultipleRoots&&w.isHierarchyRoot(F)&&(Q=Q.slice(1),ut-=1,J=1,q+=1),Q=Q.filter(function(vt){return vt.y1<=q});var it=o(R.rotation);it&&Q.forEach(function(vt){vt.x0+=it,vt.x1+=it});var nt=Math.min(ut,N),dt=function(vt){return(vt-J)/nt*st},Tt=function(vt,Ut){return[vt*Math.cos(Ut),-vt*Math.sin(Ut)]},wt=function(vt){return A.pathAnnulus(vt.rpx0,vt.rpx1,vt.x0,vt.x1,et,K)},It=function(vt){return et+S(vt)[0]*(vt.transform.rCenter||0)+(vt.transform.x||0)},Ct=function(vt){return K+S(vt)[1]*(vt.transform.rCenter||0)+(vt.transform.y||0)};D=D.data(Q,w.getPtId),D.enter().append("g").classed("slice",!0),P?D.exit().transition().each(function(){var vt=V.select(this),Ut=vt.select("path.surface");Ut.transition().attrTween("d",function(Zt){var ue=te(Zt);return function(Me){return wt(ue(Me))}});var re=vt.select("g.slicetext");re.attr("opacity",0)}).remove():D.exit().remove(),D.order();var Nt=null;if(P&&ot){var ee=w.getPtId(ot);D.each(function(vt){Nt===null&&w.getPtId(vt)===ee&&(Nt=vt.x1)})}var Jt=D;P&&(Jt=Jt.transition().each("end",function(){var vt=V.select(this);w.setSliceCursor(vt,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),Jt.each(function(vt){var Ut=V.select(this),re=A.ensureSingle(Ut,"path","surface",function(qe){qe.style("pointer-events",b?"none":"all")});vt.rpx0=dt(vt.y0),vt.rpx1=dt(vt.y1),vt.xmid=(vt.x0+vt.x1)/2,vt.pxmid=Tt(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=y(vt),P?re.transition().attrTween("d",function(qe){var vr=Kt(qe);return function(_r){return wt(vr(_r))}}):re.attr("d",wt),Ut.call(g,F,M,T,{eventDataKeys:m.eventDataKeys,transitionTime:m.CLICK_TRANSITION_TIME,transitionEasing:m.CLICK_TRANSITION_EASING}).call(w.setSliceCursor,M,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:M._transitioning}),re.call(f,vt,R,M);var Zt=A.ensureSingle(Ut,"g","slicetext"),ue=A.ensureSingle(Zt,"text","",function(qe){qe.attr("data-notex",1)}),Me=A.ensureUniformFontSize(M,w.determineTextFont(R,vt,_.font));ue.text(Z.formatSliceLabel(vt,F,R,T,_)).classed("slicetext",!0).attr("text-anchor","middle").call(E.font,Me).call(t.convertToTspans,M);var Ce=E.bBox(ue.node());vt.transform=s(Ce,vt,B),vt.transform.targetX=It(vt),vt.transform.targetY=Ct(vt);var We=function(qe,vr){var _r=qe.transform;return a(_r,vr),_r.fontSize=Me.size,r(R.type,_r,_),A.getTextTransform(_r)};P?ue.transition().attrTween("transform",function(qe){var vr=mt(qe);return function(_r){return We(vr(_r),Ce)}}):ue.attr("transform",We(vt,Ce))});function te(vt){var Ut=w.getPtId(vt),re=X[Ut],Zt=X[w.getPtId(F)],ue;if(Zt){var Me=(vt.x1>Zt.x1?2*Math.PI:0)+it;ue=vt.rpx1<Zt.rpx1?{x0:vt.x0,x1:vt.x1,rpx0:0,rpx1:0}:{x0:Me,x1:Me,rpx0:vt.rpx0,rpx1:vt.rpx1}}else{var Ce,We=w.getPtId(vt.parent);D.each(function(Mr){if(w.getPtId(Mr)===We)return Ce=Mr});var qe=Ce.children,vr;qe.forEach(function(Mr,Ir){if(w.getPtId(Mr)===Ut)return vr=Ir});var _r=qe.length,er=d(Ce.x0,Ce.x1);ue={rpx0:st,rpx1:st,x0:er(vr/_r),x1:er((vr+1)/_r)}}return d(re,ue)}function Kt(vt){var Ut=X[w.getPtId(vt)],re,Zt={x0:vt.x0,x1:vt.x1,rpx0:vt.rpx0,rpx1:vt.rpx1};if(Ut)re=Ut;else if(ot)if(vt.parent)if(Nt){var ue=(vt.x1>Nt?2*Math.PI:0)+it;re={x0:ue,x1:ue}}else re={rpx0:st,rpx1:st},A.extendFlat(re,bt(vt));else re={rpx0:0,rpx1:0};else re={x0:it,x1:it};return d(re,Zt)}function mt(vt){var Ut=X[w.getPtId(vt)],re,Zt=vt.transform;if(Ut)re=Ut;else if(re={rpx1:vt.rpx1,transform:{textPosAngle:Zt.textPosAngle,scale:0,rotate:Zt.rotate,rCenter:Zt.rCenter,x:Zt.x,y:Zt.y}},ot)if(vt.parent)if(Nt){var ue=vt.x1>Nt?2*Math.PI:0;re.x0=re.x1=ue}else A.extendFlat(re,bt(vt));else re.x0=re.x1=it;else re.x0=re.x1=it;var Me=d(re.transform.textPosAngle,vt.transform.textPosAngle),Ce=d(re.rpx1,vt.rpx1),We=d(re.x0,vt.x0),qe=d(re.x1,vt.x1),vr=d(re.transform.scale,Zt.scale),_r=d(re.transform.rotate,Zt.rotate),er=Zt.rCenter===0?3:re.transform.rCenter===0?1/3:1,Mr=d(re.transform.rCenter,Zt.rCenter),Ir=function(de){return Mr(Math.pow(de,er))};return function(de){var Dt=Ce(de);We(de),qe(de);var qt=Ir(de),_t=Me(de),lt={rpx1:Dt,transform:{textPosAngle:_t,rCenter:qt,x:Zt.x,y:Zt.y}};return r(R.type,Zt,_),{transform:{targetX:It(lt),targetY:Ct(lt),scale:vr(de),rotate:_r(de),rCenter:qt}}}}function bt(vt){var Ut=vt.parent,re=X[w.getPtId(Ut)],Zt={};if(re){var ue=Ut.children,Me=ue.indexOf(vt),Ce=ue.length,We=d(re.x0,re.x1);Zt.x0=We(Me/Ce),Zt.x1=We(Me/Ce)}else Zt.x0=Zt.x1=0;return Zt}}function x(M){return u.partition().size([2*Math.PI,M.height+1])(M)}Z.formatSliceLabel=function(M,T,c,h,b){var _=c.texttemplate,P=c.textinfo;if(!_&&(!P||P==="none"))return"";var L=b.separators,D=h[0],B=M.data.data,R=D.hierarchy,I=w.isHierarchyRoot(M),F=w.getParent(R,M),N=w.getValue(M);if(!_){var j=P.split("+"),G=function(J){return j.indexOf(J)!==-1},rt=[],ct;if(G("label")&&B.label&&rt.push(B.label),B.hasOwnProperty("v")&&G("value")&&rt.push(w.formatValue(B.v,L)),!I){G("current path")&&rt.push(w.getPath(M.data));var st=0;G("percent parent")&&st++,G("percent entry")&&st++,G("percent root")&&st++;var et=st>1;if(st){var K,ot=function(J){ct=w.formatPercent(K,L),et&&(ct+=" of "+J),rt.push(ct)};G("percent parent")&&!I&&(K=N/w.getValue(F),ot("parent")),G("percent entry")&&(K=N/w.getValue(T),ot("entry")),G("percent root")&&(K=N/w.getValue(R),ot("root"))}}return G("text")&&(ct=A.castOption(c,B.i,"text"),A.isValidTextValue(ct)&&rt.push(ct)),rt.join("<br>")}var X=A.castOption(c,B.i,"texttemplate");if(!X)return"";var Q={};B.label&&(Q.label=B.label),B.hasOwnProperty("v")&&(Q.value=B.v,Q.valueLabel=w.formatValue(B.v,L)),Q.currentPath=w.getPath(M.data),I||(Q.percentParent=N/w.getValue(F),Q.percentParentLabel=w.formatPercent(Q.percentParent,L),Q.parent=w.getPtLabel(F)),Q.percentEntry=N/w.getValue(T),Q.percentEntryLabel=w.formatPercent(Q.percentEntry,L),Q.entry=w.getPtLabel(T),Q.percentRoot=N/w.getValue(R),Q.percentRootLabel=w.formatPercent(Q.percentRoot,L),Q.root=w.getPtLabel(R),B.hasOwnProperty("color")&&(Q.color=B.color);var ut=A.castOption(c,B.i,"text");return(A.isValidTextValue(ut)||ut==="")&&(Q.text=ut),Q.customdata=A.castOption(c,B.i,"customdata"),A.texttemplateString({data:[Q,c._meta],fallback:c.texttemplatefallback,labels:Q,locale:b._d3locale,template:X})};function y(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 k(M.rpx1,M.transform.textPosAngle)}function k(M,T){return[M*Math.sin(T),-M*Math.cos(T)]}}),eS=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"sunburst",basePlotModule:v8(),categories:[],animatable:!0,attributes:nv(),layoutAttributes:nw(),supplyDefaults:y8(),supplyLayoutDefaults:x8(),calc:iv().calc,crossTraceCalc:iv().crossTraceCalc,plot:gx().plot,style:a3().style,colorbar:Gf(),meta:{}}}),rS=Vt((Z,V)=>{V.exports=eS()}),nS=Vt(Z=>{var V=Uu();Z.name="treemap",Z.plot=function(u,d,E,A){V.plotBasePlot(Z.name,u,d,E,A)},Z.clean=function(u,d,E,A){V.cleanBasePlot(Z.name,u,d,E,A)}}),A0=Vt((Z,V)=>{V.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),vx=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Wl(),t=Vu().attributes,e=v0(),r=nv(),i=A0(),n=So().extendFlat,o=Cf().pattern;V.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.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:n({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:r.marker.colors,pattern:o,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},A("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:n({},e.textfont,{}),editType:"calc"},text:e.text,textinfo:r.textinfo,texttemplate:d({editType:"plot"},{keys:i.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,hoverinfo:r.hoverinfo,hovertemplate:u({},{keys:i.eventDataKeys}),hovertemplatefallback:E(),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:n({},e.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:e.sort,root:r.root,domain:t({name:"treemap",trace:!0,editType:"calc"})}}),i3=Vt((Z,V)=>{V.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),aS=Vt((Z,V)=>{var u=Xr(),d=vx(),E=Pi(),A=Vu().defaults,t=Lh().handleText,e=f0().TEXTPAD,r=y0().handleMarkerDefaults,i=xu(),n=i.hasColorscale,o=i.handleDefaults;V.exports=function(a,s,f,v){function g(h,b){return u.coerce(a,s,d,h,b)}var m=g("labels"),w=g("parents");if(!m||!m.length||!w||!w.length){s.visible=!1;return}var l=g("values");l&&l.length?g("branchvalues"):g("count"),g("level"),g("maxdepth");var x=g("tiling.packing");x==="squarify"&&g("tiling.squarifyratio"),g("tiling.flip"),g("tiling.pad");var y=g("text");g("texttemplate"),g("texttemplatefallback"),s.texttemplate||g("textinfo",u.isArrayOrTypedArray(y)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var S=g("pathbar.visible"),k="auto";t(a,s,v,g,k,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("textposition");var M=s.textposition.indexOf("bottom")!==-1;r(a,s,v,g);var T=s._hasColorscale=n(a,"marker","colors")||(a.marker||{}).coloraxis;T?o(a,s,v,g,{prefix:"marker.",cLetter:"c"}):g("marker.depthfade",!(s.marker.colors||[]).length);var c=s.textfont.size*2;g("marker.pad.t",M?c/4:c),g("marker.pad.l",c/4),g("marker.pad.r",c/4),g("marker.pad.b",M?c:c/4),g("marker.cornerradius"),s._hovered={marker:{line:{width:2,color:E.contrast(v.paper_bgcolor)}}},S&&(g("pathbar.thickness",s.pathbar.textfont.size+2*e),g("pathbar.side"),g("pathbar.edgeshape")),g("sort"),g("root.color"),A(s,v,g),s._length=null}}),iS=Vt((Z,V)=>{var u=Xr(),d=i3();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("treemapcolorway",A.colorway),t("extendtreemapcolors")}}),o3=Vt(Z=>{var V=iv();Z.calc=function(u,d){return V.calc(u,d)},Z.crossTraceCalc=function(u){return V._runCrossTraceCalc("treemap",u)}}),s3=Vt((Z,V)=>{V.exports=function u(d,E,A){var t;A.swapXY&&(t=d.x0,d.x0=d.y0,d.y0=t,t=d.x1,d.x1=d.y1,d.y1=t),A.flipX&&(t=d.x0,d.x0=E[0]-d.x1,d.x1=E[0]-t),A.flipY&&(t=d.y0,d.y0=E[1]-d.y1,d.y1=E[1]-t);var e=d.children;if(e)for(var r=0;r<e.length;r++)u(e[r],E,A)}}),l3=Vt((Z,V)=>{var u=av(),d=s3();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"],f=e.pad[i?"top":"bottom"],v;n&&(v=a,a=o,o=v,v=s,s=f,f=v);var g=u.treemap().tile(E(e.packing,e.squarifyratio)).paddingInner(e.pad.inner).paddingLeft(a).paddingRight(s).paddingTop(o).paddingBottom(f).size(n?[t[1],t[0]]:t)(A);return(n||r||i)&&d(g,t,{swapXY:n,flipX:r,flipY:i}),g};function E(A,t){switch(A){case"squarify":return u.treemapSquarify.ratio(t);case"binary":return u.treemapBinary;case"dice":return u.treemapDice;case"slice":return u.treemapSlice;default:return u.treemapSliceDice}}}),yx=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Xr(),A=Up(),t=oh().resizeText,e=mx();function r(n){var o=n._fullLayout._treemaplayer.selectAll(".trace");t(n,o,"treemap"),o.each(function(a){var s=u.select(this),f=a[0],v=f.trace;s.style("opacity",v.opacity),s.selectAll("path.surface").each(function(g){u.select(this).call(i,g,v,n,{hovered:!1})})})}function i(n,o,a,s,f){var v=(f||{}).hovered,g=o.data.data,m=g.i,w,l,x=g.color,y=A.isHierarchyRoot(o),S=1;if(v)w=a._hovered.marker.line.color,l=a._hovered.marker.line.width;else if(y&&x===a.root.color)S=100,w="rgba(0,0,0,0)",l=0;else if(w=E.castOption(a,m,"marker.line.color")||d.defaultLine,l=E.castOption(a,m,"marker.line.width")||0,!a._hasColorscale&&!o.onPathbar){var k=a.marker.depthfade;if(k){var M=d.combine(d.addOpacity(a._backgroundColor,.75),x),T;if(k===!0){var c=A.getMaxDepth(a);isFinite(c)?A.isLeaf(o)?T=0:T=a._maxVisibleLayers-(o.data.depth-a._entryDepth):T=o.data.height+1}else T=o.data.depth-a._entryDepth,a._atRootLevel||T++;if(T>0)for(var h=0;h<T;h++){var b=.5*h/T;x=d.combine(d.addOpacity(M,b),x)}}}n.call(e,o,a,s,x).style("stroke-width",l).call(d.stroke,w).style("opacity",S)}V.exports={style:r,styleOne:i}}),oS=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=Dl(),t=l3(),e=yx().styleOne,r=A0(),i=Up(),n=bv(),o=!0;V.exports=function(a,s,f,v,g){var m=g.barDifY,w=g.width,l=g.height,x=g.viewX,y=g.viewY,S=g.pathSlice,k=g.toMoveInsideSlice,M=g.strTransform,T=g.hasTransition,c=g.handleSlicesExit,h=g.makeUpdateSliceInterpolator,b=g.makeUpdateTextInterpolator,_={},P=a._context.staticPlot,L=a._fullLayout,D=s[0],B=D.trace,R=D.hierarchy,I=w/B._entryDepth,F=i.listPath(f.data,"id"),N=t(R.copy(),[w,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=I*rt,G.x1=I*(rt+1),G.y0=m,G.y1=m+l,G.onPathbar=!0,!0)}),N.reverse(),v=v.data(N,i.getPtId),v.enter().append("g").classed("pathbar",!0),c(v,o,_,[w,l],S),v.order();var j=v;T&&(j=j.transition().each("end",function(){var G=u.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=y(G.y0),G._y1=y(G.y1),G._hoverX=x(G.x1-Math.min(w,l)/2),G._hoverY=y(G.y1-l/2);var rt=u.select(this),ct=d.ensureSingle(rt,"path","surface",function(ot){ot.style("pointer-events",P?"none":"all")});T?ct.transition().attrTween("d",function(ot){var X=h(ot,o,_,[w,l]);return function(Q){return S(X(Q))}}):ct.attr("d",S),rt.call(n,f,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 st=d.ensureSingle(rt,"g","slicetext"),et=d.ensureSingle(st,"text","",function(ot){ot.attr("data-notex",1)}),K=d.ensureUniformFontSize(a,i.determineTextFont(B,G,L.font,{onPathbar:!0}));et.text(G._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(E.font,K).call(A.convertToTspans,a),G.textBB=E.bBox(et.node()),G.transform=k(G,{fontSize:K.size,onPathbar:!0}),G.transform.fontSize=K.size,T?et.transition().attrTween("transform",function(ot){var X=b(ot,o,_,[w,l]);return function(Q){return M(X(Q))}}):et.attr("transform",M(G))})}}),sS=Vt((Z,V)=>{var u=Ni(),d=(k0(),vd(Fd)).interpolate,E=Up(),A=Xr(),t=f0().TEXTPAD,e=h0(),r=e.toMoveInsideBar,i=oh(),n=i.recordMinTextSize,o=A0(),a=oS();function s(f){return E.isHierarchyRoot(f)?"":E.getPtId(f)}V.exports=function(f,v,g,m,w){var l=f._fullLayout,x=v[0],y=x.trace,S=y.type,k=S==="icicle",M=x.hierarchy,T=E.findEntryWithLevel(M,y.level),c=u.select(g),h=c.selectAll("g.pathbar"),b=c.selectAll("g.slice");if(!T){h.remove(),b.remove();return}var _=E.isHierarchyRoot(T),P=!l.uniformtext.mode&&E.hasTransition(m),L=E.getMaxDepth(y),D=function(er){return er.data.depth-T.data.depth<L},B=l._size,R=y.domain,I=B.w*(R.x[1]-R.x[0]),F=B.h*(R.y[1]-R.y[0]),N=I,j=y.pathbar.thickness,G=y.marker.line.width+o.gapWithPathbar,rt=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?F+G:-(j+G):0,ct={x0:N,x1:N,y0:rt,y1:rt+j},st=function(er,Mr,Ir){var de=y.tiling.pad,Dt=function(yt){return yt-de<=Mr.x0},qt=function(yt){return yt+de>=Mr.x1},_t=function(yt){return yt-de<=Mr.y0},lt=function(yt){return yt+de>=Mr.y1};return er.x0===Mr.x0&&er.x1===Mr.x1&&er.y0===Mr.y0&&er.y1===Mr.y1?{x0:er.x0,x1:er.x1,y0:er.y0,y1:er.y1}:{x0:Dt(er.x0-de)?0:qt(er.x0-de)?Ir[0]:er.x0,x1:Dt(er.x1+de)?0:qt(er.x1+de)?Ir[0]:er.x1,y0:_t(er.y0-de)?0:lt(er.y0-de)?Ir[1]:er.y0,y1:_t(er.y1+de)?0:lt(er.y1+de)?Ir[1]:er.y1}},et=null,K={},ot={},X=null,Q=function(er,Mr){return Mr?K[s(er)]:ot[s(er)]},ut=function(er,Mr,Ir,de){if(Mr)return K[s(M)]||ct;var Dt=ot[y.level]||Ir;return D(er)?st(er,Dt,de):{}};x.hasMultipleRoots&&_&&L++,y._maxDepth=L,y._backgroundColor=l.paper_bgcolor,y._entryDepth=T.data.depth,y._atRootLevel=_;var J=-I/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),it=function(er){return J+er},nt=function(er){return q+er},dt=nt(0),Tt=it(0),wt=function(er){return Tt+er},It=function(er){return dt+er};function Ct(er,Mr){return er+","+Mr}var Nt=wt(0),ee=function(er){er.x=Math.max(Nt,er.x)},Jt=y.pathbar.edgeshape,te=function(er){var Mr=wt(Math.max(Math.min(er.x0,er.x0),0)),Ir=wt(Math.min(Math.max(er.x1,er.x1),N)),de=It(er.y0),Dt=It(er.y1),qt=j/2,_t={},lt={};_t.x=Mr,lt.x=Ir,_t.y=lt.y=(de+Dt)/2;var yt={x:Mr,y:de},St={x:Ir,y:de},Ht={x:Ir,y:Dt},Yt={x:Mr,y:Dt};return Jt===">"?(yt.x-=qt,St.x-=qt,Ht.x-=qt,Yt.x-=qt):Jt==="/"?(Ht.x-=qt,Yt.x-=qt,_t.x-=qt/2,lt.x-=qt/2):Jt==="\\"?(yt.x-=qt,St.x-=qt,_t.x-=qt/2,lt.x-=qt/2):Jt==="<"&&(_t.x-=qt,lt.x-=qt),ee(yt),ee(Yt),ee(_t),ee(St),ee(Ht),ee(lt),"M"+Ct(yt.x,yt.y)+"L"+Ct(St.x,St.y)+"L"+Ct(lt.x,lt.y)+"L"+Ct(Ht.x,Ht.y)+"L"+Ct(Yt.x,Yt.y)+"L"+Ct(_t.x,_t.y)+"Z"},Kt=y[k?"tiling":"marker"].pad,mt=function(er){return y.textposition.indexOf(er)!==-1},bt=mt("top"),vt=mt("left"),Ut=mt("right"),re=mt("bottom"),Zt=function(er){var Mr=it(er.x0),Ir=it(er.x1),de=nt(er.y0),Dt=nt(er.y1),qt=Ir-Mr,_t=Dt-de;if(!qt||!_t)return"";var lt=y.marker.cornerradius||0,yt=Math.min(lt,qt/2,_t/2);yt&&er.data&&er.data.data&&er.data.data.label&&(bt&&(yt=Math.min(yt,Kt.t)),vt&&(yt=Math.min(yt,Kt.l)),Ut&&(yt=Math.min(yt,Kt.r)),re&&(yt=Math.min(yt,Kt.b)));var St=function(Ht,Yt){return yt?"a"+Ct(yt,yt)+" 0 0 1 "+Ct(Ht,Yt):""};return"M"+Ct(Mr,de+yt)+St(yt,-yt)+"L"+Ct(Ir-yt,de)+St(yt,yt)+"L"+Ct(Ir,Dt-yt)+St(-yt,yt)+"L"+Ct(Mr+yt,Dt)+St(-yt,-yt)+"Z"},ue=function(er,Mr){var Ir=er.x0,de=er.x1,Dt=er.y0,qt=er.y1,_t=er.textBB,lt=bt||Mr.isHeader&&!re,yt=lt?"start":re?"end":"middle",St=mt("right"),Ht=mt("left")||Mr.onPathbar,Yt=Ht?-1:St?1:0;if(Mr.isHeader){if(Ir+=(k?Kt:Kt.l)-t,de-=(k?Kt:Kt.r)-t,Ir>=de){var se=(Ir+de)/2;Ir=se,de=se}var ke;re?(ke=qt-(k?Kt:Kt.b),Dt<ke&&ke<qt&&(Dt=ke)):(ke=Dt+(k?Kt:Kt.t),Dt<ke&&ke<qt&&(qt=ke))}var Ee=r(Ir,de,Dt,qt,_t,{isHorizontal:!1,constrained:!0,angle:0,anchor:yt,leftToRight:Yt});return Ee.fontSize=Mr.fontSize,Ee.targetX=it(Ee.targetX),Ee.targetY=nt(Ee.targetY),isNaN(Ee.targetX)||isNaN(Ee.targetY)?{}:(Ir!==de&&Dt!==qt&&n(y.type,Ee,l),{scale:Ee.scale,rotate:Ee.rotate,textX:Ee.textX,textY:Ee.textY,anchorX:Ee.anchorX,anchorY:Ee.anchorY,targetX:Ee.targetX,targetY:Ee.targetY})},Me=function(er,Mr){for(var Ir,de=0,Dt=er;!Ir&&de<L;)de++,Dt=Dt.parent,Dt?Ir=Q(Dt,Mr):de=L;return Ir||{}},Ce=function(er,Mr,Ir,de){var Dt=Q(er,Mr),qt;if(Mr)qt=ct;else{var _t=Q(T,Mr);_t?qt=st(er,_t,de):qt={}}return d(Dt,qt)},We=function(er,Mr,Ir,de,Dt){var qt=Q(er,Mr),_t;if(qt)_t=qt;else if(Mr)_t=ct;else if(et)if(er.parent){var lt=X||Ir;lt&&!Mr?_t=st(er,lt,de):(_t={},A.extendFlat(_t,Me(er,Mr)))}else _t=A.extendFlat({},er),k&&(Dt.orientation==="h"?Dt.flipX?_t.x0=er.x1:_t.x1=0:Dt.flipY?_t.y0=er.y1:_t.y1=0);else _t={};return d(_t,{x0:er.x0,x1:er.x1,y0:er.y0,y1:er.y1})},qe=function(er,Mr,Ir,de){var Dt=Q(er,Mr),qt={},_t=ut(er,Mr,Ir,de);A.extendFlat(qt,{transform:ue({x0:_t.x0,x1:_t.x1,y0:_t.y0,y1:_t.y1,textBB:er.textBB,_text:er._text},{isHeader:E.isHeader(er,y)})}),Dt?qt=Dt:er.parent&&A.extendFlat(qt,Me(er,Mr));var lt=er.transform;return er.x0!==er.x1&&er.y0!==er.y1&&n(y.type,lt,l),d(qt,{transform:{scale:lt.scale,rotate:lt.rotate,textX:lt.textX,textY:lt.textY,anchorX:lt.anchorX,anchorY:lt.anchorY,targetX:lt.targetX,targetY:lt.targetY}})},vr=function(er,Mr,Ir,de,Dt){var qt=de[0],_t=de[1];P?er.exit().transition().each(function(){var lt=u.select(this),yt=lt.select("path.surface");yt.transition().attrTween("d",function(Ht){var Yt=Ce(Ht,Mr,Ir,[qt,_t]);return function(se){return Dt(Yt(se))}});var St=lt.select("g.slicetext");St.attr("opacity",0)}).remove():er.exit().remove()},_r=function(er){var Mr=er.transform;return er.x0!==er.x1&&er.y0!==er.y1&&n(y.type,Mr,l),A.getTextTransform({textX:Mr.textX,textY:Mr.textY,anchorX:Mr.anchorX,anchorY:Mr.anchorY,targetX:Mr.targetX,targetY:Mr.targetY,scale:Mr.scale,rotate:Mr.rotate})};P&&(h.each(function(er){K[s(er)]={x0:er.x0,x1:er.x1,y0:er.y0,y1:er.y1},er.transform&&(K[s(er)].transform={textX:er.transform.textX,textY:er.transform.textY,anchorX:er.transform.anchorX,anchorY:er.transform.anchorY,targetX:er.transform.targetX,targetY:er.transform.targetY,scale:er.transform.scale,rotate:er.transform.rotate})}),b.each(function(er){ot[s(er)]={x0:er.x0,x1:er.x1,y0:er.y0,y1:er.y1},er.transform&&(ot[s(er)].transform={textX:er.transform.textX,textY:er.transform.textY,anchorX:er.transform.anchorX,anchorY:er.transform.anchorY,targetX:er.transform.targetX,targetY:er.transform.targetY,scale:er.transform.scale,rotate:er.transform.rotate}),!et&&E.isEntry(er)&&(et=er)})),X=w(f,v,T,b,{width:I,height:F,viewX:it,viewY:nt,pathSlice:Zt,toMoveInsideSlice:ue,prevEntry:et,makeUpdateSliceInterpolator:We,makeUpdateTextInterpolator:qe,handleSlicesExit:vr,hasTransition:P,strTransform:_r}),y.pathbar.visible?a(f,v,T,h,{barDifY:rt,width:N,height:j,viewX:wt,viewY:It,pathSlice:te,toMoveInsideSlice:ue,makeUpdateSliceInterpolator:We,makeUpdateTextInterpolator:qe,handleSlicesExit:vr,hasTransition:P,strTransform:_r}):h.remove()}}),u3=Vt((Z,V)=>{var u=Ni(),d=Up(),E=oh(),A=E.clearMinTextSize,t=Vh().resizeText,e=sS();V.exports=function(r,i,n,o,a){var s=a.type,f=a.drawDescendants,v=r._fullLayout,g=v["_"+s+"layer"],m,w,l=!n;if(A(s,v),m=g.selectAll("g.trace."+s).data(i,function(y){return y[0].trace.uid}),m.enter().append("g").classed("trace",!0).classed(s,!0),m.order(),!v.uniformtext.mode&&d.hasTransition(n)){o&&(w=o());var x=u.transition().duration(n.duration).ease(n.easing).each("end",function(){w&&w()}).each("interrupt",function(){w&&w()});x.each(function(){g.selectAll("g.trace").each(function(y){e(r,y,this,n,f)})})}else m.each(function(y){e(r,y,this,n,f)}),v.uniformtext.mode&&t(r,g.selectAll(".trace"),s);l&&m.exit().remove()}}),lS=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=Dl(),t=l3(),e=yx().styleOne,r=A0(),i=Up(),n=bv(),o=gx().formatSliceLabel,a=!1;V.exports=function(s,f,v,g,m){var w=m.width,l=m.height,x=m.viewX,y=m.viewY,S=m.pathSlice,k=m.toMoveInsideSlice,M=m.strTransform,T=m.hasTransition,c=m.handleSlicesExit,h=m.makeUpdateSliceInterpolator,b=m.makeUpdateTextInterpolator,_=m.prevEntry,P={},L=s._context.staticPlot,D=s._fullLayout,B=f[0],R=B.trace,I=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,[w,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,st=-1/0;rt.forEach(function(Q){var ut=Q.depth;ut>=R._maxDepth?(Q.x0=Q.x1=(Q.x0+Q.x1)/2,Q.y0=Q.y1=(Q.y0+Q.y1)/2):(ct=Math.min(ct,ut),st=Math.max(st,ut))}),g=g.data(rt,i.getPtId),R._maxVisibleLayers=isFinite(st)?st-ct+1:0,g.enter().append("g").classed("slice",!0),c(g,a,P,[w,l],S),g.order();var et=null;if(T&&_){var K=i.getPtId(_);g.each(function(Q){et===null&&i.getPtId(Q)===K&&(et={x0:Q.x0,x1:Q.x1,y0:Q.y0,y1:Q.y1})})}var ot=function(){return et||{x0:0,x1:w,y0:0,y1:l}},X=g;return T&&(X=X.transition().each("end",function(){var Q=u.select(this);i.setSliceCursor(Q,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(Q){var ut=i.isHeader(Q,R);Q._x0=x(Q.x0),Q._x1=x(Q.x1),Q._y0=y(Q.y0),Q._y1=y(Q.y1),Q._hoverX=x(Q.x1-R.marker.pad.r),Q._hoverY=y(N?Q.y1-R.marker.pad.b/2:Q.y0+R.marker.pad.t/2);var J=u.select(this),q=d.ensureSingle(J,"path","surface",function(It){It.style("pointer-events",L?"none":"all")});T?q.transition().attrTween("d",function(It){var Ct=h(It,a,ot(),[w,l]);return function(Nt){return S(Ct(Nt))}}):q.attr("d",S),J.call(n,v,s,f,{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="":ut?Q._text=j?"":i.getPtLabel(Q)||"":Q._text=o(Q,v,R,f,D)||"";var it=d.ensureSingle(J,"g","slicetext"),nt=d.ensureSingle(it,"text","",function(It){It.attr("data-notex",1)}),dt=d.ensureUniformFontSize(s,i.determineTextFont(R,Q,D.font)),Tt=Q._text||" ",wt=ut&&Tt.indexOf("<br>")===-1;nt.text(Tt).classed("slicetext",!0).attr("text-anchor",F?"end":I||wt?"start":"middle").call(E.font,dt).call(A.convertToTspans,s),Q.textBB=E.bBox(nt.node()),Q.transform=k(Q,{fontSize:dt.size,isHeader:ut}),Q.transform.fontSize=dt.size,T?nt.transition().attrTween("transform",function(It){var Ct=b(It,a,ot(),[w,l]);return function(Nt){return M(Ct(Nt))}}):nt.attr("transform",M(Q))}),et}}),uS=Vt((Z,V)=>{var u=u3(),d=lS();V.exports=function(E,A,t,e){return u(E,A,t,e,{type:"treemap",drawDescendants:d})}}),cS=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"treemap",basePlotModule:nS(),categories:[],animatable:!0,attributes:vx(),layoutAttributes:i3(),supplyDefaults:aS(),supplyLayoutDefaults:iS(),calc:o3().calc,crossTraceCalc:o3().crossTraceCalc,plot:uS(),style:yx().style,colorbar:Gf(),meta:{}}}),fS=Vt((Z,V)=>{V.exports=cS()}),hS=Vt(Z=>{var V=Uu();Z.name="icicle",Z.plot=function(u,d,E,A){V.plotBasePlot(Z.name,u,d,E,A)},Z.clean=function(u,d,E,A){V.cleanBasePlot(Z.name,u,d,E,A)}}),c3=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Wl(),t=Vu().attributes,e=v0(),r=nv(),i=vx(),n=A0(),o=So().extendFlat,a=Cf().pattern;V.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:i.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:o({colors:r.marker.colors,line:r.marker.line,pattern:a,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:i.pathbar,text:e.text,textinfo:r.textinfo,texttemplate:d({editType:"plot"},{keys:n.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,hoverinfo:r.hoverinfo,hovertemplate:u({},{keys:n.eventDataKeys}),hovertemplatefallback:E(),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:i.outsidetextfont,textposition:i.textposition,sort:e.sort,root:r.root,domain:t({name:"icicle",trace:!0,editType:"calc"})}}),f3=Vt((Z,V)=>{V.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),pS=Vt((Z,V)=>{var u=Xr(),d=c3(),E=Pi(),A=Vu().defaults,t=Lh().handleText,e=f0().TEXTPAD,r=y0().handleMarkerDefaults,i=xu(),n=i.hasColorscale,o=i.handleDefaults;V.exports=function(a,s,f,v){function g(M,T){return u.coerce(a,s,d,M,T)}var m=g("labels"),w=g("parents");if(!m||!m.length||!w||!w.length){s.visible=!1;return}var l=g("values");l&&l.length?g("branchvalues"):g("count"),g("level"),g("maxdepth"),g("tiling.orientation"),g("tiling.flip"),g("tiling.pad");var x=g("text");g("texttemplate"),g("texttemplatefallback"),s.texttemplate||g("textinfo",u.isArrayOrTypedArray(x)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var y=g("pathbar.visible"),S="auto";t(a,s,v,g,S,{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("textposition"),r(a,s,v,g);var k=s._hasColorscale=n(a,"marker","colors")||(a.marker||{}).coloraxis;k&&o(a,s,v,g,{prefix:"marker.",cLetter:"c"}),g("leaf.opacity",k?1:.7),s._hovered={marker:{line:{width:2,color:E.contrast(v.paper_bgcolor)}}},y&&(g("pathbar.thickness",s.pathbar.textfont.size+2*e),g("pathbar.side"),g("pathbar.edgeshape")),g("sort"),g("root.color"),A(s,v,g),s._length=null}}),dS=Vt((Z,V)=>{var u=Xr(),d=f3();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("iciclecolorway",A.colorway),t("extendiciclecolors")}}),h3=Vt(Z=>{var V=iv();Z.calc=function(u,d){return V.calc(u,d)},Z.crossTraceCalc=function(u){return V._runCrossTraceCalc("icicle",u)}}),mS=Vt((Z,V)=>{var u=av(),d=s3();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=u.partition().padding(t.pad.inner).size(i?[A[1],o]:[A[0],a])(E);return(i||e||r)&&d(s,A,{swapXY:i,flipX:e,flipY:r}),s}}),p3=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Xr(),A=oh().resizeText,t=mx();function e(i){var n=i._fullLayout._iciclelayer.selectAll(".trace");A(i,n,"icicle"),n.each(function(o){var a=u.select(this),s=o[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(v){u.select(this).call(r,v,f,i)})})}function r(i,n,o,a){var s=n.data.data,f=!n.children,v=s.i,g=E.castOption(o,v,"marker.line.color")||d.defaultLine,m=E.castOption(o,v,"marker.line.width")||0;i.call(t,n,o,a).style("stroke-width",m).call(d.stroke,g).style("opacity",f?o.leaf.opacity:null)}V.exports={style:e,styleOne:r}}),gS=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Eo(),A=Dl(),t=mS(),e=p3().styleOne,r=A0(),i=Up(),n=bv(),o=gx().formatSliceLabel,a=!1;V.exports=function(s,f,v,g,m){var w=m.width,l=m.height,x=m.viewX,y=m.viewY,S=m.pathSlice,k=m.toMoveInsideSlice,M=m.strTransform,T=m.hasTransition,c=m.handleSlicesExit,h=m.makeUpdateSliceInterpolator,b=m.makeUpdateTextInterpolator,_=m.prevEntry,P={},L=s._context.staticPlot,D=s._fullLayout,B=f[0],R=B.trace,I=R.textposition.indexOf("left")!==-1,F=R.textposition.indexOf("right")!==-1,N=R.textposition.indexOf("bottom")!==-1,j=t(v,[w,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(X){var Q=X.depth;Q>=R._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(rt=Math.min(rt,Q),ct=Math.max(ct,Q))}),g=g.data(G,i.getPtId),R._maxVisibleLayers=isFinite(ct)?ct-rt+1:0,g.enter().append("g").classed("slice",!0),c(g,a,P,[w,l],S),g.order();var st=null;if(T&&_){var et=i.getPtId(_);g.each(function(X){st===null&&i.getPtId(X)===et&&(st={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var K=function(){return st||{x0:0,x1:w,y0:0,y1:l}},ot=g;return T&&(ot=ot.transition().each("end",function(){var X=u.select(this);i.setSliceCursor(X,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ot.each(function(X){X._x0=x(X.x0),X._x1=x(X.x1),X._y0=y(X.y0),X._y1=y(X.y1),X._hoverX=x(X.x1-R.tiling.pad),X._hoverY=y(N?X.y1-R.tiling.pad/2:X.y0+R.tiling.pad/2);var Q=u.select(this),ut=d.ensureSingle(Q,"path","surface",function(nt){nt.style("pointer-events",L?"none":"all")});T?ut.transition().attrTween("d",function(nt){var dt=h(nt,a,K(),[w,l],{orientation:R.tiling.orientation,flipX:R.tiling.flip.indexOf("x")>-1,flipY:R.tiling.flip.indexOf("y")>-1});return function(Tt){return S(dt(Tt))}}):ut.attr("d",S),Q.call(n,v,s,f,{styleOne:e,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,s,{isTransitioning:s._transitioning}),ut.call(e,X,R,s,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=o(X,v,R,f,D)||"";var J=d.ensureSingle(Q,"g","slicetext"),q=d.ensureSingle(J,"text","",function(nt){nt.attr("data-notex",1)}),it=d.ensureUniformFontSize(s,i.determineTextFont(R,X,D.font));q.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",F?"end":I?"start":"middle").call(E.font,it).call(A.convertToTspans,s),X.textBB=E.bBox(q.node()),X.transform=k(X,{fontSize:it.size}),X.transform.fontSize=it.size,T?q.transition().attrTween("transform",function(nt){var dt=b(nt,a,K(),[w,l]);return function(Tt){return M(dt(Tt))}}):q.attr("transform",M(X))}),st}}),vS=Vt((Z,V)=>{var u=u3(),d=gS();V.exports=function(E,A,t,e){return u(E,A,t,e,{type:"icicle",drawDescendants:d})}}),yS=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"icicle",basePlotModule:hS(),categories:[],animatable:!0,attributes:c3(),layoutAttributes:f3(),supplyDefaults:pS(),supplyLayoutDefaults:dS(),calc:h3().calc,crossTraceCalc:h3().crossTraceCalc,plot:vS(),style:p3().style,colorbar:Gf(),meta:{}}}),xS=Vt((Z,V)=>{V.exports=yS()}),_S=Vt(Z=>{var V=Uu();Z.name="funnelarea",Z.plot=function(u,d,E,A){V.plotBasePlot(Z.name,u,d,E,A)},Z.clean=function(u,d,E,A){V.cleanBasePlot(Z.name,u,d,E,A)}}),d3=Vt((Z,V)=>{var u=v0(),d=Tl(),E=Vu().attributes,{hovertemplateAttrs:A,texttemplateAttrs:t,templatefallbackAttrs:e}=kl(),r=So().extendFlat;V.exports={labels:u.labels,label0:u.label0,dlabel:u.dlabel,values:u.values,marker:{colors:u.marker.colors,line:{color:r({},u.marker.line.color,{dflt:null}),width:r({},u.marker.line.width,{dflt:1}),editType:"calc"},pattern:u.marker.pattern,editType:"calc"},text:u.text,hovertext:u.hovertext,scalegroup:r({},u.scalegroup,{}),textinfo:r({},u.textinfo,{flags:["label","text","value","percent"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:e({editType:"plot"}),hoverinfo:r({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:A({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:e(),textposition:r({},u.textposition,{values:["inside","none"],dflt:"inside"}),textfont:u.textfont,insidetextfont:u.insidetextfont,title:{text:u.title.text,font:u.title.font,position:r({},u.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"}}}),m3=Vt((Z,V)=>{var u=N1().hiddenlabels;V.exports={hiddenlabels:u,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),bS=Vt((Z,V)=>{var u=Xr(),d=d3(),E=Vu().defaults,A=Lh().handleText,t=y0().handleLabelsAndValues,e=y0().handleMarkerDefaults;V.exports=function(r,i,n,o){function a(S,k){return u.coerce(r,i,d,S,k)}var s=a("labels"),f=a("values"),v=t(s,f),g=v.len;if(i._hasLabels=v.hasLabels,i._hasValues=v.hasValues,!i._hasLabels&&i._hasValues&&(a("label0"),a("dlabel")),!g){i.visible=!1;return}i._length=g,e(r,i,o,a),a("scalegroup");var m=a("text"),w=a("texttemplate");a("texttemplatefallback");var l;if(w||(l=a("textinfo",Array.isArray(m)?"text+percent":"percent")),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),w||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 y=a("title.text");y&&(a("title.position"),u.coerceFont(a,"title.font",o.font)),a("aspectratio"),a("baseratio")}}),wS=Vt((Z,V)=>{var u=Xr(),d=m3();V.exports=function(E,A){function t(e,r){return u.coerce(E,A,d,e,r)}t("hiddenlabels"),t("funnelareacolorway",A.colorway),t("extendfunnelareacolors")}}),g3=Vt((Z,V)=>{var u=Fm();function d(A,t){return u.calc(A,t)}function E(A){u.crossTraceCalc(A,{type:"funnelarea"})}V.exports={calc:d,crossTraceCalc:E}}),TS=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=Xr(),A=E.strScale,t=E.strTranslate,e=Dl(),r=h0(),i=r.toMoveInsideBar,n=oh(),o=n.recordMinTextSize,a=n.clearMinTextSize,s=Ad(),f=j1(),v=f.attachFxHandlers,g=f.determineInsideTextFont,m=f.layoutAreas,w=f.prerenderTitles,l=f.positionTitleOutside,x=f.formatSliceLabel;V.exports=function(M,T){var c=M._context.staticPlot,h=M._fullLayout;a("funnelarea",h),w(T,M),m(T,h._size),E.makeTraceGroups(h._funnelarealayer,T,"trace").each(function(b){var _=u.select(this),P=b[0],L=P.trace;k(b),_.each(function(){var D=u.select(this).selectAll("g.slice").data(b);D.enter().append("g").classed("slice",!0),D.exit().remove(),D.each(function(R,I){if(R.hidden){u.select(this).selectAll("path,g").remove();return}R.pointNumber=R.i,R.curveNumber=L.index;var F=P.cx,N=P.cy,j=u.select(this),G=j.selectAll("path.surface").data([R]);G.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),j.call(v,M,b);var rt="M"+(F+R.TR[0])+","+(N+R.TR[1])+y(R.TR,R.BR)+y(R.BR,R.BL)+y(R.BL,R.TL)+"Z";G.attr("d",rt),x(M,R,P);var ct=s.castOption(L.textposition,R.pts),st=j.selectAll("g.slicetext").data(R.text&&ct!=="none"?[0]:[]);st.enter().append("g").classed("slicetext",!0),st.exit().remove(),st.each(function(){var et=E.ensureSingle(u.select(this),"text","",function(it){it.attr("data-notex",1)}),K=E.ensureUniformFontSize(M,g(L,R,h.font));et.text(R.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,K).call(e.convertToTspans,M);var ot=d.bBox(et.node()),X,Q,ut,J=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,ut=Math.min(R.TR[0],R.BR[0])+F,X=i(Q,ut,J,q,ot,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=K.size,o(L.type,X,h),b[I].transform=X,E.setTransormAndDisplay(et,X)})});var B=u.select(this).selectAll("g.titletext").data(L.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var R=E.ensureSingle(u.select(this),"text","",function(N){N.attr("data-notex",1)}),I=L.title.text;L._meta&&(I=E.templateString(I,L._meta)),R.text(I).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(d.font,L.title.font).call(e.convertToTspans,M);var F=l(P,h._size);R.attr("transform",t(F.x,F.y)+A(Math.min(1,F.scale))+t(F.tx,F.ty))})})})};function y(M,T){var c=T[0]-M[0],h=T[1]-M[1];return"l"+c+","+h}function S(M,T){return[.5*(M[0]+T[0]),.5*(M[1]+T[1])]}function k(M){if(!M.length)return;var T=M[0],c=T.trace,h=c.aspectratio,b=c.baseratio;b>.999&&(b=.999);var _=Math.pow(b,2),P=T.vTotal,L=P*_/(1-_),D=P,B=L/P;function R(){var dt=Math.sqrt(B);return{x:dt,y:-dt}}function I(){var dt=R();return[dt.x,dt.y]}var F,N=[];N.push(I());var j,G;for(j=M.length-1;j>-1;j--)if(G=M[j],!G.hidden){var rt=G.v/D;B+=rt,N.push(I())}var ct=1/0,st=-1/0;for(j=0;j<N.length;j++)F=N[j],ct=Math.min(ct,F[1]),st=Math.max(st,F[1]);for(j=0;j<N.length;j++)N[j][1]-=(st+ct)/2;var et=N[N.length-1][0],K=T.r,ot=(st-ct)/2,X=K/et,Q=K/ot*h;for(T.r=Q*ot,j=0;j<N.length;j++)N[j][0]*=X,N[j][1]*=Q;F=N[0];var ut=[-F[0],F[1]],J=[F[0],F[1]],q=0;for(j=M.length-1;j>-1;j--)if(G=M[j],!G.hidden){q+=1;var it=N[q][0],nt=N[q][1];G.TL=[-it,nt],G.TR=[it,nt],G.BL=ut,G.BR=J,G.pxmid=S(G.TR,G.BR),ut=G.TL,J=G.TR}}}),kS=Vt((Z,V)=>{var u=Ni(),d=_m(),E=oh().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=u.select(this);n.style({opacity:i.opacity}),n.selectAll("path.surface").each(function(o){u.select(this).call(d,o,i,A)})})}}),AS=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"funnelarea",basePlotModule:_S(),categories:["pie-like","funnelarea","showLegend"],attributes:d3(),layoutAttributes:m3(),supplyDefaults:bS(),supplyLayoutDefaults:wS(),calc:g3().calc,crossTraceCalc:g3().crossTraceCalc,plot:TS(),style:kS(),styleOne:_m(),meta:{}}}),MS=Vt((Z,V)=>{V.exports=AS()}),Ff=Vt((Z,V)=>{(function(){var u={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,f=n.clientY||0,v=i(o);return a[0]=s-v.left,a[1]=f-v.top,a}function i(n){return n===window||n===document||n===document.body?e:n.getBoundingClientRect()}},109:function(t){t.exports=e;function e(r,i,n,o){var a=n[0],s=n[2],f=i[0]-a,v=i[2]-s,g=Math.sin(o),m=Math.cos(o);return r[0]=a+v*g+f*m,r[1]=i[1],r[2]=s+v*m-f*g,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}},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("."),f=n,v=0;v<s.length;++v){var g=s[v].split("[");if(g.length>1){g[0]in f||(f[g[0]]=[]),f=f[g[0]];for(var m=1;m<g.length;++m){var w=parseInt(g[m]);m<g.length-1||v<s.length-1?(w in f||(m<g.length-1?f[w]=[]:f[w]={}),f=f[w]):i?f[w]=o:f[w]=r[o].type}}else v<s.length-1?(g[0]in f||(f[g[0]]={}),f=f[g[0]]):i?f[g[0]]=o:f[g[0]]=r[o].type}return n}},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)}}},244:function(t){t.exports=e;function e(r,i){return r[0]*i[0]+r[1]*i[1]+r[2]*i[2]}},264:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=n[0],v=n[1],g=n[2],m=n[3],w=m*o+v*s-g*a,l=m*a+g*o-f*s,x=m*s+f*a-v*o,y=-f*o-v*a-g*s;return r[0]=w*m+y*-f+l*-g-x*-v,r[1]=l*m+y*-v+x*-f-w*-g,r[2]=x*m+y*-g+w*-v-l*-f,r}},332:function(t,e,r){t.exports=P;var i=r(1755),n=r(6867),o=r(1125),a=r(7842),s=r(1318),f=r(946),v=r(5838),g=r(1278),m=r(3637);function w(L){var D=f(L);return[g(D,-1/0),g(D,1/0)]}function l(L,D){for(var B=new Array(D.length),R=0;R<D.length;++R){var I=D[R],F=L[I[0]],N=L[I[1]];B[R]=[g(Math.min(F[0],N[0]),-1/0),g(Math.min(F[1],N[1]),-1/0),g(Math.max(F[0],N[0]),1/0),g(Math.max(F[1],N[1]),1/0)]}return B}function x(L){for(var D=new Array(L.length),B=0;B<L.length;++B){var R=L[B];D[B]=[g(R[0],-1/0),g(R[1],-1/0),g(R[0],1/0),g(R[1],1/0)]}return D}function y(L,D,B){var R=[];return n(B,function(I,F){var N=D[I],j=D[F];if(!(N[0]===j[0]||N[0]===j[1]||N[1]===j[0]||N[1]===j[1])){var G=L[N[0]],rt=L[N[1]],ct=L[j[0]],st=L[j[1]];o(G,rt,ct,st)&&R.push([I,F])}}),R}function S(L,D,B,R){var I=[];return n(B,R,function(F,N){var j=D[F];if(!(j[0]===N||j[1]===N)){var G=L[N],rt=L[j[0]],ct=L[j[1]];o(rt,ct,G,G)&&I.push([F,N])}}),I}function k(L,D,B,R,I){var F,N,j=L.map(function(wt){return[a(wt[0]),a(wt[1])]});for(F=0;F<B.length;++F){var G=B[F];N=G[0];var rt=G[1],ct=D[N],st=D[rt],et=m(v(L[ct[0]]),v(L[ct[1]]),v(L[st[0]]),v(L[st[1]]));if(et){var K=L.length;L.push([f(et[0]),f(et[1])]),j.push(et),R.push([N,K],[rt,K])}}for(R.sort(function(wt,It){if(wt[0]!==It[0])return wt[0]-It[0];var Ct=j[wt[1]],Nt=j[It[1]];return s(Ct[0],Nt[0])||s(Ct[1],Nt[1])}),F=R.length-1;F>=0;--F){var ot=R[F];N=ot[0];var X=D[N],Q=X[0],ut=X[1],J=L[Q],q=L[ut];if((J[0]-q[0]||J[1]-q[1])<0){var it=Q;Q=ut,ut=it}X[0]=Q;var nt=X[1]=ot[1],dt;for(I&&(dt=X[2]);F>0&&R[F-1][0]===N;){var ot=R[--F],Tt=ot[1];I?D.push([nt,Tt,dt]):D.push([nt,Tt]),nt=Tt}I?D.push([nt,ut,dt]):D.push([nt,ut])}return j}function M(L,D,B){for(var R=D.length,I=new i(R),F=[],N=0;N<D.length;++N){var j=D[N],G=w(j[0]),rt=w(j[1]);F.push([g(G[0],-1/0),g(rt[0],-1/0),g(G[1],1/0),g(rt[1],1/0)])}n(F,function(ot,X){I.link(ot,X)});for(var ct=!0,st=new Array(R),N=0;N<R;++N){var et=I.find(N);et!==N&&(ct=!1,L[et]=[Math.min(L[N][0],L[et][0]),Math.min(L[N][1],L[et][1])])}if(ct)return null;for(var K=0,N=0;N<R;++N){var et=I.find(N);et===N?(st[N]=K,L[K++]=L[N]):st[N]=-1}L.length=K;for(var N=0;N<R;++N)st[N]<0&&(st[N]=st[I.find(N)]);return st}function T(L,D){return L[0]-D[0]||L[1]-D[1]}function c(L,D){var B=L[0]-D[0]||L[1]-D[1];return B||(L[2]<D[2]?-1:L[2]>D[2]?1:0)}function h(L,D,B){if(L.length!==0){if(D)for(var R=0;R<L.length;++R){var I=L[R],F=D[I[0]],N=D[I[1]];I[0]=Math.min(F,N),I[1]=Math.max(F,N)}else for(var R=0;R<L.length;++R){var I=L[R],F=I[0],N=I[1];I[0]=Math.min(F,N),I[1]=Math.max(F,N)}B?L.sort(c):L.sort(T);for(var j=1,R=1;R<L.length;++R){var G=L[R-1],rt=L[R];rt[0]===G[0]&&rt[1]===G[1]&&(!B||rt[2]===G[2])||(L[j++]=rt)}L.length=j}}function b(L,D,B){var R=M(L,[],x(L));return h(D,R,B),!!R}function _(L,D,B){var R=l(L,D),I=y(L,D,R),F=x(L),N=S(L,D,R,F),j=k(L,D,I,N,B),G=M(L,j);return h(D,G,B),G?!0:I.length>0||N.length>0}function P(L,D,B){var R;if(B){R=D;for(var I=new Array(D.length),F=0;F<D.length;++F){var N=D[F];I[F]=[N[0],N[1],B[F]]}D=I}for(var j=b(L,D,!!B);_(L,D,!!B);)j=!0;if(B&&j){R.length=0,B.length=0;for(var F=0;F<D.length;++F){var N=D[F];R.push([N[0],N[1]]),B.push(N[2])}}return j}},351:function(t,e,r){t.exports=n;var i=r(4687);function n(o,a){a||(a=o,o=window);var s=0,f=0,v=0,g={shift:!1,alt:!1,control:!1,meta:!1},m=!1;function w(_){var P=!1;return"altKey"in _&&(P=P||_.altKey!==g.alt,g.alt=!!_.altKey),"shiftKey"in _&&(P=P||_.shiftKey!==g.shift,g.shift=!!_.shiftKey),"ctrlKey"in _&&(P=P||_.ctrlKey!==g.control,g.control=!!_.ctrlKey),"metaKey"in _&&(P=P||_.metaKey!==g.meta,g.meta=!!_.metaKey),P}function l(_,P){var L=i.x(P),D=i.y(P);"buttons"in P&&(_=P.buttons|0),(_!==s||L!==f||D!==v||w(P))&&(s=_|0,f=L||0,v=D||0,a&&a(s,f,v,g))}function x(_){l(0,_)}function y(){(s||f||v||g.shift||g.alt||g.meta||g.control)&&(f=v=0,s=0,g.shift=g.alt=g.control=g.meta=!1,a&&a(0,0,0,g))}function S(_){w(_)&&a&&a(s,f,v,g)}function k(_){i.buttons(_)===0?l(0,_):l(s,_)}function M(_){l(s|i.buttons(_),_)}function T(_){l(s&~i.buttons(_),_)}function c(){m||(m=!0,o.addEventListener("mousemove",k),o.addEventListener("mousedown",M),o.addEventListener("mouseup",T),o.addEventListener("mouseleave",x),o.addEventListener("mouseenter",x),o.addEventListener("mouseout",x),o.addEventListener("mouseover",x),o.addEventListener("blur",y),o.addEventListener("keyup",S),o.addEventListener("keydown",S),o.addEventListener("keypress",S),o!==window&&(window.addEventListener("blur",y),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function h(){m&&(m=!1,o.removeEventListener("mousemove",k),o.removeEventListener("mousedown",M),o.removeEventListener("mouseup",T),o.removeEventListener("mouseleave",x),o.removeEventListener("mouseenter",x),o.removeEventListener("mouseout",x),o.removeEventListener("mouseover",x),o.removeEventListener("blur",y),o.removeEventListener("keyup",S),o.removeEventListener("keydown",S),o.removeEventListener("keypress",S),o!==window&&(window.removeEventListener("blur",y),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}c();var b={element:o};return Object.defineProperties(b,{enabled:{get:function(){return m},set:function(_){_?c():h()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return f},enumerable:!0},y:{get:function(){return v},enumerable:!0},mods:{get:function(){return g},enumerable:!0}}),b}},395:function(t){function e(r,i,n){return r*(1-n)+i*n}t.exports=e},446:function(t,e,r){var i=r(7640),n={};function o(a){var s=a.order,f=a.dtype,v=[s,f],g=v.join(":"),m=n[g];return m||(n[g]=m=i(s,f)),m(a),a}t.exports=o},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}},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}},501:function(t,e,r){t.exports=y;var i=r(2762),n=r(8116),o=r(1879).n,a=[0,0,0],s=[0,0,0],f=[0,0,0],v=[0,0,0],g=[1,1];function m(S){return S[0]=S[1]=S[2]=0,S}function w(S,k){return S[0]=k[0],S[1]=k[1],S[2]=k[2],S}function l(S,k,M,T,c,h,b,_){this.gl=S,this.vertBuffer=k,this.vao=M,this.shader=T,this.tickCount=c,this.tickOffset=h,this.gridCount=b,this.gridOffset=_}var x=l.prototype;x.bind=function(S,k,M){this.shader.bind(),this.shader.uniforms.model=S,this.shader.uniforms.view=k,this.shader.uniforms.projection=M,g[0]=this.gl.drawingBufferWidth,g[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=g,this.vao.bind()},x.unbind=function(){this.vao.unbind()},x.drawAxisLine=function(S,k,M,T,c){var h=m(s);this.shader.uniforms.majorAxis=s,h[S]=k[1][S]-k[0][S],this.shader.uniforms.minorAxis=h;var b=w(v,M);b[S]+=k[0][S],this.shader.uniforms.offset=b,this.shader.uniforms.lineWidth=c,this.shader.uniforms.color=T;var _=m(f);_[(S+2)%3]=1,this.shader.uniforms.screenAxis=_,this.vao.draw(this.gl.TRIANGLES,6);var _=m(f);_[(S+1)%3]=1,this.shader.uniforms.screenAxis=_,this.vao.draw(this.gl.TRIANGLES,6)},x.drawAxisTicks=function(S,k,M,T,c){if(this.tickCount[S]){var h=m(a);h[S]=1,this.shader.uniforms.majorAxis=h,this.shader.uniforms.offset=k,this.shader.uniforms.minorAxis=M,this.shader.uniforms.color=T,this.shader.uniforms.lineWidth=c;var b=m(f);b[S]=1,this.shader.uniforms.screenAxis=b,this.vao.draw(this.gl.TRIANGLES,this.tickCount[S],this.tickOffset[S])}},x.drawGrid=function(S,k,M,T,c,h){if(this.gridCount[S]){var b=m(s);b[k]=M[1][k]-M[0][k],this.shader.uniforms.minorAxis=b;var _=w(v,T);_[k]+=M[0][k],this.shader.uniforms.offset=_;var P=m(a);P[S]=1,this.shader.uniforms.majorAxis=P;var L=m(f);L[S]=1,this.shader.uniforms.screenAxis=L,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=c,this.vao.draw(this.gl.TRIANGLES,this.gridCount[S],this.gridOffset[S])}},x.drawZero=function(S,k,M,T,c,h){var b=m(s);this.shader.uniforms.majorAxis=b,b[S]=M[1][S]-M[0][S],this.shader.uniforms.minorAxis=b;var _=w(v,T);_[S]+=M[0][S],this.shader.uniforms.offset=_;var P=m(f);P[k]=1,this.shader.uniforms.screenAxis=P,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=c,this.vao.draw(this.gl.TRIANGLES,6)},x.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()};function y(S,k,M){var T=[],c=[0,0,0],h=[0,0,0],b=[0,0,0],_=[0,0,0];T.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var P=0;P<3;++P){for(var L=T.length/3|0,D=0;D<M[P].length;++D){var B=+M[P][D].x;T.push(B,0,1,B,1,1,B,0,-1,B,0,-1,B,1,1,B,1,-1)}var I=T.length/3|0;c[P]=L,h[P]=I-L;for(var L=T.length/3|0,R=0;R<M[P].length;++R){var B=+M[P][R].x;T.push(B,0,1,B,1,1,B,0,-1,B,0,-1,B,1,1,B,1,-1)}var I=T.length/3|0;b[P]=L,_[P]=I-L}var F=i(S,new Float32Array(T)),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,h,c,_,b)}},544:function(t,e,r){var i=r(5572);t.exports=n;function n(o,a){for(var s=o.length,f=new Array(s),v=0;v<s;++v)f[v]=i(o[v],a[v]);return f}},606:function(t,e,r){var i=r(236);t.exports=n;function n(){var o=i();return{get:function(a,s){var f=o(a);return f.hasOwnProperty("value")?f.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}}}},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"}]}},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"]},665:function(t,e,r){var i=r(3202);t.exports=s;var n=96;function o(f,v){var g=i(getComputedStyle(f).getPropertyValue(v));return g[0]*s(g[1],f)}function a(f,v){var g=document.createElement("div");g.style["font-size"]="128"+f,v.appendChild(g);var m=o(g,"font-size")/128;return v.removeChild(g),m}function s(f,v){switch(v=v||document.body,f=(f||"px").trim().toLowerCase(),(v===window||v===document)&&(v=document.body),f){case"%":return v.clientHeight/100;case"ch":case"ex":return a(f,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}},727:function(t,e,r){var i=r(2962),n=6;function o(S){var k=S===2?f:S===3?v:S===4?g:S===5?m:w;return S<6?k(i[S]):k(i)}function a(){return[[0]]}function s(S,k){return[[k[0]],[S[0][0]]]}function f(S){return function(k,M){return[S([[+M[0],+k[0][1]],[+M[1],+k[1][1]]]),S([[+k[0][0],+M[0]],[+k[1][0],+M[1]]]),S(k)]}}function v(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2]],[+M[1],+k[1][1],+k[1][2]],[+M[2],+k[2][1],+k[2][2]]]),S([[+k[0][0],+M[0],+k[0][2]],[+k[1][0],+M[1],+k[1][2]],[+k[2][0],+M[2],+k[2][2]]]),S([[+k[0][0],+k[0][1],+M[0]],[+k[1][0],+k[1][1],+M[1]],[+k[2][0],+k[2][1],+M[2]]]),S(k)]}}function g(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2],+k[0][3]],[+M[1],+k[1][1],+k[1][2],+k[1][3]],[+M[2],+k[2][1],+k[2][2],+k[2][3]],[+M[3],+k[3][1],+k[3][2],+k[3][3]]]),S([[+k[0][0],+M[0],+k[0][2],+k[0][3]],[+k[1][0],+M[1],+k[1][2],+k[1][3]],[+k[2][0],+M[2],+k[2][2],+k[2][3]],[+k[3][0],+M[3],+k[3][2],+k[3][3]]]),S([[+k[0][0],+k[0][1],+M[0],+k[0][3]],[+k[1][0],+k[1][1],+M[1],+k[1][3]],[+k[2][0],+k[2][1],+M[2],+k[2][3]],[+k[3][0],+k[3][1],+M[3],+k[3][3]]]),S([[+k[0][0],+k[0][1],+k[0][2],+M[0]],[+k[1][0],+k[1][1],+k[1][2],+M[1]],[+k[2][0],+k[2][1],+k[2][2],+M[2]],[+k[3][0],+k[3][1],+k[3][2],+M[3]]]),S(k)]}}function m(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2],+k[0][3],+k[0][4]],[+M[1],+k[1][1],+k[1][2],+k[1][3],+k[1][4]],[+M[2],+k[2][1],+k[2][2],+k[2][3],+k[2][4]],[+M[3],+k[3][1],+k[3][2],+k[3][3],+k[3][4]],[+M[4],+k[4][1],+k[4][2],+k[4][3],+k[4][4]]]),S([[+k[0][0],+M[0],+k[0][2],+k[0][3],+k[0][4]],[+k[1][0],+M[1],+k[1][2],+k[1][3],+k[1][4]],[+k[2][0],+M[2],+k[2][2],+k[2][3],+k[2][4]],[+k[3][0],+M[3],+k[3][2],+k[3][3],+k[3][4]],[+k[4][0],+M[4],+k[4][2],+k[4][3],+k[4][4]]]),S([[+k[0][0],+k[0][1],+M[0],+k[0][3],+k[0][4]],[+k[1][0],+k[1][1],+M[1],+k[1][3],+k[1][4]],[+k[2][0],+k[2][1],+M[2],+k[2][3],+k[2][4]],[+k[3][0],+k[3][1],+M[3],+k[3][3],+k[3][4]],[+k[4][0],+k[4][1],+M[4],+k[4][3],+k[4][4]]]),S([[+k[0][0],+k[0][1],+k[0][2],+M[0],+k[0][4]],[+k[1][0],+k[1][1],+k[1][2],+M[1],+k[1][4]],[+k[2][0],+k[2][1],+k[2][2],+M[2],+k[2][4]],[+k[3][0],+k[3][1],+k[3][2],+M[3],+k[3][4]],[+k[4][0],+k[4][1],+k[4][2],+M[4],+k[4][4]]]),S([[+k[0][0],+k[0][1],+k[0][2],+k[0][3],+M[0]],[+k[1][0],+k[1][1],+k[1][2],+k[1][3],+M[1]],[+k[2][0],+k[2][1],+k[2][2],+k[2][3],+M[2]],[+k[3][0],+k[3][1],+k[3][2],+k[3][3],+M[3]],[+k[4][0],+k[4][1],+k[4][2],+k[4][3],+M[4]]]),S(k)]}}function w(S){return function(k,M){return[S([[+M[0],+k[0][1],+k[0][2],+k[0][3],+k[0][4],+k[0][5]],[+M[1],+k[1][1],+k[1][2],+k[1][3],+k[1][4],+k[1][5]],[+M[2],+k[2][1],+k[2][2],+k[2][3],+k[2][4],+k[2][5]],[+M[3],+k[3][1],+k[3][2],+k[3][3],+k[3][4],+k[3][5]],[+M[4],+k[4][1],+k[4][2],+k[4][3],+k[4][4],+k[4][5]],[+M[5],+k[5][1],+k[5][2],+k[5][3],+k[5][4],+k[5][5]]]),S([[+k[0][0],+M[0],+k[0][2],+k[0][3],+k[0][4],+k[0][5]],[+k[1][0],+M[1],+k[1][2],+k[1][3],+k[1][4],+k[1][5]],[+k[2][0],+M[2],+k[2][2],+k[2][3],+k[2][4],+k[2][5]],[+k[3][0],+M[3],+k[3][2],+k[3][3],+k[3][4],+k[3][5]],[+k[4][0],+M[4],+k[4][2],+k[4][3],+k[4][4],+k[4][5]],[+k[5][0],+M[5],+k[5][2],+k[5][3],+k[5][4],+k[5][5]]]),S([[+k[0][0],+k[0][1],+M[0],+k[0][3],+k[0][4],+k[0][5]],[+k[1][0],+k[1][1],+M[1],+k[1][3],+k[1][4],+k[1][5]],[+k[2][0],+k[2][1],+M[2],+k[2][3],+k[2][4],+k[2][5]],[+k[3][0],+k[3][1],+M[3],+k[3][3],+k[3][4],+k[3][5]],[+k[4][0],+k[4][1],+M[4],+k[4][3],+k[4][4],+k[4][5]],[+k[5][0],+k[5][1],+M[5],+k[5][3],+k[5][4],+k[5][5]]]),S([[+k[0][0],+k[0][1],+k[0][2],+M[0],+k[0][4],+k[0][5]],[+k[1][0],+k[1][1],+k[1][2],+M[1],+k[1][4],+k[1][5]],[+k[2][0],+k[2][1],+k[2][2],+M[2],+k[2][4],+k[2][5]],[+k[3][0],+k[3][1],+k[3][2],+M[3],+k[3][4],+k[3][5]],[+k[4][0],+k[4][1],+k[4][2],+M[4],+k[4][4],+k[4][5]],[+k[5][0],+k[5][1],+k[5][2],+M[5],+k[5][4],+k[5][5]]]),S([[+k[0][0],+k[0][1],+k[0][2],+k[0][3],+M[0],+k[0][5]],[+k[1][0],+k[1][1],+k[1][2],+k[1][3],+M[1],+k[1][5]],[+k[2][0],+k[2][1],+k[2][2],+k[2][3],+M[2],+k[2][5]],[+k[3][0],+k[3][1],+k[3][2],+k[3][3],+M[3],+k[3][5]],[+k[4][0],+k[4][1],+k[4][2],+k[4][3],+M[4],+k[4][5]],[+k[5][0],+k[5][1],+k[5][2],+k[5][3],+M[5],+k[5][5]]]),S([[+k[0][0],+k[0][1],+k[0][2],+k[0][3],+k[0][4],+M[0]],[+k[1][0],+k[1][1],+k[1][2],+k[1][3],+k[1][4],+M[1]],[+k[2][0],+k[2][1],+k[2][2],+k[2][3],+k[2][4],+M[2]],[+k[3][0],+k[3][1],+k[3][2],+k[3][3],+k[3][4],+M[3]],[+k[4][0],+k[4][1],+k[4][2],+k[4][3],+k[4][4],+M[4]],[+k[5][0],+k[5][1],+k[5][2],+k[5][3],+k[5][4],+M[5]]]),S(k)]}}var l=[a,s];function x(S,k,M,T,c,h,b,_){return function(P,L){switch(P.length){case 0:return S(P,L);case 1:return k(P,L);case 2:return M(P,L);case 3:return T(P,L);case 4:return c(P,L);case 5:return h(P,L)}var D=b[P.length];return D||(D=b[P.length]=_(P.length)),D(P,L)}}function y(){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]}y()},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"}},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}},783:function(t){t.exports=e;function e(r,i,n,o){var a=i[0],s=i[1],f=i[2],v=i[3],g=n[0],m=n[1],w=n[2],l=n[3],x,y,S,k,M;return y=a*g+s*m+f*w+v*l,y<0&&(y=-y,g=-g,m=-m,w=-w,l=-l),1-y>1e-6?(x=Math.acos(y),S=Math.sin(x),k=Math.sin((1-o)*x)/S,M=Math.sin(o*x)/S):(k=1-o,M=o),r[0]=k*a+M*g,r[1]=k*s+M*m,r[2]=k*f+M*w,r[3]=k*v+M*l,r}},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"}])}},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}},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;
}`]),f=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;
}`]),g=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;
}`]),m=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);
}`]),w=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:f,fragment:v,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:g,fragment:m,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:w,fragment:m,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:l,fragment:x,attributes:[{name:"position",type:"vec3"}]}},855:function(t,e,r){t.exports={init:y,sweepBipartite:M,sweepComplete:T,scanBipartite:c,scanComplete:h};var i=r(1888),n=r(8828),o=r(4192),a=1<<28,s=1024,f=i.mallocInt32(s),v=i.mallocInt32(s),g=i.mallocInt32(s),m=i.mallocInt32(s),w=i.mallocInt32(s),l=i.mallocInt32(s),x=i.mallocDouble(s*8);function y(b){var _=n.nextPow2(b);f.length<_&&(i.free(f),f=i.mallocInt32(_)),v.length<_&&(i.free(v),v=i.mallocInt32(_)),g.length<_&&(i.free(g),g=i.mallocInt32(_)),m.length<_&&(i.free(m),m=i.mallocInt32(_)),w.length<_&&(i.free(w),w=i.mallocInt32(_)),l.length<_&&(i.free(l),l=i.mallocInt32(_));var P=8*_;x.length<P&&(i.free(x),x=i.mallocDouble(P))}function S(b,_,P,L){var D=_[L],B=b[P-1];b[D]=B,_[B]=D}function k(b,_,P,L){b[P]=L,_[L]=P}function M(b,_,P,L,D,B,R,I,F,N){for(var j=0,G=2*b,rt=b-1,ct=G-1,st=P;st<L;++st){var et=B[st],K=G*st;x[j++]=D[K+rt],x[j++]=-(et+1),x[j++]=D[K+ct],x[j++]=et}for(var st=R;st<I;++st){var et=N[st]+a,ot=G*st;x[j++]=F[ot+rt],x[j++]=-et,x[j++]=F[ot+ct],x[j++]=et}var X=j>>>1;o(x,X);for(var Q=0,ut=0,st=0;st<X;++st){var J=x[2*st+1]|0;if(J>=a)J=J-a|0,S(g,m,ut--,J);else if(J>=0)S(f,v,Q--,J);else if(J<=-a){J=-J-a|0;for(var q=0;q<Q;++q){var it=_(f[q],J);if(it!==void 0)return it}k(g,m,ut++,J)}else{J=-J-1|0;for(var q=0;q<ut;++q){var it=_(J,g[q]);if(it!==void 0)return it}k(f,v,Q++,J)}}}function T(b,_,P,L,D,B,R,I,F,N){for(var j=0,G=2*b,rt=b-1,ct=G-1,st=P;st<L;++st){var et=B[st]+1<<1,K=G*st;x[j++]=D[K+rt],x[j++]=-et,x[j++]=D[K+ct],x[j++]=et}for(var st=R;st<I;++st){var et=N[st]+1<<1,ot=G*st;x[j++]=F[ot+rt],x[j++]=-et|1,x[j++]=F[ot+ct],x[j++]=et|1}var X=j>>>1;o(x,X);for(var Q=0,ut=0,J=0,st=0;st<X;++st){var q=x[2*st+1]|0,it=q&1;if(st<X-1&&q>>1===x[2*st+3]>>1&&(it=2,st+=1),q<0){for(var nt=-(q>>1)-1,dt=0;dt<J;++dt){var Tt=_(w[dt],nt);if(Tt!==void 0)return Tt}if(it!==0)for(var dt=0;dt<Q;++dt){var Tt=_(f[dt],nt);if(Tt!==void 0)return Tt}if(it!==1)for(var dt=0;dt<ut;++dt){var Tt=_(g[dt],nt);if(Tt!==void 0)return Tt}it===0?k(f,v,Q++,nt):it===1?k(g,m,ut++,nt):it===2&&k(w,l,J++,nt)}else{var nt=(q>>1)-1;it===0?S(f,v,Q--,nt):it===1?S(g,m,ut--,nt):it===2&&S(w,l,J--,nt)}}}function c(b,_,P,L,D,B,R,I,F,N,j,G){var rt=0,ct=2*b,st=_,et=_+b,K=1,ot=1;L?ot=a:K=a;for(var X=D;X<B;++X){var Q=X+K,ut=ct*X;x[rt++]=R[ut+st],x[rt++]=-Q,x[rt++]=R[ut+et],x[rt++]=Q}for(var X=F;X<N;++X){var Q=X+ot,J=ct*X;x[rt++]=j[J+st],x[rt++]=-Q}var q=rt>>>1;o(x,q);for(var it=0,X=0;X<q;++X){var nt=x[2*X+1]|0;if(nt<0){var Q=-nt,dt=!1;if(Q>=a?(dt=!L,Q-=a):(dt=!!L,Q-=1),dt)k(f,v,it++,Q);else{var Tt=G[Q],wt=ct*Q,It=j[wt+_+1],Ct=j[wt+_+1+b];t:for(var Nt=0;Nt<it;++Nt){var ee=f[Nt],Jt=ct*ee;if(!(Ct<R[Jt+_+1]||R[Jt+_+1+b]<It)){for(var te=_+2;te<b;++te)if(j[wt+te+b]<R[Jt+te]||R[Jt+te+b]<j[wt+te])continue t;var Kt=I[ee],mt;if(L?mt=P(Tt,Kt):mt=P(Kt,Tt),mt!==void 0)return mt}}}}else S(f,v,it--,nt-K)}}function h(b,_,P,L,D,B,R,I,F,N,j){for(var G=0,rt=2*b,ct=_,st=_+b,et=L;et<D;++et){var K=et+a,ot=rt*et;x[G++]=B[ot+ct],x[G++]=-K,x[G++]=B[ot+st],x[G++]=K}for(var et=I;et<F;++et){var K=et+1,X=rt*et;x[G++]=N[X+ct],x[G++]=-K}var Q=G>>>1;o(x,Q);for(var ut=0,et=0;et<Q;++et){var J=x[2*et+1]|0;if(J<0){var K=-J;if(K>=a)f[ut++]=K-a;else{K-=1;var q=j[K],it=rt*K,nt=N[it+_+1],dt=N[it+_+1+b];t:for(var Tt=0;Tt<ut;++Tt){var wt=f[Tt],It=R[wt];if(It===q)break;var Ct=rt*wt;if(!(dt<B[Ct+_+1]||B[Ct+_+1+b]<nt)){for(var Nt=_+2;Nt<b;++Nt)if(N[it+Nt+b]<B[Ct+Nt]||B[Ct+Nt+b]<N[it+Nt])continue t;var ee=P(It,q);if(ee!==void 0)return ee}}}}else{for(var K=J-a,Tt=ut-1;Tt>=0;--Tt)if(f[Tt]===K){for(var Nt=Tt+1;Nt<ut;++Nt)f[Nt-1]=f[Nt];break}--ut}}}},868:function(t,e,r){t.exports=r(1387)},869:function(t,e,r){var i=r(2651),n=r(5716);t.exports=o;function o(a,s){var f=n(a),v=n(s);if(f===0)return[i(0),i(1)];if(v===0)return[i(0),i(0)];v<0&&(a=a.neg(),s=s.neg());var g=a.gcd(s);return g.cmpn(1)?[a.div(g),s.div(g)]:[a,s]}},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,f){this._elements=s,this._attributes=a,this._elementsType=f||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(a,s,f){f=f||0;var v=this.gl;this._elements?v.drawElements(a,s,this._elementsType,f):v.drawArrays(a,f,s)};function o(a){return new n(a)}t.exports=o},946:function(t,e,r){var i=r(1369),n=r(4025);t.exports=o;function o(a){var s=a[0],f=a[1];if(s.cmpn(0)===0)return 0;var v=s.abs().divmod(f.abs()),g=v.div,m=i(g),w=v.mod,l=s.negative!==f.negative?-1:1;if(w.cmpn(0)===0)return l*m;if(m){var x=n(m)+4,y=i(w.ushln(x).divRound(f));return l*(m+y*Math.pow(2,-x))}else{var S=f.bitLength()-w.bitLength()+53,y=i(w.ushln(S).divRound(f));return S<1023?l*y*Math.pow(2,-S):(y*=Math.pow(2,-1023),l*y*Math.pow(2,1023-S))}}},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);
}
`]),f=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 g=i(v,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g.attributes.normal.location=2,g},e.createPickShader=function(v){var g=i(v,o,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g.attributes.normal.location=2,g},e.createContourShader=function(v){var g=i(v,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g},e.createPickContourShader=function(v){var g=i(v,s,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return g.attributes.uv.location=0,g.attributes.f.location=1,g}},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 f=o.split(/\r?\n/),v=String(f.length+a-1).length;return f.map(function(g,m){var w=m+a,l=String(w).length,x=i(w,v-l);return x+s+g}).join(`
`)}},1091:function(t){t.exports=e;function e(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},1125:function(t,e,r){t.exports=o;var i=r(3250)[3];function n(a,s,f,v){for(var g=0;g<2;++g){var m=a[g],w=s[g],l=Math.min(m,w),x=Math.max(m,w),y=f[g],S=v[g],k=Math.min(y,S),M=Math.max(y,S);if(M<l||x<k)return!1}return!0}function o(a,s,f,v){var g=i(a,f,v),m=i(s,f,v);if(g>0&&m>0||g<0&&m<0)return!1;var w=i(f,a,s),l=i(v,a,s);return w>0&&l>0||w<0&&l<0?!1:g===0&&m===0&&w===0&&l===0?n(a,s,f,v):!0}},1278:function(t,e,r){var i=r(2361),n=Math.pow(2,-1074),o=-1>>>0;t.exports=a;function a(s,f){if(isNaN(s)||isNaN(f))return NaN;if(s===f)return s;if(s===0)return f<0?-n:n;var v=i.hi(s),g=i.lo(s);return f>s==s>0?g===o?(v+=1,g=0):g+=1:g===0?(g=o,v-=1):g-=1,i.pack(g,v)}},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;
}
}
`]),f=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);
}`]),g=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],m={vertex:o,fragment:f,attributes:g},w={vertex:a,fragment:f,attributes:g},l={vertex:s,fragment:f,attributes:g},x={vertex:o,fragment:v,attributes:g},y={vertex:a,fragment:v,attributes:g},S={vertex:s,fragment:v,attributes:g};function k(M,T){var c=i(M,T),h=c.attributes;return h.position.location=0,h.color.location=1,h.glyph.location=2,h.id.location=3,c}e.createPerspective=function(M){return k(M,m)},e.createOrtho=function(M){return k(M,w)},e.createProject=function(M){return k(M,l)},e.createPickPerspective=function(M){return k(M,x)},e.createPickOrtho=function(M){return k(M,y)},e.createPickProject=function(M){return k(M,S)}},1303:function(t,e,r){t.exports=o;var i=r(3250);function n(a,s){var f,v;if(s[0][0]<s[1][0])f=s[0],v=s[1];else if(s[0][0]>s[1][0])f=s[1],v=s[0];else{var g=Math.min(a[0][1],a[1][1]),m=Math.max(a[0][1],a[1][1]),w=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return m<w?m-w:g>l?g-l:m-l}var x,y;a[0][1]<a[1][1]?(x=a[0],y=a[1]):(x=a[1],y=a[0]);var S=i(v,f,x);return S||(S=i(v,f,y),S)?S:y-v}function o(a,s){var f,v;if(s[0][0]<s[1][0])f=s[0],v=s[1];else if(s[0][0]>s[1][0])f=s[1],v=s[0];else return n(s,a);var g,m;if(a[0][0]<a[1][0])g=a[0],m=a[1];else if(a[0][0]>a[1][0])g=a[1],m=a[0];else return-n(a,s);var w=i(f,v,m),l=i(f,v,g);if(w<0){if(l<=0)return w}else if(w>0){if(l>=0)return w}else if(l)return l;if(w=i(m,g,v),l=i(m,g,f),w<0){if(l<=0)return w}else if(w>0){if(l>=0)return w}else if(l)return l;return v[0]-m[0]}},1318:function(t){t.exports=e;function e(r,i){return r[0].mul(i[1]).cmp(i[0].mul(r[1]))}},1338:function(t){function e(n,o,a){var s=n[a]|0;if(s<=0)return[];var f=new Array(s),v;if(a===n.length-1)for(v=0;v<s;++v)f[v]=o;else for(v=0;v<s;++v)f[v]=e(n,o,a+1);return f}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},1369:function(t,e,r){var i=r(5716);t.exports=n;function n(o){var a=o.length,s=o.words,f=0;if(a===1)f=s[0];else if(a===2)f=s[0]+s[1]*67108864;else for(var v=0;v<a;v++){var g=s[v];f+=g*Math.pow(67108864,v)}return i(o)*f}},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}},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}},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)}},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 f=s.buffer,v=s.size||4,g=s.type||r.FLOAT,m=!!s.normalized,w=s.stride||0,l=s.offset||0;f.bind(),r.enableVertexAttribArray(a),r.vertexAttribPointer(a,v,g,m,w,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},1463:function(t){t.exports=e;function e(r,i,n,o){return r[0]=i,r[1]=n,r[2]=o,r}},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"}])}},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}},1533:function(t,e,r){r(6859),t.exports=i;function i(n){return n&&typeof n=="object"&&!!n.words}},1538:function(t){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function e(h){h.permitHostObjects___&&h.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,f=Object.isExtensible,v="weakmap:",g=v+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var m=new ArrayBuffer(25),w=new Uint8Array(m);crypto.getRandomValues(w),g=v+"rand:"+Array.prototype.map.call(w,function(h){return(h%36).toString(36)}).join("")+"___"}function l(h){return!(h.substr(0,v.length)==v&&h.substr(h.length-3)==="___")}if(s(Object,"getOwnPropertyNames",{value:function(h){return a(h).filter(l)}}),"getPropertyNames"in Object){var x=Object.getPropertyNames;s(Object,"getPropertyNames",{value:function(h){return x(h).filter(l)}})}function y(h){if(h!==Object(h))throw new TypeError("Not an object: "+h);var b=h[g];if(b&&b.key===h)return b;if(f(h)){b={key:h};try{return s(h,g,{value:b,writable:!1,enumerable:!1,configurable:!1}),b}catch{return}}}(function(){var h=Object.freeze;s(Object,"freeze",{value:function(P){return y(P),h(P)}});var b=Object.seal;s(Object,"seal",{value:function(P){return y(P),b(P)}});var _=Object.preventExtensions;s(Object,"preventExtensions",{value:function(P){return y(P),_(P)}})})();function S(h){return h.prototype=null,Object.freeze(h)}var k=!1;function M(){!k&&typeof console<"u"&&(k=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var T=0,c=function(){this instanceof c||M();var h=[],b=[],_=T++;function P(R,I){var F,N=y(R);return N?_ in N?N[_]:I:(F=h.indexOf(R),F>=0?b[F]:I)}function L(R){var I=y(R);return I?_ in I:h.indexOf(R)>=0}function D(R,I){var F,N=y(R);return N?N[_]=I:(F=h.indexOf(R),F>=0?b[F]=I:(F=h.length,b[F]=I,h[F]=R)),this}function B(R){var I=y(R),F,N;return I?_ in I&&delete I[_]:(F=h.indexOf(R),F<0?!1:(N=h.length-1,h[F]=void 0,b[F]=b[N],h[F]=h[N],h.length=N,b.length=N,!0))}return Object.create(c.prototype,{get___:{value:S(P)},has___:{value:S(L)},set___:{value:S(D)},delete___:{value:S(B)}})};c.prototype=Object.create(Object.prototype,{get:{value:function(h,b){return this.get___(h,b)},writable:!0,configurable:!0},has:{value:function(h){return this.has___(h)},writable:!0,configurable:!0},set:{value:function(h,b){return this.set___(h,b)},writable:!0,configurable:!0},delete:{value:function(h){return this.delete___(h)},writable:!0,configurable:!0}}),typeof i=="function"?function(){r&&typeof Proxy<"u"&&(Proxy=void 0);function h(){this instanceof c||M();var b=new i,_=void 0,P=!1;function L(I,F){return _?b.has(I)?b.get(I):_.get___(I,F):b.get(I,F)}function D(I){return b.has(I)||(_?_.has___(I):!1)}var B;r?B=function(I,F){return b.set(I,F),b.has(I)||(_||(_=new c),_.set(I,F)),this}:B=function(I,F){if(P)try{b.set(I,F)}catch{_||(_=new c),_.set___(I,F)}else b.set(I,F);return this};function R(I){var F=!!b.delete(I);return _&&_.delete___(I)||F}return Object.create(c.prototype,{get___:{value:S(L)},has___:{value:S(D)},set___:{value:S(B)},delete___:{value:S(R)},permitHostObjects___:{value:S(function(I){if(I===e)P=!0;else throw new Error("bogus call to permitHostObjects___")})}})}h.prototype=c.prototype,t.exports=h,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),t.exports=c)})()},1570:function(t){t.exports=r;var e=[function(){function i(n,o,a,s){for(var f=n.length,v=[],g=0;g<f;++g)var m=n[g],w=m.length;return v}return i},function(){function i(o,a,s,f){for(var v=Math.min(s,f)|0,g=Math.max(s,f)|0,m=o[2*v],w=o[2*v+1];m<w;){var l=m+w>>1,x=a[2*l+1];if(x===g)return l;g<x?w=l:m=l+1}return m}function n(o,a,s,f){for(var v=o.length,g=[],m=0;m<v;++m){var w=o[m],l=w.length;if(l===2){var x=(f[w[0]]<<0)+(f[w[1]]<<1);if(x===0||x===3)continue;switch(x){case 0:break;case 1:g.push([i(s,a,w[0],w[1])]);break;case 2:g.push([i(s,a,w[1],w[0])]);break}}}return g}return n},function(){function i(o,a,s,f){for(var v=Math.min(s,f)|0,g=Math.max(s,f)|0,m=o[2*v],w=o[2*v+1];m<w;){var l=m+w>>1,x=a[2*l+1];if(x===g)return l;g<x?w=l:m=l+1}return m}function n(o,a,s,f){for(var v=o.length,g=[],m=0;m<v;++m){var w=o[m],l=w.length;if(l===3){var x=(f[w[0]]<<0)+(f[w[1]]<<1)+(f[w[2]]<<2);if(x===0||x===7)continue;switch(x){case 0:break;case 1:g.push([i(s,a,w[0],w[2]),i(s,a,w[0],w[1])]);break;case 2:g.push([i(s,a,w[1],w[0]),i(s,a,w[1],w[2])]);break;case 3:g.push([i(s,a,w[0],w[2]),i(s,a,w[1],w[2])]);break;case 4:g.push([i(s,a,w[2],w[1]),i(s,a,w[2],w[0])]);break;case 5:g.push([i(s,a,w[2],w[1]),i(s,a,w[0],w[1])]);break;case 6:g.push([i(s,a,w[1],w[0]),i(s,a,w[2],w[0])]);break}}else if(l===2){var x=(f[w[0]]<<0)+(f[w[1]]<<1);if(x===0||x===3)continue;switch(x){case 0:break;case 1:g.push([i(s,a,w[0],w[1])]);break;case 2:g.push([i(s,a,w[1],w[0])]);break}}}return g}return n},function(){function i(o,a,s,f){for(var v=Math.min(s,f)|0,g=Math.max(s,f)|0,m=o[2*v],w=o[2*v+1];m<w;){var l=m+w>>1,x=a[2*l+1];if(x===g)return l;g<x?w=l:m=l+1}return m}function n(o,a,s,f){for(var v=o.length,g=[],m=0;m<v;++m){var w=o[m],l=w.length;if(l===4){var x=(f[w[0]]<<0)+(f[w[1]]<<1)+(f[w[2]]<<2)+(f[w[3]]<<3);if(x===0||x===15)continue;switch(x){case 0:break;case 1:g.push([i(s,a,w[0],w[1]),i(s,a,w[0],w[2]),i(s,a,w[0],w[3])]);break;case 2:g.push([i(s,a,w[1],w[2]),i(s,a,w[1],w[0]),i(s,a,w[1],w[3])]);break;case 3:g.push([i(s,a,w[1],w[2]),i(s,a,w[0],w[2]),i(s,a,w[0],w[3])],[i(s,a,w[1],w[3]),i(s,a,w[1],w[2]),i(s,a,w[0],w[3])]);break;case 4:g.push([i(s,a,w[2],w[0]),i(s,a,w[2],w[1]),i(s,a,w[2],w[3])]);break;case 5:g.push([i(s,a,w[0],w[1]),i(s,a,w[2],w[1]),i(s,a,w[0],w[3])],[i(s,a,w[2],w[1]),i(s,a,w[2],w[3]),i(s,a,w[0],w[3])]);break;case 6:g.push([i(s,a,w[2],w[0]),i(s,a,w[1],w[0]),i(s,a,w[1],w[3])],[i(s,a,w[2],w[3]),i(s,a,w[2],w[0]),i(s,a,w[1],w[3])]);break;case 7:g.push([i(s,a,w[0],w[3]),i(s,a,w[1],w[3]),i(s,a,w[2],w[3])]);break;case 8:g.push([i(s,a,w[3],w[1]),i(s,a,w[3],w[0]),i(s,a,w[3],w[2])]);break;case 9:g.push([i(s,a,w[3],w[1]),i(s,a,w[0],w[1]),i(s,a,w[0],w[2])],[i(s,a,w[3],w[2]),i(s,a,w[3],w[1]),i(s,a,w[0],w[2])]);break;case 10:g.push([i(s,a,w[1],w[0]),i(s,a,w[3],w[0]),i(s,a,w[1],w[2])],[i(s,a,w[3],w[0]),i(s,a,w[3],w[2]),i(s,a,w[1],w[2])]);break;case 11:g.push([i(s,a,w[1],w[2]),i(s,a,w[0],w[2]),i(s,a,w[3],w[2])]);break;case 12:g.push([i(s,a,w[3],w[0]),i(s,a,w[2],w[0]),i(s,a,w[2],w[1])],[i(s,a,w[3],w[1]),i(s,a,w[3],w[0]),i(s,a,w[2],w[1])]);break;case 13:g.push([i(s,a,w[0],w[1]),i(s,a,w[2],w[1]),i(s,a,w[3],w[1])]);break;case 14:g.push([i(s,a,w[2],w[0]),i(s,a,w[1],w[0]),i(s,a,w[3],w[0])]);break}}else if(l===3){var x=(f[w[0]]<<0)+(f[w[1]]<<1)+(f[w[2]]<<2);if(x===0||x===7)continue;switch(x){case 0:break;case 1:g.push([i(s,a,w[0],w[2]),i(s,a,w[0],w[1])]);break;case 2:g.push([i(s,a,w[1],w[0]),i(s,a,w[1],w[2])]);break;case 3:g.push([i(s,a,w[0],w[2]),i(s,a,w[1],w[2])]);break;case 4:g.push([i(s,a,w[2],w[1]),i(s,a,w[2],w[0])]);break;case 5:g.push([i(s,a,w[2],w[1]),i(s,a,w[0],w[1])]);break;case 6:g.push([i(s,a,w[1],w[0]),i(s,a,w[2],w[0])]);break}}else if(l===2){var x=(f[w[0]]<<0)+(f[w[1]]<<1);if(x===0||x===3)continue;switch(x){case 0:break;case 1:g.push([i(s,a,w[0],w[1])]);break;case 2:g.push([i(s,a,w[1],w[0])]);break}}}return g}return n}];function r(i){return e[i]()}},1682:function(t){function e(n,o){for(var a=1,s=n.length,f=n[0],v=n[0],g=1;g<s;++g)if(v=f,f=n[g],o(f,v)){if(g===a){a++;continue}n[a++]=f}return n.length=a,n}function r(n){for(var o=1,a=n.length,s=n[0],f=n[0],v=1;v<a;++v,f=s)if(f=s,s=n[v],s!==f){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},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,f=this.roots,v=s[o],g=s[a];v<g?f[o]=a:g<v?f[a]=o:(f[a]=o,++s[o])}}},1811:function(t,e,r){var i=r(2478),n=r(7442),o=r(7608),a=r(5567),s=r(2408),f=r(7089),v=r(6582),g=r(7656);r(2504);var m=r(3536),w=[0,0,0];t.exports=S;function l(k){this._components=k.slice(),this._time=[0],this.prevMatrix=k.slice(),this.nextMatrix=k.slice(),this.computedMatrix=k.slice(),this.computedInverse=k.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(k){var M=this._time,T=i.le(M,k),c=this.computedMatrix;if(!(T<0)){var h=this._components;if(T===M.length-1)for(var b=16*T,_=0;_<16;++_)c[_]=h[b++];else{for(var P=M[T+1]-M[T],b=16*T,L=this.prevMatrix,D=!0,_=0;_<16;++_)L[_]=h[b++];for(var B=this.nextMatrix,_=0;_<16;++_)B[_]=h[b++],D=D&&L[_]===B[_];if(P<1e-6||D)for(var _=0;_<16;++_)c[_]=L[_];else n(c,L,B,(k-M[T])/P)}var R=this.computedUp;R[0]=c[1],R[1]=c[5],R[2]=c[9],m(R,R);var I=this.computedInverse;o(I,c);var F=this.computedEye,N=I[15];F[0]=I[12]/N,F[1]=I[13]/N,F[2]=I[14]/N;for(var j=this.computedCenter,G=Math.exp(this.computedRadius[0]),_=0;_<3;++_)j[_]=F[_]-c[2+4*_]*G}},x.idle=function(k){if(!(k<this.lastT())){for(var M=this._components,T=M.length-16,c=0;c<16;++c)M.push(M[T++]);this._time.push(k)}},x.flush=function(k){var M=i.gt(this._time,k)-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(k,M,T,c){this.recalcMatrix(k),M=M||this.computedEye,T=T||w,c=c||this.computedUp,this.setMatrix(k,v(this.computedMatrix,M,T,c));for(var h=0,b=0;b<3;++b)h+=Math.pow(T[b]-M[b],2);h=Math.log(Math.sqrt(h)),this.computedRadius[0]=h},x.rotate=function(k,M,T,c){this.recalcMatrix(k);var h=this.computedInverse;M&&s(h,h,M),T&&a(h,h,T),c&&f(h,h,c),this.setMatrix(k,o(this.computedMatrix,h))};var y=[0,0,0];x.pan=function(k,M,T,c){y[0]=-(M||0),y[1]=-(T||0),y[2]=-(c||0),this.recalcMatrix(k);var h=this.computedInverse;g(h,h,y),this.setMatrix(k,o(h,h))},x.translate=function(k,M,T,c){y[0]=M||0,y[1]=T||0,y[2]=c||0,this.recalcMatrix(k);var h=this.computedMatrix;g(h,h,y),this.setMatrix(k,h)},x.setMatrix=function(k,M){if(!(k<this.lastT())){this._time.push(k);for(var T=0;T<16;++T)this._components.push(M[T])}},x.setDistance=function(k,M){this.computedRadius[0]=M},x.setDistanceLimits=function(k,M){var T=this._limits;T[0]=k,T[1]=M},x.getDistanceLimits=function(k){var M=this._limits;return k?(k[0]=M[0],k[1]=M[1],k):M};function S(k){k=k||{};var M=k.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new l(M)}},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),f=0;f<s.length;f++){var v=s[f];if(v.type==="preprocessor"){var g=v.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(g&&g[2]){var m=g[1],w=g[2];return(m?n(w):w).trim()}}}}},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(m){return n(m,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);
}
`]),f=i([`precision highp float;
#define GLSLIFY 1
uniform vec4 color;
void main() {
gl_FragColor = color;
}`]);e.Q=function(m){return n(m,s,f,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);
}
`]),g=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(m){return n(m,v,g,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},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",f=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 g=v.DATA,m=v.BUFFER;e.free=function(R){if(o.isBuffer(R))m[i.log2(R.length)].push(R);else{if(Object.prototype.toString.call(R)!=="[object ArrayBuffer]"&&(R=R.buffer),!R)return;var I=R.length||R.byteLength,F=i.log2(I)|0;g[F].push(R)}};function w(R){if(R){var I=R.length||R.byteLength,F=i.log2(I);g[F].push(R)}}function l(R){w(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=w,e.freeBuffer=function(R){m[i.log2(R.length)].push(R)},e.malloc=function(R,I){if(I===void 0||I==="arraybuffer")return x(R);switch(I){case"uint8":return y(R);case"uint16":return S(R);case"uint32":return k(R);case"int8":return M(R);case"int16":return T(R);case"int32":return c(R);case"float":case"float32":return h(R);case"double":case"float64":return b(R);case"uint8_clamped":return _(R);case"bigint64":return L(R);case"biguint64":return P(R);case"buffer":return B(R);case"data":case"dataview":return D(R);default:return null}return null};function x(I){var I=i.nextPow2(I),F=i.log2(I),N=g[F];return N.length>0?N.pop():new ArrayBuffer(I)}e.mallocArrayBuffer=x;function y(R){return new Uint8Array(x(R),0,R)}e.mallocUint8=y;function S(R){return new Uint16Array(x(2*R),0,R)}e.mallocUint16=S;function k(R){return new Uint32Array(x(4*R),0,R)}e.mallocUint32=k;function M(R){return new Int8Array(x(R),0,R)}e.mallocInt8=M;function T(R){return new Int16Array(x(2*R),0,R)}e.mallocInt16=T;function c(R){return new Int32Array(x(4*R),0,R)}e.mallocInt32=c;function h(R){return new Float32Array(x(4*R),0,R)}e.mallocFloat32=e.mallocFloat=h;function b(R){return new Float64Array(x(8*R),0,R)}e.mallocFloat64=e.mallocDouble=b;function _(R){return a?new Uint8ClampedArray(x(R),0,R):y(R)}e.mallocUint8Clamped=_;function P(R){return s?new BigUint64Array(x(8*R),0,R):null}e.mallocBigUint64=P;function L(R){return f?new BigInt64Array(x(8*R),0,R):null}e.mallocBigInt64=L;function D(R){return new DataView(x(R),0,R)}e.mallocDataView=D;function B(R){R=i.nextPow2(R);var I=i.log2(R),F=m[I];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,g[R].length=0,m[R].length=0}},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}},1944:function(t,e,r){var i=r(5250),n=r(8210);t.exports=o;function o(a,s){for(var f=i(a[0],s[0]),v=1;v<a.length;++v)f=n(f,i(a[v],s[v]));return f}},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)}},2014:function(t,e,r){"use restrict";var i=r(3105),n=r(4623);function o(h){for(var b=0,_=Math.max,P=0,L=h.length;P<L;++P)b=_(b,h[P].length);return b-1}e.dimension=o;function a(h){for(var b=-1,_=Math.max,P=0,L=h.length;P<L;++P)for(var D=h[P],B=0,R=D.length;B<R;++B)b=_(b,D[B]);return b+1}e.countVertices=a;function s(h){for(var b=new Array(h.length),_=0,P=h.length;_<P;++_)b[_]=h[_].slice(0);return b}e.cloneCells=s;function f(h,b){var _=h.length,P=h.length-b.length,L=Math.min;if(P)return P;switch(_){case 0:return 0;case 1:return h[0]-b[0];case 2:var F=h[0]+h[1]-b[0]-b[1];return F||L(h[0],h[1])-L(b[0],b[1]);case 3:var D=h[0]+h[1],B=b[0]+b[1];if(F=D+h[2]-(B+b[2]),F)return F;var R=L(h[0],h[1]),I=L(b[0],b[1]),F=L(R,h[2])-L(I,b[2]);return F||L(R+h[2],D)-L(I+b[2],B);default:var N=h.slice(0);N.sort();var j=b.slice(0);j.sort();for(var G=0;G<_;++G)if(P=N[G]-j[G],P)return P;return 0}}e.compareCells=f;function v(h,b){return f(h[0],b[0])}function g(h,b){if(b){for(var _=h.length,P=new Array(_),L=0;L<_;++L)P[L]=[h[L],b[L]];P.sort(v);for(var L=0;L<_;++L)h[L]=P[L][0],b[L]=P[L][1];return h}else return h.sort(f),h}e.normalize=g;function m(h){if(h.length===0)return[];for(var b=1,_=h.length,P=1;P<_;++P){var L=h[P];if(f(L,h[P-1])){if(P===b){b++;continue}h[b++]=L}}return h.length=b,h}e.unique=m;function w(h,b){for(var _=0,P=h.length-1,L=-1;_<=P;){var D=_+P>>1,B=f(h[D],b);B<=0?(B===0&&(L=D),_=D+1):B>0&&(P=D-1)}return L}e.findCell=w;function l(h,b){for(var _=new Array(h.length),P=0,L=_.length;P<L;++P)_[P]=[];for(var D=[],P=0,B=b.length;P<B;++P)for(var R=b[P],I=R.length,F=1,N=1<<I;F<N;++F){D.length=i.popCount(F);for(var j=0,G=0;G<I;++G)F&1<<G&&(D[j++]=R[G]);var rt=w(h,D);if(!(rt<0))for(;_[rt++].push(P),!(rt>=h.length||f(h[rt],D)!==0););}return _}e.incidence=l;function x(h,b){if(!b)return l(m(S(h,0)),h);for(var _=new Array(b),P=0;P<b;++P)_[P]=[];for(var P=0,L=h.length;P<L;++P)for(var D=h[P],B=0,R=D.length;B<R;++B)_[D[B]].push(P);return _}e.dual=x;function y(h){for(var b=[],_=0,P=h.length;_<P;++_)for(var L=h[_],D=L.length|0,B=1,R=1<<D;B<R;++B){for(var I=[],F=0;F<D;++F)B>>>F&1&&I.push(L[F]);b.push(I)}return g(b)}e.explode=y;function S(h,b){if(b<0)return[];for(var _=[],P=(1<<b+1)-1,L=0;L<h.length;++L)for(var D=h[L],B=P;B<1<<D.length;B=i.nextCombination(B)){for(var R=new Array(b+1),I=0,F=0;F<D.length;++F)B&1<<F&&(R[I++]=D[F]);_.push(R)}return g(_)}e.skeleton=S;function k(h){for(var b=[],_=0,P=h.length;_<P;++_)for(var L=h[_],D=0,B=L.length;D<B;++D){for(var R=new Array(L.length-1),I=0,F=0;I<B;++I)I!==D&&(R[F++]=L[I]);b.push(R)}return g(b)}e.boundary=k;function M(h,b){for(var _=new n(b),P=0;P<h.length;++P)for(var L=h[P],D=0;D<L.length;++D)for(var B=D+1;B<L.length;++B)_.link(L[D],L[B]);for(var R=[],I=_.ranks,P=0;P<I.length;++P)I[P]=-1;for(var P=0;P<h.length;++P){var F=_.find(h[P][0]);I[F]<0?(I[F]=R.length,R.push([h[P].slice(0)])):R[I[F]].push(h[P].slice(0))}return R}function T(h){for(var b=m(g(S(h,0))),_=new n(b.length),P=0;P<h.length;++P)for(var L=h[P],D=0;D<L.length;++D)for(var B=w(b,[L[D]]),R=D+1;R<L.length;++R)_.link(B,w(b,[L[R]]));for(var I=[],F=_.ranks,P=0;P<F.length;++P)F[P]=-1;for(var P=0;P<h.length;++P){var N=_.find(w(b,[h[P][0]]));F[N]<0?(F[N]=I.length,I.push([h[P].slice(0)])):I[F[N]].push(h[P].slice(0))}return I}function c(h,b){return b?M(h,b):T(h)}e.connectedComponents=c},2095:function(t,e,r){t.exports=w;var i=r(3134),n=r(3088),o=r(5085),a=r(5250),s=r(8210),f=r(1682),v=r(5609);function g(l,x){for(var y=new Array(l),S=0;S<l;++S)y[S]=x;return y}function m(l){for(var x=new Array(l),y=0;y<l;++y)x[y]=[];return x}function w(l,x){var y=v(l,x);l=y[0],x=y[1];for(var S=x.length,k=l.length,M=i(l,x.length),T=0;T<S;++T)if(M[T].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var c=n(l,x);function h(Nt){for(var ee=Nt.length,Jt=[0],te=0;te<ee;++te){var Kt=x[Nt[te]],mt=x[Nt[(te+1)%ee]],bt=a(-Kt[0],Kt[1]),vt=a(-Kt[0],mt[1]),Ut=a(mt[0],Kt[1]),re=a(mt[0],mt[1]);Jt=s(Jt,s(s(bt,vt),s(Ut,re)))}return Jt[Jt.length-1]>0}c=c.filter(h);for(var b=c.length,_=new Array(b),P=new Array(b),T=0;T<b;++T){_[T]=T;var L=new Array(b),D=c[T].map(function(ee){return x[ee]}),B=o([D]),R=0;t:for(var I=0;I<b;++I)if(L[I]=0,T!==I){for(var F=c[I],N=F.length,j=0;j<N;++j){var G=B(x[F[j]]);if(G!==0){G<0&&(L[I]=1,R+=1);continue t}}L[I]=1,R+=1}P[T]=[R,T,L]}P.sort(function(Nt,ee){return ee[0]-Nt[0]});for(var T=0;T<b;++T)for(var L=P[T],rt=L[1],ct=L[2],I=0;I<b;++I)ct[I]&&(_[I]=rt);for(var st=m(b),T=0;T<b;++T)st[T].push(_[T]),st[_[T]].push(T);for(var et={},K=g(S,!1),T=0;T<b;++T)for(var F=c[T],N=F.length,I=0;I<N;++I){var ot=F[I],X=F[(I+1)%N],Q=Math.min(ot,X)+":"+Math.max(ot,X);if(Q in et){var ut=et[Q];st[ut].push(T),st[T].push(ut),K[ot]=K[X]=!0}else et[Q]=T}function J(Nt){for(var ee=Nt.length,Jt=0;Jt<ee;++Jt)if(!K[Nt[Jt]])return!1;return!0}for(var q=[],it=g(b,-1),T=0;T<b;++T)_[T]===T&&!J(c[T])?(q.push(T),it[T]=0):it[T]=-1;for(var y=[];q.length>0;){var nt=q.pop(),dt=st[nt];f(dt,function(ee,Jt){return ee-Jt});var Tt=dt.length,wt=it[nt],It;if(wt===0){var F=c[nt];It=[F]}for(var T=0;T<Tt;++T){var Ct=dt[T];if(!(it[Ct]>=0)&&(it[Ct]=wt^1,q.push(Ct),wt===0)){var F=c[Ct];J(F)||(F.reverse(),It.push(F))}}wt===0&&y.push(It)}return y}},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,f){if(!i){var v=Object.keys(r);i={};for(var g=0;g<v.length;++g){var m=v[g];i[s[m]]=r[m]}}return i[f]}function o(s,f){for(var v=s.getProgramParameter(f,s.ACTIVE_UNIFORMS),g=[],m=0;m<v;++m){var w=s.getActiveUniform(f,m);if(w){var l=n(s,w.type);if(w.size>1)for(var x=0;x<w.size;++x)g.push({name:w.name.replace("[0]","["+x+"]"),type:l});else g.push({name:w.name,type:l})}}return g}function a(s,f){for(var v=s.getProgramParameter(f,s.ACTIVE_ATTRIBUTES),g=[],m=0;m<v;++m){var w=s.getActiveAttrib(f,m);w&&g.push({name:w.name,type:n(s,w.type)})}return g}},2229:function(t,e,r){t.exports=r(6843)},2260:function(t,e,r){var i=r(7766);t.exports=T;var n=null,o,a,s,f;function v(c){var h=c.getParameter(c.FRAMEBUFFER_BINDING),b=c.getParameter(c.RENDERBUFFER_BINDING),_=c.getParameter(c.TEXTURE_BINDING_2D);return[h,b,_]}function g(c,h){c.bindFramebuffer(c.FRAMEBUFFER,h[0]),c.bindRenderbuffer(c.RENDERBUFFER,h[1]),c.bindTexture(c.TEXTURE_2D,h[2])}function m(c,h){var b=c.getParameter(h.MAX_COLOR_ATTACHMENTS_WEBGL);n=new Array(b+1);for(var _=0;_<=b;++_){for(var P=new Array(b),L=0;L<_;++L)P[L]=c.COLOR_ATTACHMENT0+L;for(var L=_;L<b;++L)P[L]=c.NONE;n[_]=P}}function w(c){switch(c){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 f:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function l(c,h,b,_,P,L){if(!_)return null;var D=i(c,h,b,P,_);return D.magFilter=c.NEAREST,D.minFilter=c.NEAREST,D.mipSamples=1,D.bind(),c.framebufferTexture2D(c.FRAMEBUFFER,L,c.TEXTURE_2D,D.handle,0),D}function x(c,h,b,_,P){var L=c.createRenderbuffer();return c.bindRenderbuffer(c.RENDERBUFFER,L),c.renderbufferStorage(c.RENDERBUFFER,_,h,b),c.framebufferRenderbuffer(c.FRAMEBUFFER,P,c.RENDERBUFFER,L),L}function y(c){var h=v(c.gl),b=c.gl,_=c.handle=b.createFramebuffer(),P=c._shape[0],L=c._shape[1],D=c.color.length,B=c._ext,R=c._useStencil,I=c._useDepth,F=c._colorType;b.bindFramebuffer(b.FRAMEBUFFER,_);for(var N=0;N<D;++N)c.color[N]=l(b,P,L,F,b.RGBA,b.COLOR_ATTACHMENT0+N);D===0?(c._color_rb=x(b,P,L,b.RGBA4,b.COLOR_ATTACHMENT0),B&&B.drawBuffersWEBGL(n[0])):D>1&&B.drawBuffersWEBGL(n[D]);var j=b.getExtension("WEBGL_depth_texture");j?R?c.depth=l(b,P,L,j.UNSIGNED_INT_24_8_WEBGL,b.DEPTH_STENCIL,b.DEPTH_STENCIL_ATTACHMENT):I&&(c.depth=l(b,P,L,b.UNSIGNED_SHORT,b.DEPTH_COMPONENT,b.DEPTH_ATTACHMENT)):I&&R?c._depth_rb=x(b,P,L,b.DEPTH_STENCIL,b.DEPTH_STENCIL_ATTACHMENT):I?c._depth_rb=x(b,P,L,b.DEPTH_COMPONENT16,b.DEPTH_ATTACHMENT):R&&(c._depth_rb=x(b,P,L,b.STENCIL_INDEX,b.STENCIL_ATTACHMENT));var G=b.checkFramebufferStatus(b.FRAMEBUFFER);if(G!==b.FRAMEBUFFER_COMPLETE){c._destroyed=!0,b.bindFramebuffer(b.FRAMEBUFFER,null),b.deleteFramebuffer(c.handle),c.handle=null,c.depth&&(c.depth.dispose(),c.depth=null),c._depth_rb&&(b.deleteRenderbuffer(c._depth_rb),c._depth_rb=null);for(var N=0;N<c.color.length;++N)c.color[N].dispose(),c.color[N]=null;c._color_rb&&(b.deleteRenderbuffer(c._color_rb),c._color_rb=null),g(b,h),w(G)}g(b,h)}function S(c,h,b,_,P,L,D,B){this.gl=c,this._shape=[h|0,b|0],this._destroyed=!1,this._ext=B,this.color=new Array(P);for(var R=0;R<P;++R)this.color[R]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=_,this._useDepth=L,this._useStencil=D;var I=this,F=[h|0,b|0];Object.defineProperties(F,{0:{get:function(){return I._shape[0]},set:function(N){return I.width=N}},1:{get:function(){return I._shape[1]},set:function(N){return I.height=N}}}),this._shapeVector=F,y(this)}var k=S.prototype;function M(c,h,b){if(c._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(!(c._shape[0]===h&&c._shape[1]===b)){var _=c.gl,P=_.getParameter(_.MAX_RENDERBUFFER_SIZE);if(h<0||h>P||b<0||b>P)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");c._shape[0]=h,c._shape[1]=b;for(var L=v(_),D=0;D<c.color.length;++D)c.color[D].shape=c._shape;c._color_rb&&(_.bindRenderbuffer(_.RENDERBUFFER,c._color_rb),_.renderbufferStorage(_.RENDERBUFFER,_.RGBA4,c._shape[0],c._shape[1])),c.depth&&(c.depth.shape=c._shape),c._depth_rb&&(_.bindRenderbuffer(_.RENDERBUFFER,c._depth_rb),c._useDepth&&c._useStencil?_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_STENCIL,c._shape[0],c._shape[1]):c._useDepth?_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_COMPONENT16,c._shape[0],c._shape[1]):c._useStencil&&_.renderbufferStorage(_.RENDERBUFFER,_.STENCIL_INDEX,c._shape[0],c._shape[1])),_.bindFramebuffer(_.FRAMEBUFFER,c.handle);var B=_.checkFramebufferStatus(_.FRAMEBUFFER);B!==_.FRAMEBUFFER_COMPLETE&&(c.dispose(),g(_,L),w(B)),g(_,L)}}Object.defineProperties(k,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(c){if(Array.isArray(c)||(c=[c|0,c|0]),c.length!==2)throw new Error("gl-fbo: Shape vector must be length 2");var h=c[0]|0,b=c[1]|0;return M(this,h,b),[h,b]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(c){return c=c|0,M(this,c,this._shape[1]),c},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(c){return c=c|0,M(this,this._shape[0],c),c},enumerable:!1}}),k.bind=function(){if(!this._destroyed){var c=this.gl;c.bindFramebuffer(c.FRAMEBUFFER,this.handle),c.viewport(0,0,this._shape[0],this._shape[1])}},k.dispose=function(){if(!this._destroyed){this._destroyed=!0;var c=this.gl;c.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(c.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var h=0;h<this.color.length;++h)this.color[h].dispose(),this.color[h]=null;this._color_rb&&(c.deleteRenderbuffer(this._color_rb),this._color_rb=null)}};function T(c,h,b,_){o||(o=c.FRAMEBUFFER_UNSUPPORTED,a=c.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,s=c.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,f=c.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var P=c.getExtension("WEBGL_draw_buffers");if(!n&&P&&m(c,P),Array.isArray(h)&&(_=b,b=h[1]|0,h=h[0]|0),typeof h!="number")throw new Error("gl-fbo: Missing shape parameter");var L=c.getParameter(c.MAX_RENDERBUFFER_SIZE);if(h<0||h>L||b<0||b>L)throw new Error("gl-fbo: Parameters are too large for FBO");_=_||{};var D=1;if("color"in _){if(D=Math.max(_.color|0,0),D<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(D>1)if(P){if(D>c.getParameter(P.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+D+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var B=c.UNSIGNED_BYTE,R=c.getExtension("OES_texture_float");if(_.float&&D>0){if(!R)throw new Error("gl-fbo: Context does not support floating point textures");B=c.FLOAT}else _.preferFloat&&D>0&&R&&(B=c.FLOAT);var I=!0;"depth"in _&&(I=!!_.depth);var F=!1;return"stencil"in _&&(F=!!_.stencil),new S(c,h,b,B,D,I,F,P)}},2272:function(t,e,r){var i=r(2646)[4];r(2478),t.exports=o;function n(a,s,f,v,g,m){var w=s.opposite(v,g);if(!(w<0)){if(g<v){var l=v;v=g,g=l,l=m,m=w,w=l}s.isConstraint(v,g)||i(a[v],a[g],a[m],a[w])<0&&f.push(v,g)}}function o(a,s){for(var f=[],v=a.length,g=s.stars,m=0;m<v;++m)for(var w=g[m],l=1;l<w.length;l+=2){var x=w[l];if(!(x<m)&&!s.isConstraint(m,x)){for(var y=w[l-1],S=-1,k=1;k<w.length;k+=2)if(w[k-1]===x){S=w[k];break}S<0||i(a[m],a[x],a[y],a[S])<0&&f.push(m,x)}}for(;f.length>0;){for(var x=f.pop(),m=f.pop(),y=-1,S=-1,w=g[m],M=1;M<w.length;M+=2){var T=w[M-1],c=w[M];T===x?S=c:c===x&&(y=T)}y<0||S<0||i(a[m],a[x],a[y],a[S])>=0||(s.flip(m,x),n(a,s,f,y,m,S),n(a,s,f,m,S,y),n(a,s,f,S,x,y),n(a,s,f,x,y,S))}}},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}},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}},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(f,v){return i[0]=f,i[1]=v,r[0]},a=function(f){return r[0]=f,i[0]},s=function(f){return r[0]=f,i[1]};t.exports=function(f){return r[0]=f,[i[0],i[1]]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}else if(i[0]===1072693248){let o=function(f,v){return i[1]=f,i[0]=v,r[0]},a=function(f){return r[0]=f,i[1]},s=function(f){return r[0]=f,i[0]};t.exports=function(f){return r[0]=f,[i[1],i[0]]},t.exports.pack=o,t.exports.lo=a,t.exports.hi=s}else e=!1}if(!e){let o=function(f,v){return n.writeUInt32LE(f,0,!0),n.writeUInt32LE(v,4,!0),n.readDoubleLE(0,!0)},a=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(0,!0)},s=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(4,!0)};var n=new Buffer(8);t.exports=function(f){return n.writeDoubleLE(f,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),f=s&(1<<20)-1;return s&2146435072&&(f+=1048576),[a,f]},t.exports.denormalized=function(o){var a=t.exports.hi(o);return!(a&2146435072)}},2408:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[0],f=i[1],v=i[2],g=i[3],m=i[8],w=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-m*o,r[1]=f*a-w*o,r[2]=v*a-l*o,r[3]=g*a-x*o,r[8]=s*o+m*a,r[9]=f*o+w*a,r[10]=v*o+l*a,r[11]=g*o+x*a,r}},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}},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}},2455:function(t,e){function r(){function o(f,v,g,m,w,l,x,y,S,k,M){for(var T=2*f,c=m,h=T*m;c<w;++c,h+=T){var b=l[v+h],_=l[v+h+f],P=x[c];t:for(var L=y,D=T*y;L<S;++L,D+=T){var B=k[v+D],R=k[v+D+f],I=M[L];if(!(R<b||_<B)){for(var F=v+1;F<f;++F){var N=l[F+h],j=l[F+f+h],G=k[F+D],rt=k[F+f+D];if(j<G||rt<N)continue t}var ct=g(P,I);if(ct!==void 0)return ct}}}}function a(f,v,g,m,w,l,x,y,S,k,M){for(var T=2*f,c=y,h=T*y;c<S;++c,h+=T){var b=k[v+h],_=k[v+h+f],P=M[c];t:for(var L=m,D=T*m;L<w;++L,D+=T){var B=l[v+D],R=l[v+D+f],I=x[L];if(!(_<B||R<b)){for(var F=v+1;F<f;++F){var N=l[F+D],j=l[F+f+D],G=k[F+h],rt=k[F+f+h];if(j<G||rt<N)continue t}var ct=g(I,P);if(ct!==void 0)return ct}}}}function s(f,v,g,m,w,l,x,y,S,k,M){return w-m>S-y?o(f,v,g,m,w,l,x,y,S,k,M):a(f,v,g,m,w,l,x,y,S,k,M)}return s}function i(){function o(g,m,w,l,x,y,S,k,M,T,c){for(var h=2*g,b=l,_=h*l;b<x;++b,_+=h){var P=y[m+_],L=y[m+_+g],D=S[b];t:for(var B=k,R=h*k;B<M;++B,R+=h){var I=T[m+R],F=c[B];if(!(I<=P||L<I)){for(var N=m+1;N<g;++N){var j=y[N+_],G=y[N+g+_],rt=T[N+R],ct=T[N+g+R];if(G<rt||ct<j)continue t}var st=w(F,D);if(st!==void 0)return st}}}}function a(g,m,w,l,x,y,S,k,M,T,c){for(var h=2*g,b=l,_=h*l;b<x;++b,_+=h){var P=y[m+_],L=y[m+_+g],D=S[b];t:for(var B=k,R=h*k;B<M;++B,R+=h){var I=T[m+R],F=c[B];if(!(I<P||L<I)){for(var N=m+1;N<g;++N){var j=y[N+_],G=y[N+g+_],rt=T[N+R],ct=T[N+g+R];if(G<rt||ct<j)continue t}var st=w(D,F);if(st!==void 0)return st}}}}function s(g,m,w,l,x,y,S,k,M,T,c){for(var h=2*g,b=k,_=h*k;b<M;++b,_+=h){var P=T[m+_],L=c[b];t:for(var D=l,B=h*l;D<x;++D,B+=h){var R=y[m+B],I=y[m+B+g],F=S[D];if(!(P<=R||I<P)){for(var N=m+1;N<g;++N){var j=y[N+B],G=y[N+g+B],rt=T[N+_],ct=T[N+g+_];if(G<rt||ct<j)continue t}var st=w(L,F);if(st!==void 0)return st}}}}function f(g,m,w,l,x,y,S,k,M,T,c){for(var h=2*g,b=k,_=h*k;b<M;++b,_+=h){var P=T[m+_],L=c[b];t:for(var D=l,B=h*l;D<x;++D,B+=h){var R=y[m+B],I=y[m+B+g],F=S[D];if(!(P<R||I<P)){for(var N=m+1;N<g;++N){var j=y[N+B],G=y[N+g+B],rt=T[N+_],ct=T[N+g+_];if(G<rt||ct<j)continue t}var st=w(F,L);if(st!==void 0)return st}}}}function v(g,m,w,l,x,y,S,k,M,T,c,h){return y-x>T-M?l?o(g,m,w,x,y,S,k,M,T,c,h):a(g,m,w,x,y,S,k,M,T,c,h):l?s(g,m,w,x,y,S,k,M,T,c,h):f(g,m,w,x,y,S,k,M,T,c,h)}return v}function n(o){return o?r():i()}e.partial=n(!1),e.full=n(!0)},2478:function(t){function e(s,f,v,g,m){for(var w=m+1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y>=0?(w=l,m=l-1):g=l+1}return w}function r(s,f,v,g,m){for(var w=m+1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y>0?(w=l,m=l-1):g=l+1}return w}function i(s,f,v,g,m){for(var w=g-1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y<0?(w=l,g=l+1):m=l-1}return w}function n(s,f,v,g,m){for(var w=g-1;g<=m;){var l=g+m>>>1,x=s[l],y=v!==void 0?v(x,f):x-f;y<=0?(w=l,g=l+1):m=l-1}return w}function o(s,f,v,g,m){for(;g<=m;){var w=g+m>>>1,l=s[w],x=v!==void 0?v(l,f):l-f;if(x===0)return w;x<=0?g=w+1:m=w-1}return-1}function a(s,f,v,g,m,w){return typeof v=="function"?w(s,f,v,g===void 0?0:g|0,m===void 0?s.length-1:m|0):w(s,f,void 0,v===void 0?0:v|0,g===void 0?s.length-1:g|0)}t.exports={ge:function(s,f,v,g,m){return a(s,f,v,g,m,e)},gt:function(s,f,v,g,m){return a(s,f,v,g,m,r)},lt:function(s,f,v,g,m){return a(s,f,v,g,m,i)},le:function(s,f,v,g,m){return a(s,f,v,g,m,n)},eq:function(s,f,v,g,m){return a(s,f,v,g,m,o)}}},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}},2538:function(t,e,r){var i=r(8902),n=r(5542),o=r(2272),a=r(5023);t.exports=m;function s(w){return[Math.min(w[0],w[1]),Math.max(w[0],w[1])]}function f(w,l){return w[0]-l[0]||w[1]-l[1]}function v(w){return w.map(s).sort(f)}function g(w,l,x){return l in w?w[l]:x}function m(w,l,x){Array.isArray(l)?(x=x||{},l=l||[]):(x=l||{},l=[]);var y=!!g(x,"delaunay",!0),S=!!g(x,"interior",!0),k=!!g(x,"exterior",!0),M=!!g(x,"infinity",!1);if(!S&&!k||w.length===0)return[];var T=i(w,l);if(y||S!==k||M){for(var c=n(w.length,v(l)),h=0;h<T.length;++h){var b=T[h];c.addTriangle(b[0],b[1],b[2])}return y&&o(w,c),k?S?M?a(c,0,M):c.cells():a(c,1,M):a(c,-1)}else return T}},2573:function(t){t.exports=e;function e(r,i,n,o){var a=i[0],s=i[1],f=i[2],v=i[3];return r[0]=a+o*(n[0]-a),r[1]=s+o*(n[1]-s),r[2]=f+o*(n[2]-f),r[3]=v+o*(n[3]-v),r}},2613:function(t){t.exports=1e-6},2640:function(t,e,r){var i=r(1888);t.exports=a;var n={"false,0,1":function(s,f,v,g,m){return function(w,l,x,y){var S=w.shape[0]|0,k=w.shape[1]|0,M=w.data,T=w.offset|0,c=w.stride[0]|0,h=w.stride[1]|0,b=T,_,P=-c|0,L=0,D=-h|0,B=0,R=-c-h|0,I=0,F=c|0,N=h-c*S|0,j=0,G=0,rt=0,ct=2*S|0,st=g(ct),et=g(ct),K=0,ot=0,X=-1,Q=-1,ut=0,J=-S|0,q=S|0,it=0,nt=-S-1|0,dt=S-1|0,Tt=0,wt=0,It=0;for(j=0;j<S;++j)st[K++]=v(M[b],l,x,y),b+=F;if(b+=N,k>0){if(G=1,st[K++]=v(M[b],l,x,y),b+=F,S>0)for(j=1,_=M[b],ot=st[K]=v(_,l,x,y),ut=st[K+X],it=st[K+J],Tt=st[K+nt],(ot!==ut||ot!==it||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,ut,it,Tt,l,x,y),wt=et[K]=rt++),K+=1,b+=F,j=2;j<S;++j)_=M[b],ot=st[K]=v(_,l,x,y),ut=st[K+X],it=st[K+J],Tt=st[K+nt],(ot!==ut||ot!==it||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,ut,it,Tt,l,x,y),wt=et[K]=rt++,Tt!==ut&&f(et[K+X],wt,I,L,Tt,ut,l,x,y)),K+=1,b+=F;for(b+=N,K=0,It=X,X=Q,Q=It,It=J,J=q,q=It,It=nt,nt=dt,dt=It,G=2;G<k;++G){if(st[K++]=v(M[b],l,x,y),b+=F,S>0)for(j=1,_=M[b],ot=st[K]=v(_,l,x,y),ut=st[K+X],it=st[K+J],Tt=st[K+nt],(ot!==ut||ot!==it||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,ut,it,Tt,l,x,y),wt=et[K]=rt++,Tt!==it&&f(et[K+J],wt,B,I,it,Tt,l,x,y)),K+=1,b+=F,j=2;j<S;++j)_=M[b],ot=st[K]=v(_,l,x,y),ut=st[K+X],it=st[K+J],Tt=st[K+nt],(ot!==ut||ot!==it||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,ut,it,Tt,l,x,y),wt=et[K]=rt++,Tt!==it&&f(et[K+J],wt,B,I,it,Tt,l,x,y),Tt!==ut&&f(et[K+X],wt,I,L,Tt,ut,l,x,y)),K+=1,b+=F;G&1&&(K=0),It=X,X=Q,Q=It,It=J,J=q,q=It,It=nt,nt=dt,dt=It,b+=N}}m(et),m(st)}},"false,1,0":function(s,f,v,g,m){return function(w,l,x,y){var S=w.shape[0]|0,k=w.shape[1]|0,M=w.data,T=w.offset|0,c=w.stride[0]|0,h=w.stride[1]|0,b=T,_,P=-c|0,L=0,D=-h|0,B=0,R=-c-h|0,I=0,F=h|0,N=c-h*k|0,j=0,G=0,rt=0,ct=2*k|0,st=g(ct),et=g(ct),K=0,ot=0,X=-1,Q=-1,ut=0,J=-k|0,q=k|0,it=0,nt=-k-1|0,dt=k-1|0,Tt=0,wt=0,It=0;for(G=0;G<k;++G)st[K++]=v(M[b],l,x,y),b+=F;if(b+=N,S>0){if(j=1,st[K++]=v(M[b],l,x,y),b+=F,k>0)for(G=1,_=M[b],ot=st[K]=v(_,l,x,y),it=st[K+J],ut=st[K+X],Tt=st[K+nt],(ot!==it||ot!==ut||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,it,ut,Tt,l,x,y),wt=et[K]=rt++),K+=1,b+=F,G=2;G<k;++G)_=M[b],ot=st[K]=v(_,l,x,y),it=st[K+J],ut=st[K+X],Tt=st[K+nt],(ot!==it||ot!==ut||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,it,ut,Tt,l,x,y),wt=et[K]=rt++,Tt!==ut&&f(et[K+X],wt,B,I,ut,Tt,l,x,y)),K+=1,b+=F;for(b+=N,K=0,It=J,J=q,q=It,It=X,X=Q,Q=It,It=nt,nt=dt,dt=It,j=2;j<S;++j){if(st[K++]=v(M[b],l,x,y),b+=F,k>0)for(G=1,_=M[b],ot=st[K]=v(_,l,x,y),it=st[K+J],ut=st[K+X],Tt=st[K+nt],(ot!==it||ot!==ut||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,it,ut,Tt,l,x,y),wt=et[K]=rt++,Tt!==it&&f(et[K+J],wt,I,L,Tt,it,l,x,y)),K+=1,b+=F,G=2;G<k;++G)_=M[b],ot=st[K]=v(_,l,x,y),it=st[K+J],ut=st[K+X],Tt=st[K+nt],(ot!==it||ot!==ut||ot!==Tt)&&(L=M[b+P],B=M[b+D],I=M[b+R],s(j,G,_,L,B,I,ot,it,ut,Tt,l,x,y),wt=et[K]=rt++,Tt!==ut&&f(et[K+X],wt,B,I,ut,Tt,l,x,y),Tt!==it&&f(et[K+J],wt,I,L,Tt,it,l,x,y)),K+=1,b+=F;j&1&&(K=0),It=J,J=q,q=It,It=X,X=Q,Q=It,It=nt,nt=dt,dt=It,b+=N}}m(et),m(st)}}};function o(s,f,v,g,m,w){var l=[w,m].join(","),x=n[l];return x(s,f,v,i.mallocUint32,i.freeUint32)}function a(s){function f(y){throw new Error("ndarray-extract-contour: "+y)}typeof s!="object"&&f("Must specify arguments");var v=s.order;Array.isArray(v)||f("Must specify order");var g=s.arrayArguments||1;g<1&&f("Must have at least one array argument");var m=s.scalarArguments||0;m<0&&f("Scalar arg count must be > 0"),typeof s.vertex!="function"&&f("Must specify vertex creation function"),typeof s.cell!="function"&&f("Must specify cell creation function"),typeof s.phase!="function"&&f("Must specify phase function");for(var w=s.getters||[],l=new Array(g),x=0;x<g;++x)w.indexOf(x)>=0?l[x]=!0:l[x]=!1;return o(s.vertex,s.cell,s.phase,m,v,l)}},2642:function(t,e,r){t.exports=o;var i=r(727);function n(a){for(var s=0,f=0;f<a.length;++f)s+=a[f];return s}function o(a,s){for(var f=s.length,v=new Array(f+1),g=0;g<f;++g){for(var m=new Array(f+1),w=0;w<=f;++w)m[w]=a[w][g];v[g]=m}v[f]=new Array(f+1);for(var g=0;g<=f;++g)v[f][g]=1;for(var l=new Array(f+1),g=0;g<f;++g)l[g]=s[g];l[f]=1;var x=i(v,l),y=n(x[f+1]);y===0&&(y=1);for(var S=new Array(f+1),g=0;g<=f;++g)S[g]=n(x[g])/y;return S}},2646:function(t,e,r){var i=r(5250),n=r(8210),o=r(8545),a=r(3012),s=6;function f(c){var h=c===3?w:c===4?l:c===5?x:y;return h(n,o,i,a)}function v(){return 0}function g(){return 0}function m(){return 0}function w(c,h,b,_){function P(L,D,B){var R=b(L[0],L[0]),I=_(R,D[0]),F=_(R,B[0]),N=b(D[0],D[0]),j=_(N,L[0]),G=_(N,B[0]),rt=b(B[0],B[0]),ct=_(rt,L[0]),st=_(rt,D[0]),et=c(h(st,G),h(j,I)),K=h(ct,F),ot=h(et,K);return ot[ot.length-1]}return P}function l(c,h,b,_){function P(L,D,B,R){var I=c(b(L[0],L[0]),b(L[1],L[1])),F=_(I,D[0]),N=_(I,B[0]),j=_(I,R[0]),G=c(b(D[0],D[0]),b(D[1],D[1])),rt=_(G,L[0]),ct=_(G,B[0]),st=_(G,R[0]),et=c(b(B[0],B[0]),b(B[1],B[1])),K=_(et,L[0]),ot=_(et,D[0]),X=_(et,R[0]),Q=c(b(R[0],R[0]),b(R[1],R[1])),ut=_(Q,L[0]),J=_(Q,D[0]),q=_(Q,B[0]),it=c(c(_(h(q,X),D[1]),c(_(h(J,st),-B[1]),_(h(ot,ct),R[1]))),c(_(h(J,st),L[1]),c(_(h(ut,j),-D[1]),_(h(rt,F),R[1])))),nt=c(c(_(h(q,X),L[1]),c(_(h(ut,j),-B[1]),_(h(K,N),R[1]))),c(_(h(ot,ct),L[1]),c(_(h(K,N),-D[1]),_(h(rt,F),B[1])))),dt=h(it,nt);return dt[dt.length-1]}return P}function x(c,h,b,_){function P(L,D,B,R,I){var F=c(b(L[0],L[0]),c(b(L[1],L[1]),b(L[2],L[2]))),N=_(F,D[0]),j=_(F,B[0]),G=_(F,R[0]),rt=_(F,I[0]),ct=c(b(D[0],D[0]),c(b(D[1],D[1]),b(D[2],D[2]))),st=_(ct,L[0]),et=_(ct,B[0]),K=_(ct,R[0]),ot=_(ct,I[0]),X=c(b(B[0],B[0]),c(b(B[1],B[1]),b(B[2],B[2]))),Q=_(X,L[0]),ut=_(X,D[0]),J=_(X,R[0]),q=_(X,I[0]),it=c(b(R[0],R[0]),c(b(R[1],R[1]),b(R[2],R[2]))),nt=_(it,L[0]),dt=_(it,D[0]),Tt=_(it,B[0]),wt=_(it,I[0]),It=c(b(I[0],I[0]),c(b(I[1],I[1]),b(I[2],I[2]))),Ct=_(It,L[0]),Nt=_(It,D[0]),ee=_(It,B[0]),Jt=_(It,R[0]),te=c(c(c(_(c(_(h(Jt,wt),B[1]),c(_(h(ee,q),-R[1]),_(h(Tt,J),I[1]))),D[2]),c(_(c(_(h(Jt,wt),D[1]),c(_(h(Nt,ot),-R[1]),_(h(dt,K),I[1]))),-B[2]),_(c(_(h(ee,q),D[1]),c(_(h(Nt,ot),-B[1]),_(h(ut,et),I[1]))),R[2]))),c(_(c(_(h(Tt,J),D[1]),c(_(h(dt,K),-B[1]),_(h(ut,et),R[1]))),-I[2]),c(_(c(_(h(Jt,wt),D[1]),c(_(h(Nt,ot),-R[1]),_(h(dt,K),I[1]))),L[2]),_(c(_(h(Jt,wt),L[1]),c(_(h(Ct,rt),-R[1]),_(h(nt,G),I[1]))),-D[2])))),c(c(_(c(_(h(Nt,ot),L[1]),c(_(h(Ct,rt),-D[1]),_(h(st,N),I[1]))),R[2]),c(_(c(_(h(dt,K),L[1]),c(_(h(nt,G),-D[1]),_(h(st,N),R[1]))),-I[2]),_(c(_(h(Tt,J),D[1]),c(_(h(dt,K),-B[1]),_(h(ut,et),R[1]))),L[2]))),c(_(c(_(h(Tt,J),L[1]),c(_(h(nt,G),-B[1]),_(h(Q,j),R[1]))),-D[2]),c(_(c(_(h(dt,K),L[1]),c(_(h(nt,G),-D[1]),_(h(st,N),R[1]))),B[2]),_(c(_(h(ut,et),L[1]),c(_(h(Q,j),-D[1]),_(h(st,N),B[1]))),-R[2]))))),Kt=c(c(c(_(c(_(h(Jt,wt),B[1]),c(_(h(ee,q),-R[1]),_(h(Tt,J),I[1]))),L[2]),_(c(_(h(Jt,wt),L[1]),c(_(h(Ct,rt),-R[1]),_(h(nt,G),I[1]))),-B[2])),c(_(c(_(h(ee,q),L[1]),c(_(h(Ct,rt),-B[1]),_(h(Q,j),I[1]))),R[2]),_(c(_(h(Tt,J),L[1]),c(_(h(nt,G),-B[1]),_(h(Q,j),R[1]))),-I[2]))),c(c(_(c(_(h(ee,q),D[1]),c(_(h(Nt,ot),-B[1]),_(h(ut,et),I[1]))),L[2]),_(c(_(h(ee,q),L[1]),c(_(h(Ct,rt),-B[1]),_(h(Q,j),I[1]))),-D[2])),c(_(c(_(h(Nt,ot),L[1]),c(_(h(Ct,rt),-D[1]),_(h(st,N),I[1]))),B[2]),_(c(_(h(ut,et),L[1]),c(_(h(Q,j),-D[1]),_(h(st,N),B[1]))),-I[2])))),mt=h(te,Kt);return mt[mt.length-1]}return P}function y(c,h,b,_){function P(L,D,B,R,I,F){var N=c(c(b(L[0],L[0]),b(L[1],L[1])),c(b(L[2],L[2]),b(L[3],L[3]))),j=_(N,D[0]),G=_(N,B[0]),rt=_(N,R[0]),ct=_(N,I[0]),st=_(N,F[0]),et=c(c(b(D[0],D[0]),b(D[1],D[1])),c(b(D[2],D[2]),b(D[3],D[3]))),K=_(et,L[0]),ot=_(et,B[0]),X=_(et,R[0]),Q=_(et,I[0]),ut=_(et,F[0]),J=c(c(b(B[0],B[0]),b(B[1],B[1])),c(b(B[2],B[2]),b(B[3],B[3]))),q=_(J,L[0]),it=_(J,D[0]),nt=_(J,R[0]),dt=_(J,I[0]),Tt=_(J,F[0]),wt=c(c(b(R[0],R[0]),b(R[1],R[1])),c(b(R[2],R[2]),b(R[3],R[3]))),It=_(wt,L[0]),Ct=_(wt,D[0]),Nt=_(wt,B[0]),ee=_(wt,I[0]),Jt=_(wt,F[0]),te=c(c(b(I[0],I[0]),b(I[1],I[1])),c(b(I[2],I[2]),b(I[3],I[3]))),Kt=_(te,L[0]),mt=_(te,D[0]),bt=_(te,B[0]),vt=_(te,R[0]),Ut=_(te,F[0]),re=c(c(b(F[0],F[0]),b(F[1],F[1])),c(b(F[2],F[2]),b(F[3],F[3]))),Zt=_(re,L[0]),ue=_(re,D[0]),Me=_(re,B[0]),Ce=_(re,R[0]),We=_(re,I[0]),qe=c(c(c(_(c(c(_(c(_(h(We,Ut),R[1]),c(_(h(Ce,Jt),-I[1]),_(h(vt,ee),F[1]))),B[2]),_(c(_(h(We,Ut),B[1]),c(_(h(Me,Tt),-I[1]),_(h(bt,dt),F[1]))),-R[2])),c(_(c(_(h(Ce,Jt),B[1]),c(_(h(Me,Tt),-R[1]),_(h(Nt,nt),F[1]))),I[2]),_(c(_(h(vt,ee),B[1]),c(_(h(bt,dt),-R[1]),_(h(Nt,nt),I[1]))),-F[2]))),D[3]),c(_(c(c(_(c(_(h(We,Ut),R[1]),c(_(h(Ce,Jt),-I[1]),_(h(vt,ee),F[1]))),D[2]),_(c(_(h(We,Ut),D[1]),c(_(h(ue,ut),-I[1]),_(h(mt,Q),F[1]))),-R[2])),c(_(c(_(h(Ce,Jt),D[1]),c(_(h(ue,ut),-R[1]),_(h(Ct,X),F[1]))),I[2]),_(c(_(h(vt,ee),D[1]),c(_(h(mt,Q),-R[1]),_(h(Ct,X),I[1]))),-F[2]))),-B[3]),_(c(c(_(c(_(h(We,Ut),B[1]),c(_(h(Me,Tt),-I[1]),_(h(bt,dt),F[1]))),D[2]),_(c(_(h(We,Ut),D[1]),c(_(h(ue,ut),-I[1]),_(h(mt,Q),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),D[1]),c(_(h(ue,ut),-B[1]),_(h(it,ot),F[1]))),I[2]),_(c(_(h(bt,dt),D[1]),c(_(h(mt,Q),-B[1]),_(h(it,ot),I[1]))),-F[2]))),R[3]))),c(c(_(c(c(_(c(_(h(Ce,Jt),B[1]),c(_(h(Me,Tt),-R[1]),_(h(Nt,nt),F[1]))),D[2]),_(c(_(h(Ce,Jt),D[1]),c(_(h(ue,ut),-R[1]),_(h(Ct,X),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),D[1]),c(_(h(ue,ut),-B[1]),_(h(it,ot),F[1]))),R[2]),_(c(_(h(Nt,nt),D[1]),c(_(h(Ct,X),-B[1]),_(h(it,ot),R[1]))),-F[2]))),-I[3]),_(c(c(_(c(_(h(vt,ee),B[1]),c(_(h(bt,dt),-R[1]),_(h(Nt,nt),I[1]))),D[2]),_(c(_(h(vt,ee),D[1]),c(_(h(mt,Q),-R[1]),_(h(Ct,X),I[1]))),-B[2])),c(_(c(_(h(bt,dt),D[1]),c(_(h(mt,Q),-B[1]),_(h(it,ot),I[1]))),R[2]),_(c(_(h(Nt,nt),D[1]),c(_(h(Ct,X),-B[1]),_(h(it,ot),R[1]))),-I[2]))),F[3])),c(_(c(c(_(c(_(h(We,Ut),R[1]),c(_(h(Ce,Jt),-I[1]),_(h(vt,ee),F[1]))),D[2]),_(c(_(h(We,Ut),D[1]),c(_(h(ue,ut),-I[1]),_(h(mt,Q),F[1]))),-R[2])),c(_(c(_(h(Ce,Jt),D[1]),c(_(h(ue,ut),-R[1]),_(h(Ct,X),F[1]))),I[2]),_(c(_(h(vt,ee),D[1]),c(_(h(mt,Q),-R[1]),_(h(Ct,X),I[1]))),-F[2]))),L[3]),_(c(c(_(c(_(h(We,Ut),R[1]),c(_(h(Ce,Jt),-I[1]),_(h(vt,ee),F[1]))),L[2]),_(c(_(h(We,Ut),L[1]),c(_(h(Zt,st),-I[1]),_(h(Kt,ct),F[1]))),-R[2])),c(_(c(_(h(Ce,Jt),L[1]),c(_(h(Zt,st),-R[1]),_(h(It,rt),F[1]))),I[2]),_(c(_(h(vt,ee),L[1]),c(_(h(Kt,ct),-R[1]),_(h(It,rt),I[1]))),-F[2]))),-D[3])))),c(c(c(_(c(c(_(c(_(h(We,Ut),D[1]),c(_(h(ue,ut),-I[1]),_(h(mt,Q),F[1]))),L[2]),_(c(_(h(We,Ut),L[1]),c(_(h(Zt,st),-I[1]),_(h(Kt,ct),F[1]))),-D[2])),c(_(c(_(h(ue,ut),L[1]),c(_(h(Zt,st),-D[1]),_(h(K,j),F[1]))),I[2]),_(c(_(h(mt,Q),L[1]),c(_(h(Kt,ct),-D[1]),_(h(K,j),I[1]))),-F[2]))),R[3]),_(c(c(_(c(_(h(Ce,Jt),D[1]),c(_(h(ue,ut),-R[1]),_(h(Ct,X),F[1]))),L[2]),_(c(_(h(Ce,Jt),L[1]),c(_(h(Zt,st),-R[1]),_(h(It,rt),F[1]))),-D[2])),c(_(c(_(h(ue,ut),L[1]),c(_(h(Zt,st),-D[1]),_(h(K,j),F[1]))),R[2]),_(c(_(h(Ct,X),L[1]),c(_(h(It,rt),-D[1]),_(h(K,j),R[1]))),-F[2]))),-I[3])),c(_(c(c(_(c(_(h(vt,ee),D[1]),c(_(h(mt,Q),-R[1]),_(h(Ct,X),I[1]))),L[2]),_(c(_(h(vt,ee),L[1]),c(_(h(Kt,ct),-R[1]),_(h(It,rt),I[1]))),-D[2])),c(_(c(_(h(mt,Q),L[1]),c(_(h(Kt,ct),-D[1]),_(h(K,j),I[1]))),R[2]),_(c(_(h(Ct,X),L[1]),c(_(h(It,rt),-D[1]),_(h(K,j),R[1]))),-I[2]))),F[3]),_(c(c(_(c(_(h(Ce,Jt),B[1]),c(_(h(Me,Tt),-R[1]),_(h(Nt,nt),F[1]))),D[2]),_(c(_(h(Ce,Jt),D[1]),c(_(h(ue,ut),-R[1]),_(h(Ct,X),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),D[1]),c(_(h(ue,ut),-B[1]),_(h(it,ot),F[1]))),R[2]),_(c(_(h(Nt,nt),D[1]),c(_(h(Ct,X),-B[1]),_(h(it,ot),R[1]))),-F[2]))),L[3]))),c(c(_(c(c(_(c(_(h(Ce,Jt),B[1]),c(_(h(Me,Tt),-R[1]),_(h(Nt,nt),F[1]))),L[2]),_(c(_(h(Ce,Jt),L[1]),c(_(h(Zt,st),-R[1]),_(h(It,rt),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),L[1]),c(_(h(Zt,st),-B[1]),_(h(q,G),F[1]))),R[2]),_(c(_(h(Nt,nt),L[1]),c(_(h(It,rt),-B[1]),_(h(q,G),R[1]))),-F[2]))),-D[3]),_(c(c(_(c(_(h(Ce,Jt),D[1]),c(_(h(ue,ut),-R[1]),_(h(Ct,X),F[1]))),L[2]),_(c(_(h(Ce,Jt),L[1]),c(_(h(Zt,st),-R[1]),_(h(It,rt),F[1]))),-D[2])),c(_(c(_(h(ue,ut),L[1]),c(_(h(Zt,st),-D[1]),_(h(K,j),F[1]))),R[2]),_(c(_(h(Ct,X),L[1]),c(_(h(It,rt),-D[1]),_(h(K,j),R[1]))),-F[2]))),B[3])),c(_(c(c(_(c(_(h(Me,Tt),D[1]),c(_(h(ue,ut),-B[1]),_(h(it,ot),F[1]))),L[2]),_(c(_(h(Me,Tt),L[1]),c(_(h(Zt,st),-B[1]),_(h(q,G),F[1]))),-D[2])),c(_(c(_(h(ue,ut),L[1]),c(_(h(Zt,st),-D[1]),_(h(K,j),F[1]))),B[2]),_(c(_(h(it,ot),L[1]),c(_(h(q,G),-D[1]),_(h(K,j),B[1]))),-F[2]))),-R[3]),_(c(c(_(c(_(h(Nt,nt),D[1]),c(_(h(Ct,X),-B[1]),_(h(it,ot),R[1]))),L[2]),_(c(_(h(Nt,nt),L[1]),c(_(h(It,rt),-B[1]),_(h(q,G),R[1]))),-D[2])),c(_(c(_(h(Ct,X),L[1]),c(_(h(It,rt),-D[1]),_(h(K,j),R[1]))),B[2]),_(c(_(h(it,ot),L[1]),c(_(h(q,G),-D[1]),_(h(K,j),B[1]))),-R[2]))),F[3]))))),vr=c(c(c(_(c(c(_(c(_(h(We,Ut),R[1]),c(_(h(Ce,Jt),-I[1]),_(h(vt,ee),F[1]))),B[2]),_(c(_(h(We,Ut),B[1]),c(_(h(Me,Tt),-I[1]),_(h(bt,dt),F[1]))),-R[2])),c(_(c(_(h(Ce,Jt),B[1]),c(_(h(Me,Tt),-R[1]),_(h(Nt,nt),F[1]))),I[2]),_(c(_(h(vt,ee),B[1]),c(_(h(bt,dt),-R[1]),_(h(Nt,nt),I[1]))),-F[2]))),L[3]),c(_(c(c(_(c(_(h(We,Ut),R[1]),c(_(h(Ce,Jt),-I[1]),_(h(vt,ee),F[1]))),L[2]),_(c(_(h(We,Ut),L[1]),c(_(h(Zt,st),-I[1]),_(h(Kt,ct),F[1]))),-R[2])),c(_(c(_(h(Ce,Jt),L[1]),c(_(h(Zt,st),-R[1]),_(h(It,rt),F[1]))),I[2]),_(c(_(h(vt,ee),L[1]),c(_(h(Kt,ct),-R[1]),_(h(It,rt),I[1]))),-F[2]))),-B[3]),_(c(c(_(c(_(h(We,Ut),B[1]),c(_(h(Me,Tt),-I[1]),_(h(bt,dt),F[1]))),L[2]),_(c(_(h(We,Ut),L[1]),c(_(h(Zt,st),-I[1]),_(h(Kt,ct),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),L[1]),c(_(h(Zt,st),-B[1]),_(h(q,G),F[1]))),I[2]),_(c(_(h(bt,dt),L[1]),c(_(h(Kt,ct),-B[1]),_(h(q,G),I[1]))),-F[2]))),R[3]))),c(c(_(c(c(_(c(_(h(Ce,Jt),B[1]),c(_(h(Me,Tt),-R[1]),_(h(Nt,nt),F[1]))),L[2]),_(c(_(h(Ce,Jt),L[1]),c(_(h(Zt,st),-R[1]),_(h(It,rt),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),L[1]),c(_(h(Zt,st),-B[1]),_(h(q,G),F[1]))),R[2]),_(c(_(h(Nt,nt),L[1]),c(_(h(It,rt),-B[1]),_(h(q,G),R[1]))),-F[2]))),-I[3]),_(c(c(_(c(_(h(vt,ee),B[1]),c(_(h(bt,dt),-R[1]),_(h(Nt,nt),I[1]))),L[2]),_(c(_(h(vt,ee),L[1]),c(_(h(Kt,ct),-R[1]),_(h(It,rt),I[1]))),-B[2])),c(_(c(_(h(bt,dt),L[1]),c(_(h(Kt,ct),-B[1]),_(h(q,G),I[1]))),R[2]),_(c(_(h(Nt,nt),L[1]),c(_(h(It,rt),-B[1]),_(h(q,G),R[1]))),-I[2]))),F[3])),c(_(c(c(_(c(_(h(We,Ut),B[1]),c(_(h(Me,Tt),-I[1]),_(h(bt,dt),F[1]))),D[2]),_(c(_(h(We,Ut),D[1]),c(_(h(ue,ut),-I[1]),_(h(mt,Q),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),D[1]),c(_(h(ue,ut),-B[1]),_(h(it,ot),F[1]))),I[2]),_(c(_(h(bt,dt),D[1]),c(_(h(mt,Q),-B[1]),_(h(it,ot),I[1]))),-F[2]))),L[3]),_(c(c(_(c(_(h(We,Ut),B[1]),c(_(h(Me,Tt),-I[1]),_(h(bt,dt),F[1]))),L[2]),_(c(_(h(We,Ut),L[1]),c(_(h(Zt,st),-I[1]),_(h(Kt,ct),F[1]))),-B[2])),c(_(c(_(h(Me,Tt),L[1]),c(_(h(Zt,st),-B[1]),_(h(q,G),F[1]))),I[2]),_(c(_(h(bt,dt),L[1]),c(_(h(Kt,ct),-B[1]),_(h(q,G),I[1]))),-F[2]))),-D[3])))),c(c(c(_(c(c(_(c(_(h(We,Ut),D[1]),c(_(h(ue,ut),-I[1]),_(h(mt,Q),F[1]))),L[2]),_(c(_(h(We,Ut),L[1]),c(_(h(Zt,st),-I[1]),_(h(Kt,ct),F[1]))),-D[2])),c(_(c(_(h(ue,ut),L[1]),c(_(h(Zt,st),-D[1]),_(h(K,j),F[1]))),I[2]),_(c(_(h(mt,Q),L[1]),c(_(h(Kt,ct),-D[1]),_(h(K,j),I[1]))),-F[2]))),B[3]),_(c(c(_(c(_(h(Me,Tt),D[1]),c(_(h(ue,ut),-B[1]),_(h(it,ot),F[1]))),L[2]),_(c(_(h(Me,Tt),L[1]),c(_(h(Zt,st),-B[1]),_(h(q,G),F[1]))),-D[2])),c(_(c(_(h(ue,ut),L[1]),c(_(h(Zt,st),-D[1]),_(h(K,j),F[1]))),B[2]),_(c(_(h(it,ot),L[1]),c(_(h(q,G),-D[1]),_(h(K,j),B[1]))),-F[2]))),-I[3])),c(_(c(c(_(c(_(h(bt,dt),D[1]),c(_(h(mt,Q),-B[1]),_(h(it,ot),I[1]))),L[2]),_(c(_(h(bt,dt),L[1]),c(_(h(Kt,ct),-B[1]),_(h(q,G),I[1]))),-D[2])),c(_(c(_(h(mt,Q),L[1]),c(_(h(Kt,ct),-D[1]),_(h(K,j),I[1]))),B[2]),_(c(_(h(it,ot),L[1]),c(_(h(q,G),-D[1]),_(h(K,j),B[1]))),-I[2]))),F[3]),_(c(c(_(c(_(h(vt,ee),B[1]),c(_(h(bt,dt),-R[1]),_(h(Nt,nt),I[1]))),D[2]),_(c(_(h(vt,ee),D[1]),c(_(h(mt,Q),-R[1]),_(h(Ct,X),I[1]))),-B[2])),c(_(c(_(h(bt,dt),D[1]),c(_(h(mt,Q),-B[1]),_(h(it,ot),I[1]))),R[2]),_(c(_(h(Nt,nt),D[1]),c(_(h(Ct,X),-B[1]),_(h(it,ot),R[1]))),-I[2]))),L[3]))),c(c(_(c(c(_(c(_(h(vt,ee),B[1]),c(_(h(bt,dt),-R[1]),_(h(Nt,nt),I[1]))),L[2]),_(c(_(h(vt,ee),L[1]),c(_(h(Kt,ct),-R[1]),_(h(It,rt),I[1]))),-B[2])),c(_(c(_(h(bt,dt),L[1]),c(_(h(Kt,ct),-B[1]),_(h(q,G),I[1]))),R[2]),_(c(_(h(Nt,nt),L[1]),c(_(h(It,rt),-B[1]),_(h(q,G),R[1]))),-I[2]))),-D[3]),_(c(c(_(c(_(h(vt,ee),D[1]),c(_(h(mt,Q),-R[1]),_(h(Ct,X),I[1]))),L[2]),_(c(_(h(vt,ee),L[1]),c(_(h(Kt,ct),-R[1]),_(h(It,rt),I[1]))),-D[2])),c(_(c(_(h(mt,Q),L[1]),c(_(h(Kt,ct),-D[1]),_(h(K,j),I[1]))),R[2]),_(c(_(h(Ct,X),L[1]),c(_(h(It,rt),-D[1]),_(h(K,j),R[1]))),-I[2]))),B[3])),c(_(c(c(_(c(_(h(bt,dt),D[1]),c(_(h(mt,Q),-B[1]),_(h(it,ot),I[1]))),L[2]),_(c(_(h(bt,dt),L[1]),c(_(h(Kt,ct),-B[1]),_(h(q,G),I[1]))),-D[2])),c(_(c(_(h(mt,Q),L[1]),c(_(h(Kt,ct),-D[1]),_(h(K,j),I[1]))),B[2]),_(c(_(h(it,ot),L[1]),c(_(h(q,G),-D[1]),_(h(K,j),B[1]))),-I[2]))),-R[3]),_(c(c(_(c(_(h(Nt,nt),D[1]),c(_(h(Ct,X),-B[1]),_(h(it,ot),R[1]))),L[2]),_(c(_(h(Nt,nt),L[1]),c(_(h(It,rt),-B[1]),_(h(q,G),R[1]))),-D[2])),c(_(c(_(h(Ct,X),L[1]),c(_(h(It,rt),-D[1]),_(h(K,j),R[1]))),B[2]),_(c(_(h(it,ot),L[1]),c(_(h(q,G),-D[1]),_(h(K,j),B[1]))),-R[2]))),I[3]))))),_r=h(qe,vr);return _r[_r.length-1]}return P}var S=[v,g,m];function k(c){var h=S[c.length];return h||(h=S[c.length]=f(c.length)),h.apply(void 0,c)}function M(c,h,b,_,P,L,D,B){function R(I,F,N,j,G,rt){switch(arguments.length){case 0:case 1:return 0;case 2:return _(I,F);case 3:return P(I,F,N);case 4:return L(I,F,N,j);case 5:return D(I,F,N,j,G);case 6:return B(I,F,N,j,G,rt)}for(var ct=new Array(arguments.length),st=0;st<arguments.length;++st)ct[st]=arguments[st];return c(ct)}return R}function T(){for(;S.length<=s;)S.push(f(S.length));t.exports=M.apply(void 0,[k].concat(S));for(var c=0;c<=s;++c)t.exports[c]=S[c]}T()},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)}},2652:function(t,e,r){var i=r(4335),n=r(6864),o=r(1903),a=r(9921),s=r(7608),f=r(5665),v={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},g=n(),m=n(),w=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],x=[0,0,0];t.exports=function(M,T,c,h,b,_){if(T||(T=[0,0,0]),c||(c=[0,0,0]),h||(h=[0,0,0]),b||(b=[0,0,0,1]),_||(_=[0,0,0,1]),!i(g,M)||(o(m,g),m[3]=0,m[7]=0,m[11]=0,m[15]=1,Math.abs(a(m)<1e-8)))return!1;var P=g[3],L=g[7],D=g[11],B=g[12],R=g[13],I=g[14],F=g[15];if(P!==0||L!==0||D!==0){w[0]=P,w[1]=L,w[2]=D,w[3]=F;var N=s(m,m);if(!N)return!1;f(m,m),y(b,w,m)}else b[0]=b[1]=b[2]=0,b[3]=1;if(T[0]=B,T[1]=R,T[2]=I,S(l,g),c[0]=v.length(l[0]),v.normalize(l[0],l[0]),h[0]=v.dot(l[0],l[1]),k(l[1],l[1],l[0],1,-h[0]),c[1]=v.length(l[1]),v.normalize(l[1],l[1]),h[0]/=c[1],h[1]=v.dot(l[0],l[2]),k(l[2],l[2],l[0],1,-h[1]),h[2]=v.dot(l[1],l[2]),k(l[2],l[2],l[1],1,-h[2]),c[2]=v.length(l[2]),v.normalize(l[2],l[2]),h[1]/=c[2],h[2]/=c[2],v.cross(x,l[1],l[2]),v.dot(l[0],x)<0)for(var j=0;j<3;j++)c[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 y(M,T,c){var h=T[0],b=T[1],_=T[2],P=T[3];return M[0]=c[0]*h+c[4]*b+c[8]*_+c[12]*P,M[1]=c[1]*h+c[5]*b+c[9]*_+c[13]*P,M[2]=c[2]*h+c[6]*b+c[10]*_+c[14]*P,M[3]=c[3]*h+c[7]*b+c[11]*_+c[15]*P,M}function S(M,T){M[0][0]=T[0],M[0][1]=T[1],M[0][2]=T[2],M[1][0]=T[4],M[1][1]=T[5],M[1][2]=T[6],M[2][0]=T[8],M[2][1]=T[9],M[2][2]=T[10]}function k(M,T,c,h,b){M[0]=T[0]*h+c[0]*b,M[1]=T[1]*h+c[1]*b,M[2]=T[2]*h+c[2]*b}},2653:function(t,e,r){var i=r(3865);t.exports=n;function n(o,a){for(var s=o.length,f=new Array(s),v=0;v<s;++v)f[v]=i(o[v],a[v]);return f}},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}},2690:function(t,e,r){t.exports=s;var i=r(8954),n=r(3952);function o(f,v){for(var g=f.length,m=new Array(g),w=0;w<v.length;++w)m[w]=f[v[w]];for(var l=v.length,w=0;w<g;++w)v.indexOf(w)<0&&(m[l++]=f[w]);return m}function a(f,v){for(var g=f.length,m=v.length,w=0;w<g;++w)for(var l=f[w],x=0;x<l.length;++x){var y=l[x];if(y<m)l[x]=v[y];else{y=y-m;for(var S=0;S<m;++S)y>=v[S]&&(y+=1);l[x]=y}}return f}function s(f,v){try{return i(f,!0)}catch{var g=n(f);if(g.length<=v)return[];var m=o(f,g),w=i(m,!0);return a(w,g)}}},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,y,S,k){this.gl=l,this.type=x,this.handle=y,this.length=S,this.usage=k}var f=s.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)};function v(l,x,y,S,k,M){var T=k.length*k.BYTES_PER_ELEMENT;if(M<0)return l.bufferData(x,k,S),T;if(T+M>y)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(x,M,k),y}function g(l,x){for(var y=i.malloc(l.length,x),S=l.length,k=0;k<S;++k)y[k]=l[k];return y}function m(l,x){for(var y=1,S=x.length-1;S>=0;--S){if(x[S]!==y)return!1;y*=l[S]}return!0}f.update=function(l,x){if(typeof x!="number"&&(x=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var y=l.dtype;if(a.indexOf(y)<0&&(y="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&y!=="uint16"?y="uint32":y="uint16"}if(y===l.dtype&&m(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 k=i.malloc(l.size,y),M=o(k,l.shape);n.assign(M,l),x<0?this.length=v(this.gl,this.type,this.length,this.usage,k,x):this.length=v(this.gl,this.type,this.length,this.usage,k.subarray(0,l.size),x),i.free(k)}}else if(Array.isArray(l)){var T;this.type===this.gl.ELEMENT_ARRAY_BUFFER?T=g(l,"uint16"):T=g(l,"float32"),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.length),x),i.free(T)}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 w(l,x,y,S){if(y=y||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,y!==l.ARRAY_BUFFER&&y!==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 k=l.createBuffer(),M=new s(l,y,k,0,S);return M.update(x),M}t.exports=w},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)}},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}},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}},2962:function(t,e,r){var i=r(5250),n=r(8210),o=r(3012),a=r(7004),s=6;function f(S,k,M,T){return function(c){return T(S(M(c[0][0],c[1][1]),M(-c[0][1],c[1][0])))}}function v(S,k,M,T){return function(c){return T(S(k(S(M(c[1][1],c[2][2]),M(-c[1][2],c[2][1])),c[0][0]),S(k(S(M(c[1][0],c[2][2]),M(-c[1][2],c[2][0])),-c[0][1]),k(S(M(c[1][0],c[2][1]),M(-c[1][1],c[2][0])),c[0][2]))))}}function g(S,k,M,T){return function(c){return T(S(S(k(S(k(S(M(c[2][2],c[3][3]),M(-c[2][3],c[3][2])),c[1][1]),S(k(S(M(c[2][1],c[3][3]),M(-c[2][3],c[3][1])),-c[1][2]),k(S(M(c[2][1],c[3][2]),M(-c[2][2],c[3][1])),c[1][3]))),c[0][0]),k(S(k(S(M(c[2][2],c[3][3]),M(-c[2][3],c[3][2])),c[1][0]),S(k(S(M(c[2][0],c[3][3]),M(-c[2][3],c[3][0])),-c[1][2]),k(S(M(c[2][0],c[3][2]),M(-c[2][2],c[3][0])),c[1][3]))),-c[0][1])),S(k(S(k(S(M(c[2][1],c[3][3]),M(-c[2][3],c[3][1])),c[1][0]),S(k(S(M(c[2][0],c[3][3]),M(-c[2][3],c[3][0])),-c[1][1]),k(S(M(c[2][0],c[3][1]),M(-c[2][1],c[3][0])),c[1][3]))),c[0][2]),k(S(k(S(M(c[2][1],c[3][2]),M(-c[2][2],c[3][1])),c[1][0]),S(k(S(M(c[2][0],c[3][2]),M(-c[2][2],c[3][0])),-c[1][1]),k(S(M(c[2][0],c[3][1]),M(-c[2][1],c[3][0])),c[1][2]))),-c[0][3]))))}}function m(S,k,M,T){return function(c){return T(S(S(k(S(S(k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][2]),S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),-c[2][3]),k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][4]))),c[1][1]),k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][3]),k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][4]))),-c[1][2])),S(k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][4]))),c[1][3]),k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][3]))),-c[1][4]))),c[0][0]),k(S(S(k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][2]),S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),-c[2][3]),k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][4]))),c[1][0]),k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][3]),k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),c[2][4]))),-c[1][2])),S(k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][4]))),c[1][3]),k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][3]))),-c[1][4]))),-c[0][1])),S(k(S(S(k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][3]),k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][4]))),c[1][0]),k(S(k(S(M(c[3][3],c[4][4]),M(-c[3][4],c[4][3])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][3]),k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),c[2][4]))),-c[1][1])),S(k(S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][4]))),c[1][3]),k(S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][3]))),-c[1][4]))),c[0][2]),S(k(S(S(k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][4]))),c[1][0]),k(S(k(S(M(c[3][2],c[4][4]),M(-c[3][4],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][4]))),-c[1][1])),S(k(S(k(S(M(c[3][1],c[4][4]),M(-c[3][4],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][4]),M(-c[3][4],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][4]))),c[1][2]),k(S(k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][2]))),-c[1][4]))),-c[0][3]),k(S(S(k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][1]),S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),-c[2][2]),k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][3]))),c[1][0]),k(S(k(S(M(c[3][2],c[4][3]),M(-c[3][3],c[4][2])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][2]),k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),c[2][3]))),-c[1][1])),S(k(S(k(S(M(c[3][1],c[4][3]),M(-c[3][3],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][3]),M(-c[3][3],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][3]))),c[1][2]),k(S(k(S(M(c[3][1],c[4][2]),M(-c[3][2],c[4][1])),c[2][0]),S(k(S(M(c[3][0],c[4][2]),M(-c[3][2],c[4][0])),-c[2][1]),k(S(M(c[3][0],c[4][1]),M(-c[3][1],c[4][0])),c[2][2]))),-c[1][3]))),c[0][4])))))}}function w(S){var k=S===2?f:S===3?v:S===4?g:S===5?m:void 0;return k(n,o,i,a)}var l=[function(){return[0]},function(S){return[S[0][0]]}];function x(S,k,M,T,c,h,b,_){return function(P){switch(P.length){case 0:return S(P);case 1:return k(P);case 2:return M(P);case 3:return T(P);case 4:return c(P);case 5:return h(P)}var L=b[P.length];return L||(L=b[P.length]=_(P.length)),L(P)}}function y(){for(;l.length<s;)l.push(w(l.length));t.exports=x.apply(void 0,l.concat([l,w]));for(var S=0;S<l.length;++S)t.exports[S]=l[S]}y()},2992:function(t,e,r){var i=r(3387).sprintf,n=r(5171),o=r(1848),a=r(1085);t.exports=s;function s(f,v,g){var m=o(v)||"of unknown name (see npm glsl-shader-name)",w="unknown type";g!==void 0&&(w=g===n.FRAGMENT_SHADER?"fragment":"vertex");for(var l=i(`Error compiling %s shader %s:
`,w,m),x=i("%s%s",l,f),y=f.split(`
`),S={},k=0;k<y.length;k++){var M=y[k];if(!(M===""||M==="\0")){var T=parseInt(M.split(":")[2]);if(isNaN(T))throw new Error(i("Could not parse error: %s",M));S[T]=M}}for(var c=a(v).split(`
`),k=0;k<c.length;k++)if(!(!S[k+3]&&!S[k+2]&&!S[k+1])){var h=c[k];if(l+=h+`
`,S[k+1]){var b=S[k+1];b=b.substr(b.split(":",3).join(":").length+1).trim(),l+=i(`^^^ %s
`,b)}}return{long:l.trim(),short:x.trim()}}},3012:function(t,e,r){var i=r(5250),n=r(9362);t.exports=o;function o(a,s){var f=a.length;if(f===1){var v=i(a[0],s);return v[0]?v:[v[1]]}var g=new Array(2*f),m=[.1,.1],w=[.1,.1],l=0;i(a[0],s,m),m[0]&&(g[l++]=m[0]);for(var x=1;x<f;++x){i(a[x],s,w);var y=m[1];n(y,w[0],m),m[0]&&(g[l++]=m[0]);var S=w[1],k=m[1],M=S+k,T=M-S,c=k-T;m[1]=M,c&&(g[l++]=c)}return m[1]&&(g[l++]=m[1]),l===0&&(g[l++]=0),g.length=l,g}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},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}},3088:function(t,e,r){t.exports=n;var i=r(3140);function n(o,a){for(var s=a.length|0,f=o.length,v=[new Array(s),new Array(s)],g=0;g<s;++g)v[0][g]=[],v[1][g]=[];for(var g=0;g<f;++g){var m=o[g];v[0][m[0]].push(m),v[1][m[1]].push(m)}for(var w=[],g=0;g<s;++g)v[0][g].length+v[1][g].length===0&&w.push([g]);function l(c,h){var b=v[h][c[h]];b.splice(b.indexOf(c),1)}function x(c,h,b){for(var _,P,L,D=0;D<2;++D)if(v[D][h].length>0){_=v[D][h][0],L=D;break}P=_[L^1];for(var B=0;B<2;++B)for(var R=v[B][h],I=0;I<R.length;++I){var F=R[I],N=F[B^1],j=i(a[c],a[h],a[P],a[N]);j>0&&(_=F,P=N,L=B)}return b||_&&l(_,L),P}function y(c,h){var b=v[h][c][0],_=[c];l(b,h);for(var P=b[h^1],L=h;;){for(;P!==c;)_.push(P),P=x(_[_.length-2],P,!1);if(v[0][c].length+v[1][c].length===0)break;var D=_[_.length-1],B=c,R=_[1],I=x(D,B,!0);if(i(a[D],a[B],a[R],a[I])<0)break;_.push(c),P=x(D,B)}return _}function S(c,h){return h[1]===h[h.length-1]}for(var g=0;g<s;++g)for(var k=0;k<2;++k){for(var M=[];v[k][g].length>0;){v[0][g].length;var T=y(g,k);S(M,T)?M.push.apply(M,T):(M.length>0&&w.push(M),M=T)}M.length>0&&w.push(M)}return w}},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),f=0;f<a;++f)s[f]=f;return a===2&&o[0][0]===o[1][0]&&o[0][1]===o[1][1]?[0]:s}for(var v=new Array(a),f=0;f<a;++f)v[f]=f;v.sort(function(M,T){var c=o[M][0]-o[T][0];return c||o[M][1]-o[T][1]});for(var g=[v[0],v[1]],m=[v[0],v[1]],f=2;f<a;++f){for(var w=v[f],l=o[w],x=g.length;x>1&&i(o[g[x-2]],o[g[x-1]],l)<=0;)x-=1,g.pop();for(g.push(w),x=m.length;x>1&&i(o[m[x-2]],o[m[x-1]],l)>=0;)x-=1,m.pop();m.push(w)}for(var s=new Array(m.length+g.length-2),y=0,f=0,S=g.length;f<S;++f)s[y++]=g[f];for(var k=m.length-2;k>0;--k)s[y++]=m[k];return s}},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,f=a,v=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--v;o[a]=f<<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}},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}},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 f=0;f<s;++f){var v=o[f];a=Math.max(a,v[0],v[1])}a=(a|0)+1}a=a|0;for(var g=new Array(a),f=0;f<a;++f)g[f]=[];for(var f=0;f<s;++f){var v=o[f];g[v[0]].push(v[1]),g[v[1]].push(v[0])}for(var m=0;m<a;++m)i(g[m],function(w,l){return w-l});return g}},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 f(g,m,w){var l=o(g[0],-m[0]),x=o(g[1],-m[1]),y=o(w[0],-m[0]),S=o(w[1],-m[1]),k=s(a(l,y),a(x,S));return k[k.length-1]>=0}function v(g,m,w,l){var x=i(m,w,l);if(x===0){var y=n(i(g,m,w)),S=n(i(g,m,l));if(y===S){if(y===0){var k=f(g,m,w),M=f(g,m,l);return k===M?0:k?1:-1}return 0}else{if(S===0)return y>0||f(g,m,l)?-1:1;if(y===0)return S>0||f(g,m,w)?1:-1}return n(S-y)}var T=i(g,m,w);if(T>0)return x>0&&i(g,m,l)>0?1:-1;if(T<0)return x>0||i(g,m,l)>0?1:-1;var c=i(g,m,l);return c>0||f(g,m,w)?1:-1}},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}},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}},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("")}},3250:function(t,e,r){var i=r(5250),n=r(8210),o=r(3012),a=r(8545),s=5,f=11102230246251565e-32,v=(3+16*f)*f,g=(7+56*f)*f;function m(h,b,_,P){return function(L,D,B){var R=h(h(b(D[1],B[0]),b(-B[1],D[0])),h(b(L[1],D[0]),b(-D[1],L[0]))),I=h(b(L[1],B[0]),b(-B[1],L[0])),F=P(R,I);return F[F.length-1]}}function w(h,b,_,P){return function(L,D,B,R){var I=h(h(_(h(b(B[1],R[0]),b(-R[1],B[0])),D[2]),h(_(h(b(D[1],R[0]),b(-R[1],D[0])),-B[2]),_(h(b(D[1],B[0]),b(-B[1],D[0])),R[2]))),h(_(h(b(D[1],R[0]),b(-R[1],D[0])),L[2]),h(_(h(b(L[1],R[0]),b(-R[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),R[2])))),F=h(h(_(h(b(B[1],R[0]),b(-R[1],B[0])),L[2]),h(_(h(b(L[1],R[0]),b(-R[1],L[0])),-B[2]),_(h(b(L[1],B[0]),b(-B[1],L[0])),R[2]))),h(_(h(b(D[1],B[0]),b(-B[1],D[0])),L[2]),h(_(h(b(L[1],B[0]),b(-B[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),B[2])))),N=P(I,F);return N[N.length-1]}}function l(h,b,_,P){return function(L,D,B,R,I){var F=h(h(h(_(h(_(h(b(R[1],I[0]),b(-I[1],R[0])),B[2]),h(_(h(b(B[1],I[0]),b(-I[1],B[0])),-R[2]),_(h(b(B[1],R[0]),b(-R[1],B[0])),I[2]))),D[3]),h(_(h(_(h(b(R[1],I[0]),b(-I[1],R[0])),D[2]),h(_(h(b(D[1],I[0]),b(-I[1],D[0])),-R[2]),_(h(b(D[1],R[0]),b(-R[1],D[0])),I[2]))),-B[3]),_(h(_(h(b(B[1],I[0]),b(-I[1],B[0])),D[2]),h(_(h(b(D[1],I[0]),b(-I[1],D[0])),-B[2]),_(h(b(D[1],B[0]),b(-B[1],D[0])),I[2]))),R[3]))),h(_(h(_(h(b(B[1],R[0]),b(-R[1],B[0])),D[2]),h(_(h(b(D[1],R[0]),b(-R[1],D[0])),-B[2]),_(h(b(D[1],B[0]),b(-B[1],D[0])),R[2]))),-I[3]),h(_(h(_(h(b(R[1],I[0]),b(-I[1],R[0])),D[2]),h(_(h(b(D[1],I[0]),b(-I[1],D[0])),-R[2]),_(h(b(D[1],R[0]),b(-R[1],D[0])),I[2]))),L[3]),_(h(_(h(b(R[1],I[0]),b(-I[1],R[0])),L[2]),h(_(h(b(L[1],I[0]),b(-I[1],L[0])),-R[2]),_(h(b(L[1],R[0]),b(-R[1],L[0])),I[2]))),-D[3])))),h(h(_(h(_(h(b(D[1],I[0]),b(-I[1],D[0])),L[2]),h(_(h(b(L[1],I[0]),b(-I[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),I[2]))),R[3]),h(_(h(_(h(b(D[1],R[0]),b(-R[1],D[0])),L[2]),h(_(h(b(L[1],R[0]),b(-R[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),R[2]))),-I[3]),_(h(_(h(b(B[1],R[0]),b(-R[1],B[0])),D[2]),h(_(h(b(D[1],R[0]),b(-R[1],D[0])),-B[2]),_(h(b(D[1],B[0]),b(-B[1],D[0])),R[2]))),L[3]))),h(_(h(_(h(b(B[1],R[0]),b(-R[1],B[0])),L[2]),h(_(h(b(L[1],R[0]),b(-R[1],L[0])),-B[2]),_(h(b(L[1],B[0]),b(-B[1],L[0])),R[2]))),-D[3]),h(_(h(_(h(b(D[1],R[0]),b(-R[1],D[0])),L[2]),h(_(h(b(L[1],R[0]),b(-R[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),R[2]))),B[3]),_(h(_(h(b(D[1],B[0]),b(-B[1],D[0])),L[2]),h(_(h(b(L[1],B[0]),b(-B[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),B[2]))),-R[3]))))),N=h(h(h(_(h(_(h(b(R[1],I[0]),b(-I[1],R[0])),B[2]),h(_(h(b(B[1],I[0]),b(-I[1],B[0])),-R[2]),_(h(b(B[1],R[0]),b(-R[1],B[0])),I[2]))),L[3]),_(h(_(h(b(R[1],I[0]),b(-I[1],R[0])),L[2]),h(_(h(b(L[1],I[0]),b(-I[1],L[0])),-R[2]),_(h(b(L[1],R[0]),b(-R[1],L[0])),I[2]))),-B[3])),h(_(h(_(h(b(B[1],I[0]),b(-I[1],B[0])),L[2]),h(_(h(b(L[1],I[0]),b(-I[1],L[0])),-B[2]),_(h(b(L[1],B[0]),b(-B[1],L[0])),I[2]))),R[3]),_(h(_(h(b(B[1],R[0]),b(-R[1],B[0])),L[2]),h(_(h(b(L[1],R[0]),b(-R[1],L[0])),-B[2]),_(h(b(L[1],B[0]),b(-B[1],L[0])),R[2]))),-I[3]))),h(h(_(h(_(h(b(B[1],I[0]),b(-I[1],B[0])),D[2]),h(_(h(b(D[1],I[0]),b(-I[1],D[0])),-B[2]),_(h(b(D[1],B[0]),b(-B[1],D[0])),I[2]))),L[3]),_(h(_(h(b(B[1],I[0]),b(-I[1],B[0])),L[2]),h(_(h(b(L[1],I[0]),b(-I[1],L[0])),-B[2]),_(h(b(L[1],B[0]),b(-B[1],L[0])),I[2]))),-D[3])),h(_(h(_(h(b(D[1],I[0]),b(-I[1],D[0])),L[2]),h(_(h(b(L[1],I[0]),b(-I[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),I[2]))),B[3]),_(h(_(h(b(D[1],B[0]),b(-B[1],D[0])),L[2]),h(_(h(b(L[1],B[0]),b(-B[1],L[0])),-D[2]),_(h(b(L[1],D[0]),b(-D[1],L[0])),B[2]))),-I[3])))),j=P(F,N);return j[j.length-1]}}function x(h){var b=h===3?m:h===4?w:l;return b(n,i,o,a)}var y=x(3),S=x(4),k=[function(){return 0},function(){return 0},function(h,b){return b[0]-h[0]},function(h,b,_){var P=(h[1]-_[1])*(b[0]-_[0]),L=(h[0]-_[0])*(b[1]-_[1]),D=P-L,B;if(P>0){if(L<=0)return D;B=P+L}else if(P<0){if(L>=0)return D;B=-(P+L)}else return D;var R=v*B;return D>=R||D<=-R?D:y(h,b,_)},function(h,b,_,P){var L=h[0]-P[0],D=b[0]-P[0],B=_[0]-P[0],R=h[1]-P[1],I=b[1]-P[1],F=_[1]-P[1],N=h[2]-P[2],j=b[2]-P[2],G=_[2]-P[2],rt=D*F,ct=B*I,st=B*R,et=L*F,K=L*I,ot=D*R,X=N*(rt-ct)+j*(st-et)+G*(K-ot),Q=(Math.abs(rt)+Math.abs(ct))*Math.abs(N)+(Math.abs(st)+Math.abs(et))*Math.abs(j)+(Math.abs(K)+Math.abs(ot))*Math.abs(G),ut=g*Q;return X>ut||-X>ut?X:S(h,b,_,P)}];function M(h){var b=k[h.length];return b||(b=k[h.length]=x(h.length)),b.apply(void 0,h)}function T(h,b,_,P,L,D,B){return function(R,I,F,N,j){switch(arguments.length){case 0:case 1:return 0;case 2:return P(R,I);case 3:return L(R,I,F);case 4:return D(R,I,F,N);case 5:return B(R,I,F,N,j)}for(var G=new Array(arguments.length),rt=0;rt<arguments.length;++rt)G[rt]=arguments[rt];return h(G)}}function c(){for(;k.length<=s;)k.push(x(k.length));t.exports=T.apply(void 0,[M].concat(k));for(var h=0;h<=s;++h)t.exports[h]=k[h]}c()},3327:function(t,e,r){var i=r(216),n=r(8866);t.exports=s;function o(f){return function(){return f}}function a(f,v){for(var g=new Array(f),m=0;m<f;++m)g[m]=v;return g}function s(f,v,g,m){function w(T){return function(c,h,b){return c.getUniform(h.program,b[T])}}function l(T){return function(c){for(var h=x("",T),b=0;b<h.length;++b){var _=h[b],P=_[0],L=_[1];if(m[L]){var D=c;if(typeof P=="string"&&(P.indexOf(".")===0||P.indexOf("[")===0)){var B=P;if(P.indexOf(".")===0&&(B=P.slice(1)),B.indexOf("]")===B.length-1){var R=B.indexOf("["),I=B.slice(0,R),F=B.slice(R+1,B.length-1);D=I?c[I][F]:c[F]}else D=c[B]}var N=g[L].type,j;switch(N){case"bool":case"int":case"sampler2D":case"samplerCube":f.uniform1i(m[L],D);break;case"float":f.uniform1f(m[L],D);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":f["uniform"+j+"iv"](m[L],D);break;case"v":f["uniform"+j+"fv"](m[L],D);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);f["uniformMatrix"+j+"fv"](m[L],!1,D);break}else throw new n("","Unknown uniform data type for "+name+": "+N)}}}}}function x(T,c){if(typeof c!="object")return[[T,c]];var h=[];for(var b in c){var _=c[b],P=T;parseInt(b)+""===b?P+="["+b+"]":P+="."+b,typeof _=="object"?h.push.apply(h,x(P,_)):h.push([P,_])}return h}function y(T){switch(T){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var c=T.indexOf("vec");if(0<=c&&c<=1&&T.length===4+c){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new n("","Invalid data type");return T.charAt(0)==="b"?a(h,!1):a(h,0)}else if(T.indexOf("mat")===0&&T.length===4){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+T);return a(h*h,0)}else throw new n("","Unknown uniform data type for "+name+": "+T)}}function S(T,c,h){if(typeof h=="object"){var b=k(h);Object.defineProperty(T,c,{get:o(b),set:l(h),enumerable:!0,configurable:!1})}else m[h]?Object.defineProperty(T,c,{get:w(h),set:l(h),enumerable:!0,configurable:!1}):T[c]=y(g[h].type)}function k(T){var c;if(Array.isArray(T)){c=new Array(T.length);for(var h=0;h<T.length;++h)S(c,h,T[h])}else{c={};for(var b in T)S(c,b,T[b])}return c}var M=i(g,!0);return{get:o(k(M)),set:l(M),enumerable:!0,configurable:!0}}},3349:function(t){function e(){return function(s,f,v,g,m,w){var l=s[0],x=v[0],y=[0],S=x;g|=0;var k=0,M=x;for(k=0;k<l;++k){{var T=f[g]-w,c=f[g+S]-w;T>=0!=c>=0&&m.push(y[0]+.5+.5*(T+c)/(T-c))}g+=M,++y[0]}}}function r(){return e()}var i=r;function n(s){var f={};return function(v,g,m){var w=v.dtype,l=v.order,x=[w,l.join()].join(),y=f[x];return y||(f[x]=y=s([w,l])),y(v.shape.slice(0),v.data,v.stride,v.offset|0,g,m)}}function o(s){return n(i.bind(void 0,s))}function a(s){return o({funcName:s.funcName})}t.exports=a({funcName:"zeroCrossings"})},3352:function(t,e,r){var i=r(2478),n=0,o=1,a=2;t.exports=b;function s(_,P,L,D,B){this.mid=_,this.left=P,this.right=L,this.leftPoints=D,this.rightPoints=B,this.count=(P?P.count:0)+(L?L.count:0)+D.length}var f=s.prototype;function v(_,P){_.mid=P.mid,_.left=P.left,_.right=P.right,_.leftPoints=P.leftPoints,_.rightPoints=P.rightPoints,_.count=P.count}function g(_,P){var L=T(P);_.mid=L.mid,_.left=L.left,_.right=L.right,_.leftPoints=L.leftPoints,_.rightPoints=L.rightPoints,_.count=L.count}function m(_,P){var L=_.intervals([]);L.push(P),g(_,L)}function w(_,P){var L=_.intervals([]),D=L.indexOf(P);return D<0?n:(L.splice(D,1),g(_,L),o)}f.intervals=function(_){return _.push.apply(_,this.leftPoints),this.left&&this.left.intervals(_),this.right&&this.right.intervals(_),_},f.insert=function(_){var P=this.count-this.leftPoints.length;if(this.count+=1,_[1]<this.mid)this.left?4*(this.left.count+1)>3*(P+1)?m(this,_):this.left.insert(_):this.left=T([_]);else if(_[0]>this.mid)this.right?4*(this.right.count+1)>3*(P+1)?m(this,_):this.right.insert(_):this.right=T([_]);else{var L=i.ge(this.leftPoints,_,k),D=i.ge(this.rightPoints,_,M);this.leftPoints.splice(L,0,_),this.rightPoints.splice(D,0,_)}},f.remove=function(_){var P=this.count-this.leftPoints;if(_[1]<this.mid){if(!this.left)return n;var L=this.right?this.right.count:0;if(4*L>3*(P-1))return w(this,_);var D=this.left.remove(_);return D===a?(this.left=null,this.count-=1,o):(D===o&&(this.count-=1),D)}else if(_[0]>this.mid){if(!this.right)return n;var B=this.left?this.left.count:0;if(4*B>3*(P-1))return w(this,_);var D=this.right.remove(_);return D===a?(this.right=null,this.count-=1,o):(D===o&&(this.count-=1),D)}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,I=this.left;I.right;)R=I,I=I.right;if(R===this)I.right=this.right;else{var F=this.left,D=this.right;R.count-=I.count,R.right=I.left,I.left=F,I.right=D}v(this,I),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,_,k);F<this.leftPoints.length&&this.leftPoints[F][0]===_[0];++F)if(this.leftPoints[F]===_){this.count-=1,this.leftPoints.splice(F,1);for(var D=i.ge(this.rightPoints,_,M);D<this.rightPoints.length&&this.rightPoints[D][1]===_[1];++D)if(this.rightPoints[D]===_)return this.rightPoints.splice(D,1),o}return n}};function l(_,P,L){for(var D=0;D<_.length&&_[D][0]<=P;++D){var B=L(_[D]);if(B)return B}}function x(_,P,L){for(var D=_.length-1;D>=0&&_[D][1]>=P;--D){var B=L(_[D]);if(B)return B}}function y(_,P){for(var L=0;L<_.length;++L){var D=P(_[L]);if(D)return D}}f.queryPoint=function(_,P){if(_<this.mid){if(this.left){var L=this.left.queryPoint(_,P);if(L)return L}return l(this.leftPoints,_,P)}else if(_>this.mid){if(this.right){var L=this.right.queryPoint(_,P);if(L)return L}return x(this.rightPoints,_,P)}else return y(this.leftPoints,P)},f.queryInterval=function(_,P,L){if(_<this.mid&&this.left){var D=this.left.queryInterval(_,P,L);if(D)return D}if(P>this.mid&&this.right){var D=this.right.queryInterval(_,P,L);if(D)return D}return P<this.mid?l(this.leftPoints,P,L):_>this.mid?x(this.rightPoints,_,L):y(this.leftPoints,L)};function S(_,P){return _-P}function k(_,P){var L=_[0]-P[0];return L||_[1]-P[1]}function M(_,P){var L=_[1]-P[1];return L||_[0]-P[0]}function T(_){if(_.length===0)return null;for(var P=[],L=0;L<_.length;++L)P.push(_[L][0],_[L][1]);P.sort(S);for(var D=P[P.length>>1],B=[],R=[],I=[],L=0;L<_.length;++L){var F=_[L];F[1]<D?B.push(F):D<F[0]?R.push(F):I.push(F)}var N=I,j=I.slice();return N.sort(k),j.sort(M),new s(D,T(B),T(R),N,j)}function c(_){this.root=_}var h=c.prototype;h.insert=function(_){this.root?this.root.insert(_):this.root=new s(_[0],null,null,[_],[_])},h.remove=function(_){if(this.root){var P=this.root.remove(_);return P===a&&(this.root=null),P!==n}return!1},h.queryPoint=function(_,P){if(this.root)return this.root.queryPoint(_,P)},h.queryInterval=function(_,P,L){if(_<=P&&this.root)return this.root.queryInterval(_,P,L)},Object.defineProperty(h,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(h,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function b(_){return!_||_.length===0?new c(null):new c(T(_))}},3387:function(t,e,r){var i;(function(){var n={not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,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(g){return s(v(g),arguments)}function a(g,m){return o.apply(null,[g].concat(m||[]))}function s(g,m){var w=1,l=g.length,x,y="",S,k,M,T,c,h,b,_;for(S=0;S<l;S++)if(typeof g[S]=="string")y+=g[S];else if(typeof g[S]=="object"){if(M=g[S],M.keys)for(x=m[w],k=0;k<M.keys.length;k++){if(x==null)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',M.keys[k],M.keys[k-1]));x=x[M.keys[k]]}else M.param_no?x=m[M.param_no]:x=m[w++];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)&&(b=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)?y+=x:(n.number.test(M.type)&&(!b||M.sign)?(_=b?"+":"-",x=x.toString().replace(n.sign,"")):_="",c=M.pad_char?M.pad_char==="0"?"0":M.pad_char.charAt(1):" ",h=M.width-(_+x).length,T=M.width&&h>0?c.repeat(h):"",y+=M.align?_+x+T:c==="0"?_+T+x:T+_+x)}return y}var f=Object.create(null);function v(g){if(f[g])return f[g];for(var m=g,w,l=[],x=0;m;){if((w=n.text.exec(m))!==null)l.push(w[0]);else if((w=n.modulo.exec(m))!==null)l.push("%");else if((w=n.placeholder.exec(m))!==null){if(w[2]){x|=1;var y=[],S=w[2],k=[];if((k=n.key.exec(S))!==null)for(y.push(k[1]);(S=S.substring(k[0].length))!=="";)if((k=n.key_access.exec(S))!==null)y.push(k[1]);else if((k=n.index_access.exec(S))!==null)y.push(k[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");w[2]=y}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:w[0],param_no:w[1],keys:w[2],sign:w[3],pad_char:w[4],align:w[5],width:w[6],precision:w[7],type:w[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");m=m.substring(w[0].length)}return f[g]=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))})()},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}},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"}])}},3502:function(t,e,r){t.exports=o;var i=r(5995),n=r(9127);function o(a,s){return n(i(a,s))}},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"])},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}},3545:function(t,e,r){t.exports=s;var i=r(8105),n=i("lo<p0"),o=8;function a(f,v,g,m,w,l){for(var x=2*f,y=x*(g+1)+v,S=g+1;S<m;++S,y+=x)for(var k=w[y],M=S,T=x*(S-1);M>g&&w[T+v]>k;--M,T-=x){for(var c=T,h=T+x,b=0;b<x;++b,++c,++h){var _=w[c];w[c]=w[h],w[h]=_}var P=l[M];l[M]=l[M-1],l[M-1]=P}}function s(f,v,g,m,w,l){if(m<=g+1)return g;for(var x=g,y=m,S=m+g>>>1,k=2*f,M=S,T=w[k*S+v];x<y;){if(y-x<o){a(f,v,x,y,w,l),T=w[k*S+v];break}var c=y-x,h=Math.random()*c+x|0,b=w[k*h+v],_=Math.random()*c+x|0,P=w[k*_+v],L=Math.random()*c+x|0,D=w[k*L+v];b<=P?D>=P?(M=_,T=P):b>=D?(M=h,T=b):(M=L,T=D):P>=D?(M=_,T=P):D>=b?(M=h,T=b):(M=L,T=D);for(var B=k*(y-1),R=k*M,I=0;I<k;++I,++B,++R){var F=w[B];w[B]=w[R],w[R]=F}var N=l[y-1];l[y-1]=l[M],l[M]=N,M=n(f,v,x,y-1,w,l,T);for(var B=k*(y-1),R=k*M,I=0;I<k;++I,++B,++R){var F=w[B];w[B]=w[R],w[R]=F}var N=l[y-1];if(l[y-1]=l[M],l[M]=N,S<M){for(y=M-1;x<y&&w[k*(y-1)+v]===T;)y-=1;y+=1}else if(M<S)for(x=M+1;x<y&&w[k*x+v]===T;)x+=1;else break}return n(f,v,g,S,w,l,w[k*S+v])}},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}},3589:function(t,e,r){t.exports=m;var i=r(2260),n=r(1888),o=r(9618),a=r(8828).nextPow2,s=function(w,l,x){for(var y=1e8,S=-1,k=-1,M=w.shape[0],T=w.shape[1],c=0;c<M;c++)for(var h=0;h<T;h++){var b=w.get(c,h,0),_=w.get(c,h,1),P=w.get(c,h,2),L=w.get(c,h,3);if(b<255||_<255||P<255||L<255){var D=l-c,B=x-h,R=D*D+B*B;R<y&&(y=R,S=c,k=h)}}return[S,k,y]};function f(w,l,x,y,S){this.coord=[w,l],this.id=x,this.value=y,this.distance=S}function v(w,l,x){this.gl=w,this.fbo=l,this.buffer=x,this._readTimeout=null;var y=this;this._readCallback=function(){y.gl&&(l.bind(),w.readPixels(0,0,l.shape[0],l.shape[1],w.RGBA,w.UNSIGNED_BYTE,y.buffer),y._readTimeout=null)}}var g=v.prototype;Object.defineProperty(g,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(w){if(this.gl){this.fbo.shape=w;var l=this.fbo.shape[0],x=this.fbo.shape[1];if(x*l*4>this.buffer.length){n.free(this.buffer);for(var y=this.buffer=n.mallocUint8(a(x*l*4)),S=0;S<x*l*4;++S)y[S]=255}return w}}}),g.begin=function(){var w=this.gl;this.shape,w&&(this.fbo.bind(),w.clearColor(1,1,1,1),w.clear(w.COLOR_BUFFER_BIT|w.DEPTH_BUFFER_BIT))},g.end=function(){var w=this.gl;w&&(w.bindFramebuffer(w.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},g.query=function(w,l,x){if(!this.gl)return null;var y=this.fbo.shape.slice();w=w|0,l=l|0,typeof x!="number"&&(x=1);var S=Math.min(Math.max(w-x,0),y[0])|0,k=Math.min(Math.max(w+x,0),y[0])|0,M=Math.min(Math.max(l-x,0),y[1])|0,T=Math.min(Math.max(l+x,0),y[1])|0;if(k<=S||T<=M)return null;var c=[k-S,T-M],h=o(this.buffer,[c[0],c[1],4],[4,y[0]*4,1],4*(S+y[0]*M)),b=s(h.hi(c[0],c[1],1),x,x),_=b[0],P=b[1];if(_<0||Math.pow(this.radius,2)<b[2])return null;var L=h.get(_,P,0),D=h.get(_,P,1),B=h.get(_,P,2),R=h.get(_,P,3);return new f(_+S|0,P+M|0,L,[D,B,R],Math.sqrt(b[2]))},g.dispose=function(){this.gl&&(this.fbo.dispose(),n.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))};function m(w,l){var x=l[0],y=l[1],S={},k=i(w,x,y,S),M=n.mallocUint8(x*y*4);return new v(w,k,M)}},3628:function(t,e,r){var i=r(1338),n=r(727);function o(f,v){for(var g=0,m=f.length,w=0;w<m;++w)g+=f[w]*v[w];return g}function a(f){var v=f.length;if(v===0)return[];f[0].length;var g=i([f.length+1,f.length+1],1),m=i([f.length+1],1);g[v][v]=0;for(var w=0;w<v;++w){for(var l=0;l<=w;++l)g[l][w]=g[w][l]=2*o(f[w],f[l]);m[w]=o(f[w],f[w])}for(var x=n(g,m),y=0,S=x[v+1],w=0;w<S.length;++w)y+=S[w];for(var k=new Array(v),w=0;w<v;++w){for(var S=x[w],M=0,l=0;l<S.length;++l)M+=S[l];k[w]=M/y}return k}function s(f){if(f.length===0)return[];for(var v=f[0].length,g=i([v]),m=a(f),w=0;w<f.length;++w)for(var l=0;l<v;++l)g[l]+=f[w][l]*m[w];return g}s.barycenetric=a,t.exports=s},3637:function(t,e,r){t.exports=m;var i=r(6504),n=r(8697),o=r(5572),a=r(7721),s=r(544),f=r(2653),v=r(8987);function g(w,l){return o(i(w[0],l[1]),i(w[1],l[0]))}function m(w,l,x,y){var S=s(l,w),k=s(y,x),M=g(S,k);if(a(M)===0)return null;var T=s(w,x),c=g(k,T),h=n(c,M),b=v(S,h),_=f(w,b);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]}]}},3711:function(t,e,r){t.exports=v;var i=r(2640),n=r(781),o={"2d":function(g,m,w){var l=g({order:m,scalarArguments:3,getters:w==="generic"?[0]:void 0,phase:function(x,y,S,k){return x>k|0},vertex:function(x,y,S,k,M,T,c,h,b,_,P,L,D){var B=(c<<0)+(h<<1)+(b<<2)+(_<<3)|0;if(!(B===0||B===15))switch(B){case 0:P.push([x-.5,y-.5]);break;case 1:P.push([x-.25-.25*(k+S-2*D)/(S-k),y-.25-.25*(M+S-2*D)/(S-M)]);break;case 2:P.push([x-.75-.25*(-k-S+2*D)/(k-S),y-.25-.25*(T+k-2*D)/(k-T)]);break;case 3:P.push([x-.5,y-.5-.5*(M+S+T+k-4*D)/(S-M+k-T)]);break;case 4:P.push([x-.25-.25*(T+M-2*D)/(M-T),y-.75-.25*(-M-S+2*D)/(M-S)]);break;case 5:P.push([x-.5-.5*(k+S+T+M-4*D)/(S-k+M-T),y-.5]);break;case 6:P.push([x-.5-.25*(-k-S+T+M)/(k-S+M-T),y-.5-.25*(-M-S+T+k)/(M-S+k-T)]);break;case 7:P.push([x-.75-.25*(T+M-2*D)/(M-T),y-.75-.25*(T+k-2*D)/(k-T)]);break;case 8:P.push([x-.75-.25*(-T-M+2*D)/(T-M),y-.75-.25*(-T-k+2*D)/(T-k)]);break;case 9:P.push([x-.5-.25*(k+S+-T-M)/(S-k+T-M),y-.5-.25*(M+S+-T-k)/(S-M+T-k)]);break;case 10:P.push([x-.5-.5*(-k-S+-T-M+4*D)/(k-S+T-M),y-.5]);break;case 11:P.push([x-.25-.25*(-T-M+2*D)/(T-M),y-.75-.25*(M+S-2*D)/(S-M)]);break;case 12:P.push([x-.5,y-.5-.5*(-M-S+-T-k+4*D)/(M-S+T-k)]);break;case 13:P.push([x-.75-.25*(k+S-2*D)/(S-k),y-.25-.25*(-T-k+2*D)/(T-k)]);break;case 14:P.push([x-.25-.25*(-k-S+2*D)/(k-S),y-.25-.25*(-M-S+2*D)/(M-S)]);break;case 15:P.push([x-.5,y-.5]);break}},cell:function(x,y,S,k,M,T,c,h,b){M?h.push([x,y]):h.push([y,x])}});return function(x,y){var S=[],k=[];return l(x,S,k,y),{positions:S,cells:k}}}};function a(g,m){var w=g.length+"d",l=o[w];if(l)return l(i,g,m)}function s(g,m){for(var w=n(g,m),l=w.length,x=new Array(l),y=new Array(l),S=0;S<l;++S)x[S]=[w[S]],y[S]=[S];return{positions:x,cells:y}}var f={};function v(g,x){if(g.dimension<=0)return{positions:[],cells:[]};if(g.dimension===1)return s(g,x);var w=g.order.join()+"-"+g.dtype,l=f[w],x=+x||0;return l||(l=f[w]=a(g.order,g.dtype)),l(g,x)}},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]}},3778:function(t,e){e.read=function(r,i,n,o,a){var s,f,v=a*8-o-1,g=(1<<v)-1,m=g>>1,w=-7,l=n?a-1:0,x=n?-1:1,y=r[i+l];for(l+=x,s=y&(1<<-w)-1,y>>=-w,w+=v;w>0;s=s*256+r[i+l],l+=x,w-=8);for(f=s&(1<<-w)-1,s>>=-w,w+=o;w>0;f=f*256+r[i+l],l+=x,w-=8);if(s===0)s=1-m;else{if(s===g)return f?NaN:(y?-1:1)*(1/0);f=f+Math.pow(2,o),s=s-m}return(y?-1:1)*f*Math.pow(2,s-o)},e.write=function(r,i,n,o,a,s){var f,v,g,m=s*8-a-1,w=(1<<m)-1,l=w>>1,x=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=o?0:s-1,S=o?1:-1,k=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(v=isNaN(i)?1:0,f=w):(f=Math.floor(Math.log(i)/Math.LN2),i*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+l>=1?i+=x/g:i+=x*Math.pow(2,1-l),i*g>=2&&(f++,g/=2),f+l>=w?(v=0,f=w):f+l>=1?(v=(i*g-1)*Math.pow(2,a),f=f+l):(v=i*Math.pow(2,l-1)*Math.pow(2,a),f=0));a>=8;r[n+y]=v&255,y+=S,v/=256,a-=8);for(f=f<<a|v,m+=a;m>0;r[n+y]=f&255,y+=S,f/=256,m-=8);r[n+y-S]|=k*128}},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)}},3837:function(t,e,r){t.exports=L;var i=r(4935),n=r(501),o=r(5304),a=r(6429),s=r(6444),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),v=ArrayBuffer,g=DataView;function m(D){return v.isView(D)&&!(D instanceof g)}function w(D){return Array.isArray(D)||m(D)}function l(D,B){return D[0]=B[0],D[1]=B[1],D[2]=B[2],D}function x(D){this.gl=D,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(D)}var y=x.prototype;y.update=function(D){D=D||{};function B(Q,ut,J){if(J in D){var q=D[J],it=this[J],nt;(Q?w(q)&&w(q[0]):w(q))?this[J]=nt=[ut(q[0]),ut(q[1]),ut(q[2])]:this[J]=nt=[ut(q),ut(q),ut(q)];for(var dt=0;dt<3;++dt)if(nt[dt]!==it[dt])return!0}return!1}var R=B.bind(this,!1,Number),I=B.bind(this,!1,Boolean),F=B.bind(this,!1,String),N=B.bind(this,!0,function(Q){if(w(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 D)for(var ct=D.bounds,st=0;st<2;++st)for(var et=0;et<3;++et)ct[st][et]!==this.bounds[st][et]&&(rt=!0),this.bounds[st][et]=ct[st][et];if("ticks"in D){j=D.ticks,G=!0,this.autoTicks=!1;for(var st=0;st<3;++st)this.tickSpacing[st]=0}else R("tickSpacing")&&(this.autoTicks=!0,rt=!0);if(this._firstInit&&("ticks"in D||"tickSpacing"in D||(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 st=0;st<3;++st)j[st].sort(function(ut,J){return ut.x-J.x});s.equal(j,this.ticks)?G=!1:this.ticks=j}I("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 K=F("labels");F("labelFont")&&(K=!0),F("labelFontStyle")&&(K=!0),F("labelFontWeight")&&(K=!0),F("labelFontVariant")&&(K=!0),I("labelEnable"),R("labelSize"),R("labelPad"),N("labelColor"),I("lineEnable"),I("lineMirror"),R("lineWidth"),N("lineColor"),I("lineTickEnable"),I("lineTickMirror"),R("lineTickLength"),R("lineTickWidth"),N("lineTickColor"),I("gridEnable"),R("gridWidth"),N("gridColor"),I("zeroEnable"),N("zeroLineColor"),R("zeroLineWidth"),I("backgroundEnable"),N("backgroundColor");var ot=[{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]}],X=[{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&&(K||G)&&this._text.update(this.bounds,this.labels,ot,this.ticks,X):this._text=i(this.gl,this.bounds,this.labels,ot,this.ticks,X),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 k=[new S,new S,new S];function M(D,B,R,I,F){for(var N=D.primalOffset,j=D.primalMinor,G=D.mirrorOffset,rt=D.mirrorMinor,ct=I[B],st=0;st<3;++st)if(B!==st){var et=N,K=G,ot=j,X=rt;ct&1<<st&&(et=G,K=N,ot=rt,X=j),et[st]=R[0][st],K[st]=R[1][st],F[st]>0?(ot[st]=-1,X[st]=0):(ot[st]=0,X[st]=1)}}var T=[0,0,0],c={model:f,view:f,projection:f,_ortho:!1};y.isOpaque=function(){return!0},y.isTransparent=function(){return!1},y.drawTransparent=function(D){};var h=0,b=[0,0,0],_=[0,0,0],P=[0,0,0];y.draw=function(D){D=D||c;for(var B=this.gl,R=D.model||f,I=D.view||f,F=D.projection||f,N=this.bounds,j=D._ortho||!1,G=a(R,I,F,N,j),rt=G.cubeEdges,ct=G.axis,st=I[12],et=I[13],K=I[14],ot=I[15],X=j?2:1,Q=X*this.pixelRatio*(F[3]*st+F[7]*et+F[11]*K+F[15]*ot)/B.drawingBufferHeight,ut=0;ut<3;++ut)this.lastCubeProps.cubeEdges[ut]=rt[ut],this.lastCubeProps.axis[ut]=ct[ut];for(var J=k,ut=0;ut<3;++ut)M(k[ut],ut,this.bounds,rt,ct);for(var B=this.gl,q=T,ut=0;ut<3;++ut)this.backgroundEnable[ut]?q[ut]=ct[ut]:q[ut]=0;this._background.draw(R,I,F,N,q,this.backgroundColor),this._lines.bind(R,I,F,this);for(var ut=0;ut<3;++ut){var it=[0,0,0];ct[ut]>0?it[ut]=N[1][ut]:it[ut]=N[0][ut];for(var nt=0;nt<2;++nt){var dt=(ut+1+nt)%3,Tt=(ut+1+(nt^1))%3;this.gridEnable[dt]&&this._lines.drawGrid(dt,Tt,this.bounds,it,this.gridColor[dt],this.gridWidth[dt]*this.pixelRatio)}for(var nt=0;nt<2;++nt){var dt=(ut+1+nt)%3,Tt=(ut+1+(nt^1))%3;this.zeroEnable[Tt]&&Math.min(N[0][Tt],N[1][Tt])<=0&&Math.max(N[0][Tt],N[1][Tt])>=0&&this._lines.drawZero(dt,Tt,this.bounds,it,this.zeroLineColor[Tt],this.zeroLineWidth[Tt]*this.pixelRatio)}}for(var ut=0;ut<3;++ut){this.lineEnable[ut]&&this._lines.drawAxisLine(ut,this.bounds,J[ut].primalOffset,this.lineColor[ut],this.lineWidth[ut]*this.pixelRatio),this.lineMirror[ut]&&this._lines.drawAxisLine(ut,this.bounds,J[ut].mirrorOffset,this.lineColor[ut],this.lineWidth[ut]*this.pixelRatio);for(var wt=l(b,J[ut].primalMinor),It=l(_,J[ut].mirrorMinor),Ct=this.lineTickLength,nt=0;nt<3;++nt){var Nt=Q/R[5*nt];wt[nt]*=Ct[nt]*Nt,It[nt]*=Ct[nt]*Nt}this.lineTickEnable[ut]&&this._lines.drawAxisTicks(ut,J[ut].primalOffset,wt,this.lineTickColor[ut],this.lineTickWidth[ut]*this.pixelRatio),this.lineTickMirror[ut]&&this._lines.drawAxisTicks(ut,J[ut].mirrorOffset,It,this.lineTickColor[ut],this.lineTickWidth[ut]*this.pixelRatio)}this._lines.unbind(),this._text.bind(R,I,F,this.pixelRatio);var ee,Jt=.5,te,Kt;function mt(ue){Kt=[0,0,0],Kt[ue]=1}function bt(ue,Me,Ce){var We=(ue+1)%3,qe=(ue+2)%3,vr=Me[We],_r=Me[qe],er=Ce[We],Mr=Ce[qe];if(vr>0&&Mr>0){mt(We);return}else if(vr>0&&Mr<0){mt(We);return}else if(vr<0&&Mr>0){mt(We);return}else if(vr<0&&Mr<0){mt(We);return}else if(_r>0&&er>0){mt(qe);return}else if(_r>0&&er<0){mt(qe);return}else if(_r<0&&er>0){mt(qe);return}else if(_r<0&&er<0){mt(qe);return}}for(var ut=0;ut<3;++ut){for(var vt=J[ut].primalMinor,Ut=J[ut].mirrorMinor,re=l(P,J[ut].primalOffset),nt=0;nt<3;++nt)this.lineTickEnable[ut]&&(re[nt]+=Q*vt[nt]*Math.max(this.lineTickLength[nt],0)/R[5*nt]);var Zt=[0,0,0];if(Zt[ut]=1,this.tickEnable[ut]){this.tickAngle[ut]===-3600?(this.tickAngle[ut]=0,this.tickAlign[ut]="auto"):this.tickAlign[ut]=-1,te=1,ee=[this.tickAlign[ut],Jt,te],ee[0]==="auto"?ee[0]=h:ee[0]=parseInt(""+ee[0]),Kt=[0,0,0],bt(ut,vt,Ut);for(var nt=0;nt<3;++nt)re[nt]+=Q*vt[nt]*this.tickPad[nt]/R[5*nt];this._text.drawTicks(ut,this.tickSize[ut],this.tickAngle[ut],re,this.tickColor[ut],Zt,Kt,ee)}if(this.labelEnable[ut]){te=0,Kt=[0,0,0],this.labels[ut].length>4&&(mt(ut),te=1),ee=[this.labelAlign[ut],Jt,te],ee[0]==="auto"?ee[0]=h:ee[0]=parseInt(""+ee[0]);for(var nt=0;nt<3;++nt)re[nt]+=Q*vt[nt]*this.labelPad[nt]/R[5*nt];re[ut]+=.5*(N[0][ut]+N[1][ut]),this._text.drawLabel(ut,this.labelSize[ut],this.labelAngle[ut],re,this.labelColor[ut],[0,0,0],Kt,ee)}}this._text.unbind()},y.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function L(D,B){var R=new x(D);return R.update(B),R}},3840:function(t){t.exports=k;var e=0,r=1;function i(M,T,c,h,b,_){this._color=M,this.key=T,this.value=c,this.left=h,this.right=b,this._count=_}function n(M){return new i(M._color,M.key,M.value,M.left,M.right,M._count)}function o(M,T){return new i(M,T.key,T.value,T.left,T.right,T._count)}function a(M){M._count=1+(M.left?M.left._count:0)+(M.right?M.right._count:0)}function s(M,T){this._compare=M,this.root=T}var f=s.prototype;Object.defineProperty(f,"keys",{get:function(){var M=[];return this.forEach(function(T,c){M.push(T)}),M}}),Object.defineProperty(f,"values",{get:function(){var M=[];return this.forEach(function(T,c){M.push(c)}),M}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(M,T){for(var c=this._compare,h=this.root,b=[],_=[];h;){var P=c(M,h.key);b.push(h),_.push(P),P<=0?h=h.left:h=h.right}b.push(new i(e,M,T,null,null,1));for(var L=b.length-2;L>=0;--L){var h=b[L];_[L]<=0?b[L]=new i(h._color,h.key,h.value,b[L+1],h.right,h._count+1):b[L]=new i(h._color,h.key,h.value,h.left,b[L+1],h._count+1)}for(var L=b.length-1;L>1;--L){var D=b[L-1],h=b[L];if(D._color===r||h._color===r)break;var B=b[L-2];if(B.left===D)if(D.left===h){var R=B.right;if(R&&R._color===e)D._color=r,B.right=o(r,R),B._color=e,L-=1;else{if(B._color=e,B.left=D.right,D._color=r,D.right=B,b[L-2]=D,b[L-1]=h,a(B),a(D),L>=3){var I=b[L-3];I.left===B?I.left=D:I.right=D}break}}else{var R=B.right;if(R&&R._color===e)D._color=r,B.right=o(r,R),B._color=e,L-=1;else{if(D.right=h.left,B._color=e,B.left=h.right,h._color=r,h.left=D,h.right=B,b[L-2]=h,b[L-1]=D,a(B),a(D),a(h),L>=3){var I=b[L-3];I.left===B?I.left=h:I.right=h}break}}else if(D.right===h){var R=B.left;if(R&&R._color===e)D._color=r,B.left=o(r,R),B._color=e,L-=1;else{if(B._color=e,B.right=D.left,D._color=r,D.left=B,b[L-2]=D,b[L-1]=h,a(B),a(D),L>=3){var I=b[L-3];I.right===B?I.right=D:I.left=D}break}}else{var R=B.left;if(R&&R._color===e)D._color=r,B.left=o(r,R),B._color=e,L-=1;else{if(D.left=h.right,B._color=e,B.right=h.left,h._color=r,h.right=D,h.left=B,b[L-2]=h,b[L-1]=D,a(B),a(D),a(h),L>=3){var I=b[L-3];I.right===B?I.right=h:I.left=h}break}}}return b[0]._color=r,new s(c,b[0])};function v(M,T){if(T.left){var c=v(M,T.left);if(c)return c}var c=M(T.key,T.value);if(c)return c;if(T.right)return v(M,T.right)}function g(M,T,c,h){var b=T(M,h.key);if(b<=0){if(h.left){var _=g(M,T,c,h.left);if(_)return _}var _=c(h.key,h.value);if(_)return _}if(h.right)return g(M,T,c,h.right)}function m(M,T,c,h,b){var _=c(M,b.key),P=c(T,b.key),L;if(_<=0&&(b.left&&(L=m(M,T,c,h,b.left),L)||P>0&&(L=h(b.key,b.value),L)))return L;if(P>0&&b.right)return m(M,T,c,h,b.right)}f.forEach=function(M,T,c){if(this.root)switch(arguments.length){case 1:return v(M,this.root);case 2:return g(T,this._compare,M,this.root);case 3:return this._compare(T,c)>=0?void 0:m(T,c,this._compare,M,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var M=[],T=this.root;T;)M.push(T),T=T.left;return new w(this,M)}}),Object.defineProperty(f,"end",{get:function(){for(var M=[],T=this.root;T;)M.push(T),T=T.right;return new w(this,M)}}),f.at=function(M){if(M<0)return new w(this,[]);for(var T=this.root,c=[];;){if(c.push(T),T.left){if(M<T.left._count){T=T.left;continue}M-=T.left._count}if(!M)return new w(this,c);if(M-=1,T.right){if(M>=T.right._count)break;T=T.right}else break}return new w(this,[])},f.ge=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_<=0&&(b=h.length),_<=0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.gt=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_<0&&(b=h.length),_<0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.lt=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_>0&&(b=h.length),_<=0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.le=function(M){for(var T=this._compare,c=this.root,h=[],b=0;c;){var _=T(M,c.key);h.push(c),_>=0&&(b=h.length),_<0?c=c.left:c=c.right}return h.length=b,new w(this,h)},f.find=function(M){for(var T=this._compare,c=this.root,h=[];c;){var b=T(M,c.key);if(h.push(c),b===0)return new w(this,h);b<=0?c=c.left:c=c.right}return new w(this,[])},f.remove=function(M){var T=this.find(M);return T?T.remove():this},f.get=function(M){for(var T=this._compare,c=this.root;c;){var h=T(M,c.key);if(h===0)return c.value;h<=0?c=c.left:c=c.right}};function w(M,T){this.tree=M,this._stack=T}var l=w.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 w(this.tree,this._stack.slice())};function x(M,T){M.key=T.key,M.value=T.value,M.left=T.left,M.right=T.right,M._color=T._color,M._count=T._count}function y(M){for(var T,c,h,b,_=M.length-1;_>=0;--_){if(T=M[_],_===0){T._color=r;return}if(c=M[_-1],c.left===T){if(h=c.right,h.right&&h.right._color===e){if(h=c.right=n(h),b=h.right=n(h.right),c.right=h.left,h.left=c,h.right=b,h._color=c._color,T._color=r,c._color=r,b._color=r,a(c),a(h),_>1){var P=M[_-2];P.left===c?P.left=h:P.right=h}M[_-1]=h;return}else if(h.left&&h.left._color===e){if(h=c.right=n(h),b=h.left=n(h.left),c.right=b.left,h.left=b.right,b.left=c,b.right=h,b._color=c._color,c._color=r,h._color=r,T._color=r,a(c),a(h),a(b),_>1){var P=M[_-2];P.left===c?P.left=b:P.right=b}M[_-1]=b;return}if(h._color===r)if(c._color===e){c._color=r,c.right=o(e,h);return}else{c.right=o(e,h);continue}else{if(h=n(h),c.right=h.left,h.left=c,h._color=c._color,c._color=e,a(c),a(h),_>1){var P=M[_-2];P.left===c?P.left=h:P.right=h}M[_-1]=h,M[_]=c,_+1<M.length?M[_+1]=T:M.push(T),_=_+2}}else{if(h=c.left,h.left&&h.left._color===e){if(h=c.left=n(h),b=h.left=n(h.left),c.left=h.right,h.right=c,h.left=b,h._color=c._color,T._color=r,c._color=r,b._color=r,a(c),a(h),_>1){var P=M[_-2];P.right===c?P.right=h:P.left=h}M[_-1]=h;return}else if(h.right&&h.right._color===e){if(h=c.left=n(h),b=h.right=n(h.right),c.left=b.right,h.right=b.left,b.right=c,b.left=h,b._color=c._color,c._color=r,h._color=r,T._color=r,a(c),a(h),a(b),_>1){var P=M[_-2];P.right===c?P.right=b:P.left=b}M[_-1]=b;return}if(h._color===r)if(c._color===e){c._color=r,c.left=o(e,h);return}else{c.left=o(e,h);continue}else{if(h=n(h),c.left=h.right,h.right=c,h._color=c._color,c._color=e,a(c),a(h),_>1){var P=M[_-2];P.right===c?P.right=h:P.left=h}M[_-1]=h,M[_]=c,_+1<M.length?M[_+1]=T:M.push(T),_=_+2}}}}l.remove=function(){var M=this._stack;if(M.length===0)return this.tree;var T=new Array(M.length),c=M[M.length-1];T[T.length-1]=new i(c._color,c.key,c.value,c.left,c.right,c._count);for(var h=M.length-2;h>=0;--h){var c=M[h];c.left===M[h+1]?T[h]=new i(c._color,c.key,c.value,T[h+1],c.right,c._count):T[h]=new i(c._color,c.key,c.value,c.left,T[h+1],c._count)}if(c=T[T.length-1],c.left&&c.right){var b=T.length;for(c=c.left;c.right;)T.push(c),c=c.right;var _=T[b-1];T.push(new i(c._color,_.key,_.value,c.left,c.right,c._count)),T[b-1].key=c.key,T[b-1].value=c.value;for(var h=T.length-2;h>=b;--h)c=T[h],T[h]=new i(c._color,c.key,c.value,c.left,T[h+1],c._count);T[b-1].left=T[b]}if(c=T[T.length-1],c._color===e){var P=T[T.length-2];P.left===c?P.left=null:P.right===c&&(P.right=null),T.pop();for(var h=0;h<T.length;++h)T[h]._count--;return new s(this.tree._compare,T[0])}else if(c.left||c.right){c.left?x(c,c.left):c.right&&x(c,c.right),c._color=r;for(var h=0;h<T.length-1;++h)T[h]._count--;return new s(this.tree._compare,T[0])}else{if(T.length===1)return new s(this.tree._compare,null);for(var h=0;h<T.length;++h)T[h]._count--;var L=T[T.length-2];y(T),L.left===c?L.left=null:L.right=null}return new s(this.tree._compare,T[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,T=this._stack;if(T.length===0){var c=this.tree.root;return c?c._count:0}else T[T.length-1].left&&(M=T[T.length-1].left._count);for(var h=T.length-2;h>=0;--h)T[h+1]===T[h].right&&(++M,T[h].left&&(M+=T[h].left._count));return M},enumerable:!0}),l.next=function(){var M=this._stack;if(M.length!==0){var T=M[M.length-1];if(T.right)for(T=T.right;T;)M.push(T),T=T.left;else for(M.pop();M.length>0&&M[M.length-1].right===T;)T=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 T=M.length-1;T>0;--T)if(M[T-1].left===M[T])return!0;return!1}}),l.update=function(M){var T=this._stack;if(T.length===0)throw new Error("Can't update empty node!");var c=new Array(T.length),h=T[T.length-1];c[c.length-1]=new i(h._color,h.key,M,h.left,h.right,h._count);for(var b=T.length-2;b>=0;--b)h=T[b],h.left===T[b+1]?c[b]=new i(h._color,h.key,h.value,c[b+1],h.right,h._count):c[b]=new i(h._color,h.key,h.value,h.left,c[b+1],h._count);return new s(this.tree._compare,c[0])},l.prev=function(){var M=this._stack;if(M.length!==0){var T=M[M.length-1];if(T.left)for(T=T.left;T;)M.push(T),T=T.right;else for(M.pop();M.length>0&&M[M.length-1].left===T;)T=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 T=M.length-1;T>0;--T)if(M[T-1].right===M[T])return!0;return!1}});function S(M,T){return M<T?-1:M>T?1:0}function k(M){return new s(M||S,null)}},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]))}},3952:function(t,e,r){t.exports=o;var i=r(3250);function n(a,s){for(var f=new Array(s+1),v=0;v<a.length;++v)f[v]=a[v];for(var v=0;v<=a.length;++v){for(var g=a.length;g<=s;++g){for(var m=new Array(s),w=0;w<s;++w)m[w]=Math.pow(g+1-v,w);f[g]=m}var l=i.apply(void 0,f);if(l)return!0}return!1}function o(a){var s=a.length;if(s===0)return[];if(s===1)return[0];for(var f=a[0].length,v=[a[0]],g=[0],m=1;m<s;++m){if(v.push(a[m]),!n(v,f)){v.pop();continue}if(g.push(m),g.length===f+1)return g}return g}},3990:function(t){t.exports=e;function e(r,i){return r[0]=i[0],r[1]=i[1],r[2]=i[2],r}},4008:function(t,e,r){t.exports=r(6690)},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 f=n(i.hi(a));return f>20?52:f+32}},4040:function(t){t.exports=e;function e(r,i,n,o,a,s,f){var v=1/(i-n),g=1/(o-a),m=1/(s-f);return r[0]=-2*v,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*m,r[11]=0,r[12]=(i+n)*v,r[13]=(a+o)*g,r[14]=(f+s)*m,r[15]=1,r}},4041:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=n[0],v=n[1],g=n[2],m=n[3],w=m*o+v*s-g*a,l=m*a+g*o-f*s,x=m*s+f*a-v*o,y=-f*o-v*a-g*s;return r[0]=w*m+y*-f+l*-g-x*-v,r[1]=l*m+y*-v+x*-f-w*-g,r[2]=x*m+y*-g+w*-v-l*-f,r[3]=i[3],r}},4081:function(t){t.exports=e;function e(r,i,n,o,a,s,f,v,g,m){var w=i+s+m;if(l>0){var l=Math.sqrt(w+1);r[0]=.5*(f-g)/l,r[1]=.5*(v-o)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var x=Math.max(i,s,m),l=Math.sqrt(2*x-w+1);i>=x?(r[0]=.5*l,r[1]=.5*(a+n)/l,r[2]=.5*(v+o)/l,r[3]=.5*(f-g)/l):s>=x?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(g+f)/l,r[3]=.5*(v-o)/l):(r[0]=.5*(o+v)/l,r[1]=.5*(f+g)/l,r[2]=.5*l,r[3]=.5*(n-a)/l)}return r}},4100:function(t,e,r){var i=r(4437),n=r(3837),o=r(5445),a=r(4449),s=r(3589),f=r(2260),v=r(7169),g=r(351),m=r(4772),w=r(4040),l=r(799),x=r(9216)({tablet:!0,featureDetect:!0});t.exports={createScene:T,createCamera:i};function y(){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(h,b){var _=null;try{_=h.getContext("webgl",b),_||(_=h.getContext("experimental-webgl",b))}catch{return null}return _}function k(h){var b=Math.round(Math.log(Math.abs(h))/Math.log(10));if(b<0){var _=Math.round(Math.pow(10,-b));return Math.ceil(h*_)/_}else if(b>0){var _=Math.round(Math.pow(10,b));return Math.ceil(h/_)*_}return Math.ceil(h)}function M(h){return typeof h=="boolean"?h:!0}function T(h){h=h||{},h.camera=h.camera||{};var b=h.canvas;if(!b)if(b=document.createElement("canvas"),h.container){var _=h.container;_.appendChild(b)}else document.body.appendChild(b);var P=h.gl;if(P||(h.glOptions&&(x=!!h.glOptions.preserveDrawingBuffer),P=S(b,h.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:x})),!P)throw new Error("webgl not supported");var L=h.bounds||[[-10,-10,-10],[10,10,10]],D=new y,B=f(P,P.drawingBufferWidth,P.drawingBufferHeight,{preferFloat:!x}),R=l(P),I=h.cameraObject&&h.cameraObject._ortho===!0||h.camera.projection&&h.camera.projection.type==="orthographic"||!1,F={eye:h.camera.eye||[2,0,0],center:h.camera.center||[0,0,0],up:h.camera.up||[0,1,0],zoomMin:h.camera.zoomMax||.1,zoomMax:h.camera.zoomMin||100,mode:h.camera.mode||"turntable",_ortho:I},N=h.axes||{},j=n(P,N);j.enable=!N.disable;var G=h.spikes||{},rt=a(P,G),ct=[],st=[],et=[],K=[],ot=!0,J=!0,X=new Array(16),Q=new Array(16),ut={view:null,projection:X,model:Q,_ortho:!1},J=!0,q=[P.drawingBufferWidth,P.drawingBufferHeight],it=h.cameraObject||i(b,F),nt={gl:P,contextLost:!1,pixelRatio:h.pixelRatio||1,canvas:b,selection:D,camera:it,axes:j,axesPixels:null,spikes:rt,bounds:L,objects:ct,shape:q,aspect:h.aspectRatio||[1,1,1],pickRadius:h.pickRadius||10,zNear:h.zNear||.01,zFar:h.zFar||1e3,fovy:h.fovy||Math.PI/4,clearColor:h.clearColor||[0,0,0,0],autoResize:M(h.autoResize),autoBounds:M(h.autoBounds),autoScale:!!h.autoScale,autoCenter:M(h.autoCenter),clipToBounds:M(h.clipToBounds),snapToData:!!h.snapToData,onselect:h.onselect||null,onrender:h.onrender||null,onclick:h.onclick||null,cameraParams:ut,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Kt){this.aspect[0]=Kt.x,this.aspect[1]=Kt.y,this.aspect[2]=Kt.z,J=!0},setBounds:function(Kt,mt){this.bounds[0][Kt]=mt.min,this.bounds[1][Kt]=mt.max},setClearColor:function(Kt){this.clearColor=Kt},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=[P.drawingBufferWidth/nt.pixelRatio|0,P.drawingBufferHeight/nt.pixelRatio|0];function Tt(){if(!nt._stopped&&nt.autoResize){var Kt=b.parentNode,mt=1,bt=1;Kt&&Kt!==document.body?(mt=Kt.clientWidth,bt=Kt.clientHeight):(mt=window.innerWidth,bt=window.innerHeight);var vt=Math.ceil(mt*nt.pixelRatio)|0,Ut=Math.ceil(bt*nt.pixelRatio)|0;if(vt!==b.width||Ut!==b.height){b.width=vt,b.height=Ut;var re=b.style;re.position=re.position||"absolute",re.left="0px",re.top="0px",re.width=mt+"px",re.height=bt+"px",ot=!0}}}nt.autoResize&&Tt(),window.addEventListener("resize",Tt);function wt(){for(var Kt=ct.length,mt=K.length,bt=0;bt<mt;++bt)et[bt]=0;t:for(var bt=0;bt<Kt;++bt){var vt=ct[bt],Ut=vt.pickSlots;if(!Ut){st[bt]=-1;continue}for(var re=0;re<mt;++re)if(et[re]+Ut<255){st[bt]=re,vt.setPickBase(et[re]+1),et[re]+=Ut;continue t}var Zt=s(P,q);st[bt]=mt,K.push(Zt),et.push(Ut),vt.setPickBase(1),mt+=1}for(;mt>0&&et[mt-1]===0;)et.pop(),K.pop().dispose()}nt.update=function(Kt){nt._stopped||(ot=!0,J=!0)},nt.add=function(Kt){nt._stopped||(Kt.axes=j,ct.push(Kt),st.push(-1),ot=!0,J=!0,wt())},nt.remove=function(Kt){if(!nt._stopped){var mt=ct.indexOf(Kt);mt<0||(ct.splice(mt,1),st.pop(),ot=!0,J=!0,wt())}},nt.dispose=function(){if(!nt._stopped&&(nt._stopped=!0,window.removeEventListener("resize",Tt),b.removeEventListener("webglcontextlost",It),nt.mouseListener.enabled=!1,!nt.contextLost)){j.dispose(),rt.dispose();for(var Kt=0;Kt<ct.length;++Kt)ct[Kt].dispose();B.dispose();for(var Kt=0;Kt<K.length;++Kt)K[Kt].dispose();R.dispose(),P=null,j=null,rt=null,ct=[]}},nt._mouseRotating=!1,nt._prevButtons=0,nt.enableMouseListeners=function(){nt.mouseListener=g(b,function(Kt,mt,bt){if(!nt._stopped){var vt=K.length,Ut=ct.length,re=D.object;D.distance=1/0,D.mouse[0]=mt,D.mouse[1]=bt,D.object=null,D.screen=null,D.dataCoordinate=D.dataPosition=null;var Zt=!1;if(Kt&&nt._prevButtons)nt._mouseRotating=!0;else{nt._mouseRotating&&(J=!0),nt._mouseRotating=!1;for(var ue=0;ue<vt;++ue){var Me=K[ue].query(mt,dt[1]-bt-1,nt.pickRadius);if(Me){if(Me.distance>D.distance)continue;for(var Ce=0;Ce<Ut;++Ce){var We=ct[Ce];if(st[Ce]===ue){var qe=We.pick(Me);qe&&(D.buttons=Kt,D.screen=Me.coord,D.distance=Me.distance,D.object=We,D.index=qe.distance,D.dataPosition=qe.position,D.dataCoordinate=qe.dataCoordinate,D.data=qe,Zt=!0)}}}}}re&&re!==D.object&&(re.highlight&&re.highlight(null),ot=!0),D.object&&(D.object.highlight&&D.object.highlight(D.data),ot=!0),Zt=Zt||D.object!==re,Zt&&nt.onselect&&nt.onselect(D),Kt&1&&!(nt._prevButtons&1)&&nt.onclick&&nt.onclick(D),nt._prevButtons=Kt}})};function It(){if(nt.contextLost)return!0;P.isContextLost()&&(nt.contextLost=!0,nt.mouseListener.enabled=!1,nt.selection.object=null,nt.oncontextloss&&nt.oncontextloss())}b.addEventListener("webglcontextlost",It);function Ct(){if(!It()){P.colorMask(!0,!0,!0,!0),P.depthMask(!0),P.disable(P.BLEND),P.enable(P.DEPTH_TEST),P.depthFunc(P.LEQUAL);for(var Kt=ct.length,mt=K.length,bt=0;bt<mt;++bt){var vt=K[bt];vt.shape=dt,vt.begin();for(var Ut=0;Ut<Kt;++Ut)if(st[Ut]===bt){var re=ct[Ut];re.drawPick&&(re.pixelRatio=1,re.drawPick(ut))}vt.end()}}}var Nt=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],ee=[Nt[0].slice(),Nt[1].slice()];function Jt(){if(!It()){Tt();var Kt=nt.camera.tick();ut.view=nt.camera.matrix,ot=ot||Kt,J=J||Kt,j.pixelRatio=nt.pixelRatio,rt.pixelRatio=nt.pixelRatio;var mt=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<mt;++Ut){var re=ct[Ut];re.pixelRatio=nt.pixelRatio,re.axes=nt.axes,ot=ot||!!re.dirty,J=J||!!re.dirty;var Zt=re.bounds;if(Zt)for(var ue=Zt[0],Me=Zt[1],Ce=0;Ce<3;++Ce)bt[Ce]=Math.min(bt[Ce],ue[Ce]),vt[Ce]=Math.max(vt[Ce],Me[Ce])}var We=nt.bounds;if(nt.autoBounds)for(var Ce=0;Ce<3;++Ce){if(vt[Ce]<bt[Ce])bt[Ce]=-1,vt[Ce]=1;else{bt[Ce]===vt[Ce]&&(bt[Ce]-=1,vt[Ce]+=1);var qe=.05*(vt[Ce]-bt[Ce]);bt[Ce]=bt[Ce]-qe,vt[Ce]=vt[Ce]+qe}We[0][Ce]=bt[Ce],We[1][Ce]=vt[Ce]}for(var vr=!1,Ce=0;Ce<3;++Ce)vr=vr||ee[0][Ce]!==We[0][Ce]||ee[1][Ce]!==We[1][Ce],ee[0][Ce]=We[0][Ce],ee[1][Ce]=We[1][Ce];if(J=J||vr,ot=ot||vr,!!ot){if(vr){for(var _r=[0,0,0],Ut=0;Ut<3;++Ut)_r[Ut]=k((We[1][Ut]-We[0][Ut])/10);j.autoTicks?j.update({bounds:We,tickSpacing:_r}):j.update({bounds:We})}var er=P.drawingBufferWidth,Mr=P.drawingBufferHeight;q[0]=er,q[1]=Mr,dt[0]=Math.max(er/nt.pixelRatio,1)|0,dt[1]=Math.max(Mr/nt.pixelRatio,1)|0,c(nt,I);for(var Ut=0;Ut<mt;++Ut){var re=ct[Ut];re.axesBounds=We,nt.clipToBounds&&(re.clipBounds=We)}D.object&&(nt.snapToData?rt.position=D.dataCoordinate:rt.position=D.dataPosition,rt.bounds=We),J&&(J=!1,Ct()),nt.axesPixels=o(nt.axes,ut,er,Mr),nt.onrender&&nt.onrender(),P.bindFramebuffer(P.FRAMEBUFFER,null),P.viewport(0,0,er,Mr),nt.clearRGBA(),P.depthMask(!0),P.colorMask(!0,!0,!0,!0),P.enable(P.DEPTH_TEST),P.depthFunc(P.LEQUAL),P.disable(P.BLEND),P.disable(P.CULL_FACE);var Ir=!1;j.enable&&(Ir=Ir||j.isTransparent(),j.draw(ut)),rt.axes=j,D.object&&rt.draw(ut),P.disable(P.CULL_FACE);for(var Ut=0;Ut<mt;++Ut){var re=ct[Ut];re.axes=j,re.pixelRatio=nt.pixelRatio,re.isOpaque&&re.isOpaque()&&re.draw(ut),re.isTransparent&&re.isTransparent()&&(Ir=!0)}if(Ir){B.shape=q,B.bind(),P.clear(P.DEPTH_BUFFER_BIT),P.colorMask(!1,!1,!1,!1),P.depthMask(!0),P.depthFunc(P.LESS),j.enable&&j.isTransparent()&&j.drawTransparent(ut);for(var Ut=0;Ut<mt;++Ut){var re=ct[Ut];re.isOpaque&&re.isOpaque()&&re.draw(ut)}P.enable(P.BLEND),P.blendEquation(P.FUNC_ADD),P.blendFunc(P.ONE,P.ONE_MINUS_SRC_ALPHA),P.colorMask(!0,!0,!0,!0),P.depthMask(!1),P.clearColor(0,0,0,0),P.clear(P.COLOR_BUFFER_BIT),j.isTransparent()&&j.drawTransparent(ut);for(var Ut=0;Ut<mt;++Ut){var re=ct[Ut];re.isTransparent&&re.isTransparent()&&re.drawTransparent(ut)}P.bindFramebuffer(P.FRAMEBUFFER,null),P.blendFunc(P.ONE,P.ONE_MINUS_SRC_ALPHA),P.disable(P.DEPTH_TEST),R.bind(),B.color[0].bind(0),R.uniforms.accumBuffer=0,v(P),P.disable(P.BLEND)}ot=!1;for(var Ut=0;Ut<mt;++Ut)ct[Ut].dirty=!1}}}function te(){nt._stopped||nt.contextLost||(Jt(),requestAnimationFrame(te))}return nt.enableMouseListeners(),te(),nt.redraw=function(){nt._stopped||(ot=!0,Jt())},nt}function c(h,b){var _=h.bounds,P=h.cameraParams,L=P.projection,D=P.model,B=h.gl.drawingBufferWidth,R=h.gl.drawingBufferHeight,I=h.zNear,F=h.zFar,N=h.fovy,j=B/R;b?(w(L,-j,j,-1,1,I,F),P._ortho=!0):(m(L,N,j,I,F),P._ortho=!1);for(var G=0;G<16;++G)D[G]=0;D[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)h.autoScale?D[5*G]=h.aspect[G]/(_[1][G]-_[0][G]):D[5*G]=1/rt,h.autoCenter&&(D[12+G]=-D[5*G]*.5*(_[0][G]+_[1][G]))}},4192:function(t){t.exports=r;var e=32;function r(m,w){w<=4*e?i(0,w-1,m):g(0,w-1,m)}function i(m,w,l){for(var x=2*(m+1),y=m+1;y<=w;++y){for(var S=l[x++],k=l[x++],M=y,T=x-2;M-- >m;){var c=l[T-2],h=l[T-1];if(c<S||c===S&&h<k)break;l[T]=c,l[T+1]=h,T-=2}l[T]=S,l[T+1]=k}}function n(m,w,l){m*=2,w*=2;var x=l[m],y=l[m+1];l[m]=l[w],l[m+1]=l[w+1],l[w]=x,l[w+1]=y}function o(m,w,l){m*=2,w*=2,l[m]=l[w],l[m+1]=l[w+1]}function a(m,w,l,x){m*=2,w*=2,l*=2;var y=x[m],S=x[m+1];x[m]=x[w],x[m+1]=x[w+1],x[w]=x[l],x[w+1]=x[l+1],x[l]=y,x[l+1]=S}function s(m,w,l,x,y){m*=2,w*=2,y[m]=y[w],y[w]=l,y[m+1]=y[w+1],y[w+1]=x}function f(m,w,l){m*=2,w*=2;var x=l[m],y=l[w];return x<y?!1:x===y?l[m+1]>l[w+1]:!0}function v(m,w,l,x){m*=2;var y=x[m];return y<w?!0:y===w?x[m+1]<l:!1}function g(m,w,l){var x=(w-m+1)/6|0,y=m+x,S=w-x,k=m+w>>1,M=k-x,T=k+x,c=y,h=M,b=k,_=T,P=S,L=m+1,D=w-1,B=0;f(c,h,l)&&(B=c,c=h,h=B),f(_,P,l)&&(B=_,_=P,P=B),f(c,b,l)&&(B=c,c=b,b=B),f(h,b,l)&&(B=h,h=b,b=B),f(c,_,l)&&(B=c,c=_,_=B),f(b,_,l)&&(B=b,b=_,_=B),f(h,P,l)&&(B=h,h=P,P=B),f(h,b,l)&&(B=h,h=b,b=B),f(_,P,l)&&(B=_,_=P,P=B);for(var R=l[2*h],I=l[2*h+1],F=l[2*_],N=l[2*_+1],j=2*c,G=2*b,rt=2*P,ct=2*y,st=2*k,et=2*S,K=0;K<2;++K){var ot=l[j+K],X=l[G+K],Q=l[rt+K];l[ct+K]=ot,l[st+K]=X,l[et+K]=Q}o(M,m,l),o(T,w,l);for(var ut=L;ut<=D;++ut)if(v(ut,R,I,l))ut!==L&&n(ut,L,l),++L;else if(!v(ut,F,N,l))for(;;)if(v(D,F,N,l)){v(D,R,I,l)?(a(ut,L,D,l),++L,--D):(n(ut,D,l),--D);break}else{if(--D<ut)break;continue}s(m,L-1,R,I,l),s(w,D+1,F,N,l),L-2-m<=e?i(m,L-2,l):g(m,L-2,l),w-(D+2)<=e?i(D+2,w,l):g(D+2,w,l),D-L<=e?i(L,D,l):g(L,D,l)}},4209:function(t,e,r){t.exports=l;var i=r(2478),n=r(3840),o=r(3250),a=r(1303);function s(x,y,S){this.slabs=x,this.coordinates=y,this.horizontal=S}var f=s.prototype;function v(x,y){return x.y-y}function g(x,y){for(var S=null;x;){var k=x.key,M,T;k[0][0]<k[1][0]?(M=k[0],T=k[1]):(M=k[1],T=k[0]);var c=o(M,T,y);if(c<0)x=x.left;else if(c>0)if(y[0]!==k[1][0])S=x,x=x.right;else{var h=g(x.right,y);if(h)return h;x=x.left}else{if(y[0]!==k[1][0])return x;var h=g(x.right,y);if(h)return h;x=x.left}}return S}f.castUp=function(x){var y=i.le(this.coordinates,x[0]);if(y<0)return-1;this.slabs[y];var S=g(this.slabs[y],x),k=-1;if(S&&(k=S.value),this.coordinates[y]===x[0]){var M=null;if(S&&(M=S.key),y>0){var T=g(this.slabs[y-1],x);T&&(M?a(T.key,M)>0&&(M=T.key,k=T.value):(k=T.value,M=T.key))}var c=this.horizontal[y];if(c.length>0){var h=i.ge(c,x[1],v);if(h<c.length){var b=c[h];if(x[1]===b.y){if(b.closed)return b.index;for(;h<c.length-1&&c[h+1].y===x[1];)if(h=h+1,b=c[h],b.closed)return b.index;if(b.y===x[1]&&!b.start){if(h=h+1,h>=c.length)return k;b=c[h]}}if(b.start)if(M){var _=o(M[0],M[1],[x[0],b.y]);M[0][0]>M[1][0]&&(_=-_),_>0&&(k=b.index)}else k=b.index;else b.y!==x[1]&&(k=b.index)}}}return k};function m(x,y,S,k){this.y=x,this.index=y,this.start=S,this.closed=k}function w(x,y,S,k){this.x=x,this.segment=y,this.create=S,this.index=k}function l(x){for(var y=x.length,S=2*y,k=new Array(S),M=0;M<y;++M){var T=x[M],c=T[0][0]<T[1][0];k[2*M]=new w(T[0][0],T,c,M),k[2*M+1]=new w(T[1][0],T,!c,M)}k.sort(function(I,F){var N=I.x-F.x;return N||(N=I.create-F.create,N)?N:Math.min(I.segment[0][1],I.segment[1][1])-Math.min(F.segment[0][1],F.segment[1][1])});for(var h=n(a),b=[],_=[],P=[],L=-1/0,M=0;M<S;){for(var D=k[M].x,B=[];M<S;){var R=k[M];if(R.x!==D)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 m(R.segment[0][1],R.index,!0,!0)),B.push(new m(R.segment[1][1],R.index,!1,!1))):(B.push(new m(R.segment[1][1],R.index,!0,!1)),B.push(new m(R.segment[0][1],R.index,!1,!0)))):R.create?h=h.insert(R.segment,R.index):h=h.remove(R.segment)}b.push(h.root),_.push(D),P.push(B)}return new s(b,_,P)}},4317:function(t){function e(a,s){var f=Math.floor(s),v=s-f,g=0<=f&&f<a.shape[0],m=0<=f+1&&f+1<a.shape[0],w=g?+a.get(f):0,l=m?+a.get(f+1):0;return(1-v)*w+v*l}function r(a,s,f){var v=Math.floor(s),g=s-v,m=0<=v&&v<a.shape[0],w=0<=v+1&&v+1<a.shape[0],l=Math.floor(f),x=f-l,y=0<=l&&l<a.shape[1],S=0<=l+1&&l+1<a.shape[1],k=m&&y?a.get(v,l):0,M=m&&S?a.get(v,l+1):0,T=w&&y?a.get(v+1,l):0,c=w&&S?a.get(v+1,l+1):0;return(1-x)*((1-g)*k+g*T)+x*((1-g)*M+g*c)}function i(a,s,f,v){var g=Math.floor(s),m=s-g,w=0<=g&&g<a.shape[0],l=0<=g+1&&g+1<a.shape[0],x=Math.floor(f),y=f-x,S=0<=x&&x<a.shape[1],k=0<=x+1&&x+1<a.shape[1],M=Math.floor(v),T=v-M,c=0<=M&&M<a.shape[2],h=0<=M+1&&M+1<a.shape[2],b=w&&S&&c?a.get(g,x,M):0,_=w&&k&&c?a.get(g,x+1,M):0,P=l&&S&&c?a.get(g+1,x,M):0,L=l&&k&&c?a.get(g+1,x+1,M):0,D=w&&S&&h?a.get(g,x,M+1):0,B=w&&k&&h?a.get(g,x+1,M+1):0,R=l&&S&&h?a.get(g+1,x,M+1):0,I=l&&k&&h?a.get(g+1,x+1,M+1):0;return(1-T)*((1-y)*((1-m)*b+m*P)+y*((1-m)*_+m*L))+T*((1-y)*((1-m)*D+m*R)+y*((1-m)*B+m*I))}function n(a){var s=a.shape.length|0,f=new Array(s),v=new Array(s),g=new Array(s),m=new Array(s),w,l;for(w=0;w<s;++w)l=+arguments[w+1],f[w]=Math.floor(l),v[w]=l-f[w],g[w]=0<=f[w]&&f[w]<a.shape[w],m[w]=0<=f[w]+1&&f[w]+1<a.shape[w];var x=0,y,S,k;t:for(w=0;w<1<<s;++w){for(S=1,k=a.offset,y=0;y<s;++y)if(w&1<<y){if(!m[y])continue t;S*=v[y],k+=a.stride[y]*(f[y]+1)}else{if(!g[y])continue t;S*=1-v[y],k+=a.stride[y]*f[y]}x+=S*a.data[k]}return x}function o(a,s,f,v){switch(a.shape.length){case 0:return 0;case 1:return e(a,s);case 2:return r(a,s,f);case 3:return i(a,s,f,v);default:return n.apply(void 0,arguments)}}t.exports=o,t.exports.d1=e,t.exports.d2=r,t.exports.d3=i},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}},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,f){return(typeof f!="object"||f===null)&&(f={}),i(s,f.canvas||n,f.context||o,f)}},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}},4437:function(t,e,r){t.exports=v;var i=r(3025),n=r(6296),o=r(351),a=r(8512),s=r(24),f=r(7520);function v(g,m){g=g||document.body,m=m||{};var w=[.01,1/0];"distanceLimits"in m&&(w[0]=m.distanceLimits[0],w[1]=m.distanceLimits[1]),"zoomMin"in m&&(w[0]=m.zoomMin),"zoomMax"in m&&(w[1]=m.zoomMax);var l=n({center:m.center||[0,0,0],up:m.up||[0,1,0],eye:m.eye||[0,0,10],mode:m.mode||"orbit",distanceLimits:w}),x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,S=g.clientWidth,k=g.clientHeight,M={keyBindingMode:"rotate",enableWheel:!0,view:l,element:g,delay:m.delay||16,rotateSpeed:m.rotateSpeed||1,zoomSpeed:m.zoomSpeed||1,translateSpeed:m.translateSpeed||1,flipX:!!m.flipX,flipY:!!m.flipY,modes:l.modes,_ortho:m._ortho||m.projection&&m.projection.type==="orthographic"||!1,tick:function(){var T=i(),c=this.delay,h=T-2*c;l.idle(T-c),l.recalcMatrix(h),l.flush(T-(100+c*2));for(var b=!0,_=l.computedMatrix,P=0;P<16;++P)b=b&&x[P]===_[P],x[P]=_[P];var L=g.clientWidth===S&&g.clientHeight===k;return S=g.clientWidth,k=g.clientHeight,b?!L:(y=Math.exp(l.computedRadius[0]),!0)},lookAt:function(T,c,h){l.lookAt(l.lastT(),T,c,h)},rotate:function(T,c,h){l.rotate(l.lastT(),T,c,h)},pan:function(T,c,h){l.pan(l.lastT(),T,c,h)},translate:function(T,c,h){l.translate(l.lastT(),T,c,h)}};return Object.defineProperties(M,{matrix:{get:function(){return l.computedMatrix},set:function(T){return l.setMatrix(l.lastT(),T),l.computedMatrix},enumerable:!0},mode:{get:function(){return l.getMode()},set:function(T){var c=l.computedUp.slice(),h=l.computedEye.slice(),b=l.computedCenter.slice();if(l.setMode(T),T==="turntable"){var _=i();l._active.lookAt(_,h,b,c),l._active.lookAt(_+500,h,b,[0,0,1]),l._active.flush(_)}return l.getMode()},enumerable:!0},center:{get:function(){return l.computedCenter},set:function(T){return l.lookAt(l.lastT(),null,T),l.computedCenter},enumerable:!0},eye:{get:function(){return l.computedEye},set:function(T){return l.lookAt(l.lastT(),T),l.computedEye},enumerable:!0},up:{get:function(){return l.computedUp},set:function(T){return l.lookAt(l.lastT(),null,null,T),l.computedUp},enumerable:!0},distance:{get:function(){return y},set:function(T){return l.setDistance(l.lastT(),T),T},enumerable:!0},distanceLimits:{get:function(){return l.getDistanceLimits(w)},set:function(T){return l.setDistanceLimits(T),T},enumerable:!0}}),g.addEventListener("contextmenu",function(T){return T.preventDefault(),!1}),M._lastX=-1,M._lastY=-1,M._lastMods={shift:!1,control:!1,alt:!1,meta:!1},M.enableMouseListeners=function(){M.mouseListener=o(g,T),g.addEventListener("touchstart",function(c){var h=s(c.changedTouches[0],g);T(0,h[0],h[1],M._lastMods),T(1,h[0],h[1],M._lastMods)},f?{passive:!0}:!1),g.addEventListener("touchmove",function(c){var h=s(c.changedTouches[0],g);T(1,h[0],h[1],M._lastMods),c.preventDefault()},f?{passive:!1}:!1),g.addEventListener("touchend",function(c){T(0,M._lastX,M._lastY,M._lastMods)},f?{passive:!0}:!1);function T(c,h,b,_){var P=M.keyBindingMode;if(P!==!1){var L=P==="rotate",D=P==="pan",B=P==="zoom",R=!!_.control,I=!!_.alt,F=!!_.shift,N=!!(c&1),j=!!(c&2),G=!!(c&4),rt=1/g.clientHeight,ct=rt*(h-M._lastX),st=rt*(b-M._lastY),et=M.flipX?1:-1,K=M.flipY?1:-1,ot=Math.PI*M.rotateSpeed,X=i();if(M._lastX!==-1&&M._lastY!==-1&&((L&&N&&!R&&!I&&!F||N&&!R&&!I&&F)&&l.rotate(X,et*ot*ct,-K*ot*st,0),(D&&N&&!R&&!I&&!F||j||N&&R&&!I&&!F)&&l.pan(X,-M.translateSpeed*ct*y,M.translateSpeed*st*y,0),B&&N&&!R&&!I&&!F||G||N&&!R&&I&&!F)){var Q=-M.zoomSpeed*st/window.innerHeight*(X-l.lastT())*100;l.pan(X,0,0,y*(Math.exp(Q)-1))}return M._lastX=h,M._lastY=b,M._lastMods=_,!0}}M.wheelListener=a(g,function(c,h){if(M.keyBindingMode!==!1&&M.enableWheel){var b=M.flipX?1:-1,_=M.flipY?1:-1,P=i();if(Math.abs(c)>Math.abs(h))l.rotate(P,0,0,-c*b*Math.PI*M.rotateSpeed/window.innerWidth);else if(!M._ortho){var L=-M.zoomSpeed*_*h/window.innerHeight*(P-l.lastT())/20;l.pan(P,0,0,y*(Math.exp(L)-1))}}},!0)},M.enableMouseListeners(),M}},4449:function(t,e,r){var i=r(2762),n=r(8116),o=r(1493);t.exports=w;var a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,x,y,S){this.gl=l,this.buffer=x,this.vao=y,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 f=s.prototype,v=[0,0,0],g=[0,0,0],m=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(l){},f.draw=function(l){var x=this.gl,y=this.vao,S=this.shader;y.bind(),S.bind();var k=l.model||a,M=l.view||a,T=l.projection||a,c;this.axes&&(c=this.axes.lastCubeProps.axis);for(var h=v,b=g,_=0;_<3;++_)c&&c[_]<0?(h[_]=this.bounds[0][_],b[_]=this.bounds[1][_]):(h[_]=this.bounds[1][_],b[_]=this.bounds[0][_]);m[0]=x.drawingBufferWidth,m[1]=x.drawingBufferHeight,S.uniforms.model=k,S.uniforms.view=M,S.uniforms.projection=T,S.uniforms.coordinates=[this.position,h,b],S.uniforms.colors=this.colors,S.uniforms.screenShape=m;for(var _=0;_<3;++_)S.uniforms.lineWidth=this.lineWidth[_]*this.pixelRatio,this.enabled[_]&&(y.draw(x.TRIANGLES,6,6*_),this.drawSides[_]&&y.draw(x.TRIANGLES,12,18+12*_));y.unbind()},f.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))},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function w(l,x){var y=[];function S(h,b,_,P,L,D){var B=[h,b,_,0,0,0,1];B[P+3]=1,B[P]=L,y.push.apply(y,B),B[6]=-1,y.push.apply(y,B),B[P]=D,y.push.apply(y,B),y.push.apply(y,B),B[6]=1,y.push.apply(y,B),B[P]=L,y.push.apply(y,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 k=i(l,y),M=n(l,[{type:l.FLOAT,buffer:k,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:k,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:k,size:1,offset:24,stride:28}]),T=o(l);T.attributes.position.location=0,T.attributes.color.location=1,T.attributes.weight.location=2;var c=new s(l,k,M,T);return c.update(x),c}},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}},4505:function(t,e,r){t.exports=r(5847)},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}},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,f=a[n],v=a[o];f<v?s[n]=o:v<f?s[o]=n:(s[o]=n,++a[n])}}},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),f=s.getBoundingClientRect();return a.clientX-f.left}return 0}e.x=n;function o(a){if(typeof a=="object"){if("offsetY"in a)return a.offsetY;var s=i(a),f=s.getBoundingClientRect();return a.clientY-f.top}return 0}e.y=o},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)}},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 f=new Array(s),v=a[s-1],g=0;g<s;++g){var m=a[g];f[g]=[v,m],v=m}return f}},4769:function(t){function e(i,n,o,a,s,f){var v=6*s*s-6*s,g=3*s*s-4*s+1,m=-6*s*s+6*s,w=3*s*s-2*s;if(i.length){f||(f=new Array(i.length));for(var l=i.length-1;l>=0;--l)f[l]=v*i[l]+g*n[l]+m*o[l]+w*a[l];return f}return v*i+g*n+m*o[l]+w*a}function r(i,n,o,a,s,f){var v=s-1,g=s*s,m=v*v,w=(1+2*s)*m,l=s*m,x=g*(3-2*s),y=g*v;if(i.length){f||(f=new Array(i.length));for(var S=i.length-1;S>=0;--S)f[S]=w*i[S]+l*n[S]+x*o[S]+y*a[S];return f}return w*i+l*n+x*o+y*a}t.exports=r,t.exports.derivative=e},4772:function(t){t.exports=e;function e(r,i,n,o,a){var s=1/Math.tan(i/2),f=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)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*o*f,r[15]=0,r}},4793:function(t,e,r){function i(lt,yt){if(!(lt instanceof yt))throw new TypeError("Cannot call a class as a function")}function n(lt,yt){for(var St=0;St<yt.length;St++){var Ht=yt[St];Ht.enumerable=Ht.enumerable||!1,Ht.configurable=!0,"value"in Ht&&(Ht.writable=!0),Object.defineProperty(lt,a(Ht.key),Ht)}}function o(lt,yt,St){return yt&&n(lt.prototype,yt),Object.defineProperty(lt,"prototype",{writable:!1}),lt}function a(lt){var yt=s(lt,"string");return y(yt)=="symbol"?yt:yt+""}function s(lt,yt){if(y(lt)!="object"||!lt)return lt;var St=lt[Symbol.toPrimitive];if(St!==void 0){var Ht=St.call(lt,yt);if(y(Ht)!="object")return Ht;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(lt)}function f(lt,yt,St){return yt=w(yt),v(lt,m()?Reflect.construct(yt,[],w(lt).constructor):yt.apply(lt,St))}function v(lt,yt){if(yt&&(y(yt)=="object"||typeof yt=="function"))return yt;if(yt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return g(lt)}function g(lt){if(lt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return lt}function m(){try{var lt=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m=function(){return!!lt})()}function w(lt){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(yt){return yt.__proto__||Object.getPrototypeOf(yt)},w(lt)}function l(lt,yt){if(typeof yt!="function"&&yt!==null)throw new TypeError("Super expression must either be null or a function");lt.prototype=Object.create(yt&&yt.prototype,{constructor:{value:lt,writable:!0,configurable:!0}}),Object.defineProperty(lt,"prototype",{writable:!1}),yt&&x(lt,yt)}function x(lt,yt){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(St,Ht){return St.__proto__=Ht,St},x(lt,yt)}function y(lt){"@babel/helpers - typeof";return y=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},y(lt)}var S=r(7507),k=r(3778),M=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=b,e.IS=50;var T=2147483647;b.TYPED_ARRAY_SUPPORT=c(),!b.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 c(){try{var lt=new Uint8Array(1),yt={foo:function(){return 42}};return Object.setPrototypeOf(yt,Uint8Array.prototype),Object.setPrototypeOf(lt,yt),lt.foo()===42}catch{return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function h(lt){if(lt>T)throw new RangeError('The value "'+lt+'" is invalid for option "size"');var yt=new Uint8Array(lt);return Object.setPrototypeOf(yt,b.prototype),yt}function b(lt,yt,St){if(typeof lt=="number"){if(typeof yt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return D(lt)}return _(lt,yt,St)}b.poolSize=8192;function _(lt,yt,St){if(typeof lt=="string")return B(lt,yt);if(ArrayBuffer.isView(lt))return I(lt);if(lt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+y(lt));if(Ir(lt,ArrayBuffer)||lt&&Ir(lt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ir(lt,SharedArrayBuffer)||lt&&Ir(lt.buffer,SharedArrayBuffer)))return F(lt,yt,St);if(typeof lt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Ht=lt.valueOf&&lt.valueOf();if(Ht!=null&&Ht!==lt)return b.from(Ht,yt,St);var Yt=N(lt);if(Yt)return Yt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof lt[Symbol.toPrimitive]=="function")return b.from(lt[Symbol.toPrimitive]("string"),yt,St);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+y(lt))}b.from=function(lt,yt,St){return _(lt,yt,St)},Object.setPrototypeOf(b.prototype,Uint8Array.prototype),Object.setPrototypeOf(b,Uint8Array);function P(lt){if(typeof lt!="number")throw new TypeError('"size" argument must be of type number');if(lt<0)throw new RangeError('The value "'+lt+'" is invalid for option "size"')}function L(lt,yt,St){return P(lt),lt<=0?h(lt):yt!==void 0?typeof St=="string"?h(lt).fill(yt,St):h(lt).fill(yt):h(lt)}b.alloc=function(lt,yt,St){return L(lt,yt,St)};function D(lt){return P(lt),h(lt<0?0:j(lt)|0)}b.allocUnsafe=function(lt){return D(lt)},b.allocUnsafeSlow=function(lt){return D(lt)};function B(lt,yt){if((typeof yt!="string"||yt==="")&&(yt="utf8"),!b.isEncoding(yt))throw new TypeError("Unknown encoding: "+yt);var St=G(lt,yt)|0,Ht=h(St),Yt=Ht.write(lt,yt);return Yt!==St&&(Ht=Ht.slice(0,Yt)),Ht}function R(lt){for(var yt=lt.length<0?0:j(lt.length)|0,St=h(yt),Ht=0;Ht<yt;Ht+=1)St[Ht]=lt[Ht]&255;return St}function I(lt){if(Ir(lt,Uint8Array)){var yt=new Uint8Array(lt);return F(yt.buffer,yt.byteOffset,yt.byteLength)}return R(lt)}function F(lt,yt,St){if(yt<0||lt.byteLength<yt)throw new RangeError('"offset" is outside of buffer bounds');if(lt.byteLength<yt+(St||0))throw new RangeError('"length" is outside of buffer bounds');var Ht;return yt===void 0&&St===void 0?Ht=new Uint8Array(lt):St===void 0?Ht=new Uint8Array(lt,yt):Ht=new Uint8Array(lt,yt,St),Object.setPrototypeOf(Ht,b.prototype),Ht}function N(lt){if(b.isBuffer(lt)){var yt=j(lt.length)|0,St=h(yt);return St.length===0||lt.copy(St,0,0,yt),St}if(lt.length!==void 0)return typeof lt.length!="number"||de(lt.length)?h(0):R(lt);if(lt.type==="Buffer"&&Array.isArray(lt.data))return R(lt.data)}function j(lt){if(lt>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return lt|0}b.isBuffer=function(lt){return lt!=null&&lt._isBuffer===!0&&lt!==b.prototype},b.compare=function(lt,yt){if(Ir(lt,Uint8Array)&&(lt=b.from(lt,lt.offset,lt.byteLength)),Ir(yt,Uint8Array)&&(yt=b.from(yt,yt.offset,yt.byteLength)),!b.isBuffer(lt)||!b.isBuffer(yt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(lt===yt)return 0;for(var St=lt.length,Ht=yt.length,Yt=0,se=Math.min(St,Ht);Yt<se;++Yt)if(lt[Yt]!==yt[Yt]){St=lt[Yt],Ht=yt[Yt];break}return St<Ht?-1:Ht<St?1:0},b.isEncoding=function(lt){switch(String(lt).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}},b.concat=function(lt,yt){if(!Array.isArray(lt))throw new TypeError('"list" argument must be an Array of Buffers');if(lt.length===0)return b.alloc(0);var St;if(yt===void 0)for(yt=0,St=0;St<lt.length;++St)yt+=lt[St].length;var Ht=b.allocUnsafe(yt),Yt=0;for(St=0;St<lt.length;++St){var se=lt[St];if(Ir(se,Uint8Array))Yt+se.length>Ht.length?(b.isBuffer(se)||(se=b.from(se)),se.copy(Ht,Yt)):Uint8Array.prototype.set.call(Ht,se,Yt);else if(b.isBuffer(se))se.copy(Ht,Yt);else throw new TypeError('"list" argument must be an Array of Buffers');Yt+=se.length}return Ht};function G(lt,yt){if(b.isBuffer(lt))return lt.length;if(ArrayBuffer.isView(lt)||Ir(lt,ArrayBuffer))return lt.byteLength;if(typeof lt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+y(lt));var St=lt.length,Ht=arguments.length>2&&arguments[2]===!0;if(!Ht&&St===0)return 0;for(var Yt=!1;;)switch(yt){case"ascii":case"latin1":case"binary":return St;case"utf8":case"utf-8":return qe(lt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St*2;case"hex":return St>>>1;case"base64":return er(lt).length;default:if(Yt)return Ht?-1:qe(lt).length;yt=(""+yt).toLowerCase(),Yt=!0}}b.byteLength=G;function rt(lt,yt,St){var Ht=!1;if((yt===void 0||yt<0)&&(yt=0),yt>this.length||((St===void 0||St>this.length)&&(St=this.length),St<=0)||(St>>>=0,yt>>>=0,St<=yt))return"";for(lt||(lt="utf8");;)switch(lt){case"hex":return wt(this,yt,St);case"utf8":case"utf-8":return q(this,yt,St);case"ascii":return dt(this,yt,St);case"latin1":case"binary":return Tt(this,yt,St);case"base64":return J(this,yt,St);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,yt,St);default:if(Ht)throw new TypeError("Unknown encoding: "+lt);lt=(lt+"").toLowerCase(),Ht=!0}}b.prototype._isBuffer=!0;function ct(lt,yt,St){var Ht=lt[yt];lt[yt]=lt[St],lt[St]=Ht}b.prototype.swap16=function(){var lt=this.length;if(lt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var yt=0;yt<lt;yt+=2)ct(this,yt,yt+1);return this},b.prototype.swap32=function(){var lt=this.length;if(lt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var yt=0;yt<lt;yt+=4)ct(this,yt,yt+3),ct(this,yt+1,yt+2);return this},b.prototype.swap64=function(){var lt=this.length;if(lt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var yt=0;yt<lt;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},b.prototype.toString=function(){var lt=this.length;return lt===0?"":arguments.length===0?q(this,0,lt):rt.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(lt){if(!b.isBuffer(lt))throw new TypeError("Argument must be a Buffer");return this===lt?!0:b.compare(this,lt)===0},b.prototype.inspect=function(){var lt="",yt=e.IS;return lt=this.toString("hex",0,yt).replace(/(.{2})/g,"$1 ").trim(),this.length>yt&&(lt+=" ... "),"<Buffer "+lt+">"},M&&(b.prototype[M]=b.prototype.inspect),b.prototype.compare=function(lt,yt,St,Ht,Yt){if(Ir(lt,Uint8Array)&&(lt=b.from(lt,lt.offset,lt.byteLength)),!b.isBuffer(lt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+y(lt));if(yt===void 0&&(yt=0),St===void 0&&(St=lt?lt.length:0),Ht===void 0&&(Ht=0),Yt===void 0&&(Yt=this.length),yt<0||St>lt.length||Ht<0||Yt>this.length)throw new RangeError("out of range index");if(Ht>=Yt&&yt>=St)return 0;if(Ht>=Yt)return-1;if(yt>=St)return 1;if(yt>>>=0,St>>>=0,Ht>>>=0,Yt>>>=0,this===lt)return 0;for(var se=Yt-Ht,ke=St-yt,Ee=Math.min(se,ke),Ue=this.slice(Ht,Yt),ir=lt.slice(yt,St),ar=0;ar<Ee;++ar)if(Ue[ar]!==ir[ar]){se=Ue[ar],ke=ir[ar];break}return se<ke?-1:ke<se?1:0};function st(lt,yt,St,Ht,Yt){if(lt.length===0)return-1;if(typeof St=="string"?(Ht=St,St=0):St>2147483647?St=2147483647:St<-2147483648&&(St=-2147483648),St=+St,de(St)&&(St=Yt?0:lt.length-1),St<0&&(St=lt.length+St),St>=lt.length){if(Yt)return-1;St=lt.length-1}else if(St<0)if(Yt)St=0;else return-1;if(typeof yt=="string"&&(yt=b.from(yt,Ht)),b.isBuffer(yt))return yt.length===0?-1:et(lt,yt,St,Ht,Yt);if(typeof yt=="number")return yt=yt&255,typeof Uint8Array.prototype.indexOf=="function"?Yt?Uint8Array.prototype.indexOf.call(lt,yt,St):Uint8Array.prototype.lastIndexOf.call(lt,yt,St):et(lt,[yt],St,Ht,Yt);throw new TypeError("val must be string, number or Buffer")}function et(lt,yt,St,Ht,Yt){var se=1,ke=lt.length,Ee=yt.length;if(Ht!==void 0&&(Ht=String(Ht).toLowerCase(),Ht==="ucs2"||Ht==="ucs-2"||Ht==="utf16le"||Ht==="utf-16le")){if(lt.length<2||yt.length<2)return-1;se=2,ke/=2,Ee/=2,St/=2}function Ue(pn,dn){return se===1?pn[dn]:pn.readUInt16BE(dn*se)}var ir;if(Yt){var ar=-1;for(ir=St;ir<ke;ir++)if(Ue(lt,ir)===Ue(yt,ar===-1?0:ir-ar)){if(ar===-1&&(ar=ir),ir-ar+1===Ee)return ar*se}else ar!==-1&&(ir-=ir-ar),ar=-1}else for(St+Ee>ke&&(St=ke-Ee),ir=St;ir>=0;ir--){for(var Ye=!0,Er=0;Er<Ee;Er++)if(Ue(lt,ir+Er)!==Ue(yt,Er)){Ye=!1;break}if(Ye)return ir}return-1}b.prototype.includes=function(lt,yt,St){return this.indexOf(lt,yt,St)!==-1},b.prototype.indexOf=function(lt,yt,St){return st(this,lt,yt,St,!0)},b.prototype.lastIndexOf=function(lt,yt,St){return st(this,lt,yt,St,!1)};function K(lt,yt,St,Ht){St=Number(St)||0;var Yt=lt.length-St;Ht?(Ht=Number(Ht),Ht>Yt&&(Ht=Yt)):Ht=Yt;var se=yt.length;Ht>se/2&&(Ht=se/2);var ke;for(ke=0;ke<Ht;++ke){var Ee=parseInt(yt.substr(ke*2,2),16);if(de(Ee))return ke;lt[St+ke]=Ee}return ke}function ot(lt,yt,St,Ht){return Mr(qe(yt,lt.length-St),lt,St,Ht)}function X(lt,yt,St,Ht){return Mr(vr(yt),lt,St,Ht)}function Q(lt,yt,St,Ht){return Mr(er(yt),lt,St,Ht)}function ut(lt,yt,St,Ht){return Mr(_r(yt,lt.length-St),lt,St,Ht)}b.prototype.write=function(lt,yt,St,Ht){if(yt===void 0)Ht="utf8",St=this.length,yt=0;else if(St===void 0&&typeof yt=="string")Ht=yt,St=this.length,yt=0;else if(isFinite(yt))yt=yt>>>0,isFinite(St)?(St=St>>>0,Ht===void 0&&(Ht="utf8")):(Ht=St,St=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Yt=this.length-yt;if((St===void 0||St>Yt)&&(St=Yt),lt.length>0&&(St<0||yt<0)||yt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ht||(Ht="utf8");for(var se=!1;;)switch(Ht){case"hex":return K(this,lt,yt,St);case"utf8":case"utf-8":return ot(this,lt,yt,St);case"ascii":case"latin1":case"binary":return X(this,lt,yt,St);case"base64":return Q(this,lt,yt,St);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,lt,yt,St);default:if(se)throw new TypeError("Unknown encoding: "+Ht);Ht=(""+Ht).toLowerCase(),se=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(lt,yt,St){return yt===0&&St===lt.length?S.fromByteArray(lt):S.fromByteArray(lt.slice(yt,St))}function q(lt,yt,St){St=Math.min(lt.length,St);for(var Ht=[],Yt=yt;Yt<St;){var se=lt[Yt],ke=null,Ee=se>239?4:se>223?3:se>191?2:1;if(Yt+Ee<=St){var Ue=void 0,ir=void 0,ar=void 0,Ye=void 0;switch(Ee){case 1:se<128&&(ke=se);break;case 2:Ue=lt[Yt+1],(Ue&192)===128&&(Ye=(se&31)<<6|Ue&63,Ye>127&&(ke=Ye));break;case 3:Ue=lt[Yt+1],ir=lt[Yt+2],(Ue&192)===128&&(ir&192)===128&&(Ye=(se&15)<<12|(Ue&63)<<6|ir&63,Ye>2047&&(Ye<55296||Ye>57343)&&(ke=Ye));break;case 4:Ue=lt[Yt+1],ir=lt[Yt+2],ar=lt[Yt+3],(Ue&192)===128&&(ir&192)===128&&(ar&192)===128&&(Ye=(se&15)<<18|(Ue&63)<<12|(ir&63)<<6|ar&63,Ye>65535&&Ye<1114112&&(ke=Ye))}}ke===null?(ke=65533,Ee=1):ke>65535&&(ke-=65536,Ht.push(ke>>>10&1023|55296),ke=56320|ke&1023),Ht.push(ke),Yt+=Ee}return nt(Ht)}var it=4096;function nt(lt){var yt=lt.length;if(yt<=it)return String.fromCharCode.apply(String,lt);for(var St="",Ht=0;Ht<yt;)St+=String.fromCharCode.apply(String,lt.slice(Ht,Ht+=it));return St}function dt(lt,yt,St){var Ht="";St=Math.min(lt.length,St);for(var Yt=yt;Yt<St;++Yt)Ht+=String.fromCharCode(lt[Yt]&127);return Ht}function Tt(lt,yt,St){var Ht="";St=Math.min(lt.length,St);for(var Yt=yt;Yt<St;++Yt)Ht+=String.fromCharCode(lt[Yt]);return Ht}function wt(lt,yt,St){var Ht=lt.length;(!yt||yt<0)&&(yt=0),(!St||St<0||St>Ht)&&(St=Ht);for(var Yt="",se=yt;se<St;++se)Yt+=Dt[lt[se]];return Yt}function It(lt,yt,St){for(var Ht=lt.slice(yt,St),Yt="",se=0;se<Ht.length-1;se+=2)Yt+=String.fromCharCode(Ht[se]+Ht[se+1]*256);return Yt}b.prototype.slice=function(lt,yt){var St=this.length;lt=~~lt,yt=yt===void 0?St:~~yt,lt<0?(lt+=St,lt<0&&(lt=0)):lt>St&&(lt=St),yt<0?(yt+=St,yt<0&&(yt=0)):yt>St&&(yt=St),yt<lt&&(yt=lt);var Ht=this.subarray(lt,yt);return Object.setPrototypeOf(Ht,b.prototype),Ht};function Ct(lt,yt,St){if(lt%1!==0||lt<0)throw new RangeError("offset is not uint");if(lt+yt>St)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(lt,yt,St){lt=lt>>>0,yt=yt>>>0,St||Ct(lt,yt,this.length);for(var Ht=this[lt],Yt=1,se=0;++se<yt&&(Yt*=256);)Ht+=this[lt+se]*Yt;return Ht},b.prototype.readUintBE=b.prototype.readUIntBE=function(lt,yt,St){lt=lt>>>0,yt=yt>>>0,St||Ct(lt,yt,this.length);for(var Ht=this[lt+--yt],Yt=1;yt>0&&(Yt*=256);)Ht+=this[lt+--yt]*Yt;return Ht},b.prototype.readUint8=b.prototype.readUInt8=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,1,this.length),this[lt]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,2,this.length),this[lt]|this[lt+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,2,this.length),this[lt]<<8|this[lt+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,4,this.length),(this[lt]|this[lt+1]<<8|this[lt+2]<<16)+this[lt+3]*16777216},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,4,this.length),this[lt]*16777216+(this[lt+1]<<16|this[lt+2]<<8|this[lt+3])},b.prototype.readBigUInt64LE=qt(function(lt){lt=lt>>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=yt+this[++lt]*Math.pow(2,8)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,24),Yt=this[++lt]+this[++lt]*Math.pow(2,8)+this[++lt]*Math.pow(2,16)+St*Math.pow(2,24);return BigInt(Ht)+(BigInt(Yt)<<BigInt(32))}),b.prototype.readBigUInt64BE=qt(function(lt){lt=lt>>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=yt*Math.pow(2,24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+this[++lt],Yt=this[++lt]*Math.pow(2,24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+St;return(BigInt(Ht)<<BigInt(32))+BigInt(Yt)}),b.prototype.readIntLE=function(lt,yt,St){lt=lt>>>0,yt=yt>>>0,St||Ct(lt,yt,this.length);for(var Ht=this[lt],Yt=1,se=0;++se<yt&&(Yt*=256);)Ht+=this[lt+se]*Yt;return Yt*=128,Ht>=Yt&&(Ht-=Math.pow(2,8*yt)),Ht},b.prototype.readIntBE=function(lt,yt,St){lt=lt>>>0,yt=yt>>>0,St||Ct(lt,yt,this.length);for(var Ht=yt,Yt=1,se=this[lt+--Ht];Ht>0&&(Yt*=256);)se+=this[lt+--Ht]*Yt;return Yt*=128,se>=Yt&&(se-=Math.pow(2,8*yt)),se},b.prototype.readInt8=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,1,this.length),this[lt]&128?(255-this[lt]+1)*-1:this[lt]},b.prototype.readInt16LE=function(lt,yt){lt=lt>>>0,yt||Ct(lt,2,this.length);var St=this[lt]|this[lt+1]<<8;return St&32768?St|4294901760:St},b.prototype.readInt16BE=function(lt,yt){lt=lt>>>0,yt||Ct(lt,2,this.length);var St=this[lt+1]|this[lt]<<8;return St&32768?St|4294901760:St},b.prototype.readInt32LE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,4,this.length),this[lt]|this[lt+1]<<8|this[lt+2]<<16|this[lt+3]<<24},b.prototype.readInt32BE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,4,this.length),this[lt]<<24|this[lt+1]<<16|this[lt+2]<<8|this[lt+3]},b.prototype.readBigInt64LE=qt(function(lt){lt=lt>>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=this[lt+4]+this[lt+5]*Math.pow(2,8)+this[lt+6]*Math.pow(2,16)+(St<<24);return(BigInt(Ht)<<BigInt(32))+BigInt(yt+this[++lt]*Math.pow(2,8)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,24))}),b.prototype.readBigInt64BE=qt(function(lt){lt=lt>>>0,ue(lt,"offset");var yt=this[lt],St=this[lt+7];(yt===void 0||St===void 0)&&Me(lt,this.length-8);var Ht=(yt<<24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+this[++lt];return(BigInt(Ht)<<BigInt(32))+BigInt(this[++lt]*Math.pow(2,24)+this[++lt]*Math.pow(2,16)+this[++lt]*Math.pow(2,8)+St)}),b.prototype.readFloatLE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,4,this.length),k.read(this,lt,!0,23,4)},b.prototype.readFloatBE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,4,this.length),k.read(this,lt,!1,23,4)},b.prototype.readDoubleLE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,8,this.length),k.read(this,lt,!0,52,8)},b.prototype.readDoubleBE=function(lt,yt){return lt=lt>>>0,yt||Ct(lt,8,this.length),k.read(this,lt,!1,52,8)};function Nt(lt,yt,St,Ht,Yt,se){if(!b.isBuffer(lt))throw new TypeError('"buffer" argument must be a Buffer instance');if(yt>Yt||yt<se)throw new RangeError('"value" argument is out of bounds');if(St+Ht>lt.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,St=St>>>0,!Ht){var Yt=Math.pow(2,8*St)-1;Nt(this,lt,yt,St,Yt,0)}var se=1,ke=0;for(this[yt]=lt&255;++ke<St&&(se*=256);)this[yt+ke]=lt/se&255;return yt+St},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,St=St>>>0,!Ht){var Yt=Math.pow(2,8*St)-1;Nt(this,lt,yt,St,Yt,0)}var se=St-1,ke=1;for(this[yt+se]=lt&255;--se>=0&&(ke*=256);)this[yt+se]=lt/ke&255;return yt+St},b.prototype.writeUint8=b.prototype.writeUInt8=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,1,255,0),this[yt]=lt&255,yt+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,65535,0),this[yt]=lt&255,this[yt+1]=lt>>>8,yt+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,65535,0),this[yt]=lt>>>8,this[yt+1]=lt&255,yt+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,4294967295,0),this[yt+3]=lt>>>24,this[yt+2]=lt>>>16,this[yt+1]=lt>>>8,this[yt]=lt&255,yt+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,4294967295,0),this[yt]=lt>>>24,this[yt+1]=lt>>>16,this[yt+2]=lt>>>8,this[yt+3]=lt&255,yt+4};function ee(lt,yt,St,Ht,Yt){Zt(yt,Ht,Yt,lt,St,7);var se=Number(yt&BigInt(4294967295));lt[St++]=se,se=se>>8,lt[St++]=se,se=se>>8,lt[St++]=se,se=se>>8,lt[St++]=se;var ke=Number(yt>>BigInt(32)&BigInt(4294967295));return lt[St++]=ke,ke=ke>>8,lt[St++]=ke,ke=ke>>8,lt[St++]=ke,ke=ke>>8,lt[St++]=ke,St}function Jt(lt,yt,St,Ht,Yt){Zt(yt,Ht,Yt,lt,St,7);var se=Number(yt&BigInt(4294967295));lt[St+7]=se,se=se>>8,lt[St+6]=se,se=se>>8,lt[St+5]=se,se=se>>8,lt[St+4]=se;var ke=Number(yt>>BigInt(32)&BigInt(4294967295));return lt[St+3]=ke,ke=ke>>8,lt[St+2]=ke,ke=ke>>8,lt[St+1]=ke,ke=ke>>8,lt[St]=ke,St+8}b.prototype.writeBigUInt64LE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ee(this,lt,yt,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Jt(this,lt,yt,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,!Ht){var Yt=Math.pow(2,8*St-1);Nt(this,lt,yt,St,Yt-1,-Yt)}var se=0,ke=1,Ee=0;for(this[yt]=lt&255;++se<St&&(ke*=256);)lt<0&&Ee===0&&this[yt+se-1]!==0&&(Ee=1),this[yt+se]=(lt/ke>>0)-Ee&255;return yt+St},b.prototype.writeIntBE=function(lt,yt,St,Ht){if(lt=+lt,yt=yt>>>0,!Ht){var Yt=Math.pow(2,8*St-1);Nt(this,lt,yt,St,Yt-1,-Yt)}var se=St-1,ke=1,Ee=0;for(this[yt+se]=lt&255;--se>=0&&(ke*=256);)lt<0&&Ee===0&&this[yt+se+1]!==0&&(Ee=1),this[yt+se]=(lt/ke>>0)-Ee&255;return yt+St},b.prototype.writeInt8=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,1,127,-128),lt<0&&(lt=255+lt+1),this[yt]=lt&255,yt+1},b.prototype.writeInt16LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,32767,-32768),this[yt]=lt&255,this[yt+1]=lt>>>8,yt+2},b.prototype.writeInt16BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,2,32767,-32768),this[yt]=lt>>>8,this[yt+1]=lt&255,yt+2},b.prototype.writeInt32LE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,2147483647,-2147483648),this[yt]=lt&255,this[yt+1]=lt>>>8,this[yt+2]=lt>>>16,this[yt+3]=lt>>>24,yt+4},b.prototype.writeInt32BE=function(lt,yt,St){return lt=+lt,yt=yt>>>0,St||Nt(this,lt,yt,4,2147483647,-2147483648),lt<0&&(lt=4294967295+lt+1),this[yt]=lt>>>24,this[yt+1]=lt>>>16,this[yt+2]=lt>>>8,this[yt+3]=lt&255,yt+4},b.prototype.writeBigInt64LE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ee(this,lt,yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=qt(function(lt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Jt(this,lt,yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(lt,yt,St,Ht,Yt,se){if(St+Ht>lt.length)throw new RangeError("Index out of range");if(St<0)throw new RangeError("Index out of range")}function Kt(lt,yt,St,Ht,Yt){return yt=+yt,St=St>>>0,Yt||te(lt,yt,St,4),k.write(lt,yt,St,Ht,23,4),St+4}b.prototype.writeFloatLE=function(lt,yt,St){return Kt(this,lt,yt,!0,St)},b.prototype.writeFloatBE=function(lt,yt,St){return Kt(this,lt,yt,!1,St)};function mt(lt,yt,St,Ht,Yt){return yt=+yt,St=St>>>0,Yt||te(lt,yt,St,8),k.write(lt,yt,St,Ht,52,8),St+8}b.prototype.writeDoubleLE=function(lt,yt,St){return mt(this,lt,yt,!0,St)},b.prototype.writeDoubleBE=function(lt,yt,St){return mt(this,lt,yt,!1,St)},b.prototype.copy=function(lt,yt,St,Ht){if(!b.isBuffer(lt))throw new TypeError("argument should be a Buffer");if(St||(St=0),!Ht&&Ht!==0&&(Ht=this.length),yt>=lt.length&&(yt=lt.length),yt||(yt=0),Ht>0&&Ht<St&&(Ht=St),Ht===St||lt.length===0||this.length===0)return 0;if(yt<0)throw new RangeError("targetStart out of bounds");if(St<0||St>=this.length)throw new RangeError("Index out of range");if(Ht<0)throw new RangeError("sourceEnd out of bounds");Ht>this.length&&(Ht=this.length),lt.length-yt<Ht-St&&(Ht=lt.length-yt+St);var Yt=Ht-St;return this===lt&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(yt,St,Ht):Uint8Array.prototype.set.call(lt,this.subarray(St,Ht),yt),Yt},b.prototype.fill=function(lt,yt,St,Ht){if(typeof lt=="string"){if(typeof yt=="string"?(Ht=yt,yt=0,St=this.length):typeof St=="string"&&(Ht=St,St=this.length),Ht!==void 0&&typeof Ht!="string")throw new TypeError("encoding must be a string");if(typeof Ht=="string"&&!b.isEncoding(Ht))throw new TypeError("Unknown encoding: "+Ht);if(lt.length===1){var Yt=lt.charCodeAt(0);(Ht==="utf8"&&Yt<128||Ht==="latin1")&&(lt=Yt)}}else typeof lt=="number"?lt=lt&255:typeof lt=="boolean"&&(lt=Number(lt));if(yt<0||this.length<yt||this.length<St)throw new RangeError("Out of range index");if(St<=yt)return this;yt=yt>>>0,St=St===void 0?this.length:St>>>0,lt||(lt=0);var se;if(typeof lt=="number")for(se=yt;se<St;++se)this[se]=lt;else{var ke=b.isBuffer(lt)?lt:b.from(lt,Ht),Ee=ke.length;if(Ee===0)throw new TypeError('The value "'+lt+'" is invalid for argument "value"');for(se=0;se<St-yt;++se)this[se+yt]=ke[se%Ee]}return this};var bt={};function vt(lt,yt,St){bt[lt]=function(Ht){function Yt(){var se;return i(this,Yt),se=f(this,Yt),Object.defineProperty(se,"message",{value:yt.apply(se,arguments),writable:!0,configurable:!0}),se.name="".concat(se.name," [").concat(lt,"]"),se.stack,delete se.name,se}return l(Yt,Ht),o(Yt,[{key:"code",get:function(){return lt},set:function(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(lt,"]: ").concat(this.message)}}])}(St)}vt("ERR_BUFFER_OUT_OF_BOUNDS",function(lt){return lt?"".concat(lt," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),vt("ERR_INVALID_ARG_TYPE",function(lt,yt){return'The "'.concat(lt,'" argument must be of type number. Received type ').concat(y(yt))},TypeError),vt("ERR_OUT_OF_RANGE",function(lt,yt,St){var Ht='The value of "'.concat(lt,'" is out of range.'),Yt=St;return Number.isInteger(St)&&Math.abs(St)>Math.pow(2,32)?Yt=Ut(String(St)):typeof St=="bigint"&&(Yt=String(St),(St>Math.pow(BigInt(2),BigInt(32))||St<-Math.pow(BigInt(2),BigInt(32)))&&(Yt=Ut(Yt)),Yt+="n"),Ht+=" It must be ".concat(yt,". Received ").concat(Yt),Ht},RangeError);function Ut(lt){for(var yt="",St=lt.length,Ht=lt[0]==="-"?1:0;St>=Ht+4;St-=3)yt="_".concat(lt.slice(St-3,St)).concat(yt);return"".concat(lt.slice(0,St)).concat(yt)}function re(lt,yt,St){ue(yt,"offset"),(lt[yt]===void 0||lt[yt+St]===void 0)&&Me(yt,lt.length-(St+1))}function Zt(lt,yt,St,Ht,Yt,se){if(lt>St||lt<yt){var ke=typeof yt=="bigint"?"n":"",Ee;throw yt===0||yt===BigInt(0)?Ee=">= 0".concat(ke," and < 2").concat(ke," ** ").concat((se+1)*8).concat(ke):Ee=">= -(2".concat(ke," ** ").concat((se+1)*8-1).concat(ke,") and < 2 ** ")+"".concat((se+1)*8-1).concat(ke),new bt.ERR_OUT_OF_RANGE("value",Ee,lt)}re(Ht,Yt,se)}function ue(lt,yt){if(typeof lt!="number")throw new bt.ERR_INVALID_ARG_TYPE(yt,"number",lt)}function Me(lt,yt,St){throw Math.floor(lt)!==lt?(ue(lt,St),new bt.ERR_OUT_OF_RANGE("offset","an integer",lt)):yt<0?new bt.ERR_BUFFER_OUT_OF_BOUNDS:new bt.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(yt),lt)}var Ce=/[^+/0-9A-Za-z-_]/g;function We(lt){if(lt=lt.split("=")[0],lt=lt.trim().replace(Ce,""),lt.length<2)return"";for(;lt.length%4!==0;)lt=lt+"=";return lt}function qe(lt,yt){yt=yt||1/0;for(var St,Ht=lt.length,Yt=null,se=[],ke=0;ke<Ht;++ke){if(St=lt.charCodeAt(ke),St>55295&&St<57344){if(!Yt){if(St>56319){(yt-=3)>-1&&se.push(239,191,189);continue}else if(ke+1===Ht){(yt-=3)>-1&&se.push(239,191,189);continue}Yt=St;continue}if(St<56320){(yt-=3)>-1&&se.push(239,191,189),Yt=St;continue}St=(Yt-55296<<10|St-56320)+65536}else Yt&&(yt-=3)>-1&&se.push(239,191,189);if(Yt=null,St<128){if((yt-=1)<0)break;se.push(St)}else if(St<2048){if((yt-=2)<0)break;se.push(St>>6|192,St&63|128)}else if(St<65536){if((yt-=3)<0)break;se.push(St>>12|224,St>>6&63|128,St&63|128)}else if(St<1114112){if((yt-=4)<0)break;se.push(St>>18|240,St>>12&63|128,St>>6&63|128,St&63|128)}else throw new Error("Invalid code point")}return se}function vr(lt){for(var yt=[],St=0;St<lt.length;++St)yt.push(lt.charCodeAt(St)&255);return yt}function _r(lt,yt){for(var St,Ht,Yt,se=[],ke=0;ke<lt.length&&!((yt-=2)<0);++ke)St=lt.charCodeAt(ke),Ht=St>>8,Yt=St%256,se.push(Yt),se.push(Ht);return se}function er(lt){return S.toByteArray(We(lt))}function Mr(lt,yt,St,Ht){var Yt;for(Yt=0;Yt<Ht&&!(Yt+St>=yt.length||Yt>=lt.length);++Yt)yt[Yt+St]=lt[Yt];return Yt}function Ir(lt,yt){return lt instanceof yt||lt!=null&&lt.constructor!=null&&lt.constructor.name!=null&&lt.constructor.name===yt.name}function de(lt){return lt!==lt}var Dt=function(){for(var lt="0123456789abcdef",yt=new Array(256),St=0;St<16;++St)for(var Ht=St*16,Yt=0;Yt<16;++Yt)yt[Ht+Yt]=lt[St]+lt[Yt];return yt}();function qt(lt){return typeof BigInt>"u"?_t:lt}function _t(){throw new Error("BigInt not supported")}},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}},4905:function(t,e,r){var i=r(5874);t.exports=n;function n(o,a){var s=i(a),f=[];return f=f.concat(s(o)),f=f.concat(s(null)),f}},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||{},f=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var v=3;function g(y,S,k,M){this.gl=y,this.shader=S,this.buffer=k,this.vao=M,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var m=g.prototype,w=[0,0];m.bind=function(y,S,k,M){this.vao.bind(),this.shader.bind();var T=this.shader.uniforms;T.model=y,T.view=S,T.projection=k,T.pixelScale=M,w[0]=this.gl.drawingBufferWidth,w[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=w},m.unbind=function(){this.vao.unbind()},m.update=function(y,S,k,M,T){var c=[];function h(N,j,G,rt,ct,st){var et=[G.style,G.weight,G.variant,G.family].join("_"),K=f[et];K||(K=f[et]={});var ot=K[j];ot||(ot=K[j]=l(j,{triangles:!0,font:G.family,fontStyle:G.style,fontWeight:G.weight,fontVariant:G.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ct,styletags:st}));for(var X=(rt||12)/12,Q=ot.positions,ut=ot.cells,J=0,q=ut.length;J<q;++J)for(var it=ut[J],nt=2;nt>=0;--nt){var dt=Q[it[nt]];c.push(X*dt[0],-X*dt[1],N)}}for(var b=[0,0,0],_=[0,0,0],P=[0,0,0],L=[0,0,0],D=1.25,B={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},R=0;R<3;++R){P[R]=c.length/v|0,h(.5*(y[0][R]+y[1][R]),S[R],k[R],12,D,B),L[R]=(c.length/v|0)-P[R],b[R]=c.length/v|0;for(var I=0;I<M[R].length;++I)if(M[R][I].text){var F={family:M[R][I].font||T[R].family,style:T[R].fontStyle||T[R].style,weight:T[R].fontWeight||T[R].weight,variant:T[R].fontVariant||T[R].variant};h(M[R][I].x,M[R][I].text,F,M[R][I].fontSize||12,D,B)}_[R]=(c.length/v|0)-b[R]}this.buffer.update(c),this.tickOffset=b,this.tickCount=_,this.labelOffset=P,this.labelCount=L},m.drawTicks=function(y,S,k,M,T,c,h,b){this.tickCount[y]&&(this.shader.uniforms.axis=c,this.shader.uniforms.color=T,this.shader.uniforms.angle=k,this.shader.uniforms.scale=S,this.shader.uniforms.offset=M,this.shader.uniforms.alignDir=h,this.shader.uniforms.alignOpt=b,this.vao.draw(this.gl.TRIANGLES,this.tickCount[y],this.tickOffset[y]))},m.drawLabel=function(y,S,k,M,T,c,h,b){this.labelCount[y]&&(this.shader.uniforms.axis=c,this.shader.uniforms.color=T,this.shader.uniforms.angle=k,this.shader.uniforms.scale=S,this.shader.uniforms.offset=M,this.shader.uniforms.alignDir=h,this.shader.uniforms.alignOpt=b,this.vao.draw(this.gl.TRIANGLES,this.labelCount[y],this.labelOffset[y]))},m.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(y,S){try{return o(y,S)}catch(k){return console.warn('error vectorizing text:"'+y+'" error:',k),{cells:[],positions:[]}}}function x(y,S,k,M,T,c){var h=i(y),b=n(y,[{buffer:h,size:3}]),_=a(y);_.attributes.position.location=0;var P=new g(y,_,h,b);return P.update(S,k,M,T,c),P}},5023:function(t,e,r){var i=r(2478);t.exports=v;function n(g,m,w,l,x,y,S){this.cells=g,this.neighbor=m,this.flags=l,this.constraint=w,this.active=x,this.next=y,this.boundary=S}var o=n.prototype;function a(g,m){return g[0]-m[0]||g[1]-m[1]||g[2]-m[2]}o.locate=function(){var g=[0,0,0];return function(m,w,l){var x=m,y=w,S=l;return w<l?w<m&&(x=w,y=l,S=m):l<m&&(x=l,y=m,S=w),x<0?-1:(g[0]=x,g[1]=y,g[2]=S,i.eq(this.cells,g,a))}}();function s(g,m){for(var w=g.cells(),l=w.length,x=0;x<l;++x){var y=w[x],S=y[0],k=y[1],M=y[2];k<M?k<S&&(y[0]=k,y[1]=M,y[2]=S):M<S&&(y[0]=M,y[1]=S,y[2]=k)}w.sort(a);for(var T=new Array(l),x=0;x<T.length;++x)T[x]=0;var c=[],h=[],b=new Array(3*l),_=new Array(3*l),P=null;m&&(P=[]);for(var L=new n(w,b,_,T,c,h,P),x=0;x<l;++x)for(var y=w[x],D=0;D<3;++D){var S=y[D],k=y[(D+1)%3],B=b[3*x+D]=L.locate(k,S,g.opposite(k,S)),R=_[3*x+D]=g.isConstraint(S,k);B<0&&(R?h.push(x):(c.push(x),T[x]=1),m&&P.push([k,S,-1]))}return L}function f(g,m,w){for(var l=0,x=0;x<g.length;++x)m[x]===w&&(g[l++]=g[x]);return g.length=l,g}function v(g,m,w){var l=s(g,w);if(m===0)return w?l.cells.concat(l.boundary):l.cells;for(var x=1,y=l.active,S=l.next,k=l.flags,M=l.cells,T=l.constraint,c=l.neighbor;y.length>0||S.length>0;){for(;y.length>0;){var h=y.pop();if(k[h]!==-x){k[h]=x;for(var b=M[h],_=0;_<3;++_){var P=c[3*h+_];P>=0&&k[P]===0&&(T[3*h+_]?S.push(P):(y.push(P),k[P]=x))}}}var L=S;S=y,y=L,S.length=0,x=-x}var D=f(M,k,m);return w?D.concat(l.boundary):D}},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]]]}},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 f(y){return function(S,k){var M=y[S];return M?!!M.queryPoint(k,s):!1}}function v(y){for(var S={},k=0;k<y.length;++k){var M=y[k],T=M[0][0],c=M[0][1],h=M[1][1],b=[Math.min(c,h),Math.max(c,h)];T in S?S[T].push(b):S[T]=[b]}for(var _={},P=Object.keys(S),k=0;k<P.length;++k){var L=S[P[k]];_[P[k]]=o(L)}return f(_)}function g(y,S){return function(k){var M=a.le(S,k[0]);if(M<0)return 1;var T=y[M];if(!T)if(M>0&&S[M]===k[0])T=y[M-1];else return 1;for(var c=1;T;){var h=T.key,b=i(k,h[0],h[1]);if(h[0][0]<h[1][0])if(b<0)T=T.left;else if(b>0)c=-1,T=T.right;else return 0;else if(b>0)T=T.left;else if(b<0)c=1,T=T.right;else return 0}return c}}function m(y){return 1}function w(y){return function(S){return y(S[0],S[1])?0:1}}function l(y,S){return function(k){return y(k[0],k[1])?0:S(k)}}function x(y){for(var S=y.length,k=[],M=[],T=0,c=0;c<S;++c)for(var h=y[c],b=h.length,_=b-1,P=0;P<b;_=P++){var L=h[_],D=h[P];L[0]===D[0]?M.push([L,D]):k.push([L,D])}if(k.length===0)return M.length===0?m:w(v(M));var B=n(k),R=g(B.slabs,B.coordinates);return M.length===0?R:l(v(M),R)}},5091:function(t,e,r){e.shader=x,e.program=y;var i=r(8866),n=r(2992),o=typeof WeakMap>"u"?r(606):WeakMap,a=new o,s=0;function f(S,k,M,T,c,h,b){this.id=S,this.src=k,this.type=M,this.shader=T,this.count=h,this.programs=[],this.cache=b}f.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,k=S.gl,M=this.programs,T=0,c=M.length;T<c;++T){var h=S.programs[M[T]];h&&(delete S.programs[T],k.deleteProgram(h))}k.deleteShader(this.shader),delete S.shaders[this.type===k.FRAGMENT_SHADER|0][this.src]}};function v(S){this.gl=S,this.shaders=[{},{}],this.programs={}}var g=v.prototype;function m(S,k,M){var T=S.createShader(k);if(S.shaderSource(T,M),S.compileShader(T),!S.getShaderParameter(T,S.COMPILE_STATUS)){var c=S.getShaderInfoLog(T);try{var h=n(c,M,k)}catch(b){throw console.warn("Failed to format compiler error: "+b),new i(c,`Error compiling shader:
`+c)}throw new i(c,h.short,h.long)}return T}g.getShaderReference=function(S,k){var M=this.gl,T=this.shaders[S===M.FRAGMENT_SHADER|0],c=T[k];if(!c||!M.isShader(c.shader)){var h=m(M,S,k);c=T[k]=new f(s++,k,S,h,[],1,this)}else c.count+=1;return c};function w(S,k,M,T,c){var h=S.createProgram();S.attachShader(h,k),S.attachShader(h,M);for(var b=0;b<T.length;++b)S.bindAttribLocation(h,c[b],T[b]);if(S.linkProgram(h),!S.getProgramParameter(h,S.LINK_STATUS)){var _=S.getProgramInfoLog(h);throw new i(_,"Error linking program: "+_)}return h}g.getProgram=function(S,k,M,T){var c=[S.id,k.id,M.join(":"),T.join(":")].join("@"),h=this.programs[c];return(!h||!this.gl.isProgram(h))&&(this.programs[c]=h=w(this.gl,S.shader,k.shader,M,T),S.programs.push(c),k.programs.push(c)),h};function l(S){var k=a.get(S);return k||(k=new v(S),a.set(S,k)),k}function x(S,k,M){return l(S).getShaderReference(k,M)}function y(S,k,M,T,c){return l(S).getProgram(k,M,T,c)}},5093:function(t){t.exports=e;function e(r,i){return r[0]=-i[0],r[1]=-i[1],r[2]=-i[2],r}},5137:function(t,e,r){t.exports=n;var i=r(1091)();function n(o,a,s,f,v,g){var m,w;for(a||(a=3),s||(s=0),f?w=Math.min(f*a+s,o.length):w=o.length,m=s;m<w;m+=a)i[0]=o[m],i[1]=o[m+1],i[2]=o[m+2],v(i,i,g),o[m]=i[0],o[m+1]=i[1],o[m+2]=i[2];return o}},5171:function(t,e,r){var i=r(737);t.exports=function(n){return i[n]}},5177:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],f=n*n+o*o+a*a+s*s;return f>0&&(f=1/Math.sqrt(f),r[0]=n*f,r[1]=o*f,r[2]=a*f,r[3]=s*f),r}},5202:function(t,e,r){var i=r(1944),n=r(8210);t.exports=s,t.exports.positive=f,t.exports.negative=v;function o(g,m){var w=n(i(g,m),[m[m.length-1]]);return w[w.length-1]}function a(g,m,w,l){var x=l-m,y=-m/x;y<0?y=0:y>1&&(y=1);for(var S=1-y,k=g.length,M=new Array(k),T=0;T<k;++T)M[T]=y*g[T]+S*w[T];return M}function s(g,m){for(var w=[],l=[],x=o(g[g.length-1],m),y=g[g.length-1],S=g[0],k=0;k<g.length;++k,y=S){S=g[k];var M=o(S,m);if(x<0&&M>0||x>0&&M<0){var T=a(y,M,S,x);w.push(T),l.push(T.slice())}M<0?l.push(S.slice()):M>0?w.push(S.slice()):(w.push(S.slice()),l.push(S.slice())),x=M}return{positive:w,negative:l}}function f(g,m){for(var w=[],l=o(g[g.length-1],m),x=g[g.length-1],y=g[0],S=0;S<g.length;++S,x=y){y=g[S];var k=o(y,m);(l<0&&k>0||l>0&&k<0)&&w.push(a(x,k,y,l)),k>=0&&w.push(y.slice()),l=k}return w}function v(g,m){for(var w=[],l=o(g[g.length-1],m),x=g[g.length-1],y=g[0],S=0;S<g.length;++S,x=y){y=g[S];var k=o(y,m);(l<0&&k>0||l>0&&k<0)&&w.push(a(x,k,y,l)),k<=0&&w.push(y.slice()),l=k}return w}},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}},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,f=s-i,v=s-f,g=i-v,m=e*n,w=m-n,l=m-w,x=n-l,y=a-v*l,S=y-g*l,k=S-v*x,M=g*x-k;return o?(o[0]=M,o[1]=a,o):[M,a]}},5298:function(t,e){var r={"float64,2,1,0":function(){return function(v,g,m,w,l){var x=v[0],y=v[1],S=v[2],k=m[0],M=m[1],T=m[2];w|=0;var c=0,h=0,b=0,_=T,P=M-S*T,L=k-y*M;for(b=0;b<x;++b){for(h=0;h<y;++h){for(c=0;c<S;++c)g[w]/=l,w+=_;w+=P}w+=L}}},"uint8,2,0,1,float64,2,1,0":function(){return function(v,g,m,w,l,x,y,S){var k=v[0],M=v[1],T=v[2],c=m[0],h=m[1],b=m[2],_=x[0],P=x[1],L=x[2];w|=0,y|=0;for(var D=w,B=y,R=v[0]|0;R>0;){R<64?(k=R,R=0):(k=64,R-=64);for(var I=v[1]|0;I>0;){I<64?(M=I,I=0):(M=64,I-=64),w=D+R*c+I*h,y=B+R*_+I*P;var F=0,N=0,j=0,G=b,rt=c-T*b,ct=h-k*c,st=L,et=_-T*L,K=P-k*_;for(j=0;j<M;++j){for(N=0;N<k;++N){for(F=0;F<T;++F)g[w]=l[y]*S,w+=G,y+=st;w+=rt,y+=et}w+=ct,y+=K}}}}},"float32,1,0,float32,1,0":function(){return function(v,g,m,w,l,x,y){var S=v[0],k=v[1],M=m[0],T=m[1],c=x[0],h=x[1];w|=0,y|=0;var b=0,_=0,P=T,L=M-k*T,D=h,B=c-k*h;for(_=0;_<S;++_){for(b=0;b<k;++b)g[w]=l[y],w+=P,y+=D;w+=L,y+=B}}},"float32,1,0,float32,0,1":function(){return function(v,g,m,w,l,x,y){var S=v[0],k=v[1],M=m[0],T=m[1],c=x[0],h=x[1];w|=0,y|=0;for(var b=w,_=y,P=v[1]|0;P>0;){P<64?(k=P,P=0):(k=64,P-=64);for(var L=v[0]|0;L>0;){L<64?(S=L,L=0):(S=64,L-=64),w=b+P*T+L*M,y=_+P*h+L*c;var D=0,B=0,R=T,I=M-k*T,F=h,N=c-k*h;for(B=0;B<S;++B){for(D=0;D<k;++D)g[w]=l[y],w+=R,y+=F;w+=I,y+=N}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(v,g,m,w,l,x,y){var S=v[0],k=v[1],M=v[2],T=m[0],c=m[1],h=m[2],b=x[0],_=x[1],P=x[2];w|=0,y|=0;for(var L=w,D=y,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 I=v[1]|0;I>0;){I<64?(k=I,I=0):(k=64,I-=64),w=L+B*h+R*T+I*c,y=D+B*P+R*b+I*_;var F=0,N=0,j=0,G=h,rt=T-M*h,ct=c-S*T,st=P,et=b-M*P,K=_-S*b;for(j=0;j<k;++j){for(N=0;N<S;++N){for(F=0;F<M;++F)g[w]=l[y],w+=G,y+=st;w+=rt,y+=et}w+=ct,y+=K}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(v,g,m,w,l,x,y){var S=v[0],k=v[1],M=v[2],T=m[0],c=m[1],h=m[2],b=x[0],_=x[1],P=x[2];w|=0,y|=0;var L=0,D=0,B=0,R=h,I=T-M*h,F=c-S*T,N=P,j=b-M*P,G=_-S*b;for(B=0;B<k;++B){for(D=0;D<S;++D){for(L=0;L<M;++L)g[w]=l[y],w+=R,y+=N;w+=I,y+=j}w+=F,y+=G}}}};function i(v,g){var m=g.join(","),w=r[m];return w()}var n=i,o={mul:function(v){var g={};return function(m,w,l){var x=m.dtype,y=m.order,S=w.dtype,k=w.order,M=l.dtype,T=l.order,c=[x,y.join(),S,k.join(),M,T.join()].join(),h=g[c];return h||(g[c]=h=v([x,y,S,k,M,T])),h(m.shape.slice(0),m.data,m.stride,m.offset|0,w.data,w.stride,w.offset|0,l.data,l.stride,l.offset|0)}},muls:function(v){var g={};return function(m,w,l){var x=m.dtype,y=m.order,S=w.dtype,k=w.order,M=[x,y.join(),S,k.join()].join(),T=g[M];return T||(g[M]=T=v([x,y,S,k])),T(m.shape.slice(0),m.data,m.stride,m.offset|0,w.data,w.stride,w.offset|0,l)}},mulseq:function(v){var g={};return function(m,w){var l=m.dtype,x=m.order,y=[l,x.join()].join(),S=g[y];return S||(g[y]=S=v([l,x])),S(m.shape.slice(0),m.data,m.stride,m.offset|0,w)}},div:function(v){var g={};return function(m,w,l){var x=m.dtype,y=m.order,S=w.dtype,k=w.order,M=l.dtype,T=l.order,c=[x,y.join(),S,k.join(),M,T.join()].join(),h=g[c];return h||(g[c]=h=v([x,y,S,k,M,T])),h(m.shape.slice(0),m.data,m.stride,m.offset|0,w.data,w.stride,w.offset|0,l.data,l.stride,l.offset|0)}},divs:function(v){var g={};return function(m,w,l){var x=m.dtype,y=m.order,S=w.dtype,k=w.order,M=[x,y.join(),S,k.join()].join(),T=g[M];return T||(g[M]=T=v([x,y,S,k])),T(m.shape.slice(0),m.data,m.stride,m.offset|0,w.data,w.stride,w.offset|0,l)}},divseq:function(v){var g={};return function(m,w){var l=m.dtype,x=m.order,y=[l,x.join()].join(),S=g[y];return S||(g[y]=S=v([l,x])),S(m.shape.slice(0),m.data,m.stride,m.offset|0,w)}},assign:function(v){var g={};return function(m,w){var l=m.dtype,x=m.order,y=w.dtype,S=w.order,k=[l,x.join(),y,S.join()].join(),M=g[k];return M||(g[k]=M=v([l,x,y,S])),M(m.shape.slice(0),m.data,m.stride,m.offset|0,w.data,w.stride,w.offset|0)}}};function a(v){var g=o[v.funcName];return g(n.bind(void 0,v))}function s(v){return a({funcName:v.funcName})}var f={mul:"*",div:"/"};(function(){for(var v in f)e[v]=s({funcName:v}),e[v+"s"]=s({funcName:v+"s"}),e[v+"seq"]=s({funcName:v+"seq"})})(),e.assign=s({funcName:"assign"})},5304:function(t,e,r){t.exports=f;var i=r(2762),n=r(8116),o=r(1879).bg;function a(v,g,m,w){this.gl=v,this.buffer=g,this.vao=m,this.shader=w}var s=a.prototype;s.draw=function(v,g,m,w,l,x){for(var y=!1,S=0;S<3;++S)y=y||l[S];if(y){var k=this.gl;k.enable(k.POLYGON_OFFSET_FILL),k.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:v,view:g,projection:m,bounds:w,enable:l,colors:x},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),k.disable(k.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function f(v){for(var g=[],m=[],w=0,l=0;l<3;++l)for(var x=(l+1)%3,y=(l+2)%3,S=[0,0,0],k=[0,0,0],M=-1;M<=1;M+=2){m.push(w,w+2,w+1,w+1,w+2,w+3),S[l]=M,k[l]=M;for(var T=-1;T<=1;T+=2){S[x]=T;for(var c=-1;c<=1;c+=2)S[y]=c,g.push(S[0],S[1],S[2],k[0],k[1],k[2]),w+=1}var h=x;x=y,y=h}var b=i(v,new Float32Array(g)),_=i(v,new Uint16Array(m),v.ELEMENT_ARRAY_BUFFER),P=n(v,[{buffer:b,type:v.FLOAT,size:3,offset:0,stride:24},{buffer:b,type:v.FLOAT,size:3,offset:12,stride:24}],_),L=o(v);return L.attributes.position.location=0,L.attributes.normal.location=1,new a(v,b,P,L)}},5352:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=i[3];return r[0]=n[0]*o+n[4]*a+n[8]*s+n[12]*f,r[1]=n[1]*o+n[5]*a+n[9]*s+n[13]*f,r[2]=n[2]*o+n[6]*a+n[10]*s+n[14]*f,r[3]=n[3]*o+n[7]*a+n[11]*s+n[15]*f,r}},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 f=[0];if(a.length<s.length)for(var v=0;v<a.length;++v)f=i(f,n(s,a[v]));else for(var v=0;v<s.length;++v)f=i(f,n(a,s[v]));return f}},5445:function(t,e,r){t.exports=k;var i=r(5033),n=r(5202),o=r(6429),a=r(6760),s=r(5665),f=r(5352),v=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),g=new Float32Array(16);function m(M,T,c){this.lo=M,this.hi=T,this.pixelsPerDataUnit=c}var w=[0,0,0,1],l=[0,0,0,1];function x(M,T,c,h,b){for(var _=0;_<3;++_){for(var P=w,L=l,D=0;D<3;++D)L[D]=P[D]=c[D];L[3]=P[3]=1,L[_]+=1,f(L,L,T),L[3]<0&&(M[_]=1/0),P[_]-=1,f(P,P,T),P[3]<0&&(M[_]=1/0);var B=(P[0]/P[3]-L[0]/L[3])*h,R=(P[1]/P[3]-L[1]/L[3])*b;M[_]=.25*Math.sqrt(B*B+R*R)}return M}var y=[new m(1/0,-1/0,1/0),new m(1/0,-1/0,1/0),new m(1/0,-1/0,1/0)],S=[0,0,0];function k(M,T,c,h,R){var _=T.model||v,P=T.view||v,L=T.projection||v,D=T._ortho||!1,B=M.bounds,R=R||o(_,P,L,B,D),I=R.axis;a(g,P,_),a(g,L,g);for(var F=y,N=0;N<3;++N)F[N].lo=1/0,F[N].hi=-1/0,F[N].pixelsPerDataUnit=1/0;var j=i(s(g,g));s(g,g);for(var G=0;G<3;++G){var rt=(G+1)%3,ct=(G+2)%3,st=S;t:for(var N=0;N<2;++N){var et=[];if(I[G]<0!=!!N){st[G]=B[N][G];for(var K=0;K<2;++K){st[rt]=B[K^N][rt];for(var ot=0;ot<2;++ot)st[ct]=B[ot^K^N][ct],et.push(st.slice())}for(var X=D?5:4,K=X;K===X;++K){if(et.length===0)continue t;et=n.positive(et,j[K])}for(var K=0;K<et.length;++K)for(var ct=et[K],Q=x(S,g,ct,c,h),ot=0;ot<3;++ot)F[ot].lo=Math.min(F[ot].lo,ct[ot]),F[ot].hi=Math.max(F[ot].hi,ct[ot]),ot!==G&&(F[ot].pixelsPerDataUnit=Math.min(F[ot].pixelsPerDataUnit,Math.abs(Q[ot])))}}}return F}},5455:function(t,e,r){t.exports=r(7056)},5486:function(t,e,r){t.exports=r(3066)},5542:function(t,e,r){var i=r(2478);t.exports=s;function n(f,v){this.stars=f,this.edges=v}var o=n.prototype;function a(f,v,g){for(var m=1,w=f.length;m<w;m+=2)if(f[m-1]===v&&f[m]===g){f[m-1]=f[w-2],f[m]=f[w-1],f.length=w-2;return}}o.isConstraint=function(){var f=[0,0];function v(g,m){return g[0]-m[0]||g[1]-m[1]}return function(g,m){return f[0]=Math.min(g,m),f[1]=Math.max(g,m),i.eq(this.edges,f,v)>=0}}(),o.removeTriangle=function(f,v,g){var m=this.stars;a(m[f],v,g),a(m[v],g,f),a(m[g],f,v)},o.addTriangle=function(f,v,g){var m=this.stars;m[f].push(v,g),m[v].push(g,f),m[g].push(f,v)},o.opposite=function(f,v){for(var g=this.stars[v],m=1,w=g.length;m<w;m+=2)if(g[m]===f)return g[m-1];return-1},o.flip=function(f,v){var g=this.opposite(f,v),m=this.opposite(v,f);this.removeTriangle(f,v,g),this.removeTriangle(v,f,m),this.addTriangle(f,m,g),this.addTriangle(v,g,m)},o.edges=function(){for(var f=this.stars,v=[],g=0,m=f.length;g<m;++g)for(var w=f[g],l=0,x=w.length;l<x;l+=2)v.push([w[l],w[l+1]]);return v},o.cells=function(){for(var f=this.stars,v=[],g=0,m=f.length;g<m;++g)for(var w=f[g],l=0,x=w.length;l<x;l+=2){var y=w[l],S=w[l+1];g<Math.min(y,S)&&v.push([g,y,S])}return v};function s(f,v){for(var g=new Array(f),m=0;m<f;++m)g[m]=[];return new n(g,v)}},5567:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[4],f=i[5],v=i[6],g=i[7],m=i[8],w=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+m*o,r[5]=f*a+w*o,r[6]=v*a+l*o,r[7]=g*a+x*o,r[8]=m*a-s*o,r[9]=w*a-f*o,r[10]=l*a-v*o,r[11]=x*a-g*o,r}},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]))}},5609:function(t,e,r){t.exports=n;var i=r(3134);function n(o,a){for(var s=i(o,a.length),f=new Array(a.length),v=new Array(a.length),g=[],m=0;m<a.length;++m){var w=s[m].length;v[m]=w,f[m]=!0,w<=1&&g.push(m)}for(;g.length>0;){var l=g.pop();f[l]=!1;for(var x=s[l],m=0;m<x.length;++m){var y=x[m];--v[y]===0&&g.push(y)}}for(var S=new Array(a.length),k=[],m=0;m<a.length;++m)if(f[m]){var l=k.length;S[m]=l,k.push(a[m])}else S[m]=-1;for(var M=[],m=0;m<o.length;++m){var T=o[m];f[T[0]]&&f[T[1]]&&M.push([S[T[0]],S[T[1]]])}return[M,k]}},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}},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],f=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]=f,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}},5673:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=n[3]*o+n[7]*a+n[11]*s+n[15];return f=f||1,r[0]=(n[0]*o+n[4]*a+n[8]*s+n[12])/f,r[1]=(n[1]*o+n[5]*a+n[9]*s+n[13])/f,r[2]=(n[2]*o+n[6]*a+n[10]*s+n[14])/f,r}},5714:function(t,e,r){t.exports=c;var i=r(2762),n=r(8116),o=r(7766),a=new Uint8Array(4),s=new Float32Array(a.buffer);function f(h,b,_,P){return a[0]=P,a[1]=_,a[2]=b,a[3]=h,s[0]}var v=r(2478),g=r(9618),m=r(7319),w=m.createShader,l=m.createPickShader,x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(h,b){for(var _=0,P=0;P<3;++P){var L=h[P]-b[P];_+=L*L}return Math.sqrt(_)}function S(h){for(var b=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],_=0;_<3;++_)b[0][_]=Math.max(h[0][_],b[0][_]),b[1][_]=Math.min(h[1][_],b[1][_]);return b}function k(h,b,_,P){this.arcLength=h,this.position=b,this.index=_,this.dataCoordinate=P}function M(h,b,_,P,L,D){this.gl=h,this.shader=b,this.pickShader=_,this.buffer=P,this.vao=L,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=D,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var T=M.prototype;T.isTransparent=function(){return this.hasAlpha},T.isOpaque=function(){return!this.hasAlpha},T.pickSlots=1,T.setPickBase=function(h){this.pickId=h},T.drawTransparent=T.draw=function(h){if(this.vertexCount){var b=this.gl,_=this.shader,P=this.vao;_.bind(),_.uniforms={model:h.model||x,view:h.view||x,projection:h.projection||x,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[b.drawingBufferWidth,b.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(b.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},T.drawPick=function(h){if(this.vertexCount){var b=this.gl,_=this.pickShader,P=this.vao;_.bind(),_.uniforms={model:h.model||x,view:h.view||x,projection:h.projection||x,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[b.drawingBufferWidth,b.drawingBufferHeight],pixelRatio:this.pixelRatio},P.bind(),P.draw(b.TRIANGLE_STRIP,this.vertexCount),P.unbind()}},T.update=function(h){var b,_;this.dirty=!0;var P=!!h.connectGaps;"dashScale"in h&&(this.dashScale=h.dashScale),this.hasAlpha=!1,"opacity"in h&&(this.opacity=+h.opacity,this.opacity<1&&(this.hasAlpha=!0));var L=[],D=[],B=[],R=0,I=0,F=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=h.position||h.positions;if(N){var j=h.color||h.colors||[0,0,0,1],G=h.lineWidth||1,rt=!1;t:for(b=1;b<N.length;++b){var ct=N[b-1],st=N[b];for(D.push(R),B.push(ct.slice()),_=0;_<3;++_){if(isNaN(ct[_])||isNaN(st[_])||!isFinite(ct[_])||!isFinite(st[_])){if(!P&&L.length>0){for(var et=0;et<24;++et)L.push(L[L.length-12]);I+=2,rt=!0}continue t}F[0][_]=Math.min(F[0][_],ct[_],st[_]),F[1][_]=Math.max(F[1][_],ct[_],st[_])}var K,ot;Array.isArray(j[0])?(K=j.length>b-1?j[b-1]:j.length>0?j[j.length-1]:[0,0,0,1],ot=j.length>b?j[b]:j.length>0?j[j.length-1]:[0,0,0,1]):K=ot=j,K.length===3&&(K=[K[0],K[1],K[2],1]),ot.length===3&&(ot=[ot[0],ot[1],ot[2],1]),!this.hasAlpha&&K[3]<1&&(this.hasAlpha=!0);var X;Array.isArray(G)?X=G.length>b-1?G[b-1]:G.length>0?G[G.length-1]:[0,0,0,1]:X=G;var Q=R;if(R+=y(ct,st),rt){for(_=0;_<2;++_)L.push(ct[0],ct[1],ct[2],st[0],st[1],st[2],Q,X,K[0],K[1],K[2],K[3]);I+=2,rt=!1}L.push(ct[0],ct[1],ct[2],st[0],st[1],st[2],Q,X,K[0],K[1],K[2],K[3],ct[0],ct[1],ct[2],st[0],st[1],st[2],Q,-X,K[0],K[1],K[2],K[3],st[0],st[1],st[2],ct[0],ct[1],ct[2],R,-X,ot[0],ot[1],ot[2],ot[3],st[0],st[1],st[2],ct[0],ct[1],ct[2],R,X,ot[0],ot[1],ot[2],ot[3]),I+=4}}if(this.buffer.update(L),D.push(R),B.push(N[N.length-1].slice()),this.bounds=F,this.vertexCount=I,this.points=B,this.arcLength=D,"dashes"in h){var ut=h.dashes,J=ut.slice();for(J.unshift(0),b=1;b<J.length;++b)J[b]=J[b-1]+J[b];var q=g(new Array(256*4),[256,1,4]);for(b=0;b<256;++b){for(_=0;_<4;++_)q.set(b,0,_,0);v.le(J,J[J.length-1]*b/255)&1?q.set(b,0,0,0):q.set(b,0,0,255)}this.texture.setPixels(q)}},T.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},T.pick=function(h){if(!h||h.id!==this.pickId)return null;var b=f(h.value[0],h.value[1],h.value[2],0),_=v.le(this.arcLength,b);if(_<0)return null;if(_===this.arcLength.length-1)return new k(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),_);for(var P=this.points[_],L=this.points[Math.min(_+1,this.points.length-1)],D=(b-this.arcLength[_])/(this.arcLength[_+1]-this.arcLength[_]),B=1-D,R=[0,0,0],I=0;I<3;++I)R[I]=B*P[I]+D*L[I];var F=Math.min(D<.5?_:_+1,this.points.length-1);return new k(b,R,F,this.points[F])};function c(h){var b=h.gl||h.scene&&h.scene.gl,_=w(b);_.attributes.position.location=0,_.attributes.nextPosition.location=1,_.attributes.arcLength.location=2,_.attributes.lineWidth.location=3,_.attributes.color.location=4;var P=l(b);P.attributes.position.location=0,P.attributes.nextPosition.location=1,P.attributes.arcLength.location=2,P.attributes.lineWidth.location=3,P.attributes.color.location=4;for(var L=i(b),D=n(b,[{buffer:L,size:3,offset:0,stride:48},{buffer:L,size:3,offset:12,stride:48},{buffer:L,size:1,offset:24,stride:48},{buffer:L,size:1,offset:28,stride:48},{buffer:L,size:4,offset:32,stride:48}]),B=g(new Array(1024),[256,1,4]),R=0;R<1024;++R)B.data[R]=255;var I=o(b,B);I.wrap=b.REPEAT;var F=new M(b,_,P,L,D,I);return F.update(h),F}},5716:function(t,e,r){var i=r(6859);t.exports=n;function n(o){return o.cmp(new i(0))}},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]]}},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 f=s.length,v=0,g=0;g<f;++g){var m=s[g],w=o(m);if(w!==0){if(v>0){var l=s[v-1];if(i(m,l)===0&&o(l)!==w){v-=1;continue}}s[v++]=m}}return s.length=v,s}},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}},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}},5874:function(t,e,r){t.exports=_;var i=r(620),n=r(7827),o=r(6852),a=r(7932),s=r(3508),f=999,v=9999,g=0,m=1,w=2,l=3,x=4,y=5,S=6,k=7,M=8,T=9,c=10,h=11,b=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function _(P){var L=0,D=0,B=f,R,I,F=[],N=[],j=1,G=0,rt=0,ct=!1,st=!1,et="",K;P=P||{};var ot=o,X=i;P.version==="300 es"&&(ot=s,X=a);for(var Q={},ut={},L=0;L<ot.length;L++)Q[ot[L]]=!0;for(var L=0;L<X.length;L++)ut[X[L]]=!0;return function(mt){return N=[],mt!==null?q(mt):it()};function J(mt){mt.length&&N.push({type:b[B],data:mt,position:rt,line:j,column:G})}function q(mt){L=0,mt.toString&&(mt=mt.toString()),et+=mt.replace(/\r\n/g,`
`),K=et.length;for(var bt;R=et[L],L<K;){switch(bt=L,B){case g:L=It();break;case m:L=wt();break;case w:L=Tt();break;case l:L=Ct();break;case x:L=Jt();break;case h:L=ee();break;case y:L=te();break;case v:L=Kt();break;case T:L=dt();break;case f:L=nt();break}if(bt!==L)switch(et[bt]){case`
`:G=0,++j;break;default:++G;break}}return D+=L,et=et.slice(L),N}function it(mt){return F.length&&J(F.join("")),B=c,J("(eof)"),N}function nt(){return F=F.length?[]:F,I==="/"&&R==="*"?(rt=D+L-1,B=g,I=R,L+1):I==="/"&&R==="/"?(rt=D+L-1,B=m,I=R,L+1):R==="#"?(B=w,rt=D+L,L):/\s/.test(R)?(B=T,rt=D+L,L):(ct=/\d/.test(R),st=/[^\w_]/.test(R),rt=D+L,B=ct?x:st?l:v,L)}function dt(){return/[^\s]/g.test(R)?(J(F.join("")),B=f,L):(F.push(R),I=R,L+1)}function Tt(){return(R==="\r"||R===`
`)&&I!=="\\"?(J(F.join("")),B=f,L):(F.push(R),I=R,L+1)}function wt(){return Tt()}function It(){return R==="/"&&I==="*"?(F.push(R),J(F.join("")),B=f,L+1):(F.push(R),I=R,L+1)}function Ct(){if(I==="."&&/\d/.test(R))return B=y,L;if(I==="/"&&R==="*")return B=g,L;if(I==="/"&&R==="/")return B=m,L;if(R==="."&&F.length){for(;Nt(F););return B=y,L}if(R===";"||R===")"||R==="("){if(F.length)for(;Nt(F););return J(R),B=f,L+1}var mt=F.length===2&&R!=="=";if(/[\w_\d\s]/.test(R)||mt){for(;Nt(F););return B=f,L}return F.push(R),I=R,L+1}function Nt(mt){var bt=0,vt,Ut;do{if(vt=n.indexOf(mt.slice(0,mt.length+bt).join("")),Ut=n[vt],vt===-1){if(bt--+mt.length>0)continue;Ut=mt.slice(0,1).join("")}return J(Ut),rt+=Ut.length,F=F.slice(Ut.length),F.length}while(!0)}function ee(){return/[^a-fA-F0-9]/.test(R)?(J(F.join("")),B=f,L):(F.push(R),I=R,L+1)}function Jt(){return R==="."||/[eE]/.test(R)?(F.push(R),B=y,I=R,L+1):R==="x"&&F.length===1&&F[0]==="0"?(B=h,F.push(R),I=R,L+1):/[^\d]/.test(R)?(J(F.join("")),B=f,L):(F.push(R),I=R,L+1)}function te(){return R==="f"&&(F.push(R),I=R,L+=1),/[eE]/.test(R)||(R==="-"||R==="+")&&/[eE]/.test(I)?(F.push(R),I=R,L+1):/[^\d]/.test(R)?(J(F.join("")),B=f,L):(F.push(R),I=R,L+1)}function Kt(){if(/[^\d\w_]/.test(R)){var mt=F.join("");return ut[mt]?B=M:Q[mt]?B=k:B=S,J(F.join("")),B=f,L}return F.push(R),I=R,L+1}}},5878:function(t,e,r){t.exports=a;var i=r(3250),n=r(2014);function o(s,f,v){var g=Math.abs(i(s,f,v)),m=Math.sqrt(Math.pow(f[0]-v[0],2)+Math.pow(f[1]-v[1],2));return g/m}function a(s,f,v){for(var g=f.length,m=s.length,w=new Array(g),l=new Array(g),x=new Array(g),y=new Array(g),S=0;S<g;++S)w[S]=l[S]=-1,x[S]=1/0,y[S]=!1;for(var S=0;S<m;++S){var k=s[S];if(k.length!==2)throw new Error("Input must be a graph");var M=k[1],T=k[0];l[T]!==-1?l[T]=-2:l[T]=M,w[M]!==-1?w[M]=-2:w[M]=T}function c(et){if(y[et])return 1/0;var K=w[et],ot=l[et];return K<0||ot<0?1/0:o(f[et],f[K],f[ot])}function h(et,K){var ot=I[et],X=I[K];I[et]=X,I[K]=ot,F[ot]=K,F[X]=et}function b(et){return x[I[et]]}function _(et){return et&1?et-1>>1:(et>>1)-1}function P(et){for(var K=b(et);;){var ot=K,X=2*et+1,Q=2*(et+1),ut=et;if(X<j){var J=b(X);J<ot&&(ut=X,ot=J)}if(Q<j){var q=b(Q);q<ot&&(ut=Q)}if(ut===et)return et;h(et,ut),et=ut}}function L(et){for(var K=b(et);et>0;){var ot=_(et);if(ot>=0){var X=b(ot);if(K<X){h(et,ot),et=ot;continue}}return et}}function D(){if(j>0){var et=I[0];return h(0,j-1),j-=1,P(0),et}return-1}function B(et,K){var ot=I[et];return x[ot]===K?et:(x[ot]=-1/0,L(et),D(),x[ot]=K,j+=1,L(j-1))}function R(et){if(!y[et]){y[et]=!0;var K=w[et],ot=l[et];w[ot]>=0&&(w[ot]=K),l[K]>=0&&(l[K]=ot),F[K]>=0&&B(F[K],c(K)),F[ot]>=0&&B(F[ot],c(ot))}}for(var I=[],F=new Array(g),S=0;S<g;++S){var N=x[S]=c(S);N<1/0?(F[S]=I.length,I.push(S)):F[S]=-1}for(var j=I.length,S=j>>1;S>=0;--S)P(S);for(;;){var G=D();if(G<0||x[G]>v)break;R(G)}for(var rt=[],S=0;S<g;++S)y[S]||(F[S]=rt.length,rt.push(f[S].slice()));rt.length;function ct(et,K){if(et[K]<0)return K;var ot=K,X=K;do{var Q=et[X];if(!y[X]||Q<0||Q===X||(X=Q,Q=et[X],!y[X]||Q<0||Q===X))break;X=Q,ot=et[ot]}while(ot!==X);for(var ut=K;ut!==X;ut=et[ut])et[ut]=X;return X}var st=[];return s.forEach(function(et){var K=ct(w,et[0]),ot=ct(l,et[1]);if(K>=0&&ot>=0&&K!==ot){var X=F[K],Q=F[ot];X!==Q&&st.push([X,Q])}}),n.unique(n.normalize(st)),{positions:rt,edges:st}}},5911:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=n[0],v=n[1],g=n[2];return r[0]=a*g-s*v,r[1]=s*f-o*g,r[2]=o*v-a*f,r}},5964:function(t){t.exports=function(e){return!e&&e!==0?"":e.toString()}},5995:function(t,e,r){t.exports=o;var i=r(7642),n=r(6037);function o(a,s){return i(s).filter(function(f){for(var v=new Array(f.length),g=0;g<f.length;++g)v[g]=s[f[g]];return n(v)*a<1})}},6037:function(t,e,r){t.exports=n;var i=r(3628);function n(o){for(var a=i(o),s=0,f=0;f<o.length;++f)for(var v=o[f],g=0;g<a.length;++g)s+=Math.pow(v[g]-a[g],2);return Math.sqrt(s/o.length)}},6079:function(t){t.exports=e;function e(r,i,n,o){var a=o[0],s=o[1],f=o[2],v=Math.sqrt(a*a+s*s+f*f),g,m,w,l,x,y,S,k,M,T,c,h,b,_,P,L,D,B,R,I,F,N,j,G;return Math.abs(v)<1e-6?null:(v=1/v,a*=v,s*=v,f*=v,g=Math.sin(n),m=Math.cos(n),w=1-m,l=i[0],x=i[1],y=i[2],S=i[3],k=i[4],M=i[5],T=i[6],c=i[7],h=i[8],b=i[9],_=i[10],P=i[11],L=a*a*w+m,D=s*a*w+f*g,B=f*a*w-s*g,R=a*s*w-f*g,I=s*s*w+m,F=f*s*w+a*g,N=a*f*w+s*g,j=s*f*w-a*g,G=f*f*w+m,r[0]=l*L+k*D+h*B,r[1]=x*L+M*D+b*B,r[2]=y*L+T*D+_*B,r[3]=S*L+c*D+P*B,r[4]=l*R+k*I+h*F,r[5]=x*R+M*I+b*F,r[6]=y*R+T*I+_*F,r[7]=S*R+c*I+P*F,r[8]=l*N+k*j+h*G,r[9]=x*N+M*j+b*G,r[10]=y*N+T*j+_*G,r[11]=S*N+c*j+P*G,i!==r&&(r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r)}},6141:function(t,e,r){t.exports=r(2953)},6199:function(t,e,r){var i=r(1338),n={zero:function(S,k,M,T){var c=S[0],h=M[0];T|=0;var b=0,_=h;for(b=0;b<c;++b)k[T]=0,T+=_},fdTemplate1:function(S,k,M,T,c,h,b){var _=S[0],P=M[0],L=h[0],D=-1*P,B=P;T|=0,b|=0;var R=0,I=P,F=L;for(R=0;R<_;++R)c[b]=.5*(k[T+D]-k[T+B]),T+=I,b+=F},fdTemplate2:function(S,k,M,T,c,h,b,_,P,L){var D=S[0],B=S[1],R=M[0],I=M[1],F=h[0],N=h[1],j=P[0],G=P[1],rt=-1*R,ct=R,st=-1*I,et=I;T|=0,b|=0,L|=0;var K=0,ot=0,X=I,Q=R-B*I,ut=N,J=F-B*N,q=G,it=j-B*G;for(ot=0;ot<D;++ot){for(K=0;K<B;++K)c[b]=.5*(k[T+rt]-k[T+ct]),_[L]=.5*(k[T+st]-k[T+et]),T+=X,b+=ut,L+=q;T+=Q,b+=J,L+=it}}},o={cdiff:function(S){var k={};return function(M,T,c){var h=M.dtype,b=M.order,_=T.dtype,P=T.order,L=c.dtype,D=c.order,B=[h,b.join(),_,P.join(),L,D.join()].join(),R=k[B];return R||(k[B]=R=S([h,b,_,P,L,D])),R(M.shape.slice(0),M.data,M.stride,M.offset|0,T.data,T.stride,T.offset|0,c.data,c.stride,c.offset|0)}},zero:function(S){var k={};return function(M){var T=M.dtype,c=M.order,h=[T,c.join()].join(),b=k[h];return b||(k[h]=b=S([T,c])),b(M.shape.slice(0),M.data,M.stride,M.offset|0)}},fdTemplate1:function(S){var k={};return function(M,T){var c=M.dtype,h=M.order,b=T.dtype,_=T.order,P=[c,h.join(),b,_.join()].join(),L=k[P];return L||(k[P]=L=S([c,h,b,_])),L(M.shape.slice(0),M.data,M.stride,M.offset|0,T.data,T.stride,T.offset|0)}},fdTemplate2:function(S){var k={};return function(M,T,c){var h=M.dtype,b=M.order,_=T.dtype,P=T.order,L=c.dtype,D=c.order,B=[h,b.join(),_,P.join(),L,D.join()].join(),R=k[B];return R||(k[B]=R=S([h,b,_,P,L,D])),R(M.shape.slice(0),M.data,M.stride,M.offset|0,T.data,T.stride,T.offset|0,c.data,c.stride,c.offset|0)}}};function a(S){var k=o[S.funcName];return k(s.bind(void 0,S))}function s(S){return n[S.funcName]}function f(S){return a({funcName:S.funcName})}var v={},g={},m=f({funcName:"cdiff"}),w=f({funcName:"zero"});function l(S){return S in v?v[S]:v[S]=f({funcName:"fdTemplate"+S})}function x(S,k,M,T){return function(c,h){var b=h.shape.slice();return b[0]>2&&b[1]>2&&T(h.pick(-1,-1).lo(1,1).hi(b[0]-2,b[1]-2),c.pick(-1,-1,0).lo(1,1).hi(b[0]-2,b[1]-2),c.pick(-1,-1,1).lo(1,1).hi(b[0]-2,b[1]-2)),b[1]>2&&(M(h.pick(0,-1).lo(1).hi(b[1]-2),c.pick(0,-1,1).lo(1).hi(b[1]-2)),k(c.pick(0,-1,0).lo(1).hi(b[1]-2))),b[1]>2&&(M(h.pick(b[0]-1,-1).lo(1).hi(b[1]-2),c.pick(b[0]-1,-1,1).lo(1).hi(b[1]-2)),k(c.pick(b[0]-1,-1,0).lo(1).hi(b[1]-2))),b[0]>2&&(M(h.pick(-1,0).lo(1).hi(b[0]-2),c.pick(-1,0,0).lo(1).hi(b[0]-2)),k(c.pick(-1,0,1).lo(1).hi(b[0]-2))),b[0]>2&&(M(h.pick(-1,b[1]-1).lo(1).hi(b[0]-2),c.pick(-1,b[1]-1,0).lo(1).hi(b[0]-2)),k(c.pick(-1,b[1]-1,1).lo(1).hi(b[0]-2))),c.set(0,0,0,0),c.set(0,0,1,0),c.set(b[0]-1,0,0,0),c.set(b[0]-1,0,1,0),c.set(0,b[1]-1,0,0),c.set(0,b[1]-1,1,0),c.set(b[0]-1,b[1]-1,0,0),c.set(b[0]-1,b[1]-1,1,0),c}}function y(S){var k=S.join(),b=g[k];if(b)return b;for(var M=S.length,T=[m,w],c=1;c<=M;++c)T.push(l(c));var h=x,b=h.apply(void 0,T);return g[k]=b,b}t.exports=function(S,k,M){if(Array.isArray(M)||(typeof M=="string"?M=i(k.dimension,M):M=i(k.dimension,"clamp")),k.size===0)return S;if(k.dimension===0)return S.set(0),S;var T=y(M);return T(S,k)}},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 f=new Array(s),v=0;for(i=0;i<a;++i){var g=r[i],m=g.length;for(n=0;n<m;++n){var w=f[v++]=new Array(m-1),l=0;for(o=0;o<m;++o)o!==n&&(w[l++]=g[o]);if(n&1){var x=w[1];w[1]=w[0],w[0]=x}}}return f}},6296:function(t,e,r){t.exports=f;var i=r(7261),n=r(9977),o=r(1811);function a(v,g){this._controllerNames=Object.keys(v),this._controllerList=this._controllerNames.map(function(m){return v[m]}),this._mode=g,this._active=v[g],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 g=this._controllerList,m=0;m<g.length;++m)g[m].flush(v)},s.idle=function(v){for(var g=this._controllerList,m=0;m<g.length;++m)g[m].idle(v)},s.lookAt=function(v,g,m,w){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].lookAt(v,g,m,w)},s.rotate=function(v,g,m,w){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].rotate(v,g,m,w)},s.pan=function(v,g,m,w){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].pan(v,g,m,w)},s.translate=function(v,g,m,w){for(var l=this._controllerList,x=0;x<l.length;++x)l[x].translate(v,g,m,w)},s.setMatrix=function(v,g){for(var m=this._controllerList,w=0;w<m.length;++w)m[w].setMatrix(v,g)},s.setDistanceLimits=function(v,g){for(var m=this._controllerList,w=0;w<m.length;++w)m[w].setDistanceLimits(v,g)},s.setDistance=function(v,g){for(var m=this._controllerList,w=0;w<m.length;++w)m[w].setDistance(v,g)},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 g=this._controllerNames.indexOf(v);if(!(g<0)){var m=this._active,w=this._controllerList[g],l=Math.max(m.lastT(),w.lastT());m.recalcMatrix(l),w.setMatrix(l,m.computedMatrix),this._active=w,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 f(v){v=v||{};var g=v.eye||[0,0,1],m=v.center||[0,0,0],w=v.up||[0,1,0],l=v.distanceLimits||[0,1/0],x=v.mode||"turntable",y=i(),S=n(),k=o();return y.setDistanceLimits(l[0],l[1]),y.lookAt(0,g,m,w),S.setDistanceLimits(l[0],l[1]),S.lookAt(0,g,m,w),k.setDistanceLimits(l[0],l[1]),k.lookAt(0,g,m,w),new a({turntable:y,orbit:S,matrix:k},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])}},6405:function(t,e,r){var i=r(2931);t.exports=function(o,a){var s=o.positions,f=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 g=0,m=1/0,w=-1/0,l=1/0,x=-1/0,y=1/0,S=-1/0,k=null,M=null,T=[],c=1/0,h=!1,b=o.coneSizemode==="raw",_=0;_<s.length;_++){var P=s[_];m=Math.min(P[0],m),w=Math.max(P[0],w),l=Math.min(P[1],l),x=Math.max(P[1],x),y=Math.min(P[2],y),S=Math.max(P[2],S);var L=f[_];if(i.length(L)>g&&(g=i.length(L)),_&&!b){var D=2*i.distance(k,P)/(i.length(M)+i.length(L));D?(c=Math.min(c,D),h=!1):h=!0}h||(k=P,M=L),T.push(L)}var B=[m,l,y],R=[w,x,S];a&&(a[0]=B,a[1]=R),g===0&&(g=1);var I=1/g;isFinite(c)||(c=1),v.vectorScale=c;var F=o.coneSize||(b?1:.5);o.absoluteConeSize&&(F=o.absoluteConeSize*I),v.coneScale=F;for(var _=0,N=0;_<s.length;_++)for(var P=s[_],j=P[0],G=P[1],rt=P[2],ct=T[_],st=i.length(ct)*I,et=0,K=8;et<K;et++){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(st,st,st),v.vertexIntensity.push(st,st,st);var ot=v.positions.length;v.cells.push([ot-6,ot-5,ot-4],[ot-3,ot-2,ot-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"})}},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),f=new Array(8),v=new Array(8),g=new Array(3),m=[0,0,0];(function(){for(var T=0;T<8;++T)f[T]=[1,1,1,1],v[T]=[1,1,1]})();function w(T,c,h){for(var b=0;b<4;++b){T[b]=h[12+b];for(var _=0;_<3;++_)T[b]+=c[_]*h[4*_+b]}}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(T){for(var c=0;c<l.length;++c)if(T=o.positive(T,l[c]),T.length<3)return 0;for(var h=T[0],b=h[0]/h[3],_=h[1]/h[3],P=0,c=1;c+1<T.length;++c){var L=T[c],D=T[c+1],B=L[0]/L[3],R=L[1]/L[3],I=D[0]/D[3],F=D[1]/D[3],N=B-b,j=R-_,G=I-b,rt=F-_;P+=Math.abs(N*rt-j*G)}return P}var y=[1,1,1],S=[0,0,0],k={cubeEdges:y,axis:S};function M(T,c,h,b,_){n(s,c,T),n(s,h,s);for(var P=0,L=0;L<2;++L){g[2]=b[L][2];for(var D=0;D<2;++D){g[1]=b[D][1];for(var B=0;B<2;++B)g[0]=b[B][0],w(f[P],g,s),P+=1}}for(var R=-1,L=0;L<8;++L){for(var I=f[L][3],F=0;F<3;++F)v[L][F]=f[L][F]/I;_&&(v[L][2]*=-1),I<0&&(R<0||v[L][2]<v[R][2])&&(R=L)}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,st=0;st<2;++st){var et=st<<N,K=et+(st<<j)+(1-st<<G),ot=et+(1-st<<j)+(st<<G);a(v[et],v[K],v[ot],m)<0||(st?rt=1:ct=1)}if(rt<0||ct<0){ct>rt&&(R|=1<<N);continue}for(var st=0;st<2;++st){var et=st<<N,K=et+(st<<j)+(1-st<<G),ot=et+(1-st<<j)+(st<<G),X=x([f[et],f[K],f[ot],f[et+(1<<j)+(1<<G)]]);st?rt=X:ct=X}if(ct>rt){R|=1<<N;continue}}}for(var Q=7^R,ut=-1,L=0;L<8;++L)L===R||L===Q||(ut<0||v[ut][1]>v[L][1])&&(ut=L);for(var J=-1,L=0;L<3;++L){var q=ut^1<<L;if(!(q===R||q===Q)){J<0&&(J=q);var G=v[q];G[0]<v[J][0]&&(J=q)}}for(var it=-1,L=0;L<3;++L){var q=ut^1<<L;if(!(q===R||q===Q||q===J)){it<0&&(it=q);var G=v[q];G[0]>v[it][0]&&(it=q)}}var nt=y;nt[0]=nt[1]=nt[2]=0,nt[i.log2(J^ut)]=ut&J,nt[i.log2(ut^it)]=ut&it;var dt=it^7;dt===R||dt===Q?(dt=J^7,nt[i.log2(it^dt)]=dt&it):nt[i.log2(J^dt)]=dt&J;for(var Tt=S,wt=R,N=0;N<3;++N)wt&1<<N?Tt[N]=-1:Tt[N]=1;return k}},6444:function(t,e){e.create=i,e.equal=n;function r(o,a){var s=o+"",f=s.indexOf("."),v=0;f>=0&&(v=s.length-f-1);var g=Math.pow(10,v),m=Math.round(o*a*g),w=m+"";if(w.indexOf("e")>=0)return w;var l=m/g,x=m%g;m<0?(l=-Math.ceil(l)|0,x=-x|0):(l=Math.floor(l)|0,x=x|0);var y=""+l;if(m<0&&(y="-"+y),v){for(var S=""+x;S.length<v;)S="0"+S;return y+"."+S}else return y}function i(o,a){for(var s=[],f=0;f<3;++f){for(var v=[],g=.5*(o[0][f]+o[1][f]),m=0;m*a[f]<=o[1][f];++m)v.push({x:m*a[f],text:r(a[f],m)});for(var m=-1;m*a[f]>=o[0][f];--m)v.push({x:m*a[f],text:r(a[f],m)});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 f=0;f<o[s].length;++f){var v=o[s][f],g=a[s][f];if(v.x!==g.x||v.text!==g.text||v.font!==g.font||v.fontColor!==g.fontColor||v.fontSize!==g.fontSize||v.dx!==g.dx||v.dy!==g.dy)return!1}}return!0}},6468:function(t){t.exports=function(e){return atob(e)}},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]))}},6582:function(t,e,r){var i=r(7894);t.exports=n;function n(o,a,s,f){var v,g,m,w,l,x,y,S,k,M,T=a[0],c=a[1],h=a[2],b=f[0],_=f[1],P=f[2],L=s[0],D=s[1],B=s[2];return Math.abs(T-L)<1e-6&&Math.abs(c-D)<1e-6&&Math.abs(h-B)<1e-6?i(o):(y=T-L,S=c-D,k=h-B,M=1/Math.sqrt(y*y+S*S+k*k),y*=M,S*=M,k*=M,v=_*k-P*S,g=P*y-b*k,m=b*S-_*y,M=Math.sqrt(v*v+g*g+m*m),M?(M=1/M,v*=M,g*=M,m*=M):(v=0,g=0,m=0),w=S*m-k*g,l=k*v-y*m,x=y*g-S*v,M=Math.sqrt(w*w+l*l+x*x),M?(M=1/M,w*=M,l*=M,x*=M):(w=0,l=0,x=0),o[0]=v,o[1]=w,o[2]=y,o[3]=0,o[4]=g,o[5]=l,o[6]=S,o[7]=0,o[8]=m,o[9]=x,o[10]=k,o[11]=0,o[12]=-(v*T+g*c+m*h),o[13]=-(w*T+l*c+x*h),o[14]=-(y*T+S*c+k*h),o[15]=1,o)}},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}},6658:function(t){t.exports=e;function e(r,i,n,o){var a=i[0],s=i[1],f=i[2];return r[0]=a+o*(n[0]-a),r[1]=s+o*(n[1]-s),r[2]=f+o*(n[2]-f),r}},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}},6729:function(t,e,r){var i=r(3642),n=r(395);t.exports=o;function o(v){var g,m,w,l,x,y,S,k,h,M,T;if(v||(v={}),k=(v.nshades||72)-1,S=v.format||"hex",y=v.colormap,y||(y="jet"),typeof y=="string"){if(y=y.toLowerCase(),!i[y])throw Error(y+" not a supported colorscale");x=i[y]}else if(Array.isArray(y))x=y.slice();else throw Error("unsupported colormap option",y);if(x.length>k+1)throw new Error(y+" 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],g=x.map(function(P){return Math.round(P.index*k)}),M[0]=Math.min(Math.max(M[0],0),1),M[1]=Math.min(Math.max(M[1],0),1);var c=x.map(function(P,L){var D=x[L].index,B=x[L].rgb.slice();return B.length===4&&B[3]>=0&&B[3]<=1||(B[3]=M[0]+(M[1]-M[0])*D),B}),h=[];for(T=0;T<g.length-1;++T){l=g[T+1]-g[T],m=c[T],w=c[T+1];for(var b=0;b<l;b++){var _=b/l;h.push([Math.round(n(m[0],w[0],_)),Math.round(n(m[1],w[1],_)),Math.round(n(m[2],w[2],_)),n(m[3],w[3],_)])}}return h.push(x[x.length-1].rgb.concat(M[1])),S==="hex"?h=h.map(s):S==="rgbaString"?h=h.map(f):S==="float"&&(h=h.map(a)),h}function a(v){return[v[0]/255,v[1]/255,v[2]/255,v[3]]}function s(v){for(var g,m="#",w=0;w<3;++w)g=v[w],g=g.toString(16),m+=("00"+g).substr(g.length);return m}function f(v){return"rgba("+v.join(",")+")"}},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"}]}},6743:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=i[3],v=o+o,g=a+a,m=s+s,w=o*v,l=o*g,x=o*m,y=a*g,S=a*m,k=s*m,M=f*v,T=f*g,c=f*m;return r[0]=1-(y+k),r[1]=l+c,r[2]=x-T,r[3]=0,r[4]=l-c,r[5]=1-(w+k),r[6]=S+M,r[7]=0,r[8]=x+T,r[9]=S-M,r[10]=1-(w+y),r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}},6760:function(t){t.exports=e;function e(r,i,n){var o=i[0],a=i[1],s=i[2],f=i[3],v=i[4],g=i[5],m=i[6],w=i[7],l=i[8],x=i[9],y=i[10],S=i[11],k=i[12],M=i[13],T=i[14],c=i[15],h=n[0],b=n[1],_=n[2],P=n[3];return r[0]=h*o+b*v+_*l+P*k,r[1]=h*a+b*g+_*x+P*M,r[2]=h*s+b*m+_*y+P*T,r[3]=h*f+b*w+_*S+P*c,h=n[4],b=n[5],_=n[6],P=n[7],r[4]=h*o+b*v+_*l+P*k,r[5]=h*a+b*g+_*x+P*M,r[6]=h*s+b*m+_*y+P*T,r[7]=h*f+b*w+_*S+P*c,h=n[8],b=n[9],_=n[10],P=n[11],r[8]=h*o+b*v+_*l+P*k,r[9]=h*a+b*g+_*x+P*M,r[10]=h*s+b*m+_*y+P*T,r[11]=h*f+b*w+_*S+P*c,h=n[12],b=n[13],_=n[14],P=n[15],r[12]=h*o+b*v+_*l+P*k,r[13]=h*a+b*g+_*x+P*M,r[14]=h*s+b*m+_*y+P*T,r[15]=h*f+b*w+_*S+P*c,r}},6768:function(t,e,r){var i=r(6859);t.exports=n;function n(o){return new i(o)}},6803:function(t,e,r){r(8828),r(1755);function i(n,o){var a=n.length,s=n.length-o.length,f=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||f(n[0],n[1])-f(o[0],o[1]);case 3:var v=n[0]+n[1],g=o[0]+o[1];if(l=v+n[2]-(g+o[2]),l)return l;var m=f(n[0],n[1]),w=f(o[0],o[1]),l=f(m,n[2])-f(w,o[2]);return l||f(m+n[2],v)-f(w+o[2],g);default:var x=n.slice(0);x.sort();var y=o.slice(0);y.sort();for(var S=0;S<a;++S)if(s=x[S]-y[S],s)return s;return 0}}e.Fw=i},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)}},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}},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"]},6859:function(t,e,r){t=r.nmd(t),function(i,n){function o(I,F){if(!I)throw new Error(F||"Assertion failed")}function a(I,F){I.super_=F;var N=function(){};N.prototype=F.prototype,I.prototype=new N,I.prototype.constructor=I}function s(I,F,N){if(s.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((F==="le"||F==="be")&&(N=F,F=10),this._init(I||0,F||10,N||"be"))}typeof i=="object"?i.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=r(7790).Buffer}catch{}s.isBN=function(I){return I instanceof s?!0:I!==null&&typeof I=="object"&&I.constructor.wordSize===s.wordSize&&Array.isArray(I.words)},s.max=function(I,F){return I.cmp(F)>0?I:F},s.min=function(I,F){return I.cmp(F)<0?I:F},s.prototype._init=function(I,F,N){if(typeof I=="number")return this._initNumber(I,F,N);if(typeof I=="object")return this._initArray(I,F,N);F==="hex"&&(F=16),o(F===(F|0)&&F>=2&&F<=36),I=I.toString().replace(/\s+/g,"");var j=0;I[0]==="-"&&(j++,this.negative=1),j<I.length&&(F===16?this._parseHex(I,j,N):(this._parseBase(I,F,j),N==="le"&&this._initArray(this.toArray(),F,N)))},s.prototype._initNumber=function(I,F,N){I<0&&(this.negative=1,I=-I),I<67108864?(this.words=[I&67108863],this.length=1):I<4503599627370496?(this.words=[I&67108863,I/67108864&67108863],this.length=2):(o(I<9007199254740992),this.words=[I&67108863,I/67108864&67108863,1],this.length=3),N==="le"&&this._initArray(this.toArray(),F,N)},s.prototype._initArray=function(I,F,N){if(o(typeof I.length=="number"),I.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(I.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=I.length-1,G=0;j>=0;j-=3)rt=I[j]|I[j-1]<<8|I[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<I.length;j+=3)rt=I[j]|I[j+1]<<8|I[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(I,F){var N=I.charCodeAt(F);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function g(I,F,N){var j=v(I,N);return N-1>=F&&(j|=v(I,N-1)<<4),j}s.prototype._parseHex=function(I,F,N){this.length=Math.ceil((I.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=I.length-1;j>=F;j-=2)ct=g(I,F,j)<<G,this.words[rt]|=ct&67108863,G>=18?(G-=18,rt+=1,this.words[rt]|=ct>>>26):G+=8;else{var st=I.length-F;for(j=st%2===0?F+1:F;j<I.length;j+=2)ct=g(I,F,j)<<G,this.words[rt]|=ct&67108863,G>=18?(G-=18,rt+=1,this.words[rt]|=ct>>>26):G+=8}this.strip()};function m(I,F,N,j){for(var G=0,rt=Math.min(I.length,N),ct=F;ct<rt;ct++){var st=I.charCodeAt(ct)-48;G*=j,st>=49?G+=st-49+10:st>=17?G+=st-17+10:G+=st}return G}s.prototype._parseBase=function(I,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=I.length-N,ct=rt%j,st=Math.min(rt,rt-ct)+N,et=0,K=N;K<st;K+=j)et=m(I,K,K+j,F),this.imuln(G),this.words[0]+et<67108864?this.words[0]+=et:this._iaddn(et);if(ct!==0){var ot=1;for(et=m(I,K,I.length,F),K=0;K<ct;K++)ot*=F;this.imuln(ot),this.words[0]+et<67108864?this.words[0]+=et:this._iaddn(et)}this.strip()},s.prototype.copy=function(I){I.words=new Array(this.length);for(var F=0;F<this.length;F++)I.words[F]=this.words[F];I.length=this.length,I.negative=this.negative,I.red=this.red},s.prototype.clone=function(){var I=new s(null);return this.copy(I),I},s.prototype._expand=function(I){for(;this.length<I;)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 w=["","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(I,F){I=I||10,F=F|0||1;var N;if(I===16||I==="hex"){N="";for(var j=0,G=0,rt=0;rt<this.length;rt++){var ct=this.words[rt],st=((ct<<j|G)&16777215).toString(16);G=ct>>>24-j&16777215,G!==0||rt!==this.length-1?N=w[6-st.length]+st+N:N=st+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(I===(I|0)&&I>=2&&I<=36){var et=l[I],K=x[I];N="";var ot=this.clone();for(ot.negative=0;!ot.isZero();){var X=ot.modn(K).toString(I);ot=ot.idivn(K),ot.isZero()?N=X+N:N=w[et-X.length]+X+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 I=this.words[0];return this.length===2?I+=this.words[1]*67108864:this.length===3&&this.words[2]===1?I+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-I:I},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(I,F){return o(typeof f<"u"),this.toArrayLike(f,I,F)},s.prototype.toArray=function(I,F){return this.toArrayLike(Array,I,F)},s.prototype.toArrayLike=function(I,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 I(G),st,et,K=this.clone();if(rt){for(et=0;!K.isZero();et++)st=K.andln(255),K.iushrn(8),ct[et]=st;for(;et<G;et++)ct[et]=0}else{for(et=0;et<G-j;et++)ct[et]=0;for(et=0;!K.isZero();et++)st=K.andln(255),K.iushrn(8),ct[G-et-1]=st}return ct},Math.clz32?s.prototype._countBits=function(I){return 32-Math.clz32(I)}:s.prototype._countBits=function(I){var F=I,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(I){if(I===0)return 26;var F=I,N=0;return(F&8191)===0&&(N+=13,F>>>=13),(F&127)===0&&(N+=7,F>>>=7),(F&15)===0&&(N+=4,F>>>=4),(F&3)===0&&(N+=2,F>>>=2),(F&1)===0&&N++,N},s.prototype.bitLength=function(){var I=this.words[this.length-1],F=this._countBits(I);return(this.length-1)*26+F};function y(I){for(var F=new Array(I.bitLength()),N=0;N<F.length;N++){var j=N/26|0,G=N%26;F[N]=(I.words[j]&1<<G)>>>G}return F}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,F=0;F<this.length;F++){var N=this._zeroBits(this.words[F]);if(I+=N,N!==26)break}return I},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(I){return this.negative!==0?this.abs().inotn(I).iaddn(1):this.clone()},s.prototype.fromTwos=function(I){return this.testn(I-1)?this.notn(I).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(I){for(;this.length<I.length;)this.words[this.length++]=0;for(var F=0;F<I.length;F++)this.words[F]=this.words[F]|I.words[F];return this.strip()},s.prototype.ior=function(I){return o((this.negative|I.negative)===0),this.iuor(I)},s.prototype.or=function(I){return this.length>I.length?this.clone().ior(I):I.clone().ior(this)},s.prototype.uor=function(I){return this.length>I.length?this.clone().iuor(I):I.clone().iuor(this)},s.prototype.iuand=function(I){var F;this.length>I.length?F=I:F=this;for(var N=0;N<F.length;N++)this.words[N]=this.words[N]&I.words[N];return this.length=F.length,this.strip()},s.prototype.iand=function(I){return o((this.negative|I.negative)===0),this.iuand(I)},s.prototype.and=function(I){return this.length>I.length?this.clone().iand(I):I.clone().iand(this)},s.prototype.uand=function(I){return this.length>I.length?this.clone().iuand(I):I.clone().iuand(this)},s.prototype.iuxor=function(I){var F,N;this.length>I.length?(F=this,N=I):(F=I,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(I){return o((this.negative|I.negative)===0),this.iuxor(I)},s.prototype.xor=function(I){return this.length>I.length?this.clone().ixor(I):I.clone().ixor(this)},s.prototype.uxor=function(I){return this.length>I.length?this.clone().iuxor(I):I.clone().iuxor(this)},s.prototype.inotn=function(I){o(typeof I=="number"&&I>=0);var F=Math.ceil(I/26)|0,N=I%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(I){return this.clone().inotn(I)},s.prototype.setn=function(I,F){o(typeof I=="number"&&I>=0);var N=I/26|0,j=I%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(I){var F;if(this.negative!==0&&I.negative===0)return this.negative=0,F=this.isub(I),this.negative^=1,this._normSign();if(this.negative===0&&I.negative!==0)return I.negative=0,F=this.isub(I),I.negative=1,F._normSign();var N,j;this.length>I.length?(N=this,j=I):(N=I,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(I){var F;return I.negative!==0&&this.negative===0?(I.negative=0,F=this.sub(I),I.negative^=1,F):I.negative===0&&this.negative!==0?(this.negative=0,F=I.sub(this),this.negative=1,F):this.length>I.length?this.clone().iadd(I):I.clone().iadd(this)},s.prototype.isub=function(I){if(I.negative!==0){I.negative=0;var F=this.iadd(I);return I.negative=1,F._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(I),this.negative=1,this._normSign();var N=this.cmp(I);if(N===0)return this.negative=0,this.length=1,this.words[0]=0,this;var j,G;N>0?(j=this,G=I):(j=I,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(I){return this.clone().isub(I)};function S(I,F,N){N.negative=F.negative^I.negative;var j=I.length+F.length|0;N.length=j,j=j-1|0;var G=I.words[0]|0,rt=F.words[0]|0,ct=G*rt,st=ct&67108863,et=ct/67108864|0;N.words[0]=st;for(var K=1;K<j;K++){for(var ot=et>>>26,X=et&67108863,Q=Math.min(K,F.length-1),ut=Math.max(0,K-I.length+1);ut<=Q;ut++){var J=K-ut|0;G=I.words[J]|0,rt=F.words[ut]|0,ct=G*rt+X,ot+=ct/67108864|0,X=ct&67108863}N.words[K]=X|0,et=ot|0}return et!==0?N.words[K]=et|0:N.length--,N.strip()}var k=function(I,F,N){var j=I.words,G=F.words,rt=N.words,ct=0,st,et,K,ot=j[0]|0,X=ot&8191,Q=ot>>>13,ut=j[1]|0,J=ut&8191,q=ut>>>13,it=j[2]|0,nt=it&8191,dt=it>>>13,Tt=j[3]|0,wt=Tt&8191,It=Tt>>>13,Ct=j[4]|0,Nt=Ct&8191,ee=Ct>>>13,Jt=j[5]|0,te=Jt&8191,Kt=Jt>>>13,mt=j[6]|0,bt=mt&8191,vt=mt>>>13,Ut=j[7]|0,re=Ut&8191,Zt=Ut>>>13,ue=j[8]|0,Me=ue&8191,Ce=ue>>>13,We=j[9]|0,qe=We&8191,vr=We>>>13,_r=G[0]|0,er=_r&8191,Mr=_r>>>13,Ir=G[1]|0,de=Ir&8191,Dt=Ir>>>13,qt=G[2]|0,_t=qt&8191,lt=qt>>>13,yt=G[3]|0,St=yt&8191,Ht=yt>>>13,Yt=G[4]|0,se=Yt&8191,ke=Yt>>>13,Ee=G[5]|0,Ue=Ee&8191,ir=Ee>>>13,ar=G[6]|0,Ye=ar&8191,Er=ar>>>13,pn=G[7]|0,dn=pn&8191,bn=pn>>>13,Zn=G[8]|0,En=Zn&8191,gn=Zn>>>13,da=G[9]|0,ra=da&8191,Se=da>>>13;N.negative=I.negative^F.negative,N.length=19,st=Math.imul(X,er),et=Math.imul(X,Mr),et=et+Math.imul(Q,er)|0,K=Math.imul(Q,Mr);var Re=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Re>>>26)|0,Re&=67108863,st=Math.imul(J,er),et=Math.imul(J,Mr),et=et+Math.imul(q,er)|0,K=Math.imul(q,Mr),st=st+Math.imul(X,de)|0,et=et+Math.imul(X,Dt)|0,et=et+Math.imul(Q,de)|0,K=K+Math.imul(Q,Dt)|0;var Ze=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,st=Math.imul(nt,er),et=Math.imul(nt,Mr),et=et+Math.imul(dt,er)|0,K=Math.imul(dt,Mr),st=st+Math.imul(J,de)|0,et=et+Math.imul(J,Dt)|0,et=et+Math.imul(q,de)|0,K=K+Math.imul(q,Dt)|0,st=st+Math.imul(X,_t)|0,et=et+Math.imul(X,lt)|0,et=et+Math.imul(Q,_t)|0,K=K+Math.imul(Q,lt)|0;var tr=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(tr>>>26)|0,tr&=67108863,st=Math.imul(wt,er),et=Math.imul(wt,Mr),et=et+Math.imul(It,er)|0,K=Math.imul(It,Mr),st=st+Math.imul(nt,de)|0,et=et+Math.imul(nt,Dt)|0,et=et+Math.imul(dt,de)|0,K=K+Math.imul(dt,Dt)|0,st=st+Math.imul(J,_t)|0,et=et+Math.imul(J,lt)|0,et=et+Math.imul(q,_t)|0,K=K+Math.imul(q,lt)|0,st=st+Math.imul(X,St)|0,et=et+Math.imul(X,Ht)|0,et=et+Math.imul(Q,St)|0,K=K+Math.imul(Q,Ht)|0;var zr=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(zr>>>26)|0,zr&=67108863,st=Math.imul(Nt,er),et=Math.imul(Nt,Mr),et=et+Math.imul(ee,er)|0,K=Math.imul(ee,Mr),st=st+Math.imul(wt,de)|0,et=et+Math.imul(wt,Dt)|0,et=et+Math.imul(It,de)|0,K=K+Math.imul(It,Dt)|0,st=st+Math.imul(nt,_t)|0,et=et+Math.imul(nt,lt)|0,et=et+Math.imul(dt,_t)|0,K=K+Math.imul(dt,lt)|0,st=st+Math.imul(J,St)|0,et=et+Math.imul(J,Ht)|0,et=et+Math.imul(q,St)|0,K=K+Math.imul(q,Ht)|0,st=st+Math.imul(X,se)|0,et=et+Math.imul(X,ke)|0,et=et+Math.imul(Q,se)|0,K=K+Math.imul(Q,ke)|0;var tn=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(tn>>>26)|0,tn&=67108863,st=Math.imul(te,er),et=Math.imul(te,Mr),et=et+Math.imul(Kt,er)|0,K=Math.imul(Kt,Mr),st=st+Math.imul(Nt,de)|0,et=et+Math.imul(Nt,Dt)|0,et=et+Math.imul(ee,de)|0,K=K+Math.imul(ee,Dt)|0,st=st+Math.imul(wt,_t)|0,et=et+Math.imul(wt,lt)|0,et=et+Math.imul(It,_t)|0,K=K+Math.imul(It,lt)|0,st=st+Math.imul(nt,St)|0,et=et+Math.imul(nt,Ht)|0,et=et+Math.imul(dt,St)|0,K=K+Math.imul(dt,Ht)|0,st=st+Math.imul(J,se)|0,et=et+Math.imul(J,ke)|0,et=et+Math.imul(q,se)|0,K=K+Math.imul(q,ke)|0,st=st+Math.imul(X,Ue)|0,et=et+Math.imul(X,ir)|0,et=et+Math.imul(Q,Ue)|0,K=K+Math.imul(Q,ir)|0;var Yr=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,st=Math.imul(bt,er),et=Math.imul(bt,Mr),et=et+Math.imul(vt,er)|0,K=Math.imul(vt,Mr),st=st+Math.imul(te,de)|0,et=et+Math.imul(te,Dt)|0,et=et+Math.imul(Kt,de)|0,K=K+Math.imul(Kt,Dt)|0,st=st+Math.imul(Nt,_t)|0,et=et+Math.imul(Nt,lt)|0,et=et+Math.imul(ee,_t)|0,K=K+Math.imul(ee,lt)|0,st=st+Math.imul(wt,St)|0,et=et+Math.imul(wt,Ht)|0,et=et+Math.imul(It,St)|0,K=K+Math.imul(It,Ht)|0,st=st+Math.imul(nt,se)|0,et=et+Math.imul(nt,ke)|0,et=et+Math.imul(dt,se)|0,K=K+Math.imul(dt,ke)|0,st=st+Math.imul(J,Ue)|0,et=et+Math.imul(J,ir)|0,et=et+Math.imul(q,Ue)|0,K=K+Math.imul(q,ir)|0,st=st+Math.imul(X,Ye)|0,et=et+Math.imul(X,Er)|0,et=et+Math.imul(Q,Ye)|0,K=K+Math.imul(Q,Er)|0;var $r=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+($r>>>26)|0,$r&=67108863,st=Math.imul(re,er),et=Math.imul(re,Mr),et=et+Math.imul(Zt,er)|0,K=Math.imul(Zt,Mr),st=st+Math.imul(bt,de)|0,et=et+Math.imul(bt,Dt)|0,et=et+Math.imul(vt,de)|0,K=K+Math.imul(vt,Dt)|0,st=st+Math.imul(te,_t)|0,et=et+Math.imul(te,lt)|0,et=et+Math.imul(Kt,_t)|0,K=K+Math.imul(Kt,lt)|0,st=st+Math.imul(Nt,St)|0,et=et+Math.imul(Nt,Ht)|0,et=et+Math.imul(ee,St)|0,K=K+Math.imul(ee,Ht)|0,st=st+Math.imul(wt,se)|0,et=et+Math.imul(wt,ke)|0,et=et+Math.imul(It,se)|0,K=K+Math.imul(It,ke)|0,st=st+Math.imul(nt,Ue)|0,et=et+Math.imul(nt,ir)|0,et=et+Math.imul(dt,Ue)|0,K=K+Math.imul(dt,ir)|0,st=st+Math.imul(J,Ye)|0,et=et+Math.imul(J,Er)|0,et=et+Math.imul(q,Ye)|0,K=K+Math.imul(q,Er)|0,st=st+Math.imul(X,dn)|0,et=et+Math.imul(X,bn)|0,et=et+Math.imul(Q,dn)|0,K=K+Math.imul(Q,bn)|0;var In=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(In>>>26)|0,In&=67108863,st=Math.imul(Me,er),et=Math.imul(Me,Mr),et=et+Math.imul(Ce,er)|0,K=Math.imul(Ce,Mr),st=st+Math.imul(re,de)|0,et=et+Math.imul(re,Dt)|0,et=et+Math.imul(Zt,de)|0,K=K+Math.imul(Zt,Dt)|0,st=st+Math.imul(bt,_t)|0,et=et+Math.imul(bt,lt)|0,et=et+Math.imul(vt,_t)|0,K=K+Math.imul(vt,lt)|0,st=st+Math.imul(te,St)|0,et=et+Math.imul(te,Ht)|0,et=et+Math.imul(Kt,St)|0,K=K+Math.imul(Kt,Ht)|0,st=st+Math.imul(Nt,se)|0,et=et+Math.imul(Nt,ke)|0,et=et+Math.imul(ee,se)|0,K=K+Math.imul(ee,ke)|0,st=st+Math.imul(wt,Ue)|0,et=et+Math.imul(wt,ir)|0,et=et+Math.imul(It,Ue)|0,K=K+Math.imul(It,ir)|0,st=st+Math.imul(nt,Ye)|0,et=et+Math.imul(nt,Er)|0,et=et+Math.imul(dt,Ye)|0,K=K+Math.imul(dt,Er)|0,st=st+Math.imul(J,dn)|0,et=et+Math.imul(J,bn)|0,et=et+Math.imul(q,dn)|0,K=K+Math.imul(q,bn)|0,st=st+Math.imul(X,En)|0,et=et+Math.imul(X,gn)|0,et=et+Math.imul(Q,En)|0,K=K+Math.imul(Q,gn)|0;var Nn=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,st=Math.imul(qe,er),et=Math.imul(qe,Mr),et=et+Math.imul(vr,er)|0,K=Math.imul(vr,Mr),st=st+Math.imul(Me,de)|0,et=et+Math.imul(Me,Dt)|0,et=et+Math.imul(Ce,de)|0,K=K+Math.imul(Ce,Dt)|0,st=st+Math.imul(re,_t)|0,et=et+Math.imul(re,lt)|0,et=et+Math.imul(Zt,_t)|0,K=K+Math.imul(Zt,lt)|0,st=st+Math.imul(bt,St)|0,et=et+Math.imul(bt,Ht)|0,et=et+Math.imul(vt,St)|0,K=K+Math.imul(vt,Ht)|0,st=st+Math.imul(te,se)|0,et=et+Math.imul(te,ke)|0,et=et+Math.imul(Kt,se)|0,K=K+Math.imul(Kt,ke)|0,st=st+Math.imul(Nt,Ue)|0,et=et+Math.imul(Nt,ir)|0,et=et+Math.imul(ee,Ue)|0,K=K+Math.imul(ee,ir)|0,st=st+Math.imul(wt,Ye)|0,et=et+Math.imul(wt,Er)|0,et=et+Math.imul(It,Ye)|0,K=K+Math.imul(It,Er)|0,st=st+Math.imul(nt,dn)|0,et=et+Math.imul(nt,bn)|0,et=et+Math.imul(dt,dn)|0,K=K+Math.imul(dt,bn)|0,st=st+Math.imul(J,En)|0,et=et+Math.imul(J,gn)|0,et=et+Math.imul(q,En)|0,K=K+Math.imul(q,gn)|0,st=st+Math.imul(X,ra)|0,et=et+Math.imul(X,Se)|0,et=et+Math.imul(Q,ra)|0,K=K+Math.imul(Q,Se)|0;var Kn=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,st=Math.imul(qe,de),et=Math.imul(qe,Dt),et=et+Math.imul(vr,de)|0,K=Math.imul(vr,Dt),st=st+Math.imul(Me,_t)|0,et=et+Math.imul(Me,lt)|0,et=et+Math.imul(Ce,_t)|0,K=K+Math.imul(Ce,lt)|0,st=st+Math.imul(re,St)|0,et=et+Math.imul(re,Ht)|0,et=et+Math.imul(Zt,St)|0,K=K+Math.imul(Zt,Ht)|0,st=st+Math.imul(bt,se)|0,et=et+Math.imul(bt,ke)|0,et=et+Math.imul(vt,se)|0,K=K+Math.imul(vt,ke)|0,st=st+Math.imul(te,Ue)|0,et=et+Math.imul(te,ir)|0,et=et+Math.imul(Kt,Ue)|0,K=K+Math.imul(Kt,ir)|0,st=st+Math.imul(Nt,Ye)|0,et=et+Math.imul(Nt,Er)|0,et=et+Math.imul(ee,Ye)|0,K=K+Math.imul(ee,Er)|0,st=st+Math.imul(wt,dn)|0,et=et+Math.imul(wt,bn)|0,et=et+Math.imul(It,dn)|0,K=K+Math.imul(It,bn)|0,st=st+Math.imul(nt,En)|0,et=et+Math.imul(nt,gn)|0,et=et+Math.imul(dt,En)|0,K=K+Math.imul(dt,gn)|0,st=st+Math.imul(J,ra)|0,et=et+Math.imul(J,Se)|0,et=et+Math.imul(q,ra)|0,K=K+Math.imul(q,Se)|0;var $n=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+($n>>>26)|0,$n&=67108863,st=Math.imul(qe,_t),et=Math.imul(qe,lt),et=et+Math.imul(vr,_t)|0,K=Math.imul(vr,lt),st=st+Math.imul(Me,St)|0,et=et+Math.imul(Me,Ht)|0,et=et+Math.imul(Ce,St)|0,K=K+Math.imul(Ce,Ht)|0,st=st+Math.imul(re,se)|0,et=et+Math.imul(re,ke)|0,et=et+Math.imul(Zt,se)|0,K=K+Math.imul(Zt,ke)|0,st=st+Math.imul(bt,Ue)|0,et=et+Math.imul(bt,ir)|0,et=et+Math.imul(vt,Ue)|0,K=K+Math.imul(vt,ir)|0,st=st+Math.imul(te,Ye)|0,et=et+Math.imul(te,Er)|0,et=et+Math.imul(Kt,Ye)|0,K=K+Math.imul(Kt,Er)|0,st=st+Math.imul(Nt,dn)|0,et=et+Math.imul(Nt,bn)|0,et=et+Math.imul(ee,dn)|0,K=K+Math.imul(ee,bn)|0,st=st+Math.imul(wt,En)|0,et=et+Math.imul(wt,gn)|0,et=et+Math.imul(It,En)|0,K=K+Math.imul(It,gn)|0,st=st+Math.imul(nt,ra)|0,et=et+Math.imul(nt,Se)|0,et=et+Math.imul(dt,ra)|0,K=K+Math.imul(dt,Se)|0;var ia=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(ia>>>26)|0,ia&=67108863,st=Math.imul(qe,St),et=Math.imul(qe,Ht),et=et+Math.imul(vr,St)|0,K=Math.imul(vr,Ht),st=st+Math.imul(Me,se)|0,et=et+Math.imul(Me,ke)|0,et=et+Math.imul(Ce,se)|0,K=K+Math.imul(Ce,ke)|0,st=st+Math.imul(re,Ue)|0,et=et+Math.imul(re,ir)|0,et=et+Math.imul(Zt,Ue)|0,K=K+Math.imul(Zt,ir)|0,st=st+Math.imul(bt,Ye)|0,et=et+Math.imul(bt,Er)|0,et=et+Math.imul(vt,Ye)|0,K=K+Math.imul(vt,Er)|0,st=st+Math.imul(te,dn)|0,et=et+Math.imul(te,bn)|0,et=et+Math.imul(Kt,dn)|0,K=K+Math.imul(Kt,bn)|0,st=st+Math.imul(Nt,En)|0,et=et+Math.imul(Nt,gn)|0,et=et+Math.imul(ee,En)|0,K=K+Math.imul(ee,gn)|0,st=st+Math.imul(wt,ra)|0,et=et+Math.imul(wt,Se)|0,et=et+Math.imul(It,ra)|0,K=K+Math.imul(It,Se)|0;var Cn=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,st=Math.imul(qe,se),et=Math.imul(qe,ke),et=et+Math.imul(vr,se)|0,K=Math.imul(vr,ke),st=st+Math.imul(Me,Ue)|0,et=et+Math.imul(Me,ir)|0,et=et+Math.imul(Ce,Ue)|0,K=K+Math.imul(Ce,ir)|0,st=st+Math.imul(re,Ye)|0,et=et+Math.imul(re,Er)|0,et=et+Math.imul(Zt,Ye)|0,K=K+Math.imul(Zt,Er)|0,st=st+Math.imul(bt,dn)|0,et=et+Math.imul(bt,bn)|0,et=et+Math.imul(vt,dn)|0,K=K+Math.imul(vt,bn)|0,st=st+Math.imul(te,En)|0,et=et+Math.imul(te,gn)|0,et=et+Math.imul(Kt,En)|0,K=K+Math.imul(Kt,gn)|0,st=st+Math.imul(Nt,ra)|0,et=et+Math.imul(Nt,Se)|0,et=et+Math.imul(ee,ra)|0,K=K+Math.imul(ee,Se)|0;var Fa=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,st=Math.imul(qe,Ue),et=Math.imul(qe,ir),et=et+Math.imul(vr,Ue)|0,K=Math.imul(vr,ir),st=st+Math.imul(Me,Ye)|0,et=et+Math.imul(Me,Er)|0,et=et+Math.imul(Ce,Ye)|0,K=K+Math.imul(Ce,Er)|0,st=st+Math.imul(re,dn)|0,et=et+Math.imul(re,bn)|0,et=et+Math.imul(Zt,dn)|0,K=K+Math.imul(Zt,bn)|0,st=st+Math.imul(bt,En)|0,et=et+Math.imul(bt,gn)|0,et=et+Math.imul(vt,En)|0,K=K+Math.imul(vt,gn)|0,st=st+Math.imul(te,ra)|0,et=et+Math.imul(te,Se)|0,et=et+Math.imul(Kt,ra)|0,K=K+Math.imul(Kt,Se)|0;var Ga=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,st=Math.imul(qe,Ye),et=Math.imul(qe,Er),et=et+Math.imul(vr,Ye)|0,K=Math.imul(vr,Er),st=st+Math.imul(Me,dn)|0,et=et+Math.imul(Me,bn)|0,et=et+Math.imul(Ce,dn)|0,K=K+Math.imul(Ce,bn)|0,st=st+Math.imul(re,En)|0,et=et+Math.imul(re,gn)|0,et=et+Math.imul(Zt,En)|0,K=K+Math.imul(Zt,gn)|0,st=st+Math.imul(bt,ra)|0,et=et+Math.imul(bt,Se)|0,et=et+Math.imul(vt,ra)|0,K=K+Math.imul(vt,Se)|0;var ve=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(ve>>>26)|0,ve&=67108863,st=Math.imul(qe,dn),et=Math.imul(qe,bn),et=et+Math.imul(vr,dn)|0,K=Math.imul(vr,bn),st=st+Math.imul(Me,En)|0,et=et+Math.imul(Me,gn)|0,et=et+Math.imul(Ce,En)|0,K=K+Math.imul(Ce,gn)|0,st=st+Math.imul(re,ra)|0,et=et+Math.imul(re,Se)|0,et=et+Math.imul(Zt,ra)|0,K=K+Math.imul(Zt,Se)|0;var ge=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(ge>>>26)|0,ge&=67108863,st=Math.imul(qe,En),et=Math.imul(qe,gn),et=et+Math.imul(vr,En)|0,K=Math.imul(vr,gn),st=st+Math.imul(Me,ra)|0,et=et+Math.imul(Me,Se)|0,et=et+Math.imul(Ce,ra)|0,K=K+Math.imul(Ce,Se)|0;var dr=(ct+st|0)+((et&8191)<<13)|0;ct=(K+(et>>>13)|0)+(dr>>>26)|0,dr&=67108863,st=Math.imul(qe,ra),et=Math.imul(qe,Se),et=et+Math.imul(vr,ra)|0,K=Math.imul(vr,Se);var br=(ct+st|0)+((et&8191)<<13)|0;return ct=(K+(et>>>13)|0)+(br>>>26)|0,br&=67108863,rt[0]=Re,rt[1]=Ze,rt[2]=tr,rt[3]=zr,rt[4]=tn,rt[5]=Yr,rt[6]=$r,rt[7]=In,rt[8]=Nn,rt[9]=Kn,rt[10]=$n,rt[11]=ia,rt[12]=Cn,rt[13]=Fa,rt[14]=Ga,rt[15]=ve,rt[16]=ge,rt[17]=dr,rt[18]=br,ct!==0&&(rt[19]=ct,N.length++),N};Math.imul||(k=S);function M(I,F,N){N.negative=F.negative^I.negative,N.length=I.length+F.length;for(var j=0,G=0,rt=0;rt<N.length-1;rt++){var ct=G;G=0;for(var st=j&67108863,et=Math.min(rt,F.length-1),K=Math.max(0,rt-I.length+1);K<=et;K++){var ot=rt-K,X=I.words[ot]|0,Q=F.words[K]|0,ut=X*Q,J=ut&67108863;ct=ct+(ut/67108864|0)|0,J=J+st|0,st=J&67108863,ct=ct+(J>>>26)|0,G+=ct>>>26,ct&=67108863}N.words[rt]=st,j=ct,ct=G}return j!==0?N.words[rt]=j:N.length--,N.strip()}function T(I,F,N){var j=new c;return j.mulp(I,F,N)}s.prototype.mulTo=function(I,F){var N,j=this.length+I.length;return this.length===10&&I.length===10?N=k(this,I,F):j<63?N=S(this,I,F):j<1024?N=M(this,I,F):N=T(this,I,F),N};function c(I,F){this.x=I,this.y=F}c.prototype.makeRBT=function(I){for(var F=new Array(I),N=s.prototype._countBits(I)-1,j=0;j<I;j++)F[j]=this.revBin(j,N,I);return F},c.prototype.revBin=function(I,F,N){if(I===0||I===N-1)return I;for(var j=0,G=0;G<F;G++)j|=(I&1)<<F-G-1,I>>=1;return j},c.prototype.permute=function(I,F,N,j,G,rt){for(var ct=0;ct<rt;ct++)j[ct]=F[I[ct]],G[ct]=N[I[ct]]},c.prototype.transform=function(I,F,N,j,G,rt){this.permute(rt,I,F,N,j,G);for(var ct=1;ct<G;ct<<=1)for(var st=ct<<1,et=Math.cos(2*Math.PI/st),K=Math.sin(2*Math.PI/st),ot=0;ot<G;ot+=st)for(var X=et,Q=K,ut=0;ut<ct;ut++){var J=N[ot+ut],q=j[ot+ut],it=N[ot+ut+ct],nt=j[ot+ut+ct],dt=X*it-Q*nt;nt=X*nt+Q*it,it=dt,N[ot+ut]=J+it,j[ot+ut]=q+nt,N[ot+ut+ct]=J-it,j[ot+ut+ct]=q-nt,ut!==st&&(dt=et*X-K*Q,Q=et*Q+K*X,X=dt)}},c.prototype.guessLen13b=function(I,F){var N=Math.max(F,I)|1,j=N&1,G=0;for(N=N/2|0;N;N=N>>>1)G++;return 1<<G+1+j},c.prototype.conjugate=function(I,F,N){if(!(N<=1))for(var j=0;j<N/2;j++){var G=I[j];I[j]=I[N-j-1],I[N-j-1]=G,G=F[j],F[j]=-F[N-j-1],F[N-j-1]=-G}},c.prototype.normalize13b=function(I,F){for(var N=0,j=0;j<F/2;j++){var G=Math.round(I[2*j+1]/F)*8192+Math.round(I[2*j]/F)+N;I[j]=G&67108863,G<67108864?N=0:N=G/67108864|0}return I},c.prototype.convert13b=function(I,F,N,j){for(var G=0,rt=0;rt<F;rt++)G=G+(I[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)},c.prototype.stub=function(I){for(var F=new Array(I),N=0;N<I;N++)F[N]=0;return F},c.prototype.mulp=function(I,F,N){var j=2*this.guessLen13b(I.length,F.length),G=this.makeRBT(j),rt=this.stub(j),ct=new Array(j),st=new Array(j),et=new Array(j),K=new Array(j),ot=new Array(j),X=new Array(j),Q=N.words;Q.length=j,this.convert13b(I.words,I.length,ct,j),this.convert13b(F.words,F.length,K,j),this.transform(ct,rt,st,et,j,G),this.transform(K,rt,ot,X,j,G);for(var ut=0;ut<j;ut++){var J=st[ut]*ot[ut]-et[ut]*X[ut];et[ut]=st[ut]*X[ut]+et[ut]*ot[ut],st[ut]=J}return this.conjugate(st,et,j),this.transform(st,et,Q,rt,j,G),this.conjugate(Q,rt,j),this.normalize13b(Q,j),N.negative=I.negative^F.negative,N.length=I.length+F.length,N.strip()},s.prototype.mul=function(I){var F=new s(null);return F.words=new Array(this.length+I.length),this.mulTo(I,F)},s.prototype.mulf=function(I){var F=new s(null);return F.words=new Array(this.length+I.length),T(this,I,F)},s.prototype.imul=function(I){return this.clone().mulTo(I,this)},s.prototype.imuln=function(I){o(typeof I=="number"),o(I<67108864);for(var F=0,N=0;N<this.length;N++){var j=(this.words[N]|0)*I,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(I){return this.clone().imuln(I)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(I){var F=y(I);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(I){o(typeof I=="number"&&I>=0);var F=I%26,N=(I-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,st=(this.words[G]|0)-ct<<F;this.words[G]=st|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(I){return o(this.negative===0),this.iushln(I)},s.prototype.iushrn=function(I,F,N){o(typeof I=="number"&&I>=0);var j;F?j=(F-F%26)/26:j=0;var G=I%26,rt=Math.min((I-G)/26,this.length),ct=67108863^67108863>>>G<<G,st=N;if(j-=rt,j=Math.max(0,j),st){for(var et=0;et<rt;et++)st.words[et]=this.words[et];st.length=rt}if(rt!==0)if(this.length>rt)for(this.length-=rt,et=0;et<this.length;et++)this.words[et]=this.words[et+rt];else this.words[0]=0,this.length=1;var K=0;for(et=this.length-1;et>=0&&(K!==0||et>=j);et--){var ot=this.words[et]|0;this.words[et]=K<<26-G|ot>>>G,K=ot&ct}return st&&K!==0&&(st.words[st.length++]=K),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(I,F,N){return o(this.negative===0),this.iushrn(I,F,N)},s.prototype.shln=function(I){return this.clone().ishln(I)},s.prototype.ushln=function(I){return this.clone().iushln(I)},s.prototype.shrn=function(I){return this.clone().ishrn(I)},s.prototype.ushrn=function(I){return this.clone().iushrn(I)},s.prototype.testn=function(I){o(typeof I=="number"&&I>=0);var F=I%26,N=(I-F)/26,j=1<<F;if(this.length<=N)return!1;var G=this.words[N];return!!(G&j)},s.prototype.imaskn=function(I){o(typeof I=="number"&&I>=0);var F=I%26,N=(I-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(I){return this.clone().imaskn(I)},s.prototype.iaddn=function(I){return o(typeof I=="number"),o(I<67108864),I<0?this.isubn(-I):this.negative!==0?this.length===1&&(this.words[0]|0)<I?(this.words[0]=I-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(I),this.negative=1,this):this._iaddn(I)},s.prototype._iaddn=function(I){this.words[0]+=I;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(I){if(o(typeof I=="number"),o(I<67108864),I<0)return this.iaddn(-I);if(this.negative!==0)return this.negative=0,this.iaddn(I),this.negative=1,this;if(this.words[0]-=I,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(I){return this.clone().iaddn(I)},s.prototype.subn=function(I){return this.clone().isubn(I)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(I,F,N){var j=I.length+N,G;this._expand(j);var rt,ct=0;for(G=0;G<I.length;G++){rt=(this.words[G+N]|0)+ct;var st=(I.words[G]|0)*F;rt-=st&67108863,ct=(rt>>26)-(st/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(I,F){var N=this.length-I.length,j=this.clone(),G=I,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 st=j.length-G.length,et;if(F!=="mod"){et=new s(null),et.length=st+1,et.words=new Array(et.length);for(var K=0;K<et.length;K++)et.words[K]=0}var ot=j.clone()._ishlnsubmul(G,1,st);ot.negative===0&&(j=ot,et&&(et.words[st]=1));for(var X=st-1;X>=0;X--){var Q=(j.words[G.length+X]|0)*67108864+(j.words[G.length+X-1]|0);for(Q=Math.min(Q/rt|0,67108863),j._ishlnsubmul(G,Q,X);j.negative!==0;)Q--,j.negative=0,j._ishlnsubmul(G,1,X),j.isZero()||(j.negative^=1);et&&(et.words[X]=Q)}return et&&et.strip(),j.strip(),F!=="div"&&N!==0&&j.iushrn(N),{div:et||null,mod:j}},s.prototype.divmod=function(I,F,N){if(o(!I.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var j,G,rt;return this.negative!==0&&I.negative===0?(rt=this.neg().divmod(I,F),F!=="mod"&&(j=rt.div.neg()),F!=="div"&&(G=rt.mod.neg(),N&&G.negative!==0&&G.iadd(I)),{div:j,mod:G}):this.negative===0&&I.negative!==0?(rt=this.divmod(I.neg(),F),F!=="mod"&&(j=rt.div.neg()),{div:j,mod:rt.mod}):(this.negative&I.negative)!==0?(rt=this.neg().divmod(I.neg(),F),F!=="div"&&(G=rt.mod.neg(),N&&G.negative!==0&&G.isub(I)),{div:rt.div,mod:G}):I.length>this.length||this.cmp(I)<0?{div:new s(0),mod:this}:I.length===1?F==="div"?{div:this.divn(I.words[0]),mod:null}:F==="mod"?{div:null,mod:new s(this.modn(I.words[0]))}:{div:this.divn(I.words[0]),mod:new s(this.modn(I.words[0]))}:this._wordDiv(I,F)},s.prototype.div=function(I){return this.divmod(I,"div",!1).div},s.prototype.mod=function(I){return this.divmod(I,"mod",!1).mod},s.prototype.umod=function(I){return this.divmod(I,"mod",!0).mod},s.prototype.divRound=function(I){var F=this.divmod(I);if(F.mod.isZero())return F.div;var N=F.div.negative!==0?F.mod.isub(I):F.mod,j=I.ushrn(1),G=I.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(I){o(I<=67108863);for(var F=67108864%I,N=0,j=this.length-1;j>=0;j--)N=(F*N+(this.words[j]|0))%I;return N},s.prototype.idivn=function(I){o(I<=67108863);for(var F=0,N=this.length-1;N>=0;N--){var j=(this.words[N]|0)+F*67108864;this.words[N]=j/I|0,F=j%I}return this.strip()},s.prototype.divn=function(I){return this.clone().idivn(I)},s.prototype.egcd=function(I){o(I.negative===0),o(!I.isZero());var F=this,N=I.clone();F.negative!==0?F=F.umod(I):F=F.clone();for(var j=new s(1),G=new s(0),rt=new s(0),ct=new s(1),st=0;F.isEven()&&N.isEven();)F.iushrn(1),N.iushrn(1),++st;for(var et=N.clone(),K=F.clone();!F.isZero();){for(var ot=0,X=1;(F.words[0]&X)===0&&ot<26;++ot,X<<=1);if(ot>0)for(F.iushrn(ot);ot-- >0;)(j.isOdd()||G.isOdd())&&(j.iadd(et),G.isub(K)),j.iushrn(1),G.iushrn(1);for(var Q=0,ut=1;(N.words[0]&ut)===0&&Q<26;++Q,ut<<=1);if(Q>0)for(N.iushrn(Q);Q-- >0;)(rt.isOdd()||ct.isOdd())&&(rt.iadd(et),ct.isub(K)),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(st)}},s.prototype._invmp=function(I){o(I.negative===0),o(!I.isZero());var F=this,N=I.clone();F.negative!==0?F=F.umod(I):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,st=1;(F.words[0]&st)===0&&ct<26;++ct,st<<=1);if(ct>0)for(F.iushrn(ct);ct-- >0;)j.isOdd()&&j.iadd(rt),j.iushrn(1);for(var et=0,K=1;(N.words[0]&K)===0&&et<26;++et,K<<=1);if(et>0)for(N.iushrn(et);et-- >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 ot;return F.cmpn(1)===0?ot=j:ot=G,ot.cmpn(0)<0&&ot.iadd(I),ot},s.prototype.gcd=function(I){if(this.isZero())return I.abs();if(I.isZero())return this.abs();var F=this.clone(),N=I.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(I){return this.egcd(I).a.umod(I)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(I){return this.words[0]&I},s.prototype.bincn=function(I){o(typeof I=="number");var F=I%26,N=(I-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(I){var F=I<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&&(I=-I),o(I<=67108863,"Number is too big");var j=this.words[0]|0;N=j===I?0:j<I?-1:1}return this.negative!==0?-N|0:N},s.prototype.cmp=function(I){if(this.negative!==0&&I.negative===0)return-1;if(this.negative===0&&I.negative!==0)return 1;var F=this.ucmp(I);return this.negative!==0?-F|0:F},s.prototype.ucmp=function(I){if(this.length>I.length)return 1;if(this.length<I.length)return-1;for(var F=0,N=this.length-1;N>=0;N--){var j=this.words[N]|0,G=I.words[N]|0;if(j!==G){j<G?F=-1:j>G&&(F=1);break}}return F},s.prototype.gtn=function(I){return this.cmpn(I)===1},s.prototype.gt=function(I){return this.cmp(I)===1},s.prototype.gten=function(I){return this.cmpn(I)>=0},s.prototype.gte=function(I){return this.cmp(I)>=0},s.prototype.ltn=function(I){return this.cmpn(I)===-1},s.prototype.lt=function(I){return this.cmp(I)===-1},s.prototype.lten=function(I){return this.cmpn(I)<=0},s.prototype.lte=function(I){return this.cmp(I)<=0},s.prototype.eqn=function(I){return this.cmpn(I)===0},s.prototype.eq=function(I){return this.cmp(I)===0},s.red=function(I){return new B(I)},s.prototype.toRed=function(I){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},s.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(I){return this.red=I,this},s.prototype.forceRed=function(I){return o(!this.red,"Already a number in reduction context"),this._forceRed(I)},s.prototype.redAdd=function(I){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},s.prototype.redIAdd=function(I){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},s.prototype.redSub=function(I){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},s.prototype.redISub=function(I){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},s.prototype.redShl=function(I){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},s.prototype.redMul=function(I){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},s.prototype.redIMul=function(I){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},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(I){return o(this.red&&!I.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,I)};var h={k256:null,p224:null,p192:null,p25519:null};function b(I,F){this.name=I,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()}b.prototype._tmp=function(){var I=new s(null);return I.words=new Array(Math.ceil(this.n/13)),I},b.prototype.ireduce=function(I){var F=I,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},b.prototype.split=function(I,F){I.iushrn(this.n,0,F)},b.prototype.imulK=function(I){return I.imul(this.k)};function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(_,b),_.prototype.split=function(I,F){for(var N=4194303,j=Math.min(I.length,9),G=0;G<j;G++)F.words[G]=I.words[G];if(F.length=j,I.length<=9){I.words[0]=0,I.length=1;return}var rt=I.words[9];for(F.words[F.length++]=rt&N,G=10;G<I.length;G++){var ct=I.words[G]|0;I.words[G-10]=(ct&N)<<4|rt>>>22,rt=ct}rt>>>=22,I.words[G-10]=rt,rt===0&&I.length>10?I.length-=10:I.length-=9},_.prototype.imulK=function(I){I.words[I.length]=0,I.words[I.length+1]=0,I.length+=2;for(var F=0,N=0;N<I.length;N++){var j=I.words[N]|0;F+=j*977,I.words[N]=F&67108863,F=j*64+(F/67108864|0)}return I.words[I.length-1]===0&&(I.length--,I.words[I.length-1]===0&&I.length--),I};function P(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(P,b);function L(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(L,b);function D(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(D,b),D.prototype.imulK=function(I){for(var F=0,N=0;N<I.length;N++){var j=(I.words[N]|0)*19+F,G=j&67108863;j>>>=26,I.words[N]=G,F=j}return F!==0&&(I.words[I.length++]=F),I},s._prime=function(I){if(h[I])return h[I];var F;if(I==="k256")F=new _;else if(I==="p224")F=new P;else if(I==="p192")F=new L;else if(I==="p25519")F=new D;else throw new Error("Unknown prime "+I);return h[I]=F,F};function B(I){if(typeof I=="string"){var F=s._prime(I);this.m=F.p,this.prime=F}else o(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}B.prototype._verify1=function(I){o(I.negative===0,"red works only with positives"),o(I.red,"red works only with red numbers")},B.prototype._verify2=function(I,F){o((I.negative|F.negative)===0,"red works only with positives"),o(I.red&&I.red===F.red,"red works only with red numbers")},B.prototype.imod=function(I){return this.prime?this.prime.ireduce(I)._forceRed(this):I.umod(this.m)._forceRed(this)},B.prototype.neg=function(I){return I.isZero()?I.clone():this.m.sub(I)._forceRed(this)},B.prototype.add=function(I,F){this._verify2(I,F);var N=I.add(F);return N.cmp(this.m)>=0&&N.isub(this.m),N._forceRed(this)},B.prototype.iadd=function(I,F){this._verify2(I,F);var N=I.iadd(F);return N.cmp(this.m)>=0&&N.isub(this.m),N},B.prototype.sub=function(I,F){this._verify2(I,F);var N=I.sub(F);return N.cmpn(0)<0&&N.iadd(this.m),N._forceRed(this)},B.prototype.isub=function(I,F){this._verify2(I,F);var N=I.isub(F);return N.cmpn(0)<0&&N.iadd(this.m),N},B.prototype.shl=function(I,F){return this._verify1(I),this.imod(I.ushln(F))},B.prototype.imul=function(I,F){return this._verify2(I,F),this.imod(I.imul(F))},B.prototype.mul=function(I,F){return this._verify2(I,F),this.imod(I.mul(F))},B.prototype.isqr=function(I){return this.imul(I,I.clone())},B.prototype.sqr=function(I){return this.mul(I,I)},B.prototype.sqrt=function(I){if(I.isZero())return I.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(I,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(),st=this.m.subn(1).iushrn(1),et=this.m.bitLength();for(et=new s(2*et*et).toRed(this);this.pow(et,st).cmp(ct)!==0;)et.redIAdd(ct);for(var K=this.pow(et,j),ot=this.pow(I,j.addn(1).iushrn(1)),X=this.pow(I,j),Q=G;X.cmp(rt)!==0;){for(var ut=X,J=0;ut.cmp(rt)!==0;J++)ut=ut.redSqr();o(J<Q);var q=this.pow(K,new s(1).iushln(Q-J-1));ot=ot.redMul(q),K=q.redSqr(),X=X.redMul(K),Q=J}return ot},B.prototype.invm=function(I){var F=I._invmp(this.m);return F.negative!==0?(F.negative=0,this.imod(F).redNeg()):this.imod(F)},B.prototype.pow=function(I,F){if(F.isZero())return new s(1).toRed(this);if(F.cmpn(1)===0)return I.clone();var N=4,j=new Array(1<<N);j[0]=new s(1).toRed(this),j[1]=I;for(var G=2;G<j.length;G++)j[G]=this.mul(j[G-1],I);var rt=j[0],ct=0,st=0,et=F.bitLength()%26;for(et===0&&(et=26),G=F.length-1;G>=0;G--){for(var K=F.words[G],ot=et-1;ot>=0;ot--){var X=K>>ot&1;if(rt!==j[0]&&(rt=this.sqr(rt)),X===0&&ct===0){st=0;continue}ct<<=1,ct|=X,st++,!(st!==N&&(G!==0||ot!==0))&&(rt=this.mul(rt,j[ct]),st=0,ct=0)}et=26}return rt},B.prototype.convertTo=function(I){var F=I.umod(this.m);return F===I?F.clone():F},B.prototype.convertFrom=function(I){var F=I.clone();return F.red=null,F},s.mont=function(I){return new R(I)};function R(I){B.call(this,I),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(I){return this.imod(I.ushln(this.shift))},R.prototype.convertFrom=function(I){var F=this.imod(I.mul(this.rinv));return F.red=null,F},R.prototype.imul=function(I,F){if(I.isZero()||F.isZero())return I.words[0]=0,I.length=1,I;var N=I.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(I,F){if(I.isZero()||F.isZero())return new s(0)._forceRed(this);var N=I.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(I){var F=this.imod(I._invmp(this.m).mul(this.r2));return F._forceRed(this)}}(t,this)},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}},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}},6867:function(t,e,r){t.exports=l;var i=r(1888),n=r(855),o=r(7150);function a(x,y){for(var S=0;S<x;++S)if(!(y[S]<=y[S+x]))return!0;return!1}function s(x,y,S,k){for(var M=0,T=0,c=0,h=x.length;c<h;++c){var b=x[c];if(!a(y,b)){for(var _=0;_<2*y;++_)S[M++]=b[_];k[T++]=c}}return T}function f(x,y,S,k){var M=x.length,T=y.length;if(!(M<=0||T<=0)){var c=x[0].length>>>1;if(!(c<=0)){var h,b=i.mallocDouble(2*c*M),_=i.mallocInt32(M);if(M=s(x,c,b,_),M>0){if(c===1&&k)n.init(M),h=n.sweepComplete(c,S,0,M,b,_,0,M,b,_);else{var P=i.mallocDouble(2*c*T),L=i.mallocInt32(T);T=s(y,c,P,L),T>0&&(n.init(M+T),c===1?h=n.sweepBipartite(c,S,0,M,b,_,0,T,P,L):h=o(c,S,k,M,b,_,T,P,L),i.free(P),i.free(L))}i.free(b),i.free(_)}return h}}}var v;function g(x,y){v.push([x,y])}function m(x){return v=[],f(x,x,g,!0),v}function w(x,y){return v=[],f(x,y,g,!1),v}function l(x,y,S){switch(arguments.length){case 1:return m(x);case 2:return typeof y=="function"?f(x,x,y,!0):w(x,y);case 3:return f(x,y,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},6894:function(t){t.exports=e;function e(r,i,n,o){var a=n[1],s=n[2],f=i[1]-a,v=i[2]-s,g=Math.sin(o),m=Math.cos(o);return r[0]=i[0],r[1]=a+f*m-v*g,r[2]=s+f*g+v*m,r}},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,f=r[a];n=s+f;var v=n-s,g=f-v;g&&(r[--o]=n,n=g)}for(var m=0,a=o;a<i;++a){var s=r[a],f=n;n=s+f;var v=n-s,g=f-v;g&&(r[m++]=g)}return r[m++]=n,r.length=m,r}},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)}},7089:function(t){t.exports=e;function e(r,i,n){var o=Math.sin(n),a=Math.cos(n),s=i[0],f=i[1],v=i[2],g=i[3],m=i[4],w=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+m*o,r[1]=f*a+w*o,r[2]=v*a+l*o,r[3]=g*a+x*o,r[4]=m*a-s*o,r[5]=w*a-f*o,r[6]=l*a-v*o,r[7]=x*a-g*o,r}},7150:function(t,e,r){t.exports=I;var i=r(1888),n=r(8828),o=r(2455),a=o.partial,s=o.full,f=r(855),v=r(3545),g=r(8105),m=128,w=1<<22,l=1<<22,x=g("!(lo>=p0)&&!(p1>=hi)"),y=g("lo===p0"),S=g("lo<p0"),k=g("hi<=p0"),M=g("lo<=p0&&p0<=hi"),T=g("lo<p0&&p0<=hi"),c=6,h=2,b=1024,_=i.mallocInt32(b),P=i.mallocDouble(b);function L(F,N){var j=8*n.log2(N+1)*(F+1)|0,G=n.nextPow2(c*j);_.length<G&&(i.free(_),_=i.mallocInt32(G));var rt=n.nextPow2(h*j);P.length<rt&&(i.free(P),P=i.mallocDouble(rt))}function D(F,N,j,G,rt,ct,st,et,K){var ot=c*F;_[ot]=N,_[ot+1]=j,_[ot+2]=G,_[ot+3]=rt,_[ot+4]=ct,_[ot+5]=st;var X=h*F;P[X]=et,P[X+1]=K}function B(F,N,j,G,rt,ct,st,et,K,ot,X){var Q=2*F,ut=K*Q,J=ot[ut+N];t:for(var q=rt,it=rt*Q;q<ct;++q,it+=Q){var nt=st[it+N],dt=st[it+N+F];if(!(J<nt||dt<J)&&!(G&&J===nt)){for(var Tt=et[q],wt=N+1;wt<F;++wt){var nt=st[it+wt],dt=st[it+wt+F],It=ot[ut+wt],Ct=ot[ut+wt+F];if(dt<It||Ct<nt)continue t}var Nt;if(G?Nt=j(X,Tt):Nt=j(Tt,X),Nt!==void 0)return Nt}}}function R(F,N,j,G,rt,ct,st,et,K,ot){var X=2*F,Q=et*X,ut=K[Q+N];t:for(var J=G,q=G*X;J<rt;++J,q+=X){var it=st[J];if(it!==ot){var nt=ct[q+N],dt=ct[q+N+F];if(!(ut<nt||dt<ut)){for(var Tt=N+1;Tt<F;++Tt){var nt=ct[q+Tt],dt=ct[q+Tt+F],wt=K[Q+Tt],It=K[Q+Tt+F];if(dt<wt||It<nt)continue t}var Ct=j(it,ot);if(Ct!==void 0)return Ct}}}}function I(F,N,j,G,rt,ct,st,et,K){L(F,G+st);var ot=0,X=2*F,Q;for(D(ot++,0,0,G,0,st,j?16:0,-1/0,1/0),j||D(ot++,0,0,st,0,G,1,-1/0,1/0);ot>0;){ot-=1;var ut=ot*c,J=_[ut],q=_[ut+1],it=_[ut+2],nt=_[ut+3],dt=_[ut+4],Tt=_[ut+5],wt=ot*h,It=P[wt],Ct=P[wt+1],Nt=Tt&1,ee=!!(Tt&16),Jt=rt,te=ct,Kt=et,mt=K;if(Nt&&(Jt=et,te=K,Kt=rt,mt=ct),!(Tt&2&&(it=S(F,J,q,it,Jt,te,Ct),q>=it))&&!(Tt&4&&(q=k(F,J,q,it,Jt,te,It),q>=it))){var bt=it-q,vt=dt-nt;if(ee){if(F*bt*(bt+vt)<l){if(Q=f.scanComplete(F,J,N,q,it,Jt,te,nt,dt,Kt,mt),Q!==void 0)return Q;continue}}else if(F*Math.min(bt,vt)<m){if(Q=a(F,J,N,Nt,q,it,Jt,te,nt,dt,Kt,mt),Q!==void 0)return Q;continue}else if(F*bt*vt<w){if(Q=f.scanBipartite(F,J,N,Nt,q,it,Jt,te,nt,dt,Kt,mt),Q!==void 0)return Q;continue}var Ut=x(F,J,q,it,Jt,te,It,Ct);if(q<Ut)if(F*(Ut-q)<m){if(Q=s(F,J+1,N,q,Ut,Jt,te,nt,dt,Kt,mt),Q!==void 0)return Q}else if(J===F-2){if(Nt?Q=f.sweepBipartite(F,N,nt,dt,Kt,mt,q,Ut,Jt,te):Q=f.sweepBipartite(F,N,q,Ut,Jt,te,nt,dt,Kt,mt),Q!==void 0)return Q}else D(ot++,J+1,q,Ut,nt,dt,Nt,-1/0,1/0),D(ot++,J+1,nt,dt,q,Ut,Nt^1,-1/0,1/0);if(Ut<it){var re=v(F,J,nt,dt,Kt,mt),Zt=Kt[X*re+J],ue=y(F,J,re,dt,Kt,mt,Zt);if(ue<dt&&D(ot++,J,Ut,it,ue,dt,(Nt|4)+(ee?16:0),Zt,Ct),nt<re&&D(ot++,J,Ut,it,nt,re,(Nt|2)+(ee?16:0),It,Zt),re+1===ue){if(ee?Q=R(F,J,N,Ut,it,Jt,te,re,Kt,mt[re]):Q=B(F,J,N,Nt,Ut,it,Jt,te,re,Kt,mt[re]),Q!==void 0)return Q}else if(re<ue){var Me;if(ee){if(Me=M(F,J,Ut,it,Jt,te,Zt),Ut<Me){var Ce=y(F,J,Ut,Me,Jt,te,Zt);if(J===F-2){if(Ut<Ce&&(Q=f.sweepComplete(F,N,Ut,Ce,Jt,te,re,ue,Kt,mt),Q!==void 0)||Ce<Me&&(Q=f.sweepBipartite(F,N,Ce,Me,Jt,te,re,ue,Kt,mt),Q!==void 0))return Q}else Ut<Ce&&D(ot++,J+1,Ut,Ce,re,ue,16,-1/0,1/0),Ce<Me&&(D(ot++,J+1,Ce,Me,re,ue,0,-1/0,1/0),D(ot++,J+1,re,ue,Ce,Me,1,-1/0,1/0))}}else Nt?Me=T(F,J,Ut,it,Jt,te,Zt):Me=M(F,J,Ut,it,Jt,te,Zt),Ut<Me&&(J===F-2?Nt?Q=f.sweepBipartite(F,N,re,ue,Kt,mt,Ut,Me,Jt,te):Q=f.sweepBipartite(F,N,Ut,Me,Jt,te,re,ue,Kt,mt):(D(ot++,J+1,Ut,Me,re,ue,Nt,-1/0,1/0),D(ot++,J+1,re,ue,Ut,Me,Nt^1,-1/0,1/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))}},7169:function(t,e,r){var i=typeof WeakMap>"u"?r(1538):WeakMap,n=r(2762),o=r(8116),a=new i;function s(f){var v=a.get(f),g=v&&(v._triangleBuffer.handle||v._triangleBuffer.buffer);if(!g||!f.isBuffer(g)){var m=n(f,new Float32Array([-1,-1,-1,4,4,-1]));v=o(f,[{buffer:m,type:f.FLOAT,size:2}]),v._triangleBuffer=m,a.set(f,v)}v.bind(),f.drawArrays(f.TRIANGLES,0,3),v.unbind()}t.exports=s},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,f,v,g){return i.identity(o),i.fromRotationTranslation(o,g,a),o[3]=v[0],o[7]=v[1],o[11]=v[2],o[15]=v[3],i.identity(n),f[2]!==0&&(n[9]=f[2],i.multiply(o,o,n)),f[1]!==0&&(n[9]=0,n[8]=f[1],i.multiply(o,o,n)),f[0]!==0&&(n[8]=0,n[4]=f[0],i.multiply(o,o,n)),i.scale(o,o,s),o}},7201:function(t,e,r){var i=1e-6,n=1e-6,o=r(9405),a=r(2762),s=r(8116),f=r(7766),v=r(8406),g=r(6760),m=r(7608),w=r(9618),l=r(6729),x=r(7765),y=r(1888),S=r(840),k=r(7626),M=S.meshShader,T=S.wireShader,c=S.pointShader,h=S.pickShader,b=S.pointPickShader,_=S.contourShader,P=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(et,K,ot,X,Q,ut,J,q,it,nt,dt,Tt,wt,It,Ct,Nt,ee,Jt,te,Kt,mt,bt,vt,Ut,re,Zt,ue){this.gl=et,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=K,this.dirty=!0,this.triShader=ot,this.lineShader=X,this.pointShader=Q,this.pickShader=ut,this.pointPickShader=J,this.contourShader=q,this.trianglePositions=it,this.triangleColors=dt,this.triangleNormals=wt,this.triangleUVs=Tt,this.triangleIds=nt,this.triangleVAO=It,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ct,this.edgeColors=ee,this.edgeUVs=Jt,this.edgeIds=Nt,this.edgeVAO=te,this.edgeCount=0,this.pointPositions=Kt,this.pointColors=bt,this.pointUVs=vt,this.pointSizes=Ut,this.pointIds=mt,this.pointVAO=re,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=Zt,this.contourVAO=ue,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=P,this._view=P,this._projection=P,this._resolution=[1,1]}var D=L.prototype;D.isOpaque=function(){return!this.hasAlpha},D.isTransparent=function(){return this.hasAlpha},D.pickSlots=1,D.setPickBase=function(et){this.pickId=et};function B(et,K){if(!K||!K.length)return 1;for(var ot=0;ot<K.length;++ot){if(K.length<2)return 1;if(K[ot][0]===et)return K[ot][1];if(K[ot][0]>et&&ot>0){var X=(K[ot][0]-et)/(K[ot][0]-K[ot-1][0]);return K[ot][1]*(1-X)+X*K[ot-1][1]}}return 1}function R(et,K){for(var ot=l({colormap:et,nshades:256,format:"rgba"}),X=new Uint8Array(1024),Q=0;Q<256;++Q){for(var ut=ot[Q],J=0;J<3;++J)X[4*Q+J]=ut[J];K?X[4*Q+3]=255*B(Q/255,K):X[4*Q+3]=255*ut[3]}return w(X,[256,256,4],[4,0,1])}function I(et){for(var K=et.length,ot=new Array(K),X=0;X<K;++X)ot[X]=et[X][2];return ot}D.highlight=function(et){if(!et||!this.contourEnable){this.contourCount=0;return}for(var K=x(this.cells,this.intensity,et.intensity),ot=K.cells,X=K.vertexIds,Q=K.vertexWeights,ut=ot.length,J=y.mallocFloat32(6*ut),q=0,it=0;it<ut;++it)for(var nt=ot[it],dt=0;dt<2;++dt){var Tt=nt[0];nt.length===2&&(Tt=nt[dt]);for(var wt=X[Tt][0],It=X[Tt][1],Ct=Q[Tt],Nt=1-Ct,ee=this.positions[wt],Jt=this.positions[It],te=0;te<3;++te)J[q++]=Ct*ee[te]+Nt*Jt[te]}this.contourCount=q/3|0,this.contourPositions.update(J.subarray(0,q)),y.free(J)},D.update=function(et){et=et||{};var K=this.gl;this.dirty=!0,"contourEnable"in et&&(this.contourEnable=et.contourEnable),"contourColor"in et&&(this.contourColor=et.contourColor),"lineWidth"in et&&(this.lineWidth=et.lineWidth),"lightPosition"in et&&(this.lightPosition=et.lightPosition),this.hasAlpha=!1,"opacity"in et&&(this.opacity=et.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in et&&(this.opacityscale=et.opacityscale,this.hasAlpha=!0),"ambient"in et&&(this.ambientLight=et.ambient),"diffuse"in et&&(this.diffuseLight=et.diffuse),"specular"in et&&(this.specularLight=et.specular),"roughness"in et&&(this.roughness=et.roughness),"fresnel"in et&&(this.fresnel=et.fresnel),et.texture?(this.texture.dispose(),this.texture=f(K,et.texture)):et.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=K.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=K.LINEAR,this.texture.setPixels(R(et.colormap,this.opacityscale)),this.texture.generateMipmap());var ot=et.cells,X=et.positions;if(!(!X||!ot)){var Q=[],ut=[],J=[],q=[],it=[],nt=[],dt=[],Tt=[],wt=[],It=[],Ct=[],Nt=[],ee=[],Jt=[];this.cells=ot,this.positions=X;var te=et.vertexNormals,Kt=et.cellNormals,mt=et.vertexNormalsEpsilon===void 0?i:et.vertexNormalsEpsilon,bt=et.faceNormalsEpsilon===void 0?n:et.faceNormalsEpsilon;et.useFacetNormals&&!Kt&&(Kt=v.faceNormals(ot,X,bt)),!Kt&&!te&&(te=v.vertexNormals(ot,X,mt));var vt=et.vertexColors,Ut=et.cellColors,re=et.meshColor||[1,1,1,1],Zt=et.vertexUVs,ue=et.vertexIntensity,Me=et.cellUVs,Ce=et.cellIntensity,We=1/0,qe=-1/0;if(!Zt&&!Me)if(ue)if(et.vertexIntensityBounds)We=+et.vertexIntensityBounds[0],qe=+et.vertexIntensityBounds[1];else for(var vr=0;vr<ue.length;++vr){var _r=ue[vr];We=Math.min(We,_r),qe=Math.max(qe,_r)}else if(Ce)if(et.cellIntensityBounds)We=+et.cellIntensityBounds[0],qe=+et.cellIntensityBounds[1];else for(var vr=0;vr<Ce.length;++vr){var _r=Ce[vr];We=Math.min(We,_r),qe=Math.max(qe,_r)}else for(var vr=0;vr<X.length;++vr){var _r=X[vr][2];We=Math.min(We,_r),qe=Math.max(qe,_r)}ue?this.intensity=ue:Ce?this.intensity=Ce:this.intensity=I(X),this.pickVertex=!(Ce||Ut);var er=et.pointSizes,Mr=et.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var vr=0;vr<X.length;++vr)for(var Ir=X[vr],de=0;de<3;++de)isNaN(Ir[de])||!isFinite(Ir[de])||(this.bounds[0][de]=Math.min(this.bounds[0][de],Ir[de]),this.bounds[1][de]=Math.max(this.bounds[1][de],Ir[de]));var Dt=0,qt=0,_t=0;t:for(var vr=0;vr<ot.length;++vr){var lt=ot[vr];switch(lt.length){case 1:for(var yt=lt[0],Ir=X[yt],de=0;de<3;++de)if(isNaN(Ir[de])||!isFinite(Ir[de]))continue t;It.push(Ir[0],Ir[1],Ir[2]);var St;vt?St=vt[yt]:Ut?St=Ut[vr]:St=re,this.opacityscale&&ue?ut.push(St[0],St[1],St[2],this.opacity*B((ue[yt]-We)/(qe-We),this.opacityscale)):St.length===3?Ct.push(St[0],St[1],St[2],this.opacity):(Ct.push(St[0],St[1],St[2],St[3]*this.opacity),St[3]<1&&(this.hasAlpha=!0));var Ht;Zt?Ht=Zt[yt]:ue?Ht=[(ue[yt]-We)/(qe-We),0]:Me?Ht=Me[vr]:Ce?Ht=[(Ce[vr]-We)/(qe-We),0]:Ht=[(Ir[2]-We)/(qe-We),0],Nt.push(Ht[0],Ht[1]),er?ee.push(er[yt]):ee.push(Mr),Jt.push(vr),_t+=1;break;case 2:for(var de=0;de<2;++de)for(var yt=lt[de],Ir=X[yt],Yt=0;Yt<3;++Yt)if(isNaN(Ir[Yt])||!isFinite(Ir[Yt]))continue t;for(var de=0;de<2;++de){var yt=lt[de],Ir=X[yt];nt.push(Ir[0],Ir[1],Ir[2]);var St;vt?St=vt[yt]:Ut?St=Ut[vr]:St=re,this.opacityscale&&ue?ut.push(St[0],St[1],St[2],this.opacity*B((ue[yt]-We)/(qe-We),this.opacityscale)):St.length===3?dt.push(St[0],St[1],St[2],this.opacity):(dt.push(St[0],St[1],St[2],St[3]*this.opacity),St[3]<1&&(this.hasAlpha=!0));var Ht;Zt?Ht=Zt[yt]:ue?Ht=[(ue[yt]-We)/(qe-We),0]:Me?Ht=Me[vr]:Ce?Ht=[(Ce[vr]-We)/(qe-We),0]:Ht=[(Ir[2]-We)/(qe-We),0],Tt.push(Ht[0],Ht[1]),wt.push(vr)}qt+=1;break;case 3:for(var de=0;de<3;++de)for(var yt=lt[de],Ir=X[yt],Yt=0;Yt<3;++Yt)if(isNaN(Ir[Yt])||!isFinite(Ir[Yt]))continue t;for(var de=0;de<3;++de){var yt=lt[2-de],Ir=X[yt];Q.push(Ir[0],Ir[1],Ir[2]);var St;vt?St=vt[yt]:Ut?St=Ut[vr]:St=re,St?this.opacityscale&&ue?ut.push(St[0],St[1],St[2],this.opacity*B((ue[yt]-We)/(qe-We),this.opacityscale)):St.length===3?ut.push(St[0],St[1],St[2],this.opacity):(ut.push(St[0],St[1],St[2],St[3]*this.opacity),St[3]<1&&(this.hasAlpha=!0)):ut.push(.5,.5,.5,1);var Ht;Zt?Ht=Zt[yt]:ue?Ht=[(ue[yt]-We)/(qe-We),0]:Me?Ht=Me[vr]:Ce?Ht=[(Ce[vr]-We)/(qe-We),0]:Ht=[(Ir[2]-We)/(qe-We),0],q.push(Ht[0],Ht[1]);var se;te?se=te[yt]:se=Kt[vr],J.push(se[0],se[1],se[2]),it.push(vr)}Dt+=1;break}}this.pointCount=_t,this.edgeCount=qt,this.triangleCount=Dt,this.pointPositions.update(It),this.pointColors.update(Ct),this.pointUVs.update(Nt),this.pointSizes.update(ee),this.pointIds.update(new Uint32Array(Jt)),this.edgePositions.update(nt),this.edgeColors.update(dt),this.edgeUVs.update(Tt),this.edgeIds.update(new Uint32Array(wt)),this.trianglePositions.update(Q),this.triangleColors.update(ut),this.triangleUVs.update(q),this.triangleNormals.update(J),this.triangleIds.update(new Uint32Array(it))}},D.drawTransparent=D.draw=function(et){et=et||{};for(var K=this.gl,ot=et.model||P,X=et.view||P,Q=et.projection||P,ut=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],J=0;J<3;++J)ut[0][J]=Math.max(ut[0][J],this.clipBounds[0][J]),ut[1][J]=Math.min(ut[1][J],this.clipBounds[1][J]);var q={model:ot,view:X,projection:Q,inverseModel:P.slice(),clipBounds:ut,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=m(q.inverseModel,q.model),K.disable(K.CULL_FACE),this.texture.bind(0);var it=new Array(16);g(it,q.view,q.model),g(it,q.projection,it),m(it,it);for(var J=0;J<3;++J)q.eyePosition[J]=it[12+J]/it[15];for(var nt=it[15],J=0;J<3;++J)nt+=this.lightPosition[J]*it[4*J+3];for(var J=0;J<3;++J){for(var dt=it[12+J],Tt=0;Tt<3;++Tt)dt+=it[4*Tt+J]*this.lightPosition[Tt];q.lightPosition[J]=dt/nt}if(this.triangleCount>0){var wt=this.triShader;wt.bind(),wt.uniforms=q,this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var wt=this.lineShader;wt.bind(),wt.uniforms=q,this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var wt=this.pointShader;wt.bind(),wt.uniforms=q,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var wt=this.contourShader;wt.bind(),wt.uniforms=q,this.contourVAO.bind(),K.drawArrays(K.LINES,0,this.contourCount),this.contourVAO.unbind()}},D.drawPick=function(et){et=et||{};for(var K=this.gl,ot=et.model||P,X=et.view||P,Q=et.projection||P,ut=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],J=0;J<3;++J)ut[0][J]=Math.max(ut[0][J],this.clipBounds[0][J]),ut[1][J]=Math.min(ut[1][J],this.clipBounds[1][J]);this._model=[].slice.call(ot),this._view=[].slice.call(X),this._projection=[].slice.call(Q),this._resolution=[K.drawingBufferWidth,K.drawingBufferHeight];var q={model:ot,view:X,projection:Q,clipBounds:ut,pickId:this.pickId/255},it=this.pickShader;if(it.bind(),it.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var it=this.pointPickShader;it.bind(),it.uniforms=q,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind()}},D.pick=function(et){if(!et||et.id!==this.pickId)return null;for(var K=et.value[0]+256*et.value[1]+65536*et.value[2],ot=this.cells[K],X=this.positions,Q=new Array(ot.length),ut=0;ut<ot.length;++ut)Q[ut]=X[ot[ut]];var J=et.coord[0],q=et.coord[1];if(!this.pickVertex){var it=this.positions[ot[0]],nt=this.positions[ot[1]],dt=this.positions[ot[2]],Tt=[(it[0]+nt[0]+dt[0])/3,(it[1]+nt[1]+dt[1])/3,(it[2]+nt[2]+dt[2])/3];return{_cellCenter:!0,position:[J,q],index:K,cell:ot,cellId:K,intensity:this.intensity[K],dataCoordinate:Tt}}var wt=k(Q,[J*this.pixelRatio,this._resolution[1]-q*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!wt)return null;for(var It=wt[2],Ct=0,ut=0;ut<ot.length;++ut)Ct+=It[ut]*this.intensity[ot[ut]];return{position:wt[1],index:ot[wt[0]],cell:ot,cellId:K,intensity:Ct,dataCoordinate:this.positions[ot[wt[0]]]}},D.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(et){var K=o(et,M.vertex,M.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K.attributes.normal.location=4,K}function N(et){var K=o(et,T.vertex,T.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K}function j(et){var K=o(et,c.vertex,c.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K.attributes.pointSize.location=4,K}function G(et){var K=o(et,h.vertex,h.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K}function rt(et){var K=o(et,b.vertex,b.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K.attributes.pointSize.location=4,K}function ct(et){var K=o(et,_.vertex,_.fragment);return K.attributes.position.location=0,K}function st(et,K){arguments.length===1&&(K=et,et=K.gl);var ot=et.getExtension("OES_standard_derivatives")||et.getExtension("MOZ_OES_standard_derivatives")||et.getExtension("WEBKIT_OES_standard_derivatives");if(!ot)throw new Error("derivatives not supported");var X=F(et),Q=N(et),ut=j(et),J=G(et),q=rt(et),it=ct(et),nt=f(et,w(new Uint8Array([255,255,255,255]),[1,1,4]));nt.generateMipmap(),nt.minFilter=et.LINEAR_MIPMAP_LINEAR,nt.magFilter=et.LINEAR;var dt=a(et),Tt=a(et),wt=a(et),It=a(et),Ct=a(et),Nt=s(et,[{buffer:dt,type:et.FLOAT,size:3},{buffer:Ct,type:et.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:Tt,type:et.FLOAT,size:4},{buffer:wt,type:et.FLOAT,size:2},{buffer:It,type:et.FLOAT,size:3}]),ee=a(et),Jt=a(et),te=a(et),Kt=a(et),mt=s(et,[{buffer:ee,type:et.FLOAT,size:3},{buffer:Kt,type:et.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:Jt,type:et.FLOAT,size:4},{buffer:te,type:et.FLOAT,size:2}]),bt=a(et),vt=a(et),Ut=a(et),re=a(et),Zt=a(et),ue=s(et,[{buffer:bt,type:et.FLOAT,size:3},{buffer:Zt,type:et.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:vt,type:et.FLOAT,size:4},{buffer:Ut,type:et.FLOAT,size:2},{buffer:re,type:et.FLOAT,size:1}]),Me=a(et),Ce=s(et,[{buffer:Me,type:et.FLOAT,size:3}]),We=new L(et,nt,X,Q,ut,J,q,it,dt,Ct,Tt,wt,It,Nt,ee,Kt,Jt,te,mt,bt,Zt,vt,Ut,re,ue,Me,Ce);return We.update(K),We}t.exports=st},7261:function(t,e,r){t.exports=y;var i=r(9215),n=r(7608),o=r(6079),a=r(5911),s=r(3536),f=r(244);function v(S,k,M){return Math.sqrt(Math.pow(S,2)+Math.pow(k,2)+Math.pow(M,2))}function g(S){return Math.min(1,Math.max(-1,S))}function m(S){var k=Math.abs(S[0]),M=Math.abs(S[1]),T=Math.abs(S[2]),c=[0,0,0];k>Math.max(M,T)?c[2]=1:M>Math.max(k,T)?c[0]=1:c[1]=1;for(var h=0,b=0,_=0;_<3;++_)h+=S[_]*S[_],b+=c[_]*S[_];for(var _=0;_<3;++_)c[_]-=b/h*S[_];return s(c,c),c}function w(S,k,M,T,c,h,b,_){this.center=i(M),this.up=i(T),this.right=i(c),this.radius=i([h]),this.angle=i([b,_]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,k),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 P=0;P<16;++P)this.computedMatrix[P]=.5;this.recalcMatrix(0)}var l=w.prototype;l.setDistanceLimits=function(S,k){S>0?S=Math.log(S):S=-1/0,k>0?k=Math.log(k):k=1/0,k=Math.max(k,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=k},l.getDistanceLimits=function(S){var k=this.radius.bounds[0];return S?(S[0]=Math.exp(k[0][0]),S[1]=Math.exp(k[1][0]),S):[Math.exp(k[0][0]),Math.exp(k[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 k=this.computedUp,M=this.computedRight,T=0,c=0,h=0;h<3;++h)c+=k[h]*M[h],T+=k[h]*k[h];for(var b=Math.sqrt(T),_=0,h=0;h<3;++h)M[h]-=k[h]*c/T,_+=M[h]*M[h],k[h]/=b;for(var P=Math.sqrt(_),h=0;h<3;++h)M[h]/=P;var L=this.computedToward;a(L,k,M),s(L,L);for(var D=Math.exp(this.computedRadius[0]),B=this.computedAngle[0],R=this.computedAngle[1],I=Math.cos(B),F=Math.sin(B),N=Math.cos(R),j=Math.sin(R),G=this.computedCenter,rt=I*N,ct=F*N,st=j,et=-I*j,K=-F*j,ot=N,X=this.computedEye,Q=this.computedMatrix,h=0;h<3;++h){var ut=rt*M[h]+ct*L[h]+st*k[h];Q[4*h+1]=et*M[h]+K*L[h]+ot*k[h],Q[4*h+2]=ut,Q[4*h+3]=0}var J=Q[1],q=Q[5],it=Q[9],nt=Q[2],dt=Q[6],Tt=Q[10],wt=q*Tt-it*dt,It=it*nt-J*Tt,Ct=J*dt-q*nt,Nt=v(wt,It,Ct);wt/=Nt,It/=Nt,Ct/=Nt,Q[0]=wt,Q[4]=It,Q[8]=Ct;for(var h=0;h<3;++h)X[h]=G[h]+Q[2+4*h]*D;for(var h=0;h<3;++h){for(var _=0,ee=0;ee<3;++ee)_+=Q[h+4*ee]*X[ee];Q[12+h]=-_}Q[15]=1},l.getMatrix=function(S,k){this.recalcMatrix(S);var M=this.computedMatrix;if(k){for(var T=0;T<16;++T)k[T]=M[T];return k}return M};var x=[0,0,0];l.rotate=function(S,k,M,T){if(this.angle.move(S,k,M),T){this.recalcMatrix(S);var c=this.computedMatrix;x[0]=c[2],x[1]=c[6],x[2]=c[10];for(var h=this.computedUp,b=this.computedRight,_=this.computedToward,P=0;P<3;++P)c[4*P]=h[P],c[4*P+1]=b[P],c[4*P+2]=_[P];o(c,c,T,x);for(var P=0;P<3;++P)h[P]=c[4*P],b[P]=c[4*P+1];this.up.set(S,h[0],h[1],h[2]),this.right.set(S,b[0],b[1],b[2])}},l.pan=function(S,k,M,T){k=k||0,M=M||0,T=T||0,this.recalcMatrix(S);var c=this.computedMatrix;Math.exp(this.computedRadius[0]);var h=c[1],b=c[5],_=c[9],P=v(h,b,_);h/=P,b/=P,_/=P;var L=c[0],D=c[4],B=c[8],R=L*h+D*b+B*_;L-=h*R,D-=b*R,B-=_*R;var I=v(L,D,B);L/=I,D/=I,B/=I;var F=L*k+h*M,N=D*k+b*M,j=B*k+_*M;this.center.move(S,F,N,j);var G=Math.exp(this.computedRadius[0]);G=Math.max(1e-4,G+T),this.radius.set(S,Math.log(G))},l.translate=function(S,k,M,T){this.center.move(S,k||0,M||0,T||0)},l.setMatrix=function(S,k,M,T){var c=1;typeof M=="number"&&(c=M|0),(c<0||c>3)&&(c=1);var h=(c+2)%3;k||(this.recalcMatrix(S),k=this.computedMatrix);var b=k[c],_=k[c+4],P=k[c+8];if(T){var L=Math.abs(b),D=Math.abs(_),B=Math.abs(P),R=Math.max(L,D,B);L===R?(b=b<0?-1:1,_=P=0):B===R?(P=P<0?-1:1,b=_=0):(_=_<0?-1:1,b=P=0)}else{var I=v(b,_,P);b/=I,_/=I,P/=I}var F=k[h],N=k[h+4],j=k[h+8],G=F*b+N*_+j*P;F-=b*G,N-=_*G,j-=P*G;var rt=v(F,N,j);F/=rt,N/=rt,j/=rt;var ct=_*j-P*N,st=P*F-b*j,et=b*N-_*F,K=v(ct,st,et);ct/=K,st/=K,et/=K,this.center.jump(S,mt,bt,vt),this.radius.idle(S),this.up.jump(S,b,_,P),this.right.jump(S,F,N,j);var ot,X;if(c===2){var Q=k[1],ut=k[5],J=k[9],q=Q*F+ut*N+J*j,it=Q*ct+ut*st+J*et;wt<0?ot=-Math.PI/2:ot=Math.PI/2,X=Math.atan2(it,q)}else{var nt=k[2],dt=k[6],Tt=k[10],wt=nt*b+dt*_+Tt*P,It=nt*F+dt*N+Tt*j,Ct=nt*ct+dt*st+Tt*et;ot=Math.asin(g(wt)),X=Math.atan2(Ct,It)}this.angle.jump(S,X,ot),this.recalcMatrix(S);var Nt=k[2],ee=k[6],Jt=k[10],te=this.computedMatrix;n(te,k);var Kt=te[15],mt=te[12]/Kt,bt=te[13]/Kt,vt=te[14]/Kt,Ut=Math.exp(this.computedRadius[0]);this.center.jump(S,mt-Nt*Ut,bt-ee*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,k){k>0&&this.radius.set(S,Math.log(k))},l.lookAt=function(S,k,M,T){this.recalcMatrix(S),k=k||this.computedEye,M=M||this.computedCenter,T=T||this.computedUp;var c=T[0],h=T[1],b=T[2],_=v(c,h,b);if(!(_<1e-6)){c/=_,h/=_,b/=_;var P=k[0]-M[0],L=k[1]-M[1],D=k[2]-M[2],B=v(P,L,D);if(!(B<1e-6)){P/=B,L/=B,D/=B;var R=this.computedRight,I=R[0],F=R[1],N=R[2],j=c*I+h*F+b*N;I-=j*c,F-=j*h,N-=j*b;var G=v(I,F,N);if(!(G<.01&&(I=h*D-b*L,F=b*P-c*D,N=c*L-h*P,G=v(I,F,N),G<1e-6))){I/=G,F/=G,N/=G,this.up.set(S,c,h,b),this.right.set(S,I,F,N),this.center.set(S,M[0],M[1],M[2]),this.radius.set(S,Math.log(B));var rt=h*N-b*F,ct=b*I-c*N,st=c*F-h*I,et=v(rt,ct,st);rt/=et,ct/=et,st/=et;var K=c*P+h*L+b*D,ot=I*P+F*L+N*D,X=rt*P+ct*L+st*D,Q=Math.asin(g(K)),ut=Math.atan2(X,ot),J=this.angle._state,q=J[J.length-1],it=J[J.length-2];q=q%(2*Math.PI);var nt=Math.abs(q+2*Math.PI-ut),dt=Math.abs(q-ut),Tt=Math.abs(q-2*Math.PI-ut);nt<dt&&(q+=2*Math.PI),Tt<dt&&(q-=2*Math.PI),this.angle.jump(this.angle.lastT(),q,it),this.angle.set(S,ut,Q)}}}};function y(S){S=S||{};var k=S.center||[0,0,0],M=S.up||[0,1,0],T=S.right||m(M),c=S.radius||1,h=S.theta||0,b=S.phi||0;if(k=[].slice.call(k,0,3),M=[].slice.call(M,0,3),s(M,M),T=[].slice.call(T,0,3),s(T,T),"eye"in S){var _=S.eye,P=[_[0]-k[0],_[1]-k[1],_[2]-k[2]];a(T,P,M),v(T[0],T[1],T[2])<1e-6?T=m(M):s(T,T),c=v(P[0],P[1],P[2]);var L=f(M,P)/c,D=f(T,P)/c;b=Math.acos(L),h=Math.acos(D)}return c=Math.log(c),new w(S.zoomMin,S.zoomMax,k,M,T,c,h,b)}},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);
}`]),f=[{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,f)},e.createPickShader=function(v){return n(v,o,s,null,f)}},7352:function(t,e,r){var i=r(5721),n=r(4750),o=r(2690);t.exports=a;function a(s){var f=s.length;if(f===0)return[];if(f===1)return[[0]];var v=s[0].length;return v===0?[]:v===1?i(s):v===2?n(s):o(s,v)}},7399:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],f=n+n,v=o+o,g=a+a,m=n*f,w=o*f,l=o*v,x=a*f,y=a*v,S=a*g,k=s*f,M=s*v,T=s*g;return r[0]=1-l-S,r[1]=w+T,r[2]=x-M,r[3]=0,r[4]=w-T,r[5]=1-m-S,r[6]=y+k,r[7]=0,r[8]=x+M,r[9]=y-k,r[10]=1-m-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,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}},7442:function(t,e,r){var i=r(6658),n=r(7182),o=r(2652),a=r(9921),s=r(8648),f=w(),v=w(),g=w();t.exports=m;function m(y,S,k,M){if(a(S)===0||a(k)===0)return!1;var T=o(S,f.translate,f.scale,f.skew,f.perspective,f.quaternion),c=o(k,v.translate,v.scale,v.skew,v.perspective,v.quaternion);return!T||!c?!1:(i(g.translate,f.translate,v.translate,M),i(g.skew,f.skew,v.skew,M),i(g.scale,f.scale,v.scale,M),i(g.perspective,f.perspective,v.perspective,M),s(g.quaternion,f.quaternion,v.quaternion,M),n(y,g.translate,g.scale,g.skew,g.perspective,g.quaternion),!0)}function w(){return{translate:l(),scale:l(1),skew:l(),perspective:x(),quaternion:x()}}function l(y){return[y||0,y||0,y||0]}function x(){return[0,0,0,1]}},7507:function(t,e){e.byteLength=v,e.toByteArray=m,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 f(y){var S=y.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=y.indexOf("=");k===-1&&(k=S);var M=k===S?0:4-k%4;return[k,M]}function v(y){var S=f(y),k=S[0],M=S[1];return(k+M)*3/4-M}function g(y,S,k){return(S+k)*3/4-k}function m(y){var S,k=f(y),M=k[0],T=k[1],c=new n(g(y,M,T)),h=0,b=T>0?M-4:M,_;for(_=0;_<b;_+=4)S=i[y.charCodeAt(_)]<<18|i[y.charCodeAt(_+1)]<<12|i[y.charCodeAt(_+2)]<<6|i[y.charCodeAt(_+3)],c[h++]=S>>16&255,c[h++]=S>>8&255,c[h++]=S&255;return T===2&&(S=i[y.charCodeAt(_)]<<2|i[y.charCodeAt(_+1)]>>4,c[h++]=S&255),T===1&&(S=i[y.charCodeAt(_)]<<10|i[y.charCodeAt(_+1)]<<4|i[y.charCodeAt(_+2)]>>2,c[h++]=S>>8&255,c[h++]=S&255),c}function w(y){return r[y>>18&63]+r[y>>12&63]+r[y>>6&63]+r[y&63]}function l(y,S,k){for(var M,T=[],c=S;c<k;c+=3)M=(y[c]<<16&16711680)+(y[c+1]<<8&65280)+(y[c+2]&255),T.push(w(M));return T.join("")}function x(y){for(var S,k=y.length,M=k%3,T=[],c=16383,h=0,b=k-M;h<b;h+=c)T.push(l(y,h,h+c>b?b:h+c));return M===1?(S=y[k-1],T.push(r[S>>2]+r[S<<4&63]+"==")):M===2&&(S=(y[k-2]<<8)+y[k-1],T.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),T.join("")}},7518:function(t,e,r){var i=r(1433);function n(s,f,v,g,m,w){this.location=s,this.dimension=f,this.a=v,this.b=g,this.c=m,this.d=w}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,f,v){this.gl=s,this._ext=f,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,f,v){if(this.bind(),i(this.gl,f,s),this.unbind(),this._attribs.length=0,s)for(var g=0;g<s.length;++g){var m=s[g];typeof m=="number"?this._attribs.push(new n(g,1,m)):Array.isArray(m)&&this._attribs.push(new n(g,m.length,m[0],m[1],m[2],m[3]))}this._useElements=!!f,this._elementsType=v||this.gl.UNSIGNED_SHORT},o.prototype.draw=function(s,f,v){v=v||0;var g=this.gl;this._useElements?g.drawElements(s,f,this._elementsType,v):g.drawArrays(s,v,f)};function a(s,f){return new o(s,f,f.createVertexArrayOES())}t.exports=a},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()},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}},7608:function(t){t.exports=e;function e(r,i){var n=i[0],o=i[1],a=i[2],s=i[3],f=i[4],v=i[5],g=i[6],m=i[7],w=i[8],l=i[9],x=i[10],y=i[11],S=i[12],k=i[13],M=i[14],T=i[15],c=n*v-o*f,h=n*g-a*f,b=n*m-s*f,_=o*g-a*v,P=o*m-s*v,L=a*m-s*g,D=w*k-l*S,B=w*M-x*S,R=w*T-y*S,I=l*M-x*k,F=l*T-y*k,N=x*T-y*M,j=c*N-h*F+b*I+_*R-P*B+L*D;return j?(j=1/j,r[0]=(v*N-g*F+m*I)*j,r[1]=(a*F-o*N-s*I)*j,r[2]=(k*L-M*P+T*_)*j,r[3]=(x*P-l*L-y*_)*j,r[4]=(g*R-f*N-m*B)*j,r[5]=(n*N-a*R+s*B)*j,r[6]=(M*b-S*L-T*h)*j,r[7]=(w*L-x*b+y*h)*j,r[8]=(f*F-v*R+m*D)*j,r[9]=(o*R-n*F-s*D)*j,r[10]=(S*P-k*b+T*c)*j,r[11]=(l*b-w*P-y*c)*j,r[12]=(v*B-f*I-g*D)*j,r[13]=(n*I-o*B+a*D)*j,r[14]=(k*h-S*_-M*c)*j,r[15]=(w*_-l*h+x*c)*j,r):null}},7626:function(t,e,r){var i=r(2642),n=r(9346);t.exports=v;function o(g,m){for(var w=[0,0,0,0],l=0;l<4;++l)for(var x=0;x<4;++x)w[x]+=g[4*l+x]*m[l];return w}function a(g,m,w,l,x){for(var y=o(l,o(w,o(m,[g[0],g[1],g[2],1]))),S=0;S<3;++S)y[S]/=y[3];return[.5*x[0]*(1+y[0]),.5*x[1]*(1-y[1])]}function s(g,m){if(g.length===2){for(var w=0,l=0,x=0;x<2;++x)w+=Math.pow(m[x]-g[0][x],2),l+=Math.pow(m[x]-g[1][x],2);return w=Math.sqrt(w),l=Math.sqrt(l),w+l<1e-6?[1,0]:[l/(w+l),w/(l+w)]}else if(g.length===3){var y=[0,0];return n(g[0],g[1],g[2],m,y),i(g,y)}return[]}function f(g,m){for(var w=[0,0,0],l=0;l<g.length;++l)for(var x=g[l],y=m[l],S=0;S<3;++S)w[S]+=y*x[S];return w}function v(g,m,w,l,x,y){if(g.length===1)return[0,g[0].slice()];for(var S=new Array(g.length),k=0;k<g.length;++k)S[k]=a(g[k],w,l,x,y);for(var M=0,T=1/0,k=0;k<S.length;++k){for(var c=0,h=0;h<2;++h)c+=Math.pow(S[k][h]-m[h],2);c<T&&(T=c,M=k)}for(var b=s(S,m),_=0,k=0;k<3;++k){if(b[k]<-.001||b[k]>1.0001)return null;_+=b[k]}return Math.abs(_-1)>.001?null:[M,f(g,b),b]}},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}},7640:function(t,e,r){var i=r(1888);function n(m){switch(m){case"uint32":return[i.mallocUint32,i.freeUint32];default:return null}}var o={"uint32,1,0":function(m,w){return function(l,x,y,S,k,M,T,c,h,b,_){var P,L,D,B=l*k+S,R,I=m(c),F,N,j,G;for(P=l+1;P<=x;++P){for(L=P,B+=k,D=B,F=0,N=B,R=0;R<c;++R)I[F++]=y[N],N+=h;t:for(;L-- >l;){F=0,N=D-k;e:for(R=0;R<c;++R){if(j=y[N],G=I[F],j<G)break t;if(j>G)break e;N+=b,F+=_}for(F=D,N=D-k,R=0;R<c;++R)y[F]=y[N],F+=h,N+=h;D-=k}for(F=D,N=0,R=0;R<c;++R)y[F]=I[N++],F+=h}w(I)}}};function a(m,w){var l=n(w),x=[w,m].join(","),y=o[x];return l?y(l[0],l[1]):y()}var s={"uint32,1,0":function(m,w,l){return function x(y,S,k,M,T,c,h,b,_,P,L){var D=(S-y+1)/6|0,B=y+D,R=S-D,I=y+S>>1,F=I-D,N=I+D,j=B,G=F,rt=I,ct=N,st=R,et=y+1,K=S-1,ot=!0,X,Q,ut,J,q,it,nt,dt,Tt,wt=0,It=0,Ct=0,Nt,ee,Jt,te,Kt,mt,bt,vt,Ut,re,Zt,ue,Me,Ce,We,qe,vr=b,_r=w(vr),er=w(vr);ee=T*j,Jt=T*G,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=j,j=G,G=Q;break t}if(Ct<0)break t;qe+=P}ee=T*ct,Jt=T*st,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=ct,ct=st,st=Q;break t}if(Ct<0)break t;qe+=P}ee=T*j,Jt=T*rt,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=j,j=rt,rt=Q;break t}if(Ct<0)break t;qe+=P}ee=T*G,Jt=T*rt,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=G,G=rt,rt=Q;break t}if(Ct<0)break t;qe+=P}ee=T*j,Jt=T*ct,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=j,j=ct,ct=Q;break t}if(Ct<0)break t;qe+=P}ee=T*rt,Jt=T*ct,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=rt,rt=ct,ct=Q;break t}if(Ct<0)break t;qe+=P}ee=T*G,Jt=T*st,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=G,G=st,st=Q;break t}if(Ct<0)break t;qe+=P}ee=T*G,Jt=T*rt,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=G,G=rt,rt=Q;break t}if(Ct<0)break t;qe+=P}ee=T*ct,Jt=T*st,qe=M;t:for(Nt=0;Nt<b;++Nt){if(nt=ee+qe,dt=Jt+qe,Ct=k[nt]-k[dt],Ct>0){Q=ct,ct=st,st=Q;break t}if(Ct<0)break t;qe+=P}for(ee=T*j,Jt=T*G,te=T*rt,Kt=T*ct,mt=T*st,bt=T*B,vt=T*I,Ut=T*R,We=0,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,Tt=te+qe,re=Kt+qe,Zt=mt+qe,ue=bt+qe,Me=vt+qe,Ce=Ut+qe,_r[We]=k[dt],er[We]=k[re],ot=ot&&_r[We]===er[We],ut=k[nt],J=k[Tt],q=k[Zt],k[ue]=ut,k[Me]=J,k[Ce]=q,++We,qe+=_;for(ee=T*F,Jt=T*y,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,k[nt]=k[dt],qe+=_;for(ee=T*N,Jt=T*S,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,k[nt]=k[dt],qe+=_;if(ot)for(it=et;it<=K;++it){nt=M+it*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(Ct=k[nt]-_r[We],Ct!==0)break t;We+=L,nt+=P}if(Ct!==0)if(Ct<0){if(it!==et)for(ee=T*it,Jt=T*et,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,X=k[nt],k[nt]=k[dt],k[dt]=X,qe+=_;++et}else for(;;){nt=M+K*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(Ct=k[nt]-_r[We],Ct!==0)break t;We+=L,nt+=P}if(Ct>0)K--;else if(Ct<0){for(ee=T*it,Jt=T*et,te=T*K,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,Tt=te+qe,X=k[nt],k[nt]=k[dt],k[dt]=k[Tt],k[Tt]=X,qe+=_;++et,--K;break}else{for(ee=T*it,Jt=T*K,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,X=k[nt],k[nt]=k[dt],k[dt]=X,qe+=_;--K;break}}}else for(it=et;it<=K;++it){nt=M+it*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(wt=k[nt]-_r[We],wt!==0)break t;We+=L,nt+=P}if(wt<0){if(it!==et)for(ee=T*it,Jt=T*et,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,X=k[nt],k[nt]=k[dt],k[dt]=X,qe+=_;++et}else{nt=M+it*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(It=k[nt]-er[We],It!==0)break t;We+=L,nt+=P}if(It>0)for(;;){nt=M+K*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(Ct=k[nt]-er[We],Ct!==0)break t;We+=L,nt+=P}if(Ct>0){if(--K<it)break;continue}else{nt=M+K*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(Ct=k[nt]-_r[We],Ct!==0)break t;We+=L,nt+=P}if(Ct<0){for(ee=T*it,Jt=T*et,te=T*K,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,Tt=te+qe,X=k[nt],k[nt]=k[dt],k[dt]=k[Tt],k[Tt]=X,qe+=_;++et,--K}else{for(ee=T*it,Jt=T*K,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,X=k[nt],k[nt]=k[dt],k[dt]=X,qe+=_;--K}break}}}}for(ee=T*y,Jt=T*(et-1),We=0,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,k[nt]=k[dt],k[dt]=_r[We],++We,qe+=_;for(ee=T*S,Jt=T*(K+1),We=0,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,k[nt]=k[dt],k[dt]=er[We],++We,qe+=_;if(et-2-y<=32?m(y,et-2,k,M,T,c,h,b,_,P,L):x(y,et-2,k,M,T,c,h,b,_,P,L),S-(K+2)<=32?m(K+2,S,k,M,T,c,h,b,_,P,L):x(K+2,S,k,M,T,c,h,b,_,P,L),ot){l(_r),l(er);return}if(et<B&&K>R){t:for(;;){for(nt=M+et*T,We=0,qe=M,Nt=0;Nt<b;++Nt){if(k[nt]!==_r[We])break t;++We,nt+=_}++et}t:for(;;){for(nt=M+K*T,We=0,qe=M,Nt=0;Nt<b;++Nt){if(k[nt]!==er[We])break t;++We,nt+=_}--K}for(it=et;it<=K;++it){nt=M+it*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(wt=k[nt]-_r[We],wt!==0)break t;We+=L,nt+=P}if(wt===0){if(it!==et)for(ee=T*it,Jt=T*et,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,X=k[nt],k[nt]=k[dt],k[dt]=X,qe+=_;++et}else{nt=M+it*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(It=k[nt]-er[We],It!==0)break t;We+=L,nt+=P}if(It===0)for(;;){nt=M+K*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(Ct=k[nt]-er[We],Ct!==0)break t;We+=L,nt+=P}if(Ct===0){if(--K<it)break;continue}else{nt=M+K*T,We=0;t:for(Nt=0;Nt<b;++Nt){if(Ct=k[nt]-_r[We],Ct!==0)break t;We+=L,nt+=P}if(Ct<0){for(ee=T*it,Jt=T*et,te=T*K,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,Tt=te+qe,X=k[nt],k[nt]=k[dt],k[dt]=k[Tt],k[Tt]=X,qe+=_;++et,--K}else{for(ee=T*it,Jt=T*K,qe=M,Nt=0;Nt<b;++Nt)nt=ee+qe,dt=Jt+qe,X=k[nt],k[nt]=k[dt],k[dt]=X,qe+=_;--K}break}}}}}l(_r),l(er),K-et<=32?m(et,K,k,M,T,c,h,b,_,P,L):x(et,K,k,M,T,c,h,b,_,P,L)}}};function f(m,w,l){var x=n(w),y=[w,m].join(","),S=s[y];return m.length>1&&x?S(l,x[0],x[1]):S(l)}var v={"uint32,1,0":function(m,w){return function(l){var x=l.data,y=l.offset|0,S=l.shape,k=l.stride,M=k[0]|0,T=S[0]|0,c=k[1]|0,h=S[1]|0,b=c,_=c,P=1;T<=32?m(0,T-1,x,y,M,c,T,h,b,_,P):w(0,T-1,x,y,M,c,T,h,b,_,P)}}};function g(m,w){var l=[w,m].join(","),x=v[l],y=a(m,w),S=f(m,w,y);return x(y,S)}t.exports=g},7642:function(t,e,r){var i=r(8954),n=r(1682);t.exports=f;function o(v,g){this.point=v,this.index=g}function a(v,g){for(var m=v.point,w=g.point,l=m.length,x=0;x<l;++x){var y=w[x]-m[x];if(y)return y}return 0}function s(v,g,m){if(v===1)return m?[[-1,0]]:[];var w=g.map(function(k,M){return[k[0],M]});w.sort(function(k,M){return k[0]-M[0]});for(var l=new Array(v-1),x=1;x<v;++x){var y=w[x-1],S=w[x];l[x-1]=[y[1],S[1]]}return m&&l.push([-1,l[0][1]],[l[v-1][1],-1]),l}function f(v,g){var m=v.length;if(m===0)return[];var w=v[0].length;if(w<1)return[];if(w===1)return s(m,v,g);for(var l=new Array(m),x=1,y=0;y<m;++y){for(var S=v[y],k=new Array(w+1),M=0,T=0;T<w;++T){var c=S[T];k[T]=c,M+=c*c}k[w]=M,l[y]=new o(k,y),x=Math.max(M,x)}n(l,a),m=l.length;for(var h=new Array(m+w+1),b=new Array(m+w+1),_=(w+1)*(w+1)*x,P=new Array(w+1),y=0;y<=w;++y)P[y]=0;P[w]=_,h[0]=P.slice(),b[0]=-1;for(var y=0;y<=w;++y){var k=P.slice();k[y]=1,h[y+1]=k,b[y+1]=-1}for(var y=0;y<m;++y){var L=l[y];h[y+w+1]=L.point,b[y+w+1]=L.index}var D=i(h,!1);if(g?D=D.filter(function(B){for(var R=0,I=0;I<=w;++I){var F=b[B[I]];if(F<0&&++R>=2)return!1;B[I]=F}return!0}):D=D.filter(function(B){for(var R=0;R<=w;++R){var I=b[B[R]];if(I<0)return!1;B[R]=I}return!0}),w&1)for(var y=0;y<D.length;++y){var L=D[y],k=L[0];L[0]=L[1],L[1]=k}return D}},7656:function(t){t.exports=e;function e(r,i,n){var o=n[0],a=n[1],s=n[2],f,v,g,m,w,l,x,y,S,k,M,T;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]):(f=i[0],v=i[1],g=i[2],m=i[3],w=i[4],l=i[5],x=i[6],y=i[7],S=i[8],k=i[9],M=i[10],T=i[11],r[0]=f,r[1]=v,r[2]=g,r[3]=m,r[4]=w,r[5]=l,r[6]=x,r[7]=y,r[8]=S,r[9]=k,r[10]=M,r[11]=T,r[12]=f*o+w*a+S*s+i[12],r[13]=v*o+l*a+k*s+i[13],r[14]=g*o+x*a+M*s+i[14],r[15]=m*o+y*a+T*s+i[15]),r}},7718:function(t,e,r){t.exports=L,t.exports.processPixels=P;var i=r(3711),n=r(9618),o=r(5878),a=r(332),s=r(2538),f=r(2095),v="b",g="b|",m="i",w="i|",l="sup",x="+",y="+1",S="sub",k="-",M="-1";function T(D,B,R,I){for(var F="<"+D+">",N="</"+D+">",j=F.length,G=N.length,rt=B[0]===x||B[0]===k,ct=0,st=-G;ct>-1&&(ct=R.indexOf(F,ct),!(ct===-1||(st=R.indexOf(N,ct+j),st===-1)||st<=ct));){for(var et=ct;et<st+G;++et)if(et<ct+j||et>=st)I[et]=null,R=R.substr(0,et)+" "+R.substr(et+1);else if(I[et]!==null){var K=I[et].indexOf(B[0]);K===-1?I[et]+=B:rt&&(I[et]=I[et].substr(0,K+1)+(1+parseInt(I[et][K+1]))+I[et].substr(K+2))}var ot=ct+j,X=R.substr(ot,st-ot),Q=X.indexOf(F);Q!==-1?ct=Q:ct=st+G}return I}function c(D,B,R){for(var I=B.textAlign||"start",F=B.textBaseline||"alphabetic",N=[1073741824,1073741824],j=[0,0],G=D.length,rt=0;rt<G;++rt)for(var ct=D[rt],st=0;st<2;++st)N[st]=Math.min(N[st],ct[st])|0,j[st]=Math.max(j[st],ct[st])|0;var et=0;switch(I){case"center":et=-.5*(N[0]+j[0]);break;case"right":case"end":et=-j[0];break;case"left":case"start":et=-N[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+I+"'")}var K=0;switch(F){case"hanging":case"top":K=-N[1];break;case"middle":K=-.5*(N[1]+j[1]);break;case"alphabetic":case"ideographic":K=-3*R;break;case"bottom":K=-j[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+F+"'")}var ot=1/R;return"lineHeight"in B?ot*=+B.lineHeight:"width"in B?ot=B.width/(j[0]-N[0]):"height"in B&&(ot=B.height/(j[1]-N[1])),D.map(function(X){return[ot*(X[0]+et),ot*(X[1]+K)]})}function h(D,B,R,I,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=T(v,g,R,G)),N.italics===!0&&(G=T(m,w,R,G)),N.superscripts===!0&&(G=T(l,y,R,G)),N.subscripts===!0&&(G=T(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 st=ct.split(`
`),et=st.length,K=Math.round(F*I),ot=I,X=I*2,Q=0,ut=et*K+X;D.height<ut&&(D.height=ut),B.fillStyle="#000",B.fillRect(0,0,D.width,D.height),B.fillStyle="#fff";var J,q,it,nt,dt,Tt=0,wt="";function It(){if(wt!==""){var vt=B.measureText(wt).width;B.fillText(wt,ot+it,X+nt),it+=vt}}function Ct(){return""+Math.round(dt)+"px "}function Nt(vt,Ut){var re=""+B.font;if(N.subscripts===!0){var Zt=vt.indexOf(k),ue=Ut.indexOf(k),Me=Zt>-1?parseInt(vt[1+Zt]):0,Ce=ue>-1?parseInt(Ut[1+ue]):0;Me!==Ce&&(re=re.replace(Ct(),"?px "),dt*=Math.pow(.75,Ce-Me),re=re.replace("?px ",Ct())),nt+=.25*K*(Ce-Me)}if(N.superscripts===!0){var We=vt.indexOf(x),qe=Ut.indexOf(x),vr=We>-1?parseInt(vt[1+We]):0,_r=qe>-1?parseInt(Ut[1+qe]):0;vr!==_r&&(re=re.replace(Ct(),"?px "),dt*=Math.pow(.75,_r-vr),re=re.replace("?px ",Ct())),nt-=.25*K*(_r-vr)}if(N.bolds===!0){var er=vt.indexOf(g)>-1,Mr=Ut.indexOf(g)>-1;!er&&Mr&&(Ir?re=re.replace("italic ","italic bold "):re="bold "+re),er&&!Mr&&(re=re.replace("bold ",""))}if(N.italics===!0){var Ir=vt.indexOf(w)>-1,de=Ut.indexOf(w)>-1;!Ir&&de&&(re="italic "+re),Ir&&!de&&(re=re.replace("italic ",""))}B.font=re}for(J=0;J<et;++J){var ee=st[J]+`
`;for(it=0,nt=J*K,dt=I,wt="",q=0;q<ee.length;++q){var Jt=q+Tt<rt.length?rt[q+Tt]:rt[rt.length-1];j===Jt?wt+=ee[q]:(It(),wt=ee[q],Jt!==void 0&&(Nt(j,Jt),j=Jt))}It(),Tt+=ee.length;var te=Math.round(it+2*ot)|0;Q<te&&(Q=te)}var Kt=Q,mt=X+K*et,bt=n(B.getImageData(0,0,Kt,mt).data,[mt,Kt,4]);return bt.pick(-1,-1,0).transpose(1,0)}function b(D,B){var R=i(D,128);return B?o(R.cells,R.positions,.25):{edges:R.cells,positions:R.positions}}function _(D,B,R,I){var F=b(D,I),N=c(F.positions,B,R),j=F.edges,G=B.orientation==="ccw";if(a(N,j),B.polygons||B.polygon||B.polyline){for(var rt=f(j,N),ct=new Array(rt.length),st=0;st<rt.length;++st){for(var et=rt[st],K=new Array(et.length),ot=0;ot<et.length;++ot){for(var X=et[ot],Q=new Array(X.length),ut=0;ut<X.length;++ut)Q[ut]=N[X[ut]].slice();G&&Q.reverse(),K[ot]=Q}ct[st]=K}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 P(D,B,R){try{return _(D,B,R,!0)}catch{}try{return _(D,B,R,!1)}catch{}return B.polygons||B.polyline||B.polygon?[]:B.triangles||B.triangulate||B.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function L(D,B,R,I){var F=64,N=1.25,j={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};I&&(I.size&&I.size>0&&(F=I.size),I.lineSpacing&&I.lineSpacing>0&&(N=I.lineSpacing),I.styletags&&I.styletags.breaklines&&(j.breaklines=!!I.styletags.breaklines),I.styletags&&I.styletags.bolds&&(j.bolds=!!I.styletags.bolds),I.styletags&&I.styletags.italics&&(j.italics=!!I.styletags.italics),I.styletags&&I.styletags.subscripts&&(j.subscripts=!!I.styletags.subscripts),I.styletags&&I.styletags.superscripts&&(j.superscripts=!!I.styletags.superscripts)),R.font=[I.fontStyle,I.fontVariant,I.fontWeight,F+"px",I.font].filter(function(rt){return rt}).join(" "),R.textAlign="start",R.textBaseline="alphabetic",R.direction="ltr";var G=h(B,R,D,F,N,j);return P(G,I,F)}},7721:function(t,e,r){var i=r(5716);t.exports=n;function n(o){return i(o[0])*i(o[1])}},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 y=x.length,S=0,k=0;k<y;++k)S=Math.max(S,x[k].length)|0;return S-1}function f(x,y){for(var S=x.length,k=n.mallocUint8(S),M=0;M<S;++M)k[M]=x[M]<y|0;return k}function v(x,y){for(var S=x.length,k=y*(y+1)/2*S|0,M=n.mallocUint32(k*2),T=0,c=0;c<S;++c)for(var h=x[c],y=h.length,b=0;b<y;++b)for(var _=0;_<b;++_){var P=h[_],L=h[b];M[T++]=Math.min(P,L)|0,M[T++]=Math.max(P,L)|0}var D=T/2|0;o(i(M,[D,2]));for(var B=2,c=2;c<T;c+=2)M[c-2]===M[c]&&M[c-1]===M[c+1]||(M[B++]=M[c],M[B++]=M[c+1]);return i(M,[B/2|0,2])}function g(x,y,S,k){for(var M=x.data,T=x.shape[0],c=n.mallocDouble(T),h=0,b=0;b<T;++b){var _=M[2*b],P=M[2*b+1];if(S[_]!==S[P]){var L=y[_],D=y[P];M[2*h]=_,M[2*h+1]=P,c[h++]=(D-k)/(D-L)}}return x.shape[0]=h,i(c,[h])}function m(x,y){var S=n.mallocInt32(y*2),k=x.shape[0],M=x.data;S[0]=0;for(var T=0,c=0;c<k;++c){var h=M[2*c];if(h!==T){for(S[2*T+1]=c;++T<h;)S[2*T]=c,S[2*T+1]=c;S[2*T]=c}}for(S[2*T+1]=k;++T<y;)S[2*T]=S[2*T+1]=k;return S}function w(x){for(var y=x.shape[0]|0,S=x.data,k=new Array(y),M=0;M<y;++M)k[M]=[S[2*M],S[2*M+1]];return k}function l(x,y,S,k){S=S||0,typeof k>"u"&&(k=s(x));var M=x.length;if(M===0||k<1)return{cells:[],vertexIds:[],vertexWeights:[]};var T=f(y,+S),c=v(x,k),h=g(c,y,T,+S),b=m(c,y.length|0),_=a(k)(x,c.data,b,T),P=w(c),L=[].slice.call(h.data,0,h.shape[0]);return n.free(T),n.free(c.data),n.free(h.data),n.free(b),{cells:_,vertexIds:P,vertexWeights:L}}},7766:function(t,e,r){var i=r(9618),n=r(5298),o=r(1888);t.exports=h;var a=null,s=null,f=null;function v(b){a=[b.LINEAR,b.NEAREST_MIPMAP_LINEAR,b.LINEAR_MIPMAP_NEAREST,b.LINEAR_MIPMAP_NEAREST],s=[b.NEAREST,b.LINEAR,b.NEAREST_MIPMAP_NEAREST,b.NEAREST_MIPMAP_LINEAR,b.LINEAR_MIPMAP_NEAREST,b.LINEAR_MIPMAP_LINEAR],f=[b.REPEAT,b.CLAMP_TO_EDGE,b.MIRRORED_REPEAT]}function g(b){return typeof HTMLCanvasElement<"u"&&b instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&b instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&b instanceof HTMLVideoElement||typeof ImageData<"u"&&b instanceof ImageData}var m=function(b,_){n.muls(b,_,255)};function w(b,_,P){var L=b.gl,D=L.getParameter(L.MAX_TEXTURE_SIZE);if(_<0||_>D||P<0||P>D)throw new Error("gl-texture2d: Invalid texture size");return b._shape=[_,P],b.bind(),L.texImage2D(L.TEXTURE_2D,0,b.format,_,P,0,b.format,b.type,null),b._mipLevels=[0],b}function l(b,_,P,L,D,B){this.gl=b,this.handle=_,this.format=D,this.type=B,this._shape=[P,L],this._mipLevels=[0],this._magFilter=b.NEAREST,this._minFilter=b.NEAREST,this._wrapS=b.CLAMP_TO_EDGE,this._wrapT=b.CLAMP_TO_EDGE,this._anisoSamples=1;var R=this,I=[this._wrapS,this._wrapT];Object.defineProperties(I,[{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=I;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(b){this.bind();var _=this.gl;if(this.type===_.FLOAT&&a.indexOf(b)>=0&&(_.getExtension("OES_texture_float_linear")||(b=_.NEAREST)),s.indexOf(b)<0)throw new Error("gl-texture2d: Unknown filter mode "+b);return _.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,b),this._minFilter=b}},magFilter:{get:function(){return this._magFilter},set:function(b){this.bind();var _=this.gl;if(this.type===_.FLOAT&&a.indexOf(b)>=0&&(_.getExtension("OES_texture_float_linear")||(b=_.NEAREST)),s.indexOf(b)<0)throw new Error("gl-texture2d: Unknown filter mode "+b);return _.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,b),this._magFilter=b}},mipSamples:{get:function(){return this._anisoSamples},set:function(b){var _=this._anisoSamples;if(this._anisoSamples=Math.max(b,1)|0,_!==this._anisoSamples){var P=this.gl.getExtension("EXT_texture_filter_anisotropic");P&&this.gl.texParameterf(this.gl.TEXTURE_2D,P.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(b){if(this.bind(),f.indexOf(b)<0)throw new Error("gl-texture2d: Unknown wrap mode "+b);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,b),this._wrapS=b}},wrapT:{get:function(){return this._wrapT},set:function(b){if(this.bind(),f.indexOf(b)<0)throw new Error("gl-texture2d: Unknown wrap mode "+b);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,b),this._wrapT=b}},wrap:{get:function(){return this._wrapVector},set:function(b){if(Array.isArray(b)||(b=[b,b]),b.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var _=0;_<2;++_)if(f.indexOf(b[_])<0)throw new Error("gl-texture2d: Unknown wrap mode "+b);this._wrapS=b[0],this._wrapT=b[1];var P=this.gl;return this.bind(),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_S,this._wrapS),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_T,this._wrapT),b}},shape:{get:function(){return this._shapeVector},set:function(b){if(!Array.isArray(b))b=[b|0,b|0];else if(b.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return w(this,b[0]|0,b[1]|0),[b[0]|0,b[1]|0]}},width:{get:function(){return this._shape[0]},set:function(b){return b=b|0,w(this,b,this._shape[1]),b}},height:{get:function(){return this._shape[1]},set:function(b){return b=b|0,w(this,this._shape[0],b),b}}}),x.bind=function(b){var _=this.gl;return b!==void 0&&_.activeTexture(_.TEXTURE0+(b|0)),_.bindTexture(_.TEXTURE_2D,this.handle),b!==void 0?b|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 b=Math.min(this._shape[0],this._shape[1]),_=0;b>0;++_,b>>>=1)this._mipLevels.indexOf(_)<0&&this._mipLevels.push(_)},x.setPixels=function(b,_,P,L){var D=this.gl;this.bind(),Array.isArray(_)?(L=P,P=_[1]|0,_=_[0]|0):(_=_||0,P=P||0),L=L||0;var B=g(b)?b:b.raw;if(B){var R=this._mipLevels.indexOf(L)<0;R?(D.texImage2D(D.TEXTURE_2D,0,this.format,this.format,this.type,B),this._mipLevels.push(L)):D.texSubImage2D(D.TEXTURE_2D,L,_,P,this.format,this.type,B)}else if(b.shape&&b.stride&&b.data){if(b.shape.length<2||_+b.shape[1]>this._shape[1]>>>L||P+b.shape[0]>this._shape[0]>>>L||_<0||P<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(D,_,P,L,this.format,this.type,this._mipLevels,b)}else throw new Error("gl-texture2d: Unsupported data type")};function y(b,_){return b.length===3?_[2]===1&&_[1]===b[0]*b[2]&&_[0]===b[2]:_[0]===1&&_[1]===b[0]}function S(b,_,P,L,D,B,R,I){var F=I.dtype,N=I.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=y(N,I.stride.slice());if(F==="float32"?j=b.FLOAT:F==="float64"?(j=b.FLOAT,rt=!1,F="float32"):F==="uint8"?j=b.UNSIGNED_BYTE:(j=b.UNSIGNED_BYTE,rt=!1,F="uint8"),N.length===2)G=b.LUMINANCE,N=[N[0],N[1],1],I=i(I.data,N,[I.stride[0],I.stride[1],1],I.offset);else if(N.length===3){if(N[2]===1)G=b.ALPHA;else if(N[2]===2)G=b.LUMINANCE_ALPHA;else if(N[2]===3)G=b.RGB;else if(N[2]===4)G=b.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===b.LUMINANCE||G===b.ALPHA)&&(D===b.LUMINANCE||D===b.ALPHA)&&(G=D),G!==D)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ct=I.size,st=R.indexOf(L)<0;if(st&&R.push(L),j===B&&rt)I.offset===0&&I.data.length===ct?st?b.texImage2D(b.TEXTURE_2D,L,D,N[0],N[1],0,D,B,I.data):b.texSubImage2D(b.TEXTURE_2D,L,_,P,N[0],N[1],D,B,I.data):st?b.texImage2D(b.TEXTURE_2D,L,D,N[0],N[1],0,D,B,I.data.subarray(I.offset,I.offset+ct)):b.texSubImage2D(b.TEXTURE_2D,L,_,P,N[0],N[1],D,B,I.data.subarray(I.offset,I.offset+ct));else{var et;B===b.FLOAT?et=o.mallocFloat32(ct):et=o.mallocUint8(ct);var K=i(et,N,[N[2],N[2]*N[0],1]);j===b.FLOAT&&B===b.UNSIGNED_BYTE?m(K,I):n.assign(K,I),st?b.texImage2D(b.TEXTURE_2D,L,D,N[0],N[1],0,D,B,et.subarray(0,ct)):b.texSubImage2D(b.TEXTURE_2D,L,_,P,N[0],N[1],D,B,et.subarray(0,ct)),B===b.FLOAT?o.freeFloat32(et):o.freeUint8(et)}}function k(b){var _=b.createTexture();return b.bindTexture(b.TEXTURE_2D,_),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),_}function M(b,_,P,L,D){var B=b.getParameter(b.MAX_TEXTURE_SIZE);if(_<0||_>B||P<0||P>B)throw new Error("gl-texture2d: Invalid texture shape");if(D===b.FLOAT&&!b.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var R=k(b);return b.texImage2D(b.TEXTURE_2D,0,L,_,P,0,L,D,null),new l(b,R,_,P,L,D)}function T(b,_,P,L,D,B){var R=k(b);return b.texImage2D(b.TEXTURE_2D,0,D,D,B,_),new l(b,R,P,L,D,B)}function c(b,_){var P=_.dtype,L=_.shape.slice(),D=b.getParameter(b.MAX_TEXTURE_SIZE);if(L[0]<0||L[0]>D||L[1]<0||L[1]>D)throw new Error("gl-texture2d: Invalid texture size");var B=y(L,_.stride.slice()),R=0;P==="float32"?R=b.FLOAT:P==="float64"?(R=b.FLOAT,B=!1,P="float32"):P==="uint8"?R=b.UNSIGNED_BYTE:(R=b.UNSIGNED_BYTE,B=!1,P="uint8");var I=0;if(L.length===2)I=b.LUMINANCE,L=[L[0],L[1],1],_=i(_.data,L,[_.stride[0],_.stride[1],1],_.offset);else if(L.length===3)if(L[2]===1)I=b.ALPHA;else if(L[2]===2)I=b.LUMINANCE_ALPHA;else if(L[2]===3)I=b.RGB;else if(L[2]===4)I=b.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");R===b.FLOAT&&!b.getExtension("OES_texture_float")&&(R=b.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=[L[2],L[2]*L[0],1];N=o.malloc(j,P);var rt=i(N,L,G,0);(P==="float32"||P==="float64")&&R===b.UNSIGNED_BYTE?m(rt,_):n.assign(rt,_),F=N.subarray(0,j)}var ct=k(b);return b.texImage2D(b.TEXTURE_2D,0,I,L[0],L[1],0,I,R,F),B||o.free(N),new l(b,ct,L[0],L[1],I,R)}function h(b){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||v(b),typeof arguments[1]=="number")return M(b,arguments[1],arguments[2],arguments[3]||b.RGBA,arguments[4]||b.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return M(b,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||b.RGBA,arguments[3]||b.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var _=arguments[1],P=g(_)?_:_.raw;if(P)return T(b,P,_.width|0,_.height|0,arguments[2]||b.RGBA,arguments[3]||b.UNSIGNED_BYTE);if(_.shape&&_.data&&_.stride)return c(b,_)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},7790:function(){},7815:function(t,e,r){var i=r(2931),n=r(9970),o=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(y,S,k,M){for(var T=y.points,c=y.velocities,h=y.divergences,b=[],_=[],P=[],L=[],D=[],B=[],R=0,I=0,F=n.create(),N=n.create(),j=8,G=0;G<T.length;G++){var rt=T[G],ct=c[G],st=h[G];S===0&&(st=k*.05),I=i.length(ct)/M,F=n.create(),i.copy(F,ct),F[3]=st;for(var et=0;et<j;et++)D[et]=[rt[0],rt[1],rt[2],et];if(L.length>0)for(var et=0;et<j;et++){var K=(et+1)%j;b.push(L[et],D[et],D[K],D[K],L[K],L[et]),P.push(N,F,F,F,N,N),B.push(R,I,I,I,R,R);var ot=b.length;_.push([ot-6,ot-5,ot-4],[ot-3,ot-2,ot-1])}var X=L;L=D,D=X;var Q=N;N=F,F=Q;var ut=R;R=I,I=ut}return{positions:b,cells:_,vectors:P,vertexIntensity:B}},s=function(y,S,k,M){for(var T=0,c=0;c<y.length;c++)for(var h=y[c].velocities,b=0;b<h.length;b++)T=Math.max(T,i.length(h[b]));for(var _=y.map(function(rt){return a(rt,k,M,T)}),P=[],L=[],D=[],B=[],c=0;c<_.length;c++){var R=_[c],I=P.length;P=P.concat(R.positions),D=D.concat(R.vectors),B=B.concat(R.vertexIntensity);for(var b=0;b<R.cells.length;b++){var F=R.cells[b],N=[];L.push(N);for(var j=0;j<F.length;j++)N.push(F[j]+I)}}return{positions:P,cells:L,vectors:D,vertexIntensity:B,colormap:S}},f=function(y,S){var k=y.length,M;for(M=0;M<k;M++){var T=y[M];if(T===S)return M;if(T>S)return M-1}return M},v=function(y,S,k){return y<S?S:y>k?k:y},g=function(y,S,k){var M=S.vectors,T=S.meshgrid,c=y[0],h=y[1],b=y[2],_=T[0].length,P=T[1].length,L=T[2].length,D=f(T[0],c),B=f(T[1],h),R=f(T[2],b),I=D+1,F=B+1,N=R+1;if(D=v(D,0,_-1),I=v(I,0,_-1),B=v(B,0,P-1),F=v(F,0,P-1),R=v(R,0,L-1),N=v(N,0,L-1),D<0||B<0||R<0||I>_-1||F>P-1||N>L-1)return i.create();var j=T[0][D],G=T[0][I],rt=T[1][B],ct=T[1][F],st=T[2][R],et=T[2][N],K=(c-j)/(G-j),ot=(h-rt)/(ct-rt),X=(b-st)/(et-st);isFinite(K)||(K=.5),isFinite(ot)||(ot=.5),isFinite(X)||(X=.5);var Q,ut,J,q,it,nt;switch(k.reversedX&&(D=_-1-D,I=_-1-I),k.reversedY&&(B=P-1-B,F=P-1-F),k.reversedZ&&(R=L-1-R,N=L-1-N),k.filled){case 5:it=R,nt=N,J=B*L,q=F*L,Q=D*L*P,ut=I*L*P;break;case 4:it=R,nt=N,Q=D*L,ut=I*L,J=B*L*_,q=F*L*_;break;case 3:J=B,q=F,it=R*P,nt=N*P,Q=D*P*L,ut=I*P*L;break;case 2:J=B,q=F,Q=D*P,ut=I*P,it=R*P*_,nt=N*P*_;break;case 1:Q=D,ut=I,it=R*_,nt=N*_,J=B*_*L,q=F*_*L;break;default:Q=D,ut=I,J=B*_,q=F*_,it=R*_*P,nt=N*_*P;break}var dt=M[Q+J+it],Tt=M[Q+J+nt],wt=M[Q+q+it],It=M[Q+q+nt],Ct=M[ut+J+it],Nt=M[ut+J+nt],ee=M[ut+q+it],Jt=M[ut+q+nt],te=i.create(),Kt=i.create(),mt=i.create(),bt=i.create();i.lerp(te,dt,Ct,K),i.lerp(Kt,Tt,Nt,K),i.lerp(mt,wt,ee,K),i.lerp(bt,It,Jt,K);var vt=i.create(),Ut=i.create();i.lerp(vt,te,mt,ot),i.lerp(Ut,Kt,bt,ot);var re=i.create();return i.lerp(re,vt,Ut,X),re},m=function(y){var S=1/0;y.sort(function(c,h){return c-h});for(var k=y.length,M=1;M<k;M++){var T=Math.abs(y[M]-y[M-1]);T<S&&(S=T)}return S},w=function(y){for(var S=[],k=[],M=[],T={},c={},h={},b=y.length,_=0;_<b;_++){var P=y[_],L=P[0],D=P[1],B=P[2];T[L]||(S.push(L),T[L]=!0),c[D]||(k.push(D),c[D]=!0),h[B]||(M.push(B),h[B]=!0)}var R=m(S),I=m(k),F=m(M),N=Math.min(R,I,F);return isFinite(N)?N:1};t.exports=function(y,S){var k=y.startingPositions,M=y.maxLength||1e3,T=y.tubeSize||1,c=y.absoluteTubeSize,h=y.gridFill||"+x+y+z",b={};h.indexOf("-x")!==-1&&(b.reversedX=!0),h.indexOf("-y")!==-1&&(b.reversedY=!0),h.indexOf("-z")!==-1&&(b.reversedZ=!0),b.filled=o.indexOf(h.replace(/-/g,"").replace(/\+/g,""));var _=y.getVelocity||function(Nt){return g(Nt,y,b)},P=y.getDivergence||function(Nt,ee){var Jt=i.create(),te=1e-4;i.add(Jt,Nt,[te,0,0]);var Kt=_(Jt);i.subtract(Kt,Kt,ee),i.scale(Kt,Kt,1/te),i.add(Jt,Nt,[0,te,0]);var mt=_(Jt);i.subtract(mt,mt,ee),i.scale(mt,mt,1/te),i.add(Jt,Nt,[0,0,te]);var bt=_(Jt);return i.subtract(bt,bt,ee),i.scale(bt,bt,1/te),i.add(Jt,Kt,mt),i.add(Jt,Jt,bt),Jt},L=[],D=S[0][0],B=S[0][1],R=S[0][2],I=S[1][0],F=S[1][1],N=S[1][2],j=function(Nt){var ee=Nt[0],Jt=Nt[1],te=Nt[2];return!(ee<D||ee>I||Jt<B||Jt>F||te<R||te>N)},G=i.distance(S[0],S[1]),rt=10*G/M,ct=rt*rt,st=1,et=0,K=k.length;K>1&&(st=w(k));for(var ot=0;ot<K;ot++){var X=i.create();i.copy(X,k[ot]);var Q=[X],ut=[],J=_(X),q=X;ut.push(J);var it=[],nt=P(X,J),dt=i.length(nt);isFinite(dt)&&dt>et&&(et=dt),it.push(dt),L.push({points:Q,velocities:ut,divergences:it});for(var Tt=0;Tt<M*100&&Q.length<M&&j(X);){Tt++;var wt=i.clone(J),It=i.squaredLength(wt);if(It===0)break;if(It>ct&&i.scale(wt,wt,rt/Math.sqrt(It)),i.add(wt,wt,X),J=_(wt),i.squaredDistance(q,wt)-ct>-1e-4*ct){Q.push(wt),q=wt,ut.push(J);var nt=P(wt,J),dt=i.length(nt);isFinite(dt)&&dt>et&&(et=dt),it.push(dt)}X=wt}}var Ct=s(L,y.colormap,et,st);return c?Ct.tubeScale=c:(et===0&&(et=1),Ct.tubeScale=T*.5*st/et),Ct};var l=r(6740),x=r(6405).createMesh;t.exports.createTubeMesh=function(y,S){return x(y,S,{shaders:l,traceType:"streamtube"})}},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},7842:function(t,e,r){var i=r(6330),n=r(1533),o=r(2651),a=r(6768),s=r(869),f=r(8697);t.exports=v;function v(g,m){if(i(g))return m?f(g,v(m)):[g[0].clone(),g[1].clone()];var w=0,l,x;if(n(g))l=g.clone();else if(typeof g=="string")l=a(g);else{if(g===0)return[o(0),o(1)];if(g===Math.floor(g))l=o(g);else{for(;g!==Math.floor(g);)g=g*Math.pow(2,256),w-=256;l=o(g)}}if(i(m))l.mul(m[1]),x=m[0].clone();else if(n(m))x=m.clone();else if(typeof m=="string")x=a(m);else if(!m)x=o(1);else if(m===Math.floor(m))x=o(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),w+=256;x=o(m)}return w>0?l=l.ushln(w):w<0&&(x=x.ushln(-w)),s(l,x)}},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}},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"])},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}},8105:function(t){t.exports=r;var e={"lo===p0":i,"lo<p0":n,"lo<=p0":o,"hi<=p0":a,"lo<p0&&p0<=hi":f,"lo<=p0&&p0<=hi":s,"!(lo>=p0)&&!(p1>=hi)":v};function r(g){return e[g]}function i(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h];if(P===S)if(c===_)c+=1,T+=k;else{for(var L=0;k>L;++L){var D=x[M+L];x[M+L]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function n(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h];if(P<S)if(c===_)c+=1,T+=k;else{for(var L=0;k>L;++L){var D=x[M+L];x[M+L]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function o(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+b];if(P<=S)if(c===_)c+=1,T+=k;else{for(var L=0;k>L;++L){var D=x[M+L];x[M+L]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function a(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+b];if(P<=S)if(c===_)c+=1,T+=k;else{for(var L=0;k>L;++L){var D=x[M+L];x[M+L]=x[T],x[T++]=D}var B=y[_];y[_]=y[c],y[c++]=B}}return c}function s(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h],L=x[M+b];if(P<=S&&S<=L)if(c===_)c+=1,T+=k;else{for(var D=0;k>D;++D){var B=x[M+D];x[M+D]=x[T],x[T++]=B}var R=y[_];y[_]=y[c],y[c++]=R}}return c}function f(g,m,w,l,x,y,S){for(var k=2*g,M=k*w,T=M,c=w,h=m,b=g+m,_=w;l>_;++_,M+=k){var P=x[M+h],L=x[M+b];if(P<S&&S<=L)if(c===_)c+=1,T+=k;else{for(var D=0;k>D;++D){var B=x[M+D];x[M+D]=x[T],x[T++]=B}var R=y[_];y[_]=y[c],y[c++]=R}}return c}function v(g,m,w,l,x,y,S,k){for(var M=2*g,T=M*w,c=T,h=w,b=m,_=g+m,P=w;l>P;++P,T+=M){var L=x[T+b],D=x[T+_];if(!(L>=S)&&!(k>=D))if(h===P)h+=1,c+=M;else{for(var B=0;M>B;++B){var R=x[T+B];x[T+B]=x[c],x[c++]=R}var I=y[P];y[P]=y[h],y[h++]=I}}return h}},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}},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,f,v,g){var m=s.createVertexArray?new o(s):s.getExtension("OES_vertex_array_object"),w;return m?w=i(s,m):w=n(s),w.update(f,v,g),w}t.exports=a},8192:function(t,e,r){t.exports=a;var i=r(2825),n=r(3536),o=r(244);function a(s,f){var v=i(s[0],s[1],s[2]),g=i(f[0],f[1],f[2]);n(v,v),n(g,g);var m=o(v,g);return m>1?0:Math.acos(m)}},8210:function(t){t.exports=r;function e(i,n){var o=i+n,a=o-i,s=o-a,f=n-a,v=i-s,g=v+f;return g?[g,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,f=new Array(s),v=0,g=0,m=0,w=Math.abs,l=i[g],x=w(l),y=n[m],S=w(y),k,M;x<S?(M=l,g+=1,g<o&&(l=i[g],x=w(l))):(M=y,m+=1,m<a&&(y=n[m],S=w(y))),g<o&&x<S||m>=a?(k=l,g+=1,g<o&&(l=i[g],x=w(l))):(k=y,m+=1,m<a&&(y=n[m],S=w(y)));for(var T=k+M,c=T-k,h=M-c,b=h,_=T,P,L,D,B,R;g<o&&m<a;)x<S?(k=l,g+=1,g<o&&(l=i[g],x=w(l))):(k=y,m+=1,m<a&&(y=n[m],S=w(y))),M=b,T=k+M,c=T-k,h=M-c,h&&(f[v++]=h),P=_+T,L=P-_,D=P-L,B=T-L,R=_-D,b=R+B,_=P;for(;g<o;)k=l,M=b,T=k+M,c=T-k,h=M-c,h&&(f[v++]=h),P=_+T,L=P-_,D=P-L,B=T-L,R=_-D,b=R+B,_=P,g+=1,g<o&&(l=i[g]);for(;m<a;)k=y,M=b,T=k+M,c=T-k,h=M-c,h&&(f[v++]=h),P=_+T,L=P-_,D=P-L,B=T-L,R=_-D,b=R+B,_=P,m+=1,m<a&&(y=n[m]);return b&&(f[v++]=b),_&&(f[v++]=_),v||(f[v++]=0),f.length=v,f}},8277:function(t){function e(){return function(s,f,v,g,m){var w=s[0],l=s[1],x=s[2],y=v[0],S=v[1],k=v[2],M=[0,0,0];g|=0;var T=0,c=0,h=0,b=k,_=S-x*k,P=y-l*S;for(h=0;h<w;++h){for(c=0;c<l;++c){for(T=0;T<x;++T){{var L=m,D;for(D=0;D<M.length-1;++D)L=L[M[D]];f[g]=L[M[M.length-1]]}g+=b,++M[2]}g+=_,M[2]-=x,++M[1]}g+=P,M[1]-=l,++M[0]}}}function r(){return e()}var i=r;function n(s){var f={};return function(v,g){var m=v.dtype,w=v.order,l=[m,w.join()].join(),x=f[l];return x||(f[l]=x=s([m,w])),x(v.shape.slice(0),v.data,v.stride,v.offset|0,g)}}function o(s){return n(i.bind(void 0,s))}function a(s){return o({funcName:s.funcName})}t.exports=a({funcName:"convert"})},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}},8406:function(t,e){var r=1e-6,i=1e-6;e.vertexNormals=function(n,o,a){for(var s=o.length,f=new Array(s),v=a===void 0?r:a,g=0;g<s;++g)f[g]=[0,0,0];for(var g=0;g<n.length;++g)for(var m=n[g],w=0,l=m[m.length-1],x=m[0],y=0;y<m.length;++y){w=l,l=x,x=m[(y+1)%m.length];for(var S=o[w],k=o[l],M=o[x],T=new Array(3),c=0,h=new Array(3),b=0,_=0;_<3;++_)T[_]=S[_]-k[_],c+=T[_]*T[_],h[_]=M[_]-k[_],b+=h[_]*h[_];if(c*b>v)for(var P=f[l],L=1/Math.sqrt(c*b),_=0;_<3;++_){var D=(_+1)%3,B=(_+2)%3;P[_]+=L*(h[D]*T[B]-h[B]*T[D])}}for(var g=0;g<s;++g){for(var P=f[g],R=0,_=0;_<3;++_)R+=P[_]*P[_];if(R>v)for(var L=1/Math.sqrt(R),_=0;_<3;++_)P[_]*=L;else for(var _=0;_<3;++_)P[_]=0}return f},e.faceNormals=function(n,o,a){for(var s=n.length,f=new Array(s),v=a===void 0?i:a,g=0;g<s;++g){for(var m=n[g],w=new Array(3),l=0;l<3;++l)w[l]=o[m[l]];for(var x=new Array(3),y=new Array(3),l=0;l<3;++l)x[l]=w[1][l]-w[0][l],y[l]=w[2][l]-w[0][l];for(var S=new Array(3),k=0,l=0;l<3;++l){var M=(l+1)%3,T=(l+2)%3;S[l]=x[M]*y[T]-x[T]*y[M],k+=S[l]*S[l]}k>v?k=1/Math.sqrt(k):k=0;for(var l=0;l<3;++l)S[l]*=k;f[g]=S}return f}},8418:function(t,e,r){var i=r(5219),n=r(2762),o=r(8116),a=r(1888),s=r(6760),f=r(1283),v=r(9366),g=r(5964),m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],w=ArrayBuffer,l=DataView;function x(Q){return w.isView(Q)&&!(Q instanceof l)}function y(Q){return Array.isArray(Q)||x(Q)}t.exports=X;function S(Q,ut){var J=Q[0],q=Q[1],it=Q[2],nt=Q[3];return Q[0]=ut[0]*J+ut[4]*q+ut[8]*it+ut[12]*nt,Q[1]=ut[1]*J+ut[5]*q+ut[9]*it+ut[13]*nt,Q[2]=ut[2]*J+ut[6]*q+ut[10]*it+ut[14]*nt,Q[3]=ut[3]*J+ut[7]*q+ut[11]*it+ut[15]*nt,Q}function k(Q,ut,J,q){return S(q,q),S(q,q),S(q,q)}function M(Q,ut){this.index=Q,this.dataCoordinate=this.position=ut}function T(Q){return Q===!0||Q>1?1:Q}function c(Q,ut,J,q,it,nt,dt,Tt,wt,It,Ct,Nt){this.gl=Q,this.pixelRatio=1,this.shader=ut,this.orthoShader=J,this.projectShader=q,this.pointBuffer=it,this.colorBuffer=nt,this.glyphBuffer=dt,this.idBuffer=Tt,this.vao=wt,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=It,this.pickOrthoShader=Ct,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 h=c.prototype;h.pickSlots=1,h.setPickBase=function(Q){this.pickId=Q},h.isTransparent=function(){if(this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&this.projectHasAlpha)return!0;return!1},h.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 b=[0,0],_=[0,0,0],P=[0,0,0],L=[0,0,0,1],D=[0,0,0,1],B=m.slice(),R=[0,0,0],I=[[0,0,0],[0,0,0]];function F(Q){return Q[0]=Q[1]=Q[2]=0,Q}function N(Q,ut){return Q[0]=ut[0],Q[1]=ut[1],Q[2]=ut[2],Q[3]=1,Q}function j(Q,ut,J,q){return Q[0]=ut[0],Q[1]=ut[1],Q[2]=ut[2],Q[J]=q,Q}function G(Q){for(var ut=I,J=0;J<2;++J)for(var q=0;q<3;++q)ut[J][q]=Math.max(Math.min(Q[J][q],1e8),-1e8);return ut}function rt(Q,ut,J,q){var it=ut.axesProject,nt=ut.gl,dt=Q.uniforms,Tt=J.model||m,wt=J.view||m,It=J.projection||m,Ct=ut.axesBounds,Nt=G(ut.clipBounds),ee;ut.axes&&ut.axes.lastCubeProps?ee=ut.axes.lastCubeProps.axis:ee=[1,1,1],b[0]=2/nt.drawingBufferWidth,b[1]=2/nt.drawingBufferHeight,Q.bind(),dt.view=wt,dt.projection=It,dt.screenSize=b,dt.highlightId=ut.highlightId,dt.highlightScale=ut.highlightScale,dt.clipBounds=Nt,dt.pickGroup=ut.pickId/255,dt.pixelRatio=q;for(var Jt=0;Jt<3;++Jt)if(it[Jt]){dt.scale=ut.projectScale[Jt],dt.opacity=ut.projectOpacity[Jt];for(var te=B,Kt=0;Kt<16;++Kt)te[Kt]=0;for(var Kt=0;Kt<4;++Kt)te[5*Kt]=1;te[5*Jt]=0,ee[Jt]<0?te[12+Jt]=Ct[0][Jt]:te[12+Jt]=Ct[1][Jt],s(te,Tt,te),dt.model=te;var mt=(Jt+1)%3,bt=(Jt+2)%3,vt=F(_),Ut=F(P);vt[mt]=1,Ut[bt]=1;var re=k(It,wt,Tt,N(L,vt)),Zt=k(It,wt,Tt,N(D,Ut));if(Math.abs(re[1])>Math.abs(Zt[1])){var ue=re;re=Zt,Zt=ue,ue=vt,vt=Ut,Ut=ue;var Me=mt;mt=bt,bt=Me}re[0]<0&&(vt[mt]=-1),Zt[1]>0&&(Ut[bt]=-1);for(var Ce=0,We=0,Kt=0;Kt<4;++Kt)Ce+=Math.pow(Tt[4*mt+Kt],2),We+=Math.pow(Tt[4*bt+Kt],2);vt[mt]/=Math.sqrt(Ce),Ut[bt]/=Math.sqrt(We),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),ut.vao.bind(),ut.vao.draw(nt.TRIANGLES,ut.vertexCount),ut.lineWidth>0&&(nt.lineWidth(ut.lineWidth*q),ut.vao.draw(nt.LINES,ut.lineVertexCount,ut.vertexCount)),ut.vao.unbind()}}var ct=[-1e8,-1e8,-1e8],st=[1e8,1e8,1e8],et=[ct,st];function K(Q,ut,J,q,it,nt,dt){var Tt=J.gl;if((nt===J.projectHasAlpha||dt)&&rt(ut,J,q,it),nt===J.hasAlpha||dt){Q.bind();var wt=Q.uniforms;wt.model=q.model||m,wt.view=q.view||m,wt.projection=q.projection||m,b[0]=2/Tt.drawingBufferWidth,b[1]=2/Tt.drawingBufferHeight,wt.screenSize=b,wt.highlightId=J.highlightId,wt.highlightScale=J.highlightScale,wt.fragClipBounds=et,wt.clipBounds=J.axes.bounds,wt.opacity=J.opacity,wt.pickGroup=J.pickId/255,wt.pixelRatio=it,J.vao.bind(),J.vao.draw(Tt.TRIANGLES,J.vertexCount),J.lineWidth>0&&(Tt.lineWidth(J.lineWidth*it),J.vao.draw(Tt.LINES,J.lineVertexCount,J.vertexCount)),J.vao.unbind()}}h.draw=function(Q){var ut=this.useOrtho?this.orthoShader:this.shader;K(ut,this.projectShader,this,Q,this.pixelRatio,!1,!1)},h.drawTransparent=function(Q){var ut=this.useOrtho?this.orthoShader:this.shader;K(ut,this.projectShader,this,Q,this.pixelRatio,!0,!1)},h.drawPick=function(Q){var ut=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;K(ut,this.pickProjectShader,this,Q,1,!0,!0)},h.pick=function(Q){if(!Q||Q.id!==this.pickId)return null;var ut=Q.value[2]+(Q.value[1]<<8)+(Q.value[0]<<16);if(ut>=this.pointCount||ut<0)return null;var J=this.points[ut],q=this._selectResult;q.index=ut;for(var it=0;it<3;++it)q.position[it]=q.dataCoordinate[it]=J[it];return q},h.highlight=function(Q){if(!Q)this.highlightId=[1,1,1,1];else{var ut=Q.index,J=ut&255,q=ut>>8&255,it=ut>>16&255;this.highlightId=[J/255,q/255,it/255,0]}};function ot(Q,ut,J,q){var it;y(Q)?ut<Q.length?it=Q[ut]:it=void 0:it=Q,it=g(it);var nt=!0;i(it)&&(it="▼",nt=!1),J||(J={});var dt=J.family;y(dt)&&(dt=dt[ut]),dt||(dt="normal");var Tt=J.weight;y(Tt)&&(Tt=Tt[ut]),Tt||(Tt="normal");var wt=J.style;y(wt)&&(wt=wt[ut]),wt||(wt="normal");var It=J.variant;y(It)&&(It=It[ut]),It||(It="normal");var Ct=v(it,{family:dt,weight:Tt,style:wt,variant:It},q),Ct=v(it,J,q);return{mesh:Ct[0],lines:Ct[1],bounds:Ct[2],visible:nt}}h.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(y(Q.project))this.axesProject=Q.project;else{var ut=!!Q.project;this.axesProject=[ut,ut,ut]}if("projectScale"in Q)if(y(Q.projectScale))this.projectScale=Q.projectScale.slice();else{var J=+Q.projectScale;this.projectScale=[J,J,J]}if(this.projectHasAlpha=!1,"projectOpacity"in Q){if(y(Q.projectOpacity))this.projectOpacity=Q.projectOpacity.slice();else{var J=+Q.projectOpacity;this.projectOpacity=[J,J,J]}for(var q=0;q<3;++q)this.projectOpacity[q]=T(this.projectOpacity[q]),this.projectOpacity[q]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in Q&&(this.opacity=T(Q.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var it=Q.position,nt={family:Q.font||"normal",style:Q.fontStyle||"normal",weight:Q.fontWeight||"normal",variant:Q.fontVariant||"normal"},dt=Q.alignment||[0,0],Tt,wt;if(dt.length===2)Tt=dt[0],wt=dt[1];else{Tt=[],wt=[];for(var q=0;q<dt.length;++q)Tt[q]=dt[q][0],wt[q]=dt[q][1]}var It=[1/0,1/0,1/0],Ct=[-1/0,-1/0,-1/0],Nt=Q.glyph,ee=Q.color,Jt=Q.size,te=Q.angle,Kt=Q.lineColor,mt=-1,bt=0,vt=0,Ut=0;if(it.length){Ut=it.length;t:for(var q=0;q<Ut;++q){for(var re=it[q],Zt=0;Zt<3;++Zt)if(isNaN(re[Zt])||!isFinite(re[Zt]))continue t;var ue=ot(Nt,q,nt,this.pixelRatio),Me=ue.mesh,Ce=ue.lines,We=ue.bounds;bt+=Me.cells.length*3,vt+=Ce.edges.length*2}}var qe=bt+vt,vr=a.mallocFloat(3*qe),_r=a.mallocFloat(4*qe),er=a.mallocFloat(2*qe),Mr=a.mallocUint32(qe);if(qe>0){var Ir=0,de=bt,Dt=[0,0,0,1],qt=[0,0,0,1],_t=y(ee)&&y(ee[0]),lt=y(Kt)&&y(Kt[0]);t:for(var q=0;q<Ut;++q){mt+=1;for(var re=it[q],Zt=0;Zt<3;++Zt){if(isNaN(re[Zt])||!isFinite(re[Zt]))continue t;Ct[Zt]=Math.max(Ct[Zt],re[Zt]),It[Zt]=Math.min(It[Zt],re[Zt])}var ue=ot(Nt,q,nt,this.pixelRatio),Me=ue.mesh,Ce=ue.lines,We=ue.bounds,yt=ue.visible;if(!yt)Dt=[1,1,1,0];else if(y(ee)){var St;if(_t?q<ee.length?St=ee[q]:St=[0,0,0,0]:St=ee,St.length===3){for(var Zt=0;Zt<3;++Zt)Dt[Zt]=St[Zt];Dt[3]=1}else if(St.length===4){for(var Zt=0;Zt<4;++Zt)Dt[Zt]=St[Zt];!this.hasAlpha&&St[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(y(Kt)){var St;if(lt?q<Kt.length?St=Kt[q]:St=[0,0,0,0]:St=Kt,St.length===3){for(var Zt=0;Zt<3;++Zt)qt[Zt]=St[Zt];qt[Zt]=1}else if(St.length===4){for(var Zt=0;Zt<4;++Zt)qt[Zt]=St[Zt];!this.hasAlpha&&St[3]<1&&(this.hasAlpha=!0)}}else qt[0]=qt[1]=qt[2]=0,qt[3]=1;var Ht=.5;yt?y(Jt)?q<Jt.length?Ht=+Jt[q]:Ht=12:Jt?Ht=+Jt:this.useOrtho&&(Ht=12):Ht=0;var Yt=0;y(te)?q<te.length?Yt=+te[q]:Yt=0:te&&(Yt=+te);for(var se=Math.cos(Yt),ke=Math.sin(Yt),re=it[q],Zt=0;Zt<3;++Zt)Ct[Zt]=Math.max(Ct[Zt],re[Zt]),It[Zt]=Math.min(It[Zt],re[Zt]);var Ee=Tt,Ue=wt,Ee=0;y(Tt)?q<Tt.length?Ee=Tt[q]:Ee=0:Tt&&(Ee=Tt);var Ue=0;y(wt)?q<wt.length?Ue=wt[q]:Ue=0:wt&&(Ue=wt),Ee*=Ee>0?1-We[0][0]:Ee<0?1+We[1][0]:1,Ue*=Ue>0?1-We[0][1]:Ue<0?1+We[1][1]:1;for(var ir=[Ee,Ue],ar=Me.cells||[],Ye=Me.positions||[],Zt=0;Zt<ar.length;++Zt)for(var Er=ar[Zt],pn=0;pn<3;++pn){for(var dn=0;dn<3;++dn)vr[3*Ir+dn]=re[dn];for(var dn=0;dn<4;++dn)_r[4*Ir+dn]=Dt[dn];Mr[Ir]=mt;var bn=Ye[Er[pn]];er[2*Ir]=Ht*(se*bn[0]-ke*bn[1]+ir[0]),er[2*Ir+1]=Ht*(ke*bn[0]+se*bn[1]+ir[1]),Ir+=1}for(var ar=Ce.edges,Ye=Ce.positions,Zt=0;Zt<ar.length;++Zt)for(var Er=ar[Zt],pn=0;pn<2;++pn){for(var dn=0;dn<3;++dn)vr[3*de+dn]=re[dn];for(var dn=0;dn<4;++dn)_r[4*de+dn]=qt[dn];Mr[de]=mt;var bn=Ye[Er[pn]];er[2*de]=Ht*(se*bn[0]-ke*bn[1]+ir[0]),er[2*de+1]=Ht*(ke*bn[0]+se*bn[1]+ir[1]),de+=1}}}this.bounds=[It,Ct],this.points=it,this.pointCount=it.length,this.vertexCount=bt,this.lineVertexCount=vt,this.pointBuffer.update(vr),this.colorBuffer.update(_r),this.glyphBuffer.update(er),this.idBuffer.update(Mr),a.free(vr),a.free(_r),a.free(er),a.free(Mr)},h.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 X(Q){var ut=Q.gl,J=f.createPerspective(ut),q=f.createOrtho(ut),it=f.createProject(ut),nt=f.createPickPerspective(ut),dt=f.createPickOrtho(ut),Tt=f.createPickProject(ut),wt=n(ut),It=n(ut),Ct=n(ut),Nt=n(ut),ee=o(ut,[{buffer:wt,size:3,type:ut.FLOAT},{buffer:It,size:4,type:ut.FLOAT},{buffer:Ct,size:2,type:ut.FLOAT},{buffer:Nt,size:4,type:ut.UNSIGNED_BYTE,normalized:!0}]),Jt=new c(ut,J,q,it,wt,It,Ct,Nt,ee,nt,dt,Tt);return Jt.update(Q),Jt}},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}},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 f=n[0]+n[1],v=o[0]+o[1];if(s=f+n[2]-(v+o[2]),s)return s;var g=e(n[0],n[1]),m=e(o[0],o[1]);return e(g,n[2])-e(m,o[2])||e(g+n[2],f)-e(m+o[2],v);case 4:var w=n[0],l=n[1],x=n[2],y=n[3],S=o[0],k=o[1],M=o[2],T=o[3];return w+l+x+y-(S+k+M+T)||e(w,l,x,y)-e(S,k,M,T,S)||e(w+l,w+x,w+y,l+x,l+y,x+y)-e(S+k,S+M,S+T,k+M,k+T,M+T)||e(w+l+x,w+l+y,w+x+y,l+x+y)-e(S+k+M,S+k+T,S+M+T,k+M+T);default:for(var c=n.slice().sort(r),h=o.slice().sort(r),b=0;b<a;++b)if(s=c[b]-h[b],s)return s;return 0}}},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 f=i("ex",o),v=function(g){s&&g.preventDefault();var m=g.deltaX||0,w=g.deltaY||0,l=g.deltaZ||0,x=g.deltaMode,y=1;switch(x){case 1:y=f;break;case 2:y=window.innerHeight;break}if(m*=y,w*=y,l*=y,m||w||l)return a(m,w,l,g)};return o.addEventListener("wheel",v),v}},8545:function(t){t.exports=r;function e(i,n){var o=i+n,a=o-i,s=o-a,f=n-a,v=i-s,g=v+f;return g?[g,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,f=new Array(s),v=0,g=0,m=0,w=Math.abs,l=i[g],x=w(l),y=-n[m],S=w(y),k,M;x<S?(M=l,g+=1,g<o&&(l=i[g],x=w(l))):(M=y,m+=1,m<a&&(y=-n[m],S=w(y))),g<o&&x<S||m>=a?(k=l,g+=1,g<o&&(l=i[g],x=w(l))):(k=y,m+=1,m<a&&(y=-n[m],S=w(y)));for(var T=k+M,c=T-k,h=M-c,b=h,_=T,P,L,D,B,R;g<o&&m<a;)x<S?(k=l,g+=1,g<o&&(l=i[g],x=w(l))):(k=y,m+=1,m<a&&(y=-n[m],S=w(y))),M=b,T=k+M,c=T-k,h=M-c,h&&(f[v++]=h),P=_+T,L=P-_,D=P-L,B=T-L,R=_-D,b=R+B,_=P;for(;g<o;)k=l,M=b,T=k+M,c=T-k,h=M-c,h&&(f[v++]=h),P=_+T,L=P-_,D=P-L,B=T-L,R=_-D,b=R+B,_=P,g+=1,g<o&&(l=i[g]);for(;m<a;)k=y,M=b,T=k+M,c=T-k,h=M-c,h&&(f[v++]=h),P=_+T,L=P-_,D=P-L,B=T-L,R=_-D,b=R+B,_=P,m+=1,m<a&&(y=-n[m]);return b&&(f[v++]=b),_&&(f[v++]=_),v||(f[v++]=0),f.length=v,f}},8572:function(t){t.exports=function(e){return e<0?-1:e>0?1:0}},8648:function(t,e,r){t.exports=r(783)},8692:function(t){t.exports=e;function e(r,i,n,o){var a=n[0],s=n[1],f=i[0]-a,v=i[1]-s,g=Math.sin(o),m=Math.cos(o);return r[0]=a+f*m-v*g,r[1]=s+f*g+v*m,r[2]=i[2],r}},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]))}},8731:function(t,e,r){t.exports=v;var i=r(8866);function n(g,m,w,l,x,y){this._gl=g,this._wrapper=m,this._index=w,this._locations=l,this._dimension=x,this._constFunc=y}var o=n.prototype;o.pointer=function(g,m,w,l){var x=this,y=x._gl,S=x._locations[x._index];y.vertexAttribPointer(S,x._dimension,g||y.FLOAT,!!m,w||0,l||0),y.enableVertexAttribArray(S)},o.set=function(g,m,w,l){return this._constFunc(this._locations[this._index],g,m,w,l)},Object.defineProperty(o,"location",{get:function(){return this._locations[this._index]},set:function(g){return g!==this._locations[this._index]&&(this._locations[this._index]=g|0,this._wrapper.program=null),g|0}});var a=[function(g,m,w){return w.length===void 0?g.vertexAttrib1f(m,w):g.vertexAttrib1fv(m,w)},function(g,m,w,l){return w.length===void 0?g.vertexAttrib2f(m,w,l):g.vertexAttrib2fv(m,w)},function(g,m,w,l,x){return w.length===void 0?g.vertexAttrib3f(m,w,l,x):g.vertexAttrib3fv(m,w)},function(g,m,w,l,x,y){return w.length===void 0?g.vertexAttrib4f(m,w,l,x,y):g.vertexAttrib4fv(m,w)}];function s(g,m,w,l,x,y,S){var k=a[x],M=new n(g,m,w,l,x,k);Object.defineProperty(y,S,{set:function(T){return g.disableVertexAttribArray(l[w]),k(g,l[w],T),T},get:function(){return M},enumerable:!0})}function f(g,m,w,l,x,y,S){for(var k=new Array(x),M=new Array(x),T=0;T<x;++T)s(g,m,w[T],l,x,k,T),M[T]=k[T];Object.defineProperty(k,"location",{set:function(b){if(Array.isArray(b))for(var _=0;_<x;++_)M[_].location=b[_];else for(var _=0;_<x;++_)M[_].location=b+_;return b},get:function(){for(var b=new Array(x),_=0;_<x;++_)b[_]=l[w[_]];return b},enumerable:!0}),k.pointer=function(b,_,P,L){b=b||g.FLOAT,_=!!_,P=P||x*x,L=L||0;for(var D=0;D<x;++D){var B=l[w[D]];g.vertexAttribPointer(B,x,b,_,P,L+D*x),g.enableVertexAttribArray(B)}};var c=new Array(x),h=g["vertexAttrib"+x+"fv"];Object.defineProperty(y,S,{set:function(b){for(var _=0;_<x;++_){var P=l[w[_]];if(g.disableVertexAttribArray(P),Array.isArray(b[0]))h.call(g,P,b[_]);else{for(var L=0;L<x;++L)c[L]=b[x*_+L];h.call(g,P,c)}}return b},get:function(){return k},enumerable:!0})}function v(g,m,w,l){for(var x={},y=0,S=w.length;y<S;++y){var k=w[y],M=k.name,T=k.type,c=k.locations;switch(T){case"bool":case"int":case"float":s(g,m,c[0],l,1,x,M);break;default:if(T.indexOf("vec")>=0){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new i("","Invalid data type for attribute "+M+": "+T);s(g,m,c[0],l,h,x,M)}else if(T.indexOf("mat")>=0){var h=T.charCodeAt(T.length-1)-48;if(h<2||h>4)throw new i("","Invalid data type for attribute "+M+": "+T);f(g,m,c,l,h,x,M)}else throw new i("","Unknown data type for attribute "+M+": "+T);break}}return x}},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,f=a,v=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--v;o[a]=f<<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}},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},8902:function(t,e,r){var i=r(2478),n=r(3250)[3],o=0,a=1,s=2;t.exports=S;function f(k,M,T,c,h){this.a=k,this.b=M,this.idx=T,this.lowerIds=c,this.upperIds=h}function v(k,M,T,c){this.a=k,this.b=M,this.type=T,this.idx=c}function g(k,M){var T=k.a[0]-M.a[0]||k.a[1]-M.a[1]||k.type-M.type;return T||k.type!==o&&(T=n(k.a,k.b,M.b),T)?T:k.idx-M.idx}function m(k,M){return n(k.a,k.b,M)}function w(k,M,T,c,h){for(var b=i.lt(M,c,m),_=i.gt(M,c,m),P=b;P<_;++P){for(var L=M[P],D=L.lowerIds,B=D.length;B>1&&n(T[D[B-2]],T[D[B-1]],c)>0;)k.push([D[B-1],D[B-2],h]),B-=1;D.length=B,D.push(h);for(var R=L.upperIds,B=R.length;B>1&&n(T[R[B-2]],T[R[B-1]],c)<0;)k.push([R[B-2],R[B-1],h]),B-=1;R.length=B,R.push(h)}}function l(k,M){var T;return k.a[0]<M.a[0]?T=n(k.a,k.b,M.a):T=n(M.b,M.a,k.a),T||(M.b[0]<k.b[0]?T=n(k.a,k.b,M.b):T=n(M.b,M.a,k.b),T||k.idx-M.idx)}function x(k,M,T){var c=i.le(k,T,l),h=k[c],b=h.upperIds,_=b[b.length-1];h.upperIds=[_],k.splice(c+1,0,new f(T.a,T.b,T.idx,[_],b))}function y(k,M,T){var c=T.a;T.a=T.b,T.b=c;var h=i.eq(k,T,l),b=k[h],_=k[h-1];_.upperIds=b.upperIds,k.splice(h,1)}function S(k,M){for(var T=k.length,c=M.length,h=[],b=0;b<T;++b)h.push(new v(k[b],null,o,b));for(var b=0;b<c;++b){var _=M[b],P=k[_[0]],L=k[_[1]];P[0]<L[0]?h.push(new v(P,L,s,b),new v(L,P,a,b)):P[0]>L[0]&&h.push(new v(L,P,s,b),new v(P,L,a,b))}h.sort(g);for(var D=h[0].a[0]-(1+Math.abs(h[0].a[0]))*Math.pow(2,-52),B=[new f([D,1],[D,0],-1,[],[])],R=[],b=0,I=h.length;b<I;++b){var F=h[b],N=F.type;N===o?w(R,B,k,F.a,F.idx):N===s?x(B,k,F):y(B,k,F)}return R}},8954:function(t,e,r){t.exports=l;var i=r(3250),n=r(6803).Fw;function o(x,y,S){this.vertices=x,this.adjacent=y,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 y=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=y};function a(x,y,S){this.vertices=x,this.cell=y,this.index=S}function s(x,y){return n(x.vertices,y.vertices)}function f(x){return function(){var y=this.tuple;return x.apply(this,y)}}function v(x){var y=i[x+1];return y||(y=i),f(y)}var g=[];function m(x,y,S){this.dimension=x,this.vertices=y,this.simplices=S,this.interior=S.filter(function(T){return!T.boundary}),this.tuple=new Array(x+1);for(var k=0;k<=x;++k)this.tuple[k]=this.vertices[k];var M=g[x];M||(M=g[x]=v(x)),this.orient=M}var w=m.prototype;w.handleBoundaryDegeneracy=function(x,y){var S=this.dimension,k=this.vertices.length-1,M=this.tuple,T=this.vertices,c=[x];for(x.lastVisited=-k;c.length>0;){x=c.pop();for(var h=x.adjacent,b=0;b<=S;++b){var _=h[b];if(!(!_.boundary||_.lastVisited<=-k)){for(var P=_.vertices,L=0;L<=S;++L){var D=P[L];D<0?M[L]=y:M[L]=T[D]}var B=this.orient();if(B>0)return _;_.lastVisited=-k,B===0&&c.push(_)}}}return null},w.walk=function(x,y){var S=this.vertices.length-1,k=this.dimension,M=this.vertices,T=this.tuple,c=y?this.interior.length*Math.random()|0:this.interior.length-1,h=this.interior[c];t:for(;!h.boundary;){for(var b=h.vertices,_=h.adjacent,P=0;P<=k;++P)T[P]=M[b[P]];h.lastVisited=S;for(var P=0;P<=k;++P){var L=_[P];if(!(L.lastVisited>=S)){var D=T[P];T[P]=x;var B=this.orient();if(T[P]=D,B<0){h=L;continue t}else L.boundary?L.lastVisited=-S:L.lastVisited=S}}return}return h},w.addPeaks=function(x,y){var S=this.vertices.length-1,k=this.dimension,M=this.vertices,T=this.tuple,c=this.interior,h=this.simplices,b=[y];y.lastVisited=S,y.vertices[y.vertices.indexOf(-1)]=S,y.boundary=!1,c.push(y);for(var _=[];b.length>0;){var y=b.pop(),P=y.vertices,L=y.adjacent,D=P.indexOf(S);if(!(D<0)){for(var B=0;B<=k;++B)if(B!==D){var R=L[B];if(!(!R.boundary||R.lastVisited>=S)){var I=R.vertices;if(R.lastVisited!==-S){for(var F=0,N=0;N<=k;++N)I[N]<0?(F=N,T[N]=x):T[N]=M[I[N]];var j=this.orient();if(j>0){I[F]=S,R.boundary=!1,c.push(R),b.push(R),R.lastVisited=S;continue}else R.lastVisited=-S}var G=R.adjacent,rt=P.slice(),ct=L.slice(),st=new o(rt,ct,!0);h.push(st);var et=G.indexOf(y);if(!(et<0)){G[et]=st,ct[D]=R,rt[B]=-1,ct[B]=y,L[B]=st,st.flip();for(var N=0;N<=k;++N){var K=rt[N];if(!(K<0||K===S)){for(var ot=new Array(k-1),X=0,Q=0;Q<=k;++Q){var ut=rt[Q];ut<0||Q===N||(ot[X++]=ut)}_.push(new a(ot,st,N))}}}}}}}_.sort(s);for(var B=0;B+1<_.length;B+=2){var J=_[B],q=_[B+1],it=J.index,nt=q.index;it<0||nt<0||(J.cell.adjacent[J.index]=q.cell,q.cell.adjacent[q.index]=J.cell)}},w.insert=function(x,y){var S=this.vertices;S.push(x);var k=this.walk(x,y);if(k){for(var M=this.dimension,T=this.tuple,c=0;c<=M;++c){var h=k.vertices[c];h<0?T[c]=x:T[c]=S[h]}var b=this.orient(T);b<0||b===0&&(k=this.handleBoundaryDegeneracy(k,x),!k)||this.addPeaks(x,k)}},w.boundary=function(){for(var x=this.dimension,y=[],S=this.simplices,k=S.length,M=0;M<k;++M){var T=S[M];if(T.boundary){for(var c=new Array(x),h=T.vertices,b=0,_=0,P=0;P<=x;++P)h[P]>=0?c[b++]=h[P]:_=P&1;if(_===(x&1)){var L=c[0];c[0]=c[1],c[1]=L}y.push(c)}}return y};function l(x,y){var S=x.length;if(S===0)throw new Error("Must have at least d+1 points");var k=x[0].length;if(S<=k)throw new Error("Must input at least d+1 points");var M=x.slice(0,k+1),T=i.apply(void 0,M);if(T===0)throw new Error("Input not in general position");for(var c=new Array(k+1),h=0;h<=k;++h)c[h]=h;T<0&&(c[0]=1,c[1]=0);for(var b=new o(c,new Array(k+1),!1),_=b.adjacent,P=new Array(k+2),h=0;h<=k;++h){for(var L=c.slice(),D=0;D<=k;++D)D===h&&(L[D]=-1);var B=L[0];L[0]=L[1],L[1]=B;var R=new o(L,new Array(k+1),!0);_[h]=R,P[h]=R}P[k+1]=b;for(var h=0;h<=k;++h)for(var L=_[h].vertices,I=_[h].adjacent,D=0;D<=k;++D){var F=L[D];if(F<0){I[D]=b;continue}for(var N=0;N<=k;++N)_[N].vertices.indexOf(F)<0&&(I[D]=_[N])}for(var j=new m(k,M,P),G=!!y,h=k+1;h<S;++h)j.insert(x[h],G);return j.boundary()}},8987:function(t,e,r){var i=r(7842),n=r(6504);t.exports=o;function o(a,s){for(var f=i(s),v=a.length,g=new Array(v),m=0;m<v;++m)g[m]=n(a[m],f);return g}},9060:function(t,e,r){var i=r(9405),n=r(2762),o=r(8116),a=r(7766),s=r(6760),f=r(7608),v=r(9618),g=r(6729),m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function w(T,c,h,b,_,P,L,D,B,R,I){this.gl=T,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=c,this.dirty=!0,this.triShader=h,this.pickShader=b,this.trianglePositions=_,this.triangleVectors=P,this.triangleColors=D,this.triangleUVs=B,this.triangleIds=L,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=I,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=m,this._view=m,this._projection=m,this._resolution=[1,1]}var l=w.prototype;l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(T){this.pickId=T};function x(T){for(var c=g({colormap:T,nshades:256,format:"rgba"}),h=new Uint8Array(1024),b=0;b<256;++b){for(var _=c[b],P=0;P<3;++P)h[4*b+P]=_[P];h[4*b+3]=_[3]*255}return v(h,[256,256,4],[4,0,1])}function y(T){for(var c=T.length,h=new Array(c),b=0;b<c;++b)h[b]=T[b][2];return h}l.update=function(T){T=T||{};var c=this.gl;this.dirty=!0,"lightPosition"in T&&(this.lightPosition=T.lightPosition),"opacity"in T&&(this.opacity=T.opacity),"ambient"in T&&(this.ambientLight=T.ambient),"diffuse"in T&&(this.diffuseLight=T.diffuse),"specular"in T&&(this.specularLight=T.specular),"roughness"in T&&(this.roughness=T.roughness),"fresnel"in T&&(this.fresnel=T.fresnel),T.tubeScale!==void 0&&(this.tubeScale=T.tubeScale),T.vectorScale!==void 0&&(this.vectorScale=T.vectorScale),T.coneScale!==void 0&&(this.coneScale=T.coneScale),T.coneOffset!==void 0&&(this.coneOffset=T.coneOffset),T.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=c.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=c.LINEAR,this.texture.setPixels(x(T.colormap)),this.texture.generateMipmap());var h=T.cells,b=T.positions,_=T.vectors;if(!(!b||!h||!_)){var P=[],L=[],D=[],B=[],R=[];this.cells=h,this.positions=b,this.vectors=_;var I=T.meshColor||[1,1,1,1],F=T.vertexIntensity,N=1/0,j=-1/0;if(F)if(T.vertexIntensityBounds)N=+T.vertexIntensityBounds[0],j=+T.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<b.length;++G){var rt=b[G][2];N=Math.min(N,rt),j=Math.max(j,rt)}F?this.intensity=F:this.intensity=y(b),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var G=0;G<b.length;++G)for(var ct=b[G],st=0;st<3;++st)isNaN(ct[st])||!isFinite(ct[st])||(this.bounds[0][st]=Math.min(this.bounds[0][st],ct[st]),this.bounds[1][st]=Math.max(this.bounds[1][st],ct[st]));var et=0;t:for(var G=0;G<h.length;++G){var K=h[G];switch(K.length){case 3:for(var st=0;st<3;++st)for(var ot=K[st],ct=b[ot],X=0;X<3;++X)if(isNaN(ct[X])||!isFinite(ct[X]))continue t;for(var st=0;st<3;++st){var ot=K[2-st],ct=b[ot];P.push(ct[0],ct[1],ct[2],ct[3]);var Q=_[ot];L.push(Q[0],Q[1],Q[2],Q[3]||0);var ut=I;ut.length===3?D.push(ut[0],ut[1],ut[2],1):D.push(ut[0],ut[1],ut[2],ut[3]);var J;F?J=[(F[ot]-N)/(j-N),0]:J=[(ct[2]-N)/(j-N),0],B.push(J[0],J[1]),R.push(G)}et+=1;break}}this.triangleCount=et,this.trianglePositions.update(P),this.triangleVectors.update(L),this.triangleColors.update(D),this.triangleUVs.update(B),this.triangleIds.update(new Uint32Array(R))}},l.drawTransparent=l.draw=function(T){T=T||{};for(var c=this.gl,h=T.model||m,b=T.view||m,_=T.projection||m,P=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)P[0][L]=Math.max(P[0][L],this.clipBounds[0][L]),P[1][L]=Math.min(P[1][L],this.clipBounds[1][L]);var D={model:h,view:b,projection:_,inverseModel:m.slice(),clipBounds:P,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};D.inverseModel=f(D.inverseModel,D.model),c.disable(c.CULL_FACE),this.texture.bind(0);var B=new Array(16);s(B,D.view,D.model),s(B,D.projection,B),f(B,B);for(var L=0;L<3;++L)D.eyePosition[L]=B[12+L]/B[15];for(var R=B[15],L=0;L<3;++L)R+=this.lightPosition[L]*B[4*L+3];for(var L=0;L<3;++L){for(var I=B[12+L],F=0;F<3;++F)I+=B[4*F+L]*this.lightPosition[F];D.lightPosition[L]=I/R}if(this.triangleCount>0){var N=this.triShader;N.bind(),N.uniforms=D,this.triangleVAO.bind(),c.drawArrays(c.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(T){T=T||{};for(var c=this.gl,h=T.model||m,b=T.view||m,_=T.projection||m,P=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)P[0][L]=Math.max(P[0][L],this.clipBounds[0][L]),P[1][L]=Math.min(P[1][L],this.clipBounds[1][L]);this._model=[].slice.call(h),this._view=[].slice.call(b),this._projection=[].slice.call(_),this._resolution=[c.drawingBufferWidth,c.drawingBufferHeight];var D={model:h,view:b,projection:_,clipBounds:P,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},B=this.pickShader;B.bind(),B.uniforms=D,this.triangleCount>0&&(this.triangleVAO.bind(),c.drawArrays(c.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(T){if(!T||T.id!==this.pickId)return null;var c=T.value[0]+256*T.value[1]+65536*T.value[2],h=this.cells[c],b=this.positions[h[1]].slice(0,3),_={position:b,dataCoordinate:b,index:Math.floor(h[1]/48)};return this.traceType==="cone"?_.index=Math.floor(h[1]/48):this.traceType==="streamtube"&&(_.intensity=this.intensity[h[1]],_.velocity=this.vectors[h[1]].slice(0,3),_.divergence=this.vectors[h[1]][3],_.index=c),_},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(T,c){var h=i(T,c.meshShader.vertex,c.meshShader.fragment,null,c.meshShader.attributes);return h.attributes.position.location=0,h.attributes.color.location=2,h.attributes.uv.location=3,h.attributes.vector.location=4,h}function k(T,c){var h=i(T,c.pickShader.vertex,c.pickShader.fragment,null,c.pickShader.attributes);return h.attributes.position.location=0,h.attributes.id.location=1,h.attributes.vector.location=4,h}function M(T,c,h){var b=h.shaders;arguments.length===1&&(c=T,T=c.gl);var _=S(T,b),P=k(T,b),L=a(T,v(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=T.LINEAR_MIPMAP_LINEAR,L.magFilter=T.LINEAR;var D=n(T),B=n(T),R=n(T),I=n(T),F=n(T),N=o(T,[{buffer:D,type:T.FLOAT,size:4},{buffer:F,type:T.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:R,type:T.FLOAT,size:4},{buffer:I,type:T.FLOAT,size:2},{buffer:B,type:T.FLOAT,size:4}]),j=new w(T,L,_,P,D,B,F,R,I,N,h.traceType||"cone");return j.update(c),j}t.exports=M},9127:function(t,e,r){t.exports=o;var i=r(6204),n=r(5771);function o(a){return n(i(a))}},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}},9165:function(t,e,r){t.exports=w;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,y,S){this.gl=l,this.shader=S,this.buffer=x,this.vao=y,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 f=s.prototype;f.isOpaque=function(){return!this.hasAlpha},f.isTransparent=function(){return this.hasAlpha},f.drawTransparent=f.draw=function(l){var x=this.gl,y=this.shader.uniforms;this.shader.bind();var S=y.view=l.view||a,k=y.projection=l.projection||a;y.model=l.model||a,y.clipBounds=this.clipBounds,y.opacity=this.opacity;var M=S[12],T=S[13],c=S[14],h=S[15],b=l._ortho||!1,_=b?2:1,P=_*this.pixelRatio*(k[3]*M+k[7]*T+k[11]*c+k[15]*h)/x.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)x.lineWidth(this.lineWidth[L]*this.pixelRatio),y.capSize=this.capSize[L]*P,this.lineCount[L]&&x.drawArrays(x.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function v(l,x){for(var y=0;y<3;++y)l[0][y]=Math.min(l[0][y],x[y]),l[1][y]=Math.max(l[1][y],x[y])}var g=function(){for(var l=new Array(3),x=0;x<3;++x){for(var y=[],S=1;S<=2;++S)for(var k=-1;k<=1;k+=2){var M=(S+x)%3,T=[0,0,0];T[M]=k,y.push(T)}l[x]=y}return l}();function m(l,x,y,S){for(var k=g[S],M=0;M<k.length;++M){var T=k[M];l.push(x[0],x[1],x[2],y[0],y[1],y[2],y[3],T[0],T[1],T[2])}return k.length}f.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]],y=l.position,S=l.error;if(Array.isArray(x[0])||(x=[x,x,x]),y&&S){var k=[],M=y.length,T=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=T;t:for(var h=0;h<M;++h){for(var b=y[h],_=0;_<3;++_)if(isNaN(b[_])||!isFinite(b[_]))continue t;var P=S[h],L=x[c];if(Array.isArray(L[0])&&(L=x[h]),L.length===3?L=[L[0],L[1],L[2],1]:L.length===4&&(L=[L[0],L[1],L[2],L[3]],!this.hasAlpha&&L[3]<1&&(this.hasAlpha=!0)),!(isNaN(P[0][c])||isNaN(P[1][c]))){if(P[0][c]<0){var D=b.slice();D[c]+=P[0][c],k.push(b[0],b[1],b[2],L[0],L[1],L[2],L[3],0,0,0,D[0],D[1],D[2],L[0],L[1],L[2],L[3],0,0,0),v(this.bounds,D),T+=2+m(k,D,L,c)}if(P[1][c]>0){var D=b.slice();D[c]+=P[1][c],k.push(b[0],b[1],b[2],L[0],L[1],L[2],L[3],0,0,0,D[0],D[1],D[2],L[0],L[1],L[2],L[3],0,0,0),v(this.bounds,D),T+=2+m(k,D,L,c)}}}this.lineCount[c]=T-this.lineOffset[c]}this.buffer.update(k)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function w(l){var x=l.gl,y=i(x),S=n(x,[{buffer:y,type:x.FLOAT,size:3,offset:0,stride:40},{buffer:y,type:x.FLOAT,size:4,offset:12,stride:40},{buffer:y,type:x.FLOAT,size:3,offset:28,stride:40}]),k=o(x);k.attributes.position.location=0,k.attributes.color.location=1,k.attributes.offset.location=2;var M=new s(x,y,S,k);return M.update(l),M}},9215:function(t,e,r){t.exports=v;var i=r(4769),n=r(2478);function o(g,m,w){return Math.min(m,Math.max(g,w))}function a(g,m,w){this.dimension=g.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=g.slice().reverse(),this._velocity=m.slice().reverse(),this._time=[w],this._scratch=[g.slice(),g.slice(),g.slice(),g.slice(),g.slice()]}var s=a.prototype;s.flush=function(g){var m=n.gt(this._time,g)-1;m<=0||(this._time.splice(0,m),this._state.splice(0,m*this.dimension),this._velocity.splice(0,m*this.dimension))},s.curve=function(g){var m=this._time,w=m.length,l=n.le(m,g),x=this._scratch[0],y=this._state,S=this._velocity,k=this.dimension,M=this.bounds;if(l<0)for(var T=k-1,c=0;c<k;++c,--T)x[c]=y[T];else if(l>=w-1)for(var T=y.length-1,h=g-m[w-1],c=0;c<k;++c,--T)x[c]=y[T]+h*S[T];else{for(var T=k*(l+1)-1,b=m[l],_=m[l+1],P=_-b||1,L=this._scratch[1],D=this._scratch[2],B=this._scratch[3],R=this._scratch[4],I=!0,c=0;c<k;++c,--T)L[c]=y[T],B[c]=S[T]*P,D[c]=y[T+k],R[c]=S[T+k]*P,I=I&&L[c]===D[c]&&B[c]===R[c]&&B[c]===0;if(I)for(var c=0;c<k;++c)x[c]=L[c];else i(L,B,D,R,(g-b)/P,x)}for(var F=M[0],N=M[1],c=0;c<k;++c)x[c]=o(F[c],N[c],x[c]);return x},s.dcurve=function(g){var m=this._time,w=m.length,l=n.le(m,g),x=this._scratch[0],y=this._state,S=this._velocity,k=this.dimension;if(l>=w-1)for(var M=y.length-1,T=g-m[w-1],c=0;c<k;++c,--M)x[c]=S[M];else{for(var M=k*(l+1)-1,h=m[l],b=m[l+1],_=b-h||1,P=this._scratch[1],L=this._scratch[2],D=this._scratch[3],B=this._scratch[4],R=!0,c=0;c<k;++c,--M)P[c]=y[M],D[c]=S[M]*_,L[c]=y[M+k],B[c]=S[M+k]*_,R=R&&P[c]===L[c]&&D[c]===B[c]&&D[c]===0;if(R)for(var c=0;c<k;++c)x[c]=0;else{i.derivative(P,D,L,B,(g-h)/_,x);for(var c=0;c<k;++c)x[c]/=_}}return x},s.lastT=function(){var g=this._time;return g[g.length-1]},s.stable=function(){for(var g=this._velocity,m=g.length,w=this.dimension-1;w>=0;--w)if(g[--m])return!1;return!0},s.jump=function(g){var m=this.lastT(),w=this.dimension;if(!(g<m||arguments.length!==w+1)){var l=this._state,x=this._velocity,y=l.length-this.dimension,S=this.bounds,k=S[0],M=S[1];this._time.push(m,g);for(var T=0;T<2;++T)for(var c=0;c<w;++c)l.push(l[y++]),x.push(0);this._time.push(g);for(var c=w;c>0;--c)l.push(o(k[c-1],M[c-1],arguments[c])),x.push(0)}},s.push=function(g){var m=this.lastT(),w=this.dimension;if(!(g<m||arguments.length!==w+1)){var l=this._state,x=this._velocity,y=l.length-this.dimension,S=g-m,k=this.bounds,M=k[0],T=k[1],c=S>1e-6?1/S:0;this._time.push(g);for(var h=w;h>0;--h){var b=o(M[h-1],T[h-1],arguments[h]);l.push(b),x.push((b-l[y++])*c)}}},s.set=function(g){var m=this.dimension;if(!(g<this.lastT()||arguments.length!==m+1)){var w=this._state,l=this._velocity,x=this.bounds,y=x[0],S=x[1];this._time.push(g);for(var k=m;k>0;--k)w.push(o(y[k-1],S[k-1],arguments[k])),l.push(0)}},s.move=function(g){var m=this.lastT(),w=this.dimension;if(!(g<=m||arguments.length!==w+1)){var l=this._state,x=this._velocity,y=l.length-this.dimension,S=this.bounds,k=S[0],M=S[1],T=g-m,c=T>1e-6?1/T:0;this._time.push(g);for(var h=w;h>0;--h){var b=arguments[h];l.push(o(k[h-1],M[h-1],l[y++]+b)),x.push(b*c)}}},s.idle=function(g){var m=this.lastT();if(!(g<m)){var w=this.dimension,l=this._state,x=this._velocity,y=l.length-w,S=this.bounds,k=S[0],M=S[1],T=g-m;this._time.push(g);for(var c=w-1;c>=0;--c)l.push(o(k[c],M[c],l[y]+T*x[y])),x.push(0),y+=1}};function f(g){for(var m=new Array(g),w=0;w<g;++w)m[w]=0;return m}function v(g,m,w){switch(arguments.length){case 0:return new a([0],[0],0);case 1:if(typeof g=="number"){var l=f(g);return new a(l,l,0)}else return new a(g,f(g.length),0);case 2:if(typeof m=="number"){var l=f(g.length);return new a(g,l,+m)}else w=0;case 3:if(g.length!==m.length)throw new Error("state and velocity lengths must match");return new a(g,m,w)}}},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}},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}},9265:function(t){t.exports=e;function e(r,i){return r[0]===i[0]&&r[1]===i[1]&&r[2]===i[2]}},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}},9346:function(t){var e=new Float64Array(4),r=new Float64Array(4),i=new Float64Array(4);function n(o,a,s,f,v){e.length<f.length&&(e=new Float64Array(f.length),r=new Float64Array(f.length),i=new Float64Array(f.length));for(var g=0;g<f.length;++g)e[g]=o[g]-f[g],r[g]=a[g]-o[g],i[g]=s[g]-o[g];for(var m=0,w=0,l=0,x=0,y=0,S=0,g=0;g<f.length;++g){var k=r[g],M=i[g],T=e[g];m+=k*k,w+=k*M,l+=M*M,x+=T*k,y+=T*M,S+=T*T}var c=Math.abs(m*l-w*w),h=w*y-l*x,b=w*x-m*y,_;if(h+b<=c)if(h<0)b<0&&x<0?(b=0,-x>=m?(h=1,_=m+2*x+S):(h=-x/m,_=x*h+S)):(h=0,y>=0?(b=0,_=S):-y>=l?(b=1,_=l+2*y+S):(b=-y/l,_=y*b+S));else if(b<0)b=0,x>=0?(h=0,_=S):-x>=m?(h=1,_=m+2*x+S):(h=-x/m,_=x*h+S);else{var P=1/c;h*=P,b*=P,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S}else{var L,D,B,R;h<0?(L=w+x,D=l+y,D>L?(B=D-L,R=m-2*w+l,B>=R?(h=1,b=0,_=m+2*x+S):(h=B/R,b=1-h,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S)):(h=0,D<=0?(b=1,_=l+2*y+S):y>=0?(b=0,_=S):(b=-y/l,_=y*b+S))):b<0?(L=w+y,D=m+x,D>L?(B=D-L,R=m-2*w+l,B>=R?(b=1,h=0,_=l+2*y+S):(b=B/R,h=1-b,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S)):(b=0,D<=0?(h=1,_=m+2*x+S):x>=0?(h=0,_=S):(h=-x/m,_=x*h+S))):(B=l+y-w-x,B<=0?(h=0,b=1,_=l+2*y+S):(R=m-2*w+l,B>=R?(h=1,b=0,_=m+2*x+S):(h=B/R,b=1-h,_=h*(m*h+w*b+2*x)+b*(w*h+l*b+2*y)+S)))}for(var I=1-h-b,g=0;g<f.length;++g)v[g]=I*o[g]+h*a[g]+b*s[g];return _<0?0:_}t.exports=n},9362:function(t){t.exports=e;function e(r,i,n){var o=r+i,a=o-r,s=o-a,f=i-a,v=r-s;return n?(n[0]=v+f,n[1]=o,n):[v+f,o]}},9366:function(t,e,r){var i=r(4359);t.exports=o;var n={};function o(a,s,f){var v=[s.style,s.weight,s.variant,s.family].join("_"),g=n[v];if(g||(g=n[v]={}),a in g)return g[a];var m={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}};m.triangles=!0;var w=i(a,m);m.triangles=!1;var l=i(a,m),x,y;if(f&&f!==1){for(x=0;x<w.positions.length;++x)for(y=0;y<w.positions[x].length;++y)w.positions[x][y]/=f;for(x=0;x<l.positions.length;++x)for(y=0;y<l.positions[x].length;++y)l.positions[x][y]/=f}var S=[[1/0,1/0],[-1/0,-1/0]],k=l.positions.length;for(x=0;x<k;++x){var M=l.positions[x];for(y=0;y<2;++y)S[0][y]=Math.min(S[0][y],M[y]),S[1][y]=Math.max(S[1][y],M[y])}return g[a]=[w,l,S]}},9405:function(t,e,r){var i=r(3327),n=r(8731),o=r(216),a=r(5091),s=r(2145),f=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 g=v.prototype;g.bind=function(){this.program||this._relink();var l,x=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),y=this.gl.lastAttribCount;if(x>y)for(l=y;l<x;l++)this.gl.enableVertexAttribArray(l);else if(y>x)for(l=x;l<y;l++)this.gl.disableVertexAttribArray(l);this.gl.lastAttribCount=x,this.gl.useProgram(this.program)},g.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 m(l,x){return l.name<x.name?-1:1}g.update=function(l,x,y,S){if(!x||arguments.length===1){var k=l;l=k.vertex,x=k.fragment,y=k.uniforms,S=k.attributes}var M=this,T=M.gl,c=M._vref;M._vref=a.shader(T,T.VERTEX_SHADER,l),c&&c.dispose(),M.vertShader=M._vref.shader;var h=this._fref;if(M._fref=a.shader(T,T.FRAGMENT_SHADER,x),h&&h.dispose(),M.fragShader=M._fref.shader,!y||!S){var b=T.createProgram();if(T.attachShader(b,M.fragShader),T.attachShader(b,M.vertShader),T.linkProgram(b),!T.getProgramParameter(b,T.LINK_STATUS)){var _=T.getProgramInfoLog(b);throw new f(_,"Error linking program:"+_)}y=y||s.uniforms(T,b),S=S||s.attributes(T,b),T.deleteProgram(b)}S=S.slice(),S.sort(m);var P=[],L=[],D=[],B;for(B=0;B<S.length;++B){var R=S[B];if(R.type.indexOf("mat")>=0){for(var I=R.type.charAt(R.type.length-1)|0,F=new Array(I),N=0;N<I;++N)F[N]=D.length,L.push(R.name+"["+N+"]"),typeof R.location=="number"?D.push(R.location+N):Array.isArray(R.location)&&R.location.length===I&&typeof R.location[N]=="number"?D.push(R.location[N]|0):D.push(-1);P.push({name:R.name,type:R.type,locations:F})}else P.push({name:R.name,type:R.type,locations:[D.length]}),L.push(R.name),typeof R.location=="number"?D.push(R.location|0):D.push(-1)}var j=0;for(B=0;B<D.length;++B)if(D[B]<0){for(;D.indexOf(j)>=0;)j+=1;D[B]=j}var G=new Array(y.length);function rt(){M.program=a.program(T,M._vref,M._fref,L,D);for(var ct=0;ct<y.length;++ct)G[ct]=T.getUniformLocation(M.program,y[ct].name)}rt(),M._relink=rt,M.types={uniforms:o(y),attributes:o(S)},M.attributes=n(T,M,P,D),Object.defineProperty(M,"uniforms",i(T,M,y,G))};function w(l,x,y,S,k){var M=new v(l);return M.update(x,y,S,k),M}t.exports=w},9499:function(t,e,r){t.exports=ut;var i=r(8828),n=r(2762),o=r(8116),a=r(7766),s=r(1888),f=r(6729),v=r(5298),g=r(9994),m=r(9618),w=r(3711),l=r(6760),x=r(7608),y=r(2478),S=r(6199),k=r(990),M=k.createShader,T=k.createContourShader,c=k.createPickShader,h=k.createPickContourShader,b=40,_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],L=[[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 J=0;J<3;++J){var q=L[J],it=(J+1)%3,nt=(J+2)%3;q[it+0]=1,q[nt+3]=1,q[J+6]=1}})();function D(J,q,it,nt,dt){this.position=J,this.index=q,this.uv=it,this.level=nt,this.dataCoordinate=dt}var B=256;function R(J,q,it,nt,dt,Tt,wt,It,Ct,Nt,ee,Jt,te,Kt,mt){this.gl=J,this.shape=q,this.bounds=it,this.objectOffset=mt,this.intensityBounds=[],this._shader=nt,this._pickShader=dt,this._coordinateBuffer=Tt,this._vao=wt,this._colorMap=It,this._contourShader=Ct,this._contourPickShader=Nt,this._contourBuffer=ee,this._contourVAO=Jt,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new D([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=te,this._dynamicVAO=Kt,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=[m(s.mallocFloat(1024),[0,0]),m(s.mallocFloat(1024),[0,0]),m(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 I=R.prototype;I.genColormap=function(J,q){var it=!1,nt=g([f({colormap:J,nshades:B,format:"rgba"}).map(function(dt,Tt){var wt=q?F(Tt/255,q):dt[3];return wt<1&&(it=!0),[dt[0],dt[1],dt[2],255*wt]})]);return v.divseq(nt,255),this.hasAlphaScale=it,nt},I.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},I.isOpaque=function(){return!this.isTransparent()},I.pickSlots=1,I.setPickBase=function(J){this.pickId=J};function F(J,q){if(!q||!q.length)return 1;for(var it=0;it<q.length;++it){if(q.length<2)return 1;if(q[it][0]===J)return q[it][1];if(q[it][0]>J&&it>0){var nt=(q[it][0]-J)/(q[it][0]-q[it-1][0]);return q[it][1]*(1-nt)+nt*q[it-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(J,q){var it,nt,dt,Tt=q.axes&&q.axes.lastCubeProps.axis||N,wt=q.showSurface,It=q.showContour;for(it=0;it<3;++it)for(wt=wt||q.surfaceProject[it],nt=0;nt<3;++nt)It=It||q.contourProject[it][nt];for(it=0;it<3;++it){var Ct=j.projections[it];for(nt=0;nt<16;++nt)Ct[nt]=0;for(nt=0;nt<4;++nt)Ct[5*nt]=1;Ct[5*it]=0,Ct[12+it]=q.axesBounds[+(Tt[it]>0)][it],l(Ct,J.model,Ct);var Nt=j.clipBounds[it];for(dt=0;dt<2;++dt)for(nt=0;nt<3;++nt)Nt[dt][nt]=J.clipBounds[dt][nt];Nt[0][it]=-1e8,Nt[1][it]=1e8}return j.showSurface=wt,j.showContour=It,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(),st=[1,0,0,0,1,0,0,0,1];function et(J,q){J=J||{};var it=this.gl;it.disable(it.CULL_FACE),this._colorMap.bind(0);var nt=rt;nt.model=J.model||_,nt.view=J.view||_,nt.projection=J.projection||_,nt.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],nt.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],nt.objectOffset=this.objectOffset,nt.contourColor=this.contourColor[0],nt.inverseModel=x(nt.inverseModel,nt.model);for(var dt=0;dt<2;++dt)for(var Tt=nt.clipBounds[dt],wt=0;wt<3;++wt)Tt[wt]=Math.min(Math.max(this.clipBounds[dt][wt],-1e8),1e8);nt.kambient=this.ambientLight,nt.kdiffuse=this.diffuseLight,nt.kspecular=this.specularLight,nt.roughness=this.roughness,nt.fresnel=this.fresnel,nt.opacity=this.opacity,nt.height=0,nt.permutation=st,nt.vertexColor=this.vertexColor;var It=ct;for(l(It,nt.view,nt.model),l(It,nt.projection,It),x(It,It),dt=0;dt<3;++dt)nt.eyePosition[dt]=It[12+dt]/It[15];var Ct=It[15];for(dt=0;dt<3;++dt)Ct+=this.lightPosition[dt]*It[4*dt+3];for(dt=0;dt<3;++dt){var Nt=It[12+dt];for(wt=0;wt<3;++wt)Nt+=It[4*wt+dt]*this.lightPosition[wt];nt.lightPosition[dt]=Nt/Ct}var ee=G(nt,this);if(ee.showSurface){for(this._shader.bind(),this._shader.uniforms=nt,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(it.TRIANGLES,this._vertexCount),dt=0;dt<3;++dt)!this.surfaceProject[dt]||!this.vertexCount||(this._shader.uniforms.model=ee.projections[dt],this._shader.uniforms.clipBounds=ee.clipBounds[dt],this._vao.draw(it.TRIANGLES,this._vertexCount));this._vao.unbind()}if(ee.showContour){var Jt=this._contourShader;nt.kambient=1,nt.kdiffuse=0,nt.kspecular=0,nt.opacity=1,Jt.bind(),Jt.uniforms=nt;var te=this._contourVAO;for(te.bind(),dt=0;dt<3;++dt)for(Jt.uniforms.permutation=L[dt],it.lineWidth(this.contourWidth[dt]*this.pixelRatio),wt=0;wt<this.contourLevels[dt].length;++wt)wt===this.highlightLevel[dt]?(Jt.uniforms.contourColor=this.highlightColor[dt],Jt.uniforms.contourTint=this.highlightTint[dt]):(wt===0||wt-1===this.highlightLevel[dt])&&(Jt.uniforms.contourColor=this.contourColor[dt],Jt.uniforms.contourTint=this.contourTint[dt]),this._contourCounts[dt][wt]&&(Jt.uniforms.height=this.contourLevels[dt][wt],te.draw(it.LINES,this._contourCounts[dt][wt],this._contourOffsets[dt][wt]));for(dt=0;dt<3;++dt)for(Jt.uniforms.model=ee.projections[dt],Jt.uniforms.clipBounds=ee.clipBounds[dt],wt=0;wt<3;++wt)if(this.contourProject[dt][wt]){Jt.uniforms.permutation=L[wt],it.lineWidth(this.contourWidth[wt]*this.pixelRatio);for(var Kt=0;Kt<this.contourLevels[wt].length;++Kt)Kt===this.highlightLevel[wt]?(Jt.uniforms.contourColor=this.highlightColor[wt],Jt.uniforms.contourTint=this.highlightTint[wt]):(Kt===0||Kt-1===this.highlightLevel[wt])&&(Jt.uniforms.contourColor=this.contourColor[wt],Jt.uniforms.contourTint=this.contourTint[wt]),this._contourCounts[wt][Kt]&&(Jt.uniforms.height=this.contourLevels[wt][Kt],te.draw(it.LINES,this._contourCounts[wt][Kt],this._contourOffsets[wt][Kt]))}for(te.unbind(),te=this._dynamicVAO,te.bind(),dt=0;dt<3;++dt)if(this._dynamicCounts[dt]!==0)for(Jt.uniforms.model=nt.model,Jt.uniforms.clipBounds=nt.clipBounds,Jt.uniforms.permutation=L[dt],it.lineWidth(this.dynamicWidth[dt]*this.pixelRatio),Jt.uniforms.contourColor=this.dynamicColor[dt],Jt.uniforms.contourTint=this.dynamicTint[dt],Jt.uniforms.height=this.dynamicLevel[dt],te.draw(it.LINES,this._dynamicCounts[dt],this._dynamicOffsets[dt]),wt=0;wt<3;++wt)this.contourProject[wt][dt]&&(Jt.uniforms.model=ee.projections[wt],Jt.uniforms.clipBounds=ee.clipBounds[wt],te.draw(it.LINES,this._dynamicCounts[dt],this._dynamicOffsets[dt]));te.unbind()}}I.draw=function(J){return et.call(this,J,!1)},I.drawTransparent=function(J){return et.call(this,J,!0)};var K={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]};I.drawPick=function(J){J=J||{};var q=this.gl;q.disable(q.CULL_FACE);var it=K;it.model=J.model||_,it.view=J.view||_,it.projection=J.projection||_,it.shape=this._field[2].shape,it.pickId=this.pickId/255,it.lowerBound=this.bounds[0],it.upperBound=this.bounds[1],it.objectOffset=this.objectOffset,it.permutation=st;for(var nt=0;nt<2;++nt)for(var dt=it.clipBounds[nt],Tt=0;Tt<3;++Tt)dt[Tt]=Math.min(Math.max(this.clipBounds[nt][Tt],-1e8),1e8);var wt=G(it,this);if(wt.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=it,this._vao.bind(),this._vao.draw(q.TRIANGLES,this._vertexCount),nt=0;nt<3;++nt)this.surfaceProject[nt]&&(this._pickShader.uniforms.model=wt.projections[nt],this._pickShader.uniforms.clipBounds=wt.clipBounds[nt],this._vao.draw(q.TRIANGLES,this._vertexCount));this._vao.unbind()}if(wt.showContour){var It=this._contourPickShader;It.bind(),It.uniforms=it;var Ct=this._contourVAO;for(Ct.bind(),Tt=0;Tt<3;++Tt)for(q.lineWidth(this.contourWidth[Tt]*this.pixelRatio),It.uniforms.permutation=L[Tt],nt=0;nt<this.contourLevels[Tt].length;++nt)this._contourCounts[Tt][nt]&&(It.uniforms.height=this.contourLevels[Tt][nt],Ct.draw(q.LINES,this._contourCounts[Tt][nt],this._contourOffsets[Tt][nt]));for(nt=0;nt<3;++nt)for(It.uniforms.model=wt.projections[nt],It.uniforms.clipBounds=wt.clipBounds[nt],Tt=0;Tt<3;++Tt)if(this.contourProject[nt][Tt]){It.uniforms.permutation=L[Tt],q.lineWidth(this.contourWidth[Tt]*this.pixelRatio);for(var Nt=0;Nt<this.contourLevels[Tt].length;++Nt)this._contourCounts[Tt][Nt]&&(It.uniforms.height=this.contourLevels[Tt][Nt],Ct.draw(q.LINES,this._contourCounts[Tt][Nt],this._contourOffsets[Tt][Nt]))}Ct.unbind()}},I.pick=function(J){if(!J||J.id!==this.pickId)return null;var q=this._field[2].shape,it=this._pickResult,nt=q[0]*(J.value[0]+(J.value[2]>>4)/16)/255,dt=Math.floor(nt),Tt=nt-dt,wt=q[1]*(J.value[1]+(J.value[2]&15)/16)/255,It=Math.floor(wt),Ct=wt-It;dt+=1,It+=1;var Nt=it.position;Nt[0]=Nt[1]=Nt[2]=0;for(var ee=0;ee<2;++ee)for(var Jt=ee?Tt:1-Tt,te=0;te<2;++te)for(var Kt=te?Ct:1-Ct,mt=dt+ee,bt=It+te,vt=Jt*Kt,Ut=0;Ut<3;++Ut)Nt[Ut]+=this._field[Ut].get(mt,bt)*vt;for(var re=this._pickResult.level,Zt=0;Zt<3;++Zt)if(re[Zt]=y.le(this.contourLevels[Zt],Nt[Zt]),re[Zt]<0)this.contourLevels[Zt].length>0&&(re[Zt]=0);else if(re[Zt]<this.contourLevels[Zt].length-1){var ue=this.contourLevels[Zt][re[Zt]],Me=this.contourLevels[Zt][re[Zt]+1];Math.abs(ue-Nt[Zt])>Math.abs(Me-Nt[Zt])&&(re[Zt]+=1)}for(it.index[0]=Tt<.5?dt:dt+1,it.index[1]=Ct<.5?It:It+1,it.uv[0]=nt/q[0],it.uv[1]=wt/q[1],Ut=0;Ut<3;++Ut)it.dataCoordinate[Ut]=this._field[Ut].get(it.index[0],it.index[1]);return it},I.padField=function(J,q){var it=q.shape.slice(),nt=J.shape.slice();v.assign(J.lo(1,1).hi(it[0],it[1]),q),v.assign(J.lo(1).hi(it[0],1),q.hi(it[0],1)),v.assign(J.lo(1,nt[1]-1).hi(it[0],1),q.lo(0,it[1]-1).hi(it[0],1)),v.assign(J.lo(0,1).hi(1,it[1]),q.hi(1)),v.assign(J.lo(nt[0]-1,1).hi(1,it[1]),q.lo(it[0]-1)),J.set(0,0,q.get(0,0)),J.set(0,nt[1]-1,q.get(0,it[1]-1)),J.set(nt[0]-1,0,q.get(it[0]-1,0)),J.set(nt[0]-1,nt[1]-1,q.get(it[0]-1,it[1]-1))};function ot(J,q){return Array.isArray(J)?[q(J[0]),q(J[1]),q(J[2])]:[q(J),q(J),q(J)]}function X(J){return Array.isArray(J)?J.length===3?[J[0],J[1],J[2],1]:[J[0],J[1],J[2],J[3]]:[0,0,0,1]}function Q(J){if(Array.isArray(J)){if(Array.isArray(J))return[X(J[0]),X(J[1]),X(J[2])];var q=X(J);return[q.slice(),q.slice(),q.slice()]}}I.update=function(J){J=J||{},this.objectOffset=J.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in J&&(this.contourWidth=ot(J.contourWidth,Number)),"showContour"in J&&(this.showContour=ot(J.showContour,Boolean)),"showSurface"in J&&(this.showSurface=!!J.showSurface),"contourTint"in J&&(this.contourTint=ot(J.contourTint,Boolean)),"contourColor"in J&&(this.contourColor=Q(J.contourColor)),"contourProject"in J&&(this.contourProject=ot(J.contourProject,function(ia){return ot(ia,Boolean)})),"surfaceProject"in J&&(this.surfaceProject=J.surfaceProject),"dynamicColor"in J&&(this.dynamicColor=Q(J.dynamicColor)),"dynamicTint"in J&&(this.dynamicTint=ot(J.dynamicTint,Number)),"dynamicWidth"in J&&(this.dynamicWidth=ot(J.dynamicWidth,Number)),"opacity"in J&&(this.opacity=J.opacity),"opacityscale"in J&&(this.opacityscale=J.opacityscale),"colorBounds"in J&&(this.colorBounds=J.colorBounds),"vertexColor"in J&&(this.vertexColor=J.vertexColor?1:0),"colormap"in J&&this._colorMap.setPixels(this.genColormap(J.colormap,this.opacityscale));var q=J.field||J.coords&&J.coords[2]||null,it=!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 J||"coords"in J){var nt=(q.shape[0]+2)*(q.shape[1]+2);nt>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(i.nextPow2(nt))),this._field[2]=m(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,Tt=0;Tt<2;++Tt)this._field[2].size>this._field[Tt].data.length&&(s.freeFloat(this._field[Tt].data),this._field[Tt].data=s.mallocFloat(this._field[2].size)),this._field[Tt]=m(this._field[Tt].data,[dt[0]+2,dt[1]+2]);if(J.coords){var wt=J.coords;if(!Array.isArray(wt)||wt.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Tt=0;Tt<2;++Tt){var It=wt[Tt];for(te=0;te<2;++te)if(It.shape[te]!==dt[te])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Tt],It)}}else if(J.ticks){var Ct=J.ticks;if(!Array.isArray(Ct)||Ct.length!==2)throw new Error("gl-surface: invalid ticks");for(Tt=0;Tt<2;++Tt){var Nt=Ct[Tt];if((Array.isArray(Nt)||Nt.length)&&(Nt=m(Nt)),Nt.shape[0]!==dt[Tt])throw new Error("gl-surface: invalid tick length");var ee=m(Nt.data,dt);ee.stride[Tt]=Nt.stride[0],ee.stride[Tt^1]=0,this.padField(this._field[Tt],ee)}}else{for(Tt=0;Tt<2;++Tt){var Jt=[0,0];Jt[Tt]=1,this._field[Tt]=m(this._field[Tt].data,[dt[0]+2,dt[1]+2],Jt,0)}this._field[0].set(0,0,0);for(var te=0;te<dt[0];++te)this._field[0].set(te+1,0,te);for(this._field[0].set(dt[0]+1,0,dt[0]-1),this._field[1].set(0,0,0),te=0;te<dt[1];++te)this._field[1].set(0,te+1,te);this._field[1].set(0,dt[1]+1,dt[1]-1)}var Kt=this._field,mt=m(s.mallocFloat(Kt[2].size*3*2),[3,dt[0]+2,dt[1]+2,2]);for(Tt=0;Tt<3;++Tt)S(mt.pick(Tt),Kt[Tt],"mirror");var bt=m(s.mallocFloat(Kt[2].size*3),[dt[0]+2,dt[1]+2,3]);for(Tt=0;Tt<dt[0]+2;++Tt)for(te=0;te<dt[1]+2;++te){var vt=mt.get(0,Tt,te,0),Ut=mt.get(0,Tt,te,1),re=mt.get(1,Tt,te,0),Zt=mt.get(1,Tt,te,1),ue=mt.get(2,Tt,te,0),Me=mt.get(2,Tt,te,1),Ce=re*Me-Zt*ue,We=ue*Ut-Me*vt,qe=vt*Zt-Ut*re,vr=Math.sqrt(Ce*Ce+We*We+qe*qe);vr<1e-8?(vr=Math.max(Math.abs(Ce),Math.abs(We),Math.abs(qe)),vr<1e-8?(qe=1,We=Ce=0,vr=1):vr=1/vr):vr=1/Math.sqrt(vr),bt.set(Tt,te,0,Ce*vr),bt.set(Tt,te,1,We*vr),bt.set(Tt,te,2,qe*vr)}s.free(mt.data);var _r=[1/0,1/0,1/0],er=[-1/0,-1/0,-1/0],Mr=1/0,Ir=-1/0,de=(dt[0]-1)*(dt[1]-1)*6,Dt=s.mallocFloat(i.nextPow2(10*de)),qt=0,_t=0;for(Tt=0;Tt<dt[0]-1;++Tt)t:for(te=0;te<dt[1]-1;++te){for(var lt=0;lt<2;++lt)for(var yt=0;yt<2;++yt)for(var St=0;St<3;++St){var Ht=this._field[St].get(1+Tt+lt,1+te+yt);if(isNaN(Ht)||!isFinite(Ht))continue t}for(St=0;St<6;++St){var Yt=Tt+P[St][0],se=te+P[St][1],ke=this._field[0].get(Yt+1,se+1),Ee=this._field[1].get(Yt+1,se+1);Ht=this._field[2].get(Yt+1,se+1),Ce=bt.get(Yt+1,se+1,0),We=bt.get(Yt+1,se+1,1),qe=bt.get(Yt+1,se+1,2),J.intensity&&(Ue=J.intensity.get(Yt,se));var Ue=J.intensity?J.intensity.get(Yt,se):Ht+this.objectOffset[2];Dt[qt++]=Yt,Dt[qt++]=se,Dt[qt++]=ke,Dt[qt++]=Ee,Dt[qt++]=Ht,Dt[qt++]=0,Dt[qt++]=Ue,Dt[qt++]=Ce,Dt[qt++]=We,Dt[qt++]=qe,_r[0]=Math.min(_r[0],ke+this.objectOffset[0]),_r[1]=Math.min(_r[1],Ee+this.objectOffset[1]),_r[2]=Math.min(_r[2],Ht+this.objectOffset[2]),Mr=Math.min(Mr,Ue),er[0]=Math.max(er[0],ke+this.objectOffset[0]),er[1]=Math.max(er[1],Ee+this.objectOffset[1]),er[2]=Math.max(er[2],Ht+this.objectOffset[2]),Ir=Math.max(Ir,Ue),_t+=1}}for(J.intensityBounds&&(Mr=+J.intensityBounds[0],Ir=+J.intensityBounds[1]),Tt=6;Tt<qt;Tt+=10)Dt[Tt]=(Dt[Tt]-Mr)/(Ir-Mr);this._vertexCount=_t,this._coordinateBuffer.update(Dt.subarray(0,qt)),s.freeFloat(Dt),s.free(bt.data),this.bounds=[_r,er],this.intensity=J.intensity||this._field[2],(this.intensityBounds[0]!==Mr||this.intensityBounds[1]!==Ir)&&(it=!0),this.intensityBounds=[Mr,Ir]}if("levels"in J){var ir=J.levels;for(Array.isArray(ir[0])?ir=ir.slice():ir=[[],[],ir],Tt=0;Tt<3;++Tt)ir[Tt]=ir[Tt].slice(),ir[Tt].sort(function(ia,Cn){return ia-Cn});for(Tt=0;Tt<3;++Tt)for(te=0;te<ir[Tt].length;++te)ir[Tt][te]-=this.objectOffset[Tt];t:for(Tt=0;Tt<3;++Tt){if(ir[Tt].length!==this.contourLevels[Tt].length){it=!0;break}for(te=0;te<ir[Tt].length;++te)if(ir[Tt][te]!==this.contourLevels[Tt][te]){it=!0;break t}}this.contourLevels=ir}if(it){Kt=this._field,dt=this.shape;for(var ar=[],Ye=0;Ye<3;++Ye){var Er=this.contourLevels[Ye],pn=[],dn=[],bn=[0,0,0];for(Tt=0;Tt<Er.length;++Tt){var Zn=w(this._field[Ye],Er[Tt]);pn.push(ar.length/5|0),_t=0;t:for(te=0;te<Zn.cells.length;++te){var En=Zn.cells[te];for(St=0;St<2;++St){var gn=Zn.positions[En[St]],da=gn[0],ra=Math.floor(da)|0,Se=da-ra,Re=gn[1],Ze=Math.floor(Re)|0,tr=Re-Ze,zr=!1;e:for(var tn=0;tn<3;++tn){bn[tn]=0;var Yr=(Ye+tn+1)%3;for(lt=0;lt<2;++lt){var $r=lt?Se:1-Se;for(Yt=Math.min(Math.max(ra+lt,0),dt[0])|0,yt=0;yt<2;++yt){var In=yt?tr:1-tr;if(se=Math.min(Math.max(Ze+yt,0),dt[1])|0,tn<2?Ht=this._field[Yr].get(Yt,se):Ht=(this.intensity.get(Yt,se)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(Ht)||isNaN(Ht)){zr=!0;break e}var Nn=$r*In;bn[tn]+=Nn*Ht}}}if(!zr)ar.push(bn[0],bn[1],gn[0],gn[1],bn[2]),_t+=1;else{if(St>0){for(var Kn=0;Kn<5;++Kn)ar.pop();_t-=1}continue t}}}dn.push(_t)}this._contourOffsets[Ye]=pn,this._contourCounts[Ye]=dn}var $n=s.mallocFloat(ar.length);for(Tt=0;Tt<ar.length;++Tt)$n[Tt]=ar[Tt];this._contourBuffer.update($n),s.freeFloat($n)}},I.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 J=0;J<3;++J)s.freeFloat(this._field[J].data)},I.highlight=function(J){var q;if(!J){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]=J.level[q]:this.highlightLevel[q]=-1;var it;for(this.snapToData?it=J.dataCoordinate:it=J.position,q=0;q<3;++q)it[q]-=this.objectOffset[q];if(!((!this.enableDynamic[0]||it[0]===this.dynamicLevel[0])&&(!this.enableDynamic[1]||it[1]===this.dynamicLevel[1])&&(!this.enableDynamic[2]||it[2]===this.dynamicLevel[2]))){for(var nt=0,dt=this.shape,Tt=s.mallocFloat(12*dt[0]*dt[1]),wt=0;wt<3;++wt){if(!this.enableDynamic[wt]){this.dynamicLevel[wt]=NaN,this._dynamicCounts[wt]=0;continue}this.dynamicLevel[wt]=it[wt];var It=(wt+1)%3,Ct=(wt+2)%3,Nt=this._field[wt],ee=this._field[It],Jt=this._field[Ct],te=w(Nt,it[wt]),Kt=te.cells,mt=te.positions;for(this._dynamicOffsets[wt]=nt,q=0;q<Kt.length;++q)for(var bt=Kt[q],vt=0;vt<2;++vt){var Ut=mt[bt[vt]],re=+Ut[0],Zt=re|0,ue=Math.min(Zt+1,dt[0])|0,Me=re-Zt,Ce=1-Me,We=+Ut[1],qe=We|0,vr=Math.min(qe+1,dt[1])|0,_r=We-qe,er=1-_r,Mr=Ce*er,Ir=Ce*_r,de=Me*er,Dt=Me*_r,qt=Mr*ee.get(Zt,qe)+Ir*ee.get(Zt,vr)+de*ee.get(ue,qe)+Dt*ee.get(ue,vr),_t=Mr*Jt.get(Zt,qe)+Ir*Jt.get(Zt,vr)+de*Jt.get(ue,qe)+Dt*Jt.get(ue,vr);if(isNaN(qt)||isNaN(_t)){vt&&(nt-=1);break}Tt[2*nt+0]=qt,Tt[2*nt+1]=_t,nt+=1}this._dynamicCounts[wt]=nt-this._dynamicOffsets[wt]}this._dynamicBuffer.update(Tt.subarray(0,2*nt)),s.freeFloat(Tt)}};function ut(J){var q=J.gl,it=M(q),nt=c(q),dt=T(q),Tt=h(q),wt=n(q),It=o(q,[{buffer:wt,size:4,stride:b,offset:0},{buffer:wt,size:3,stride:b,offset:16},{buffer:wt,size:3,stride:b,offset:28}]),Ct=n(q),Nt=o(q,[{buffer:Ct,size:4,stride:20,offset:0},{buffer:Ct,size:1,stride:20,offset:16}]),ee=n(q),Jt=o(q,[{buffer:ee,size:2,type:q.FLOAT}]),te=a(q,1,B,q.RGBA,q.UNSIGNED_BYTE);te.minFilter=q.LINEAR,te.magFilter=q.LINEAR;var Kt=new R(q,[0,0],[[0,0,0],[0,0,0]],it,nt,wt,It,te,dt,Tt,Ct,Nt,ee,Jt,[0,0,0]),mt={levels:[[],[],[]]};for(var bt in J)mt[bt]=J[bt];return mt.colormap=mt.colormap||"jet",Kt.update(mt),Kt}},9507:function(t){t.exports=!0},9618:function(t,e,r){var i=r(7163),n=typeof Float64Array<"u";function o(w,l){return w[0]-l[0]}function a(){var w=this.stride,l=new Array(w.length),x;for(x=0;x<l.length;++x)l[x]=[Math.abs(w[x]),x];l.sort(o);var y=new Array(l.length);for(x=0;x<y.length;++x)y[x]=l[x][1];return y}var s={T:function(w){function l(y){this.data=y}var x=l.prototype;return x.dtype=w,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(y){return new l(y)}},0:function(w,l){function x(S,k){this.data=S,this.offset=k}var y=x.prototype;return y.dtype=w,y.index=function(){return this.offset},y.dimension=0,y.size=1,y.shape=y.stride=y.order=[],y.lo=y.hi=y.transpose=y.step=function(){return new x(this.data,this.offset)},y.pick=function(){return l(this.data)},y.valueOf=y.get=function(){return w==="generic"?this.data.get(this.offset):this.data[this.offset]},y.set=function(S){return w==="generic"?this.data.set(this.offset,S):this.data[this.offset]=S},function(S,k,M,T){return new x(S,T)}},1:function(w,l,x){function y(k,M,T,c){this.data=k,this.shape=[M],this.stride=[T],this.offset=c|0}var S=y.prototype;return S.dtype=w,S.dimension=1,Object.defineProperty(S,"size",{get:function(){return this.shape[0]}}),S.order=[0],S.set=function(k,M){return w==="generic"?this.data.set(this.offset+this.stride[0]*k,M):this.data[this.offset+this.stride[0]*k]=M},S.get=function(k){return w==="generic"?this.data.get(this.offset+this.stride[0]*k):this.data[this.offset+this.stride[0]*k]},S.index=function(k){return this.offset+this.stride[0]*k},S.hi=function(k){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,this.stride[0],this.offset)},S.lo=function(k){var M=this.offset,T=0,c=this.shape[0],h=this.stride[0];return typeof k=="number"&&k>=0&&(T=k|0,M+=h*T,c-=T),new y(this.data,c,h,M)},S.step=function(k){var M=this.shape[0],T=this.stride[0],c=this.offset,h=0,b=Math.ceil;return typeof k=="number"&&(h=k|0,h<0?(c+=T*(M-1),M=b(-M/h)):M=b(M/h),T*=h),new y(this.data,M,T,c)},S.transpose=function(k){k=k===void 0?0:k|0;var M=this.shape,T=this.stride;return new y(this.data,M[k],T[k],this.offset)},S.pick=function(k){var M=[],T=[],c=this.offset;typeof k=="number"&&k>=0?c=c+this.stride[0]*k|0:(M.push(this.shape[0]),T.push(this.stride[0]));var h=l[M.length+1];return h(this.data,M,T,c)},function(k,M,T,c){return new y(k,M[0],T[0],c)}},2:function(w,l,x){function y(k,M,T,c,h,b){this.data=k,this.shape=[M,T],this.stride=[c,h],this.offset=b|0}var S=y.prototype;return S.dtype=w,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(k,M,T){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M,T):this.data[this.offset+this.stride[0]*k+this.stride[1]*M]=T},S.get=function(k,M){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M):this.data[this.offset+this.stride[0]*k+this.stride[1]*M]},S.index=function(k,M){return this.offset+this.stride[0]*k+this.stride[1]*M},S.hi=function(k,M){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(k,M){var T=this.offset,c=0,h=this.shape[0],b=this.shape[1],_=this.stride[0],P=this.stride[1];return typeof k=="number"&&k>=0&&(c=k|0,T+=_*c,h-=c),typeof M=="number"&&M>=0&&(c=M|0,T+=P*c,b-=c),new y(this.data,h,b,_,P,T)},S.step=function(k,M){var T=this.shape[0],c=this.shape[1],h=this.stride[0],b=this.stride[1],_=this.offset,P=0,L=Math.ceil;return typeof k=="number"&&(P=k|0,P<0?(_+=h*(T-1),T=L(-T/P)):T=L(T/P),h*=P),typeof M=="number"&&(P=M|0,P<0?(_+=b*(c-1),c=L(-c/P)):c=L(c/P),b*=P),new y(this.data,T,c,h,b,_)},S.transpose=function(k,M){k=k===void 0?0:k|0,M=M===void 0?1:M|0;var T=this.shape,c=this.stride;return new y(this.data,T[k],T[M],c[k],c[M],this.offset)},S.pick=function(k,M){var T=[],c=[],h=this.offset;typeof k=="number"&&k>=0?h=h+this.stride[0]*k|0:(T.push(this.shape[0]),c.push(this.stride[0])),typeof M=="number"&&M>=0?h=h+this.stride[1]*M|0:(T.push(this.shape[1]),c.push(this.stride[1]));var b=l[T.length+1];return b(this.data,T,c,h)},function(k,M,T,c){return new y(k,M[0],M[1],T[0],T[1],c)}},3:function(w,l,x){function y(k,M,T,c,h,b,_,P){this.data=k,this.shape=[M,T,c],this.stride=[h,b,_],this.offset=P|0}var S=y.prototype;return S.dtype=w,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 k=Math.abs(this.stride[0]),M=Math.abs(this.stride[1]),T=Math.abs(this.stride[2]);return k>M?M>T?[2,1,0]:k>T?[1,2,0]:[1,0,2]:k>T?[2,0,1]:T>M?[0,1,2]:[0,2,1]}}),S.set=function(k,M,T,c){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T,c):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T]=c},S.get=function(k,M,T){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T]},S.index=function(k,M,T){return this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T},S.hi=function(k,M,T){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof T!="number"||T<0?this.shape[2]:T|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(k,M,T){var c=this.offset,h=0,b=this.shape[0],_=this.shape[1],P=this.shape[2],L=this.stride[0],D=this.stride[1],B=this.stride[2];return typeof k=="number"&&k>=0&&(h=k|0,c+=L*h,b-=h),typeof M=="number"&&M>=0&&(h=M|0,c+=D*h,_-=h),typeof T=="number"&&T>=0&&(h=T|0,c+=B*h,P-=h),new y(this.data,b,_,P,L,D,B,c)},S.step=function(k,M,T){var c=this.shape[0],h=this.shape[1],b=this.shape[2],_=this.stride[0],P=this.stride[1],L=this.stride[2],D=this.offset,B=0,R=Math.ceil;return typeof k=="number"&&(B=k|0,B<0?(D+=_*(c-1),c=R(-c/B)):c=R(c/B),_*=B),typeof M=="number"&&(B=M|0,B<0?(D+=P*(h-1),h=R(-h/B)):h=R(h/B),P*=B),typeof T=="number"&&(B=T|0,B<0?(D+=L*(b-1),b=R(-b/B)):b=R(b/B),L*=B),new y(this.data,c,h,b,_,P,L,D)},S.transpose=function(k,M,T){k=k===void 0?0:k|0,M=M===void 0?1:M|0,T=T===void 0?2:T|0;var c=this.shape,h=this.stride;return new y(this.data,c[k],c[M],c[T],h[k],h[M],h[T],this.offset)},S.pick=function(k,M,T){var c=[],h=[],b=this.offset;typeof k=="number"&&k>=0?b=b+this.stride[0]*k|0:(c.push(this.shape[0]),h.push(this.stride[0])),typeof M=="number"&&M>=0?b=b+this.stride[1]*M|0:(c.push(this.shape[1]),h.push(this.stride[1])),typeof T=="number"&&T>=0?b=b+this.stride[2]*T|0:(c.push(this.shape[2]),h.push(this.stride[2]));var _=l[c.length+1];return _(this.data,c,h,b)},function(k,M,T,c){return new y(k,M[0],M[1],M[2],T[0],T[1],T[2],c)}},4:function(w,l,x){function y(k,M,T,c,h,b,_,P,L,D){this.data=k,this.shape=[M,T,c,h],this.stride=[b,_,P,L],this.offset=D|0}var S=y.prototype;return S.dtype=w,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(k,M,T,c,h){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c,h):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c]=h},S.get=function(k,M,T,c){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c]},S.index=function(k,M,T,c){return this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c},S.hi=function(k,M,T,c){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof T!="number"||T<0?this.shape[2]:T|0,typeof c!="number"||c<0?this.shape[3]:c|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(k,M,T,c){var h=this.offset,b=0,_=this.shape[0],P=this.shape[1],L=this.shape[2],D=this.shape[3],B=this.stride[0],R=this.stride[1],I=this.stride[2],F=this.stride[3];return typeof k=="number"&&k>=0&&(b=k|0,h+=B*b,_-=b),typeof M=="number"&&M>=0&&(b=M|0,h+=R*b,P-=b),typeof T=="number"&&T>=0&&(b=T|0,h+=I*b,L-=b),typeof c=="number"&&c>=0&&(b=c|0,h+=F*b,D-=b),new y(this.data,_,P,L,D,B,R,I,F,h)},S.step=function(k,M,T,c){var h=this.shape[0],b=this.shape[1],_=this.shape[2],P=this.shape[3],L=this.stride[0],D=this.stride[1],B=this.stride[2],R=this.stride[3],I=this.offset,F=0,N=Math.ceil;return typeof k=="number"&&(F=k|0,F<0?(I+=L*(h-1),h=N(-h/F)):h=N(h/F),L*=F),typeof M=="number"&&(F=M|0,F<0?(I+=D*(b-1),b=N(-b/F)):b=N(b/F),D*=F),typeof T=="number"&&(F=T|0,F<0?(I+=B*(_-1),_=N(-_/F)):_=N(_/F),B*=F),typeof c=="number"&&(F=c|0,F<0?(I+=R*(P-1),P=N(-P/F)):P=N(P/F),R*=F),new y(this.data,h,b,_,P,L,D,B,R,I)},S.transpose=function(k,M,T,c){k=k===void 0?0:k|0,M=M===void 0?1:M|0,T=T===void 0?2:T|0,c=c===void 0?3:c|0;var h=this.shape,b=this.stride;return new y(this.data,h[k],h[M],h[T],h[c],b[k],b[M],b[T],b[c],this.offset)},S.pick=function(k,M,T,c){var h=[],b=[],_=this.offset;typeof k=="number"&&k>=0?_=_+this.stride[0]*k|0:(h.push(this.shape[0]),b.push(this.stride[0])),typeof M=="number"&&M>=0?_=_+this.stride[1]*M|0:(h.push(this.shape[1]),b.push(this.stride[1])),typeof T=="number"&&T>=0?_=_+this.stride[2]*T|0:(h.push(this.shape[2]),b.push(this.stride[2])),typeof c=="number"&&c>=0?_=_+this.stride[3]*c|0:(h.push(this.shape[3]),b.push(this.stride[3]));var P=l[h.length+1];return P(this.data,h,b,_)},function(k,M,T,c){return new y(k,M[0],M[1],M[2],M[3],T[0],T[1],T[2],T[3],c)}},5:function(w,l,x){function y(k,M,T,c,h,b,_,P,L,D,B,R){this.data=k,this.shape=[M,T,c,h,b],this.stride=[_,P,L,D,B],this.offset=R|0}var S=y.prototype;return S.dtype=w,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(k,M,T,c,h,b){return w==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h,b):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h]=b},S.get=function(k,M,T,c,h){return w==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h):this.data[this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h]},S.index=function(k,M,T,c,h){return this.offset+this.stride[0]*k+this.stride[1]*M+this.stride[2]*T+this.stride[3]*c+this.stride[4]*h},S.hi=function(k,M,T,c,h){return new y(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof M!="number"||M<0?this.shape[1]:M|0,typeof T!="number"||T<0?this.shape[2]:T|0,typeof c!="number"||c<0?this.shape[3]:c|0,typeof h!="number"||h<0?this.shape[4]:h|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},S.lo=function(k,M,T,c,h){var b=this.offset,_=0,P=this.shape[0],L=this.shape[1],D=this.shape[2],B=this.shape[3],R=this.shape[4],I=this.stride[0],F=this.stride[1],N=this.stride[2],j=this.stride[3],G=this.stride[4];return typeof k=="number"&&k>=0&&(_=k|0,b+=I*_,P-=_),typeof M=="number"&&M>=0&&(_=M|0,b+=F*_,L-=_),typeof T=="number"&&T>=0&&(_=T|0,b+=N*_,D-=_),typeof c=="number"&&c>=0&&(_=c|0,b+=j*_,B-=_),typeof h=="number"&&h>=0&&(_=h|0,b+=G*_,R-=_),new y(this.data,P,L,D,B,R,I,F,N,j,G,b)},S.step=function(k,M,T,c,h){var b=this.shape[0],_=this.shape[1],P=this.shape[2],L=this.shape[3],D=this.shape[4],B=this.stride[0],R=this.stride[1],I=this.stride[2],F=this.stride[3],N=this.stride[4],j=this.offset,G=0,rt=Math.ceil;return typeof k=="number"&&(G=k|0,G<0?(j+=B*(b-1),b=rt(-b/G)):b=rt(b/G),B*=G),typeof M=="number"&&(G=M|0,G<0?(j+=R*(_-1),_=rt(-_/G)):_=rt(_/G),R*=G),typeof T=="number"&&(G=T|0,G<0?(j+=I*(P-1),P=rt(-P/G)):P=rt(P/G),I*=G),typeof c=="number"&&(G=c|0,G<0?(j+=F*(L-1),L=rt(-L/G)):L=rt(L/G),F*=G),typeof h=="number"&&(G=h|0,G<0?(j+=N*(D-1),D=rt(-D/G)):D=rt(D/G),N*=G),new y(this.data,b,_,P,L,D,B,R,I,F,N,j)},S.transpose=function(k,M,T,c,h){k=k===void 0?0:k|0,M=M===void 0?1:M|0,T=T===void 0?2:T|0,c=c===void 0?3:c|0,h=h===void 0?4:h|0;var b=this.shape,_=this.stride;return new y(this.data,b[k],b[M],b[T],b[c],b[h],_[k],_[M],_[T],_[c],_[h],this.offset)},S.pick=function(k,M,T,c,h){var b=[],_=[],P=this.offset;typeof k=="number"&&k>=0?P=P+this.stride[0]*k|0:(b.push(this.shape[0]),_.push(this.stride[0])),typeof M=="number"&&M>=0?P=P+this.stride[1]*M|0:(b.push(this.shape[1]),_.push(this.stride[1])),typeof T=="number"&&T>=0?P=P+this.stride[2]*T|0:(b.push(this.shape[2]),_.push(this.stride[2])),typeof c=="number"&&c>=0?P=P+this.stride[3]*c|0:(b.push(this.shape[3]),_.push(this.stride[3])),typeof h=="number"&&h>=0?P=P+this.stride[4]*h|0:(b.push(this.shape[4]),_.push(this.stride[4]));var L=l[b.length+1];return L(this.data,b,_,P)},function(k,M,T,c){return new y(k,M[0],M[1],M[2],M[3],M[4],T[0],T[1],T[2],T[3],T[4],c)}}};function f(w,l){var x=l===-1?"T":String(l),y=s[x];return l===-1?y(w):l===0?y(w,g[w][0]):y(w,g[w],a)}function v(w){if(i(w))return"buffer";if(n)switch(Object.prototype.toString.call(w)){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(w)?"array":"generic"}var g={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function m(w,l,x,y){if(w===void 0){var h=g.array[0];return h([])}else typeof w=="number"&&(w=[w]);l===void 0&&(l=[w.length]);var S=l.length;if(x===void 0){x=new Array(S);for(var k=S-1,M=1;k>=0;--k)x[k]=M,M*=l[k]}if(y===void 0){y=0;for(var k=0;k<S;++k)x[k]<0&&(y-=(l[k]-1)*x[k])}for(var T=v(w),c=g[T];c.length<=S+1;)c.push(f(T,c.length-1));var h=c[S+1];return h(w,l,x,y)}t.exports=m},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],f=r[5],v=r[6],g=r[7],m=r[8],w=r[9],l=r[10],x=r[11],y=r[12],S=r[13],k=r[14],M=r[15],T=i*f-n*s,c=i*v-o*s,h=i*g-a*s,b=n*v-o*f,_=n*g-a*f,P=o*g-a*v,L=m*S-w*y,D=m*k-l*y,B=m*M-x*y,R=w*k-l*S,I=w*M-x*S,F=l*M-x*k;return T*F-c*I+h*R+b*B-_*D+P*L}},9922:function(t,e,r){t.exports=n;var i=r(2613);function n(o,a){var s=o[0],f=o[1],v=o[2],g=a[0],m=a[1],w=a[2];return Math.abs(s-g)<=i*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(f-m)<=i*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(v-w)<=i*Math.max(1,Math.abs(v),Math.abs(w))}},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)}},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 f(x,y,S){return Math.sqrt(Math.pow(x,2)+Math.pow(y,2)+Math.pow(S,2))}function v(x,y,S,k){return Math.sqrt(Math.pow(x,2)+Math.pow(y,2)+Math.pow(S,2)+Math.pow(k,2))}function g(x,y){var S=y[0],k=y[1],M=y[2],T=y[3],c=v(S,k,M,T);c>1e-6?(x[0]=S/c,x[1]=k/c,x[2]=M/c,x[3]=T/c):(x[0]=x[1]=x[2]=0,x[3]=1)}function m(x,y,S){this.radius=i([S]),this.center=i(y),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 w=m.prototype;w.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},w.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var y=this.computedRotation;g(y,y);var S=this.computedMatrix;o(S,y);var k=this.computedCenter,M=this.computedEye,T=this.computedUp,c=Math.exp(this.computedRadius[0]);M[0]=k[0]+c*S[2],M[1]=k[1]+c*S[6],M[2]=k[2]+c*S[10],T[0]=S[1],T[1]=S[5],T[2]=S[9];for(var h=0;h<3;++h){for(var b=0,_=0;_<3;++_)b+=S[h+4*_]*M[_];S[12+h]=-b}},w.getMatrix=function(x,y){this.recalcMatrix(x);var S=this.computedMatrix;if(y){for(var k=0;k<16;++k)y[k]=S[k];return y}return S},w.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},w.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},w.pan=function(x,y,S,k){y=y||0,S=S||0,k=k||0,this.recalcMatrix(x);var M=this.computedMatrix,T=M[1],c=M[5],h=M[9],b=f(T,c,h);T/=b,c/=b,h/=b;var _=M[0],P=M[4],L=M[8],D=_*T+P*c+L*h;_-=T*D,P-=c*D,L-=h*D;var B=f(_,P,L);_/=B,P/=B,L/=B,M[2],M[6],M[10];var R=_*y+T*S,I=P*y+c*S,F=L*y+h*S;this.center.move(x,R,I,F);var N=Math.exp(this.computedRadius[0]);N=Math.max(1e-4,N+k),this.radius.set(x,Math.log(N))},w.rotate=function(x,y,S,k){this.recalcMatrix(x),y=y||0,S=S||0;var M=this.computedMatrix,T=M[0],c=M[4],h=M[8],b=M[1],_=M[5],P=M[9],L=M[2],D=M[6],B=M[10],R=y*T+S*b,I=y*c+S*_,F=y*h+S*P,N=-(D*F-B*I),j=-(B*R-L*F),G=-(L*I-D*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 st=this.computedRotation,et=st[0],K=st[1],ot=st[2],X=st[3],Q=et*rt+X*N+K*G-ot*j,ut=K*rt+X*j+ot*N-et*G,J=ot*rt+X*G+et*j-K*N,q=X*rt-et*N-K*j-ot*G;if(k){N=L,j=D,G=B;var it=Math.sin(k)/f(N,j,G);N*=it,j*=it,G*=it,rt=Math.cos(y),Q=Q*rt+q*N+ut*G-J*j,ut=ut*rt+q*j+J*N-Q*G,J=J*rt+q*G+Q*j-ut*N,q=q*rt-Q*N-ut*j-J*G}var nt=v(Q,ut,J,q);nt>1e-6?(Q/=nt,ut/=nt,J/=nt,q/=nt):(Q=ut=J=0,q=1),this.rotation.set(x,Q,ut,J,q)},w.lookAt=function(x,y,S,k){this.recalcMatrix(x),S=S||this.computedCenter,y=y||this.computedEye,k=k||this.computedUp;var M=this.computedMatrix;n(M,y,S,k);var T=this.computedRotation;s(T,M[0],M[1],M[2],M[4],M[5],M[6],M[8],M[9],M[10]),g(T,T),this.rotation.set(x,T[0],T[1],T[2],T[3]);for(var c=0,h=0;h<3;++h)c+=Math.pow(S[h]-y[h],2);this.radius.set(x,.5*Math.log(Math.max(c,1e-6))),this.center.set(x,S[0],S[1],S[2])},w.translate=function(x,y,S,k){this.center.move(x,y||0,S||0,k||0)},w.setMatrix=function(x,y){var S=this.computedRotation;s(S,y[0],y[1],y[2],y[4],y[5],y[6],y[8],y[9],y[10]),g(S,S),this.rotation.set(x,S[0],S[1],S[2],S[3]);var k=this.computedMatrix;a(k,y);var M=k[15];if(Math.abs(M)>1e-6){var T=k[12]/M,c=k[13]/M,h=k[14]/M;this.recalcMatrix(x);var b=Math.exp(this.computedRadius[0]);this.center.set(x,T-k[2]*b,c-k[6]*b,h-k[10]*b),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},w.setDistance=function(x,y){y>0&&this.radius.set(x,Math.log(y))},w.setDistanceLimits=function(x,y){x>0?x=Math.log(x):x=-1/0,y>0?y=Math.log(y):y=1/0,y=Math.max(y,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=y},w.getDistanceLimits=function(x){var y=this.radius.bounds;return x?(x[0]=Math.exp(y[0][0]),x[1]=Math.exp(y[1][0]),x):[Math.exp(y[0][0]),Math.exp(y[1][0])]},w.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]}},w.fromJSON=function(x){var y=this.lastT(),S=x.center;S&&this.center.set(y,S[0],S[1],S[2]);var k=x.rotation;k&&this.rotation.set(y,k[0],k[1],k[2],k[3]);var M=x.distance;M&&M>0&&this.radius.set(y,Math.log(M)),this.setDistanceLimits(x.zoomMin,x.zoomMax)};function l(x){x=x||{};var y=x.center||[0,0,0],S=x.rotation||[0,0,0,1],k=x.radius||1;y=[].slice.call(y,0,3),S=[].slice.call(S,0,4),g(S,S);var M=new m(S,y,Math.log(k));return M.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&M.lookAt(0,x.eye,x.center,x.up),M}},9994:function(t,e,r){var i=r(9618),n=r(8277);t.exports=function(o,a){for(var s=[],f=o,v=1;Array.isArray(f);)s.push(f.length),v*=f.length,f=f[0];return s.length===0?i():(a||(a=i(new Float64Array(v),s)),n(a,o),a)}}},d={};function E(t){var e=d[t];if(e!==void 0)return e.exports;var r=d[t]={id:t,loaded:!1,exports:{}};return u[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})()}),v3=Vt((Z,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]}}),SS=Vt((Z,V)=>{var u=v3();V.exports=E;var d={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(),u[A])e=u[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],f=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(m,w){if(/%$/.test(m))return w===o?parseFloat(m)/100:n==="rgb"?parseFloat(m)*255/100:parseFloat(m);if(n[w]==="h"){if(/deg$/.test(m))return parseFloat(m);if(d[m]!==void 0)return d[m]}return parseFloat(m)}),s===n&&e.push(1),r=f||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}}}),ES=Vt((Z,V)=>{var u=SS();V.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var A,t=u(E);if(!t.space)return[];var e=[0,0,0],r=t.space[0]==="h"?[360,100,100]:[255,255,255];return A=Array(3),A[0]=Math.min(Math.max(t.values[0],e[0]),r[0]),A[1]=Math.min(Math.max(t.values[1],e[1]),r[1]),A[2]=Math.min(Math.max(t.values[2],e[2]),r[2]),t.space[0]==="h"&&(A=d(A)),A.push(Math.min(Math.max(t.alpha,0),1)),A};function d(E){var A=E[0]/360,t=E[1]/100,e=E[2]/100,r,i,n,o,a,s=0;if(t===0)return a=e*255,[a,a,a];for(i=e<.5?e*(1+t):e+t-e*t,r=2*e-i,o=[0,0,0];s<3;)n=A+1/3*-(s-1),n<0?n++:n>1&&n--,a=6*n<1?r+(i-r)*6*n:2*n<1?i:3*n<2?r+(i-r)*(2/3-n)*6:r,o[s++]=a*255;return o}}),wv=Vt((Z,V)=>{V.exports=u;function u(d,E,A){return E<A?d<E?E:d>A?A:d:d<A?A:d>E?E:d}}),xx=Vt((Z,V)=>{V.exports=function(u){switch(u){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}}}),Bd=Vt((Z,V)=>{var u=ES(),d=wv(),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=u(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]=d(Math.floor(t[0]*255),0,255),i[1]=d(Math.floor(t[1]*255),0,255),i[2]=d(Math.floor(t[2]*255),0,255),i[3]=t[3]==null?255:d(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))}}),Vp=Vt((Z,V)=>{var u=Bd();function d(E){return E?u(E):[0,0,0,1]}V.exports=d}),Hp=Vt((Z,V)=>{var u=Lo(),d=kf(),E=Bd(),A=xu(),t=nf().defaultLine,e=rh().isArrayOrTypedArray,r=E(t),i=1;function n(v,g){var m=v;return m[3]*=g,m}function o(v){if(u(v))return r;var g=E(v);return g.length?g:r}function a(v){return u(v)?v:i}function s(v,g,m){var w=v.color;w&&w._inputArray&&(w=w._inputArray);var l=e(w),x=e(g),y=A.extractOpts(v),S=[],k,M,T,c,h;if(y.colorscale!==void 0?k=A.makeColorScaleFuncFromTrace(v):k=o,l?M=function(_,P){return _[P]===void 0?r:E(k(_[P]))}:M=o,x?T=function(_,P){return _[P]===void 0?i:a(_[P])}:T=a,l||x)for(var b=0;b<m;b++)c=M(w,b),h=T(g,b),S[b]=n(c,h);else S=n(E(w),g);return S}function f(v){var g=A.extractOpts(v),m=g.colorscale;return g.reversescale&&(m=A.flipScale(g.colorscale)),m.map(function(w){var l=w[0],x=d(w[1]),y=x.toRgb();return{index:l,rgb:[y.r,y.g,y.b,y.a]}})}V.exports={formatColor:s,parseColorScale:f}}),y3=Vt((Z,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((Z,V)=>{V.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),zS=Vt((Z,V)=>{var u=ji();function d(t,e,r,i){if(!e||!e.visible)return null;for(var n=u.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 f=i.c2l(t[a]),v=t[a]-s[0],g=t[a]+s[1];if(o[a]=[(i.c2l(v,!0)-f)*r,(i.c2l(g,!0)-f)*r],v>0){var m=i.c2l(v);i._lowerLogErrorBound||(i._lowerLogErrorBound=m),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,m)}}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=[d(t.x,t.error_x,e[0],r.xaxis),d(t.y,t.error_y,e[1],r.yaxis),d(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]],f=0;f<3;f++)if(i[f])for(var v=0;v<2;v++)s[v][f]=i[f][a][v];o[a]=s}return o}V.exports=A}),LS=Vt((Z,V)=>{var u=Ff().gl_line3d,d=Ff().gl_scatter3d,E=Ff().gl_error3d,A=Ff().gl_mesh3d,t=Ff().delaunay_triangulate,e=Xr(),r=Vp(),i=Hp().formatColor,n=ym(),o=y3(),a=_x(),s=yo(),f=dh().appendArrayPointValue,v=zS();function g(P,L){this.scene=P,this.uid=L,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 m=g.prototype;m.handlePick=function(P){if(P.object&&(P.object===this.linePlot||P.object===this.delaunayMesh||P.object===this.textMarkers||P.object===this.scatterPlot)){var L=P.index=P.data.index;return P.object.highlight&&P.object.highlight(null),this.scatterPlot&&(P.object=this.scatterPlot,this.scatterPlot.highlight(P.data)),P.textLabel="",this.textLabels&&(e.isArrayOrTypedArray(this.textLabels)?(this.textLabels[L]||this.textLabels[L]===0)&&(P.textLabel=this.textLabels[L]):P.textLabel=this.textLabels),P.traceCoordinate=[this.data.x[L],this.data.y[L],this.data.z[L]],!0}};function w(P,L,D){var B=(D+1)%3,R=(D+2)%3,I=[],F=[],N;for(N=0;N<P.length;++N){var j=P[N];isNaN(j[B])||!isFinite(j[B])||isNaN(j[R])||!isFinite(j[R])||(I.push([j[B],j[R]]),F.push(N))}var G=t(I);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:P,cells:G,meshColor:L}}function l(P){for(var L=[0,0,0],D=[[0,0,0],[0,0,0],[0,0,0]],B=[1,1,1],R=0;R<3;R++){var I=P[R];I&&I.copy_zstyle!==!1&&P[2].visible!==!1&&(I=P[2]),!(!I||!I.visible)&&(L[R]=I.width/2,D[R]=r(I.color),B[R]=I.thickness)}return{capSize:L,color:D,lineWidth:B}}function x(P){return P==null?0:P.indexOf("left")>-1?-1:P.indexOf("right")>-1?1:0}function y(P){return P==null?0:P.indexOf("top")>-1?-1:P.indexOf("bottom")>-1?1:0}function S(P){var L=0,D=0,B=[L,D];if(Array.isArray(P))for(var R=0;R<P.length;R++)B[R]=[L,D],P[R]&&(B[R][0]=x(P[R]),B[R][1]=y(P[R]));else B[0]=x(P),B[1]=y(P);return B}function k(P,L){return L(P*4)}function M(P){return a[P]}function T(P,L,D,B,R){var I=null;if(e.isArrayOrTypedArray(P)){I=[];for(var F=0;F<L;F++)P[F]===void 0?I[F]=B:I[F]=D(P[F],R)}else I=D(P,e.identity);return I}function c(P,L){var D=[],B=P.fullSceneLayout,R=P.dataScale,I=B.xaxis,F=B.yaxis,N=B.zaxis,j=L.marker,G=L.line,rt=L.x||[],ct=L.y||[],st=L.z||[],et=rt.length,K=L.xcalendar,ot=L.ycalendar,X=L.zcalendar,Q,ut,J,q,it,nt;for(it=0;it<et;it++)Q=I.d2l(rt[it],0,K)*R[0],ut=F.d2l(ct[it],0,ot)*R[1],J=N.d2l(st[it],0,X)*R[2],D[it]=[Q,ut,J];if(Array.isArray(L.text))nt=L.text;else if(e.isTypedArray(L.text))nt=Array.from(L.text);else if(L.text!==void 0)for(nt=new Array(et),it=0;it<et;it++)nt[it]=L.text;function dt(re,Zt){var ue=B[re];return s.tickText(ue,ue.d2l(Zt),!0).text}var Tt=L.texttemplate;if(Tt){var wt=P.fullLayout,It=wt._d3locale,Ct=Array.isArray(Tt),Nt=Ct?Math.min(Tt.length,et):et,ee=Ct?function(re){return Tt[re]}:function(){return Tt};for(nt=new Array(Nt),it=0;it<Nt;it++){var Jt={x:rt[it],y:ct[it],z:st[it]},te={xLabel:dt("xaxis",rt[it]),yLabel:dt("yaxis",ct[it]),zLabel:dt("zaxis",st[it])},Kt={};f(Kt,L,it),nt[it]=e.texttemplateString({data:[Kt,Jt,L._meta],fallback:L.texttemplatefallback,labels:te,locale:It,template:ee(it)})}}if(q={position:D,mode:L.mode,text:nt},"line"in L&&(q.lineColor=i(G,1,et),q.lineWidth=G.width,q.lineDashes=G.dash),"marker"in L){var mt=n(L);q.scatterColor=i(j,1,et),q.scatterSize=T(j.size,et,k,20,mt),q.scatterMarker=T(j.symbol,et,M,"●"),q.scatterLineWidth=j.line.width,q.scatterLineColor=i(j.line,1,et),q.scatterAngle=0}"textposition"in L&&(q.textOffset=S(L.textposition),q.textColor=i(L.textfont,1,et),q.textSize=T(L.textfont.size,et,e.identity,12),q.textFontFamily=L.textfont.family,q.textFontWeight=L.textfont.weight,q.textFontStyle=L.textfont.style,q.textFontVariant=L.textfont.variant,q.textAngle=0);var bt=["x","y","z"];for(q.project=[!1,!1,!1],q.projectScale=[1,1,1],q.projectOpacity=[1,1,1],it=0;it<3;++it){var vt=L.projection[bt[it]];(q.project[it]=vt.show)&&(q.projectOpacity[it]=vt.opacity,q.projectScale[it]=vt.scale)}q.errorBounds=v(L,R,B);var Ut=l([L.error_x,L.error_y,L.error_z]);return q.errorColor=Ut.color,q.errorLineWidth=Ut.lineWidth,q.errorCapSize=Ut.capSize,q.delaunayAxis=L.surfaceaxis,q.delaunayColor=r(L.surfacecolor),q}function h(P){if(e.isArrayOrTypedArray(P)){var L=P[0];return e.isArrayOrTypedArray(L)&&(P=L),"rgb("+P.slice(0,3).map(function(D){return Math.round(D*255)})+")"}return null}function b(P){return e.isArrayOrTypedArray(P)?P.length===4&&typeof P[0]=="number"?h(P):P.map(h):null}m.update=function(P){var L=this.scene.glplot.gl,D,B,R,I,F=o.solid;this.data=P;var N=c(this.scene,P);"mode"in N&&(this.mode=N.mode),"lineDashes"in N&&N.lineDashes in o&&(F=o[N.lineDashes]),this.color=b(N.scatterColor)||b(N.lineColor),this.dataPoints=N.position,D={gl:this.scene.glplot.gl,position:N.position,color:N.lineColor,lineWidth:N.lineWidth||1,dashes:F[0],dashScale:F[1],opacity:P.opacity,connectGaps:P.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(D):(this.linePlot=u(D),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=P.opacity;if(P.marker&&P.marker.opacity!==void 0&&(j*=P.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=d(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),I={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:P.opacity},this.textLabels=P.hovertext||P.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(I):(this.textMarkers=d(I),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:P.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=w(N.position,N.delaunayColor,N.delaunayAxis);G.opacity=P.opacity,this.delaunayMesh?this.delaunayMesh.update(G):(G.gl=L,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)},m.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 _(P,L){var D=new g(P,L.uid);return D.update(L),D}V.exports=_}),x3=Vt((Z,V)=>{var u=pc(),d=yu(),E=Wl(),A=fc().axisHoverFormat,{hovertemplateAttrs:t,texttemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=Tl(),n=y3(),o=_x(),a=So().extendFlat,s=Cu().overrideAll,f=bd(),v=u.line,g=u.marker,m=g.line,w=a({width:v.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},E("line"));function l(y){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 x=V.exports=s({x:u.x,y:u.y,z:{valType:"data_array"},text:a({},u.text,{}),texttemplate:e(),texttemplatefallback:r({editType:"calc"}),hovertext:a({},u.hovertext,{}),hovertemplate:t(),hovertemplatefallback:r(),xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z"),mode:a({},u.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l(),y:l(),z:l()},connectgaps:u.connectgaps,line:w,marker:a({symbol:{valType:"enumerated",values:f(o),dflt:"circle",arrayOk:!0},size:a({},g.size,{dflt:8}),sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode,opacity:a({},g.opacity,{arrayOk:!1}),colorbar:g.colorbar,line:a({width:a({},m.width,{arrayOk:!1})},E("marker.line"))},E("marker")),textposition:a({},u.textposition,{dflt:"top center"}),textfont:d({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:i.opacity,hoverinfo:a({},i.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"}),CS=Vt((Z,V)=>{var u=ji(),d=Xr(),E=nu(),A=zh(),t=Bh(),e=Rh(),r=x3();V.exports=function(n,o,a,s){function f(S,k){return d.coerce(n,o,r,S,k)}var v=i(n,o,f,s);if(!v){o.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),E.hasMarkers(o)&&A(n,o,a,s,f,{noSelect:!0,noAngle:!0}),E.hasLines(o)&&(f("connectgaps"),t(n,o,a,s,f)),E.hasText(o)&&(f("texttemplate"),f("texttemplatefallback"),e(n,o,s,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var g=(o.line||{}).color,m=(o.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",g||m);for(var w=["x","y","z"],l=0;l<3;++l){var x="projection."+w[l];f(x+".show")&&(f(x+".opacity"),f(x+".scale"))}var y=u.getComponentMethod("errorbars","supplyDefaults");y(n,o,g||m||a,{axis:"z"}),y(n,o,g||m||a,{axis:"y",inherit:"z"}),y(n,o,g||m||a,{axis:"x",inherit:"z"})};function i(n,o,a,s){var f=0,v=a("x"),g=a("y"),m=a("z"),w=u.getComponentMethod("calendars","handleTraceDefaults");return w(n,o,["x","y","z"],s),v&&g&&m&&(f=Math.min(v.length,g.length,m.length),o._length=o._xlength=o._ylength=o._zlength=f),f}}),IS=Vt((Z,V)=>{var u=vp(),d=Nh();V.exports=function(E,A){var t=[{x:!1,y:!1,trace:A,t:{}}];return u(t,A),d(E,A),t}}),PS=Vt((Z,V)=>{V.exports=u;function u(d,E){if(typeof d!="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=[d];d.indexOf("webgl")===0&&r.push("experimental-"+d);for(var i=0;i<r.length;i++)if(e=A.getContext(r[i],t),e)return e}catch{e=null}return e||null}}),OS=Vt((Z,V)=>{var u=PS();V.exports=function(d){return u("webgl",d)}}),_3=Vt((Z,V)=>{var u=Pi(),d=function(){};V.exports=function(E){for(var A in E)typeof E[A]=="function"&&(E[A]=d);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=u.defaults[0],t.style.position="absolute",t.style.left=t.style.top="0px",t.style.width=t.style.height="100%",t.style["background-color"]=u.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}}),DS=Vt((Z,V)=>{var u=Vp(),d=Xr(),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?d.templateString(a.title.text,r._meta):a.title.text,"font"in a.title&&(a.title.font.color&&(n.labelColor[o]=u(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]=u(a.linecolor)),"linewidth"in a&&(n.lineWidth[o]=a.linewidth),"showgrid"in a&&(n.gridEnable[o]=a.showgrid),"gridcolor"in a&&(n.gridColor[o]=u(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]=u(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]=u(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]=u(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]=u(a.backgroundcolor)):n.backgroundEnable[o]=!1}};function e(r,i){var n=new A;return n.merge(r,i),n}V.exports=e}),FS=Vt((Z,V)=>{var u=Vp(),d=["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[d[r]];if(!i.visible){this.enabled[r]=!1,this.drawSides[r]=!1;continue}this.enabled[r]=i.showspikes,this.colors[r]=u(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}),BS=Vt((Z,V)=>{V.exports=t;var u=yo(),d=Xr(),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 f=s.tickmode;if(s.tickmode==="auto"){s.tickmode="linear";var v=s.nticks||d.constrain(s._length/40,4,9);u.autoTicks(s,Math.abs(s.range[1]-s.range[0])/v)}for(var g=u.calcTicks(s,{msUTC:!0}),m=0;m<g.length;++m)g[m].x=g[m].x*e.dataScale[a],s.type==="date"&&(g[m].text=g[m].text.replace(/\<br\>/g," "));o[a]=g,s.tickmode=f}}r.ticks=o;for(var a=0;a<3;++a){.5*(e.glplot.bounds[0][a]+e.glplot.bounds[1][a]);for(var m=0;m<2;++m)r.bounds[m][a]=e.glplot.bounds[m][a]}e.contourLevels=A(o)}}),RS=Vt((Z,V)=>{var u=Ff().gl_plot3d,d=u.createCamera,E=u.createScene,A=OS(),t=jy(),e=ji(),r=Xr(),i=r.preserveDrawingBuffer(),n=yo(),o=hc(),a=Vp(),s=_3(),f=Bb(),v=DS(),g=FS(),m=BS(),w=Xh().applyAutorangeOptions,l,x,y=!1;function S(D,B){var R=document.createElement("div"),I=D.container;this.graphDiv=D.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=D.id,R.style.position="absolute",R.style.top=R.style.left="0px",R.style.width=R.style.height="100%",I.appendChild(R),this.fullLayout=B,this.id=D.id||"scene",this.fullSceneLayout=B[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(B,B[this.id]),this.spikeOptions=g(B[this.id]),this.container=R,this.staticMode=!!D.staticPlot,this.pixelRatio=this.pixelRatio||D.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=e.getComponentMethod("annotations3d","convert"),this.drawAnnotations=e.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var k=S.prototype;k.prepareOptions=function(){var D=this,B={canvas:D.canvas,gl:D.gl,glOptions:{preserveDrawingBuffer:i,premultipliedAlpha:!0,antialias:!0},container:D.container,axes:D.axesOptions,spikes:D.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:D.camera,pixelRatio:D.pixelRatio};if(D.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;k.tryCreatePlot=function(){var D=this,B=D.prepareOptions(),R=!0;try{D.glplot=E(B)}catch{if(D.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,D.glplot=E(B)}catch{i=B.glOptions.preserveDrawingBuffer=!1,R=!1}}}return M=!1,R},k.initializeGLCamera=function(){var D=this,B=D.fullSceneLayout.camera,R=B.projection.type==="orthographic";D.camera=d(D.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"})},k.initializeGLPlot=function(){var D=this;D.initializeGLCamera();var B=D.tryCreatePlot();if(!B)return s(D);D.traces={},D.make4thDimension();var R=D.graphDiv,I=R.layout,F=function(){var j={};return D.isCameraChanged(I)&&(j[D.id+".camera"]=D.getCamera()),D.isAspectChanged(I)&&(j[D.id+".aspectratio"]=D.glplot.getAspectratio(),I[D.id].aspectmode!=="manual"&&(D.fullSceneLayout.aspectmode=I[D.id].aspectmode=j[D.id+".aspectmode"]="manual")),j},N=function(j){if(j.fullSceneLayout.dragmode!==!1){var G=F();j.saveLayout(I),j.graphDiv.emit("plotly_relayout",G)}};return D.glplot.canvas&&(D.glplot.canvas.addEventListener("mouseup",function(){N(D)}),D.glplot.canvas.addEventListener("touchstart",function(){y=!0}),D.glplot.canvas.addEventListener("wheel",function(j){if(R._context._scrollZoom.gl3d){if(D.camera._ortho){var G=j.deltaX>j.deltaY?1.1:.9090909090909091,rt=D.glplot.getAspectratio();D.glplot.setAspectratio({x:G*rt.x,y:G*rt.y,z:G*rt.z})}N(D)}},t?{passive:!1}:!1),D.glplot.canvas.addEventListener("mousemove",function(){if(D.fullSceneLayout.dragmode!==!1&&D.camera.mouseListener.buttons!==0){var j=F();D.graphDiv.emit("plotly_relayouting",j)}}),D.staticMode||D.glplot.canvas.addEventListener("webglcontextlost",function(j){R&&R.emit&&R.emit("plotly_webglcontextlost",{event:j,layer:D.id})},!1)),D.glplot.oncontextloss=function(){D.recoverContext()},D.glplot.onrender=function(){D.render()},!0},k.render=function(){var D=this,B=D.graphDiv,R,I=D.svgContainer,F=D.container.getBoundingClientRect();B._fullLayout._calcInverseTransform(B);var N=B._fullLayout._invScaleX,j=B._fullLayout._invScaleY,G=F.width*N,rt=F.height*j;I.setAttributeNS(null,"viewBox","0 0 "+G+" "+rt),I.setAttributeNS(null,"width",G),I.setAttributeNS(null,"height",rt),m(D),D.glplot.axes.update(D.axesOptions);for(var ct=Object.keys(D.traces),st=null,et=D.glplot.selection,K=0;K<ct.length;++K)R=D.traces[ct[K]],R.data.hoverinfo!=="skip"&&R.handlePick(et)&&(st=R),R.setContourLevels&&R.setContourLevels();function ot(Nt,ee,Jt){var te=D.fullSceneLayout[Nt+"axis"];return te.type!=="log"&&(ee=te.d2l(ee)),n.hoverLabelText(te,ee,Jt)}if(st!==null){var X=f(D.glplot.cameraParams,et.dataCoordinate);R=st.data;var Q=B._fullData[R.index],ut=et.index,J={xLabel:ot("x",et.traceCoordinate[0],R.xhoverformat),yLabel:ot("y",et.traceCoordinate[1],R.yhoverformat),zLabel:ot("z",et.traceCoordinate[2],R.zhoverformat)},q=o.castHoverinfo(Q,D.fullLayout,ut),it=(q||"").split("+"),nt=q&&q==="all";!Q.hovertemplate&&!nt&&(it.indexOf("x")===-1&&(J.xLabel=void 0),it.indexOf("y")===-1&&(J.yLabel=void 0),it.indexOf("z")===-1&&(J.zLabel=void 0),it.indexOf("text")===-1&&(et.textLabel=void 0),it.indexOf("name")===-1&&(st.name=void 0));var dt,Tt=[];R.type==="cone"||R.type==="streamtube"?(J.uLabel=ot("x",et.traceCoordinate[3],R.uhoverformat),(nt||it.indexOf("u")!==-1)&&Tt.push("u: "+J.uLabel),J.vLabel=ot("y",et.traceCoordinate[4],R.vhoverformat),(nt||it.indexOf("v")!==-1)&&Tt.push("v: "+J.vLabel),J.wLabel=ot("z",et.traceCoordinate[5],R.whoverformat),(nt||it.indexOf("w")!==-1)&&Tt.push("w: "+J.wLabel),J.normLabel=et.traceCoordinate[6].toPrecision(3),(nt||it.indexOf("norm")!==-1)&&Tt.push("norm: "+J.normLabel),R.type==="streamtube"&&(J.divergenceLabel=et.traceCoordinate[7].toPrecision(3),(nt||it.indexOf("divergence")!==-1)&&Tt.push("divergence: "+J.divergenceLabel)),et.textLabel&&Tt.push(et.textLabel),dt=Tt.join("<br>")):R.type==="isosurface"||R.type==="volume"?(J.valueLabel=n.hoverLabelText(D._mockAxis,D._mockAxis.d2l(et.traceCoordinate[3]),R.valuehoverformat),Tt.push("value: "+J.valueLabel),et.textLabel&&Tt.push(et.textLabel),dt=Tt.join("<br>")):dt=et.textLabel;var wt={x:et.traceCoordinate[0],y:et.traceCoordinate[1],z:et.traceCoordinate[2],data:Q._input,fullData:Q,curveNumber:Q.index,pointNumber:ut};o.appendArrayPointValue(wt,Q,ut),R._module.eventData&&(wt=Q._module.eventData(wt,et,Q,{},ut));var It={points:[wt]};if(D.fullSceneLayout.hovermode){var Ct=[];o.loneHover({trace:Q,x:(.5+.5*X[0]/X[3])*G,y:(.5-.5*X[1]/X[3])*rt,xLabel:J.xLabel,yLabel:J.yLabel,zLabel:J.zLabel,text:dt,name:st.name,color:o.castHoverOption(Q,ut,"bgcolor")||st.color,borderColor:o.castHoverOption(Q,ut,"bordercolor"),fontFamily:o.castHoverOption(Q,ut,"font.family"),fontSize:o.castHoverOption(Q,ut,"font.size"),fontColor:o.castHoverOption(Q,ut,"font.color"),nameLength:o.castHoverOption(Q,ut,"namelength"),textAlign:o.castHoverOption(Q,ut,"align"),hovertemplate:r.castOption(Q,ut,"hovertemplate"),hovertemplateLabels:r.extendFlat({},wt,J),eventData:[wt]},{container:I,gd:B,inOut_bbox:Ct}),wt.bbox=Ct[0]}et.distance<5&&(et.buttons||y)?B.emit("plotly_click",It):B.emit("plotly_hover",It),this.oldEventData=It}else o.loneUnhover(I),this.oldEventData&&B.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;D.drawAnnotations(D)},k.recoverContext=function(){var D=this;D.glplot.dispose();var B=function(){if(D.glplot.gl.isContextLost()){requestAnimationFrame(B);return}if(!D.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}D.plot.apply(D,D.plotArgs)};requestAnimationFrame(B)};var T=["xaxis","yaxis","zaxis"];function c(D,B,R){for(var I=D.fullSceneLayout,F=0;F<3;F++){var N=T[F],j=N.charAt(0),G=I[N],rt=B[j],ct=B[j+"calendar"],st=B["_"+j+"length"];if(!r.isArrayOrTypedArray(rt))R[0][F]=Math.min(R[0][F],0),R[1][F]=Math.max(R[1][F],st-1);else for(var et,K=0;K<(st||rt.length);K++)if(r.isArrayOrTypedArray(rt[K]))for(var ot=0;ot<rt[K].length;++ot)et=G.d2l(rt[K][ot],0,ct),!isNaN(et)&&isFinite(et)&&(R[0][F]=Math.min(R[0][F],et),R[1][F]=Math.max(R[1][F],et));else et=G.d2l(rt[K],0,ct),!isNaN(et)&&isFinite(et)&&(R[0][F]=Math.min(R[0][F],et),R[1][F]=Math.max(R[1][F],et))}}function h(D,B){for(var R=D.fullSceneLayout,I=R.annotations||[],F=0;F<3;F++)for(var N=T[F],j=N.charAt(0),G=R[N],rt=0;rt<I.length;rt++){var ct=I[rt];if(ct.visible){var st=G.r2l(ct[j]);!isNaN(st)&&isFinite(st)&&(B[0][F]=Math.min(B[0][F],st),B[1][F]=Math.max(B[1][F],st))}}}k.plot=function(D,B,R){var I=this;if(I.plotArgs=[D,B,R],!I.glplot.contextLost){var F,N,j,G,rt,ct,st=B[I.id],et=R[I.id];I.fullLayout=B,I.fullSceneLayout=st,I.axesOptions.merge(B,st),I.spikeOptions.merge(st),I.setViewport(st),I.updateFx(st.dragmode,st.hovermode),I.camera.enableWheel=I.graphDiv._context._scrollZoom.gl3d,I.glplot.setClearColor(a(st.bgcolor)),I.setConvert(rt),D?Array.isArray(D)||(D=[D]):D=[];var K=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(j=0;j<D.length;++j)F=D[j],!(F.visible!==!0||F._length===0)&&c(this,F,K);h(this,K);var ot=[1,1,1];for(G=0;G<3;++G)K[1][G]===K[0][G]?ot[G]=1:ot[G]=1/(K[1][G]-K[0][G]);for(I.dataScale=ot,I.convertAnnotations(this),j=0;j<D.length;++j)F=D[j],!(F.visible!==!0||F._length===0)&&(N=I.traces[F.uid],N?N.data.type===F.type?N.update(F):(N.dispose(),N=F._module.plot(this,F),I.traces[F.uid]=N):(N=F._module.plot(this,F),I.traces[F.uid]=N),N.name=F.name);var X=Object.keys(I.traces);t:for(j=0;j<X.length;++j){for(G=0;G<D.length;++G)if(D[G].uid===X[j]&&D[G].visible===!0&&D[G]._length!==0)continue t;N=I.traces[X[j]],N.dispose(),delete I.traces[X[j]]}I.glplot.objects.sort(function(ue,Me){return ue._trace.data.index-Me._trace.data.index});var Q=[[0,0,0],[0,0,0]],ut=[],J={};for(j=0;j<3;++j){rt=st[T[j]],ct=rt.type,ct in J?(J[ct].acc*=ot[j],J[ct].count+=1):J[ct]={acc:ot[j],count:1};var q;if(rt.autorange){Q[0][j]=1/0,Q[1][j]=-1/0;var it=I.glplot.objects,nt=I.fullSceneLayout.annotations||[],dt=rt._name.charAt(0);for(G=0;G<it.length;G++){var Tt=it[G],wt=Tt.bounds,It=Tt._trace.data._pad||0;Tt.constructor.name==="ErrorBars"&&rt._lowerLogErrorBound?Q[0][j]=Math.min(Q[0][j],rt._lowerLogErrorBound):Q[0][j]=Math.min(Q[0][j],wt[0][j]/ot[j]-It),Q[1][j]=Math.max(Q[1][j],wt[1][j]/ot[j]+It)}for(G=0;G<nt.length;G++){var Ct=nt[G];if(Ct.visible){var Nt=rt.r2l(Ct[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 ee=Q[1][j]-Q[0][j];Q[0][j]-=ee/32,Q[1][j]+=ee/32}if(q=[Q[0][j],Q[1][j]],q=w(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),ut[j]=Q[1][j]-Q[0][j],rt.range=[Q[0][j],Q[1][j]],rt.limitRange(),I.glplot.setBounds(j,{min:rt.range[0]*ot[j],max:rt.range[1]*ot[j]})}var te,Kt=st.aspectmode;if(Kt==="cube")te=[1,1,1];else if(Kt==="manual"){var mt=st.aspectratio;te=[mt.x,mt.y,mt.z]}else if(Kt==="auto"||Kt==="data"){var bt=[1,1,1];for(j=0;j<3;++j){rt=st[T[j]],ct=rt.type;var vt=J[ct];bt[j]=Math.pow(vt.acc,1/vt.count)/ot[j]}Kt==="data"||Math.max.apply(null,bt)/Math.min.apply(null,bt)<=4?te=bt:te=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");st.aspectratio.x=et.aspectratio.x=te[0],st.aspectratio.y=et.aspectratio.y=te[1],st.aspectratio.z=et.aspectratio.z=te[2],I.glplot.setAspectratio(st.aspectratio),I.viewInitial.aspectratio||(I.viewInitial.aspectratio={x:st.aspectratio.x,y:st.aspectratio.y,z:st.aspectratio.z}),I.viewInitial.aspectmode||(I.viewInitial.aspectmode=st.aspectmode);var Ut=st.domain||null,re=B._size||null;if(Ut&&re){var Zt=I.container.style;Zt.position="absolute",Zt.left=re.l+Ut.x[0]*re.w+"px",Zt.top=re.t+(1-Ut.y[1])*re.h+"px",Zt.width=re.w*(Ut.x[1]-Ut.x[0])+"px",Zt.height=re.h*(Ut.y[1]-Ut.y[0])+"px"}I.glplot.redraw()}},k.destroy=function(){var D=this;D.glplot&&(D.camera.mouseListener.enabled=!1,D.container.removeEventListener("wheel",D.camera.wheelListener),D.camera=null,D.glplot.dispose(),D.container.parentNode.removeChild(D.container),D.glplot=null)};function b(D){return[[D.eye.x,D.eye.y,D.eye.z],[D.center.x,D.center.y,D.center.z],[D.up.x,D.up.y,D.up.z]]}function _(D){return{up:{x:D.up[0],y:D.up[1],z:D.up[2]},center:{x:D.center[0],y:D.center[1],z:D.center[2]},eye:{x:D.eye[0],y:D.eye[1],z:D.eye[2]},projection:{type:D._ortho===!0?"orthographic":"perspective"}}}k.getCamera=function(){var D=this;return D.camera.view.recalcMatrix(D.camera.view.lastT()),_(D.camera)},k.setViewport=function(D){var B=this,R=D.camera;B.camera.lookAt.apply(this,b(R)),B.glplot.setAspectratio(D.aspectratio);var I=R.projection.type==="orthographic",F=B.camera._ortho;I!==F&&(B.glplot.redraw(),B.glplot.clearRGBA(),B.glplot.dispose(),B.initializeGLPlot())},k.isCameraChanged=function(D){var B=this,R=B.getCamera(),I=r.nestedProperty(D,B.id+".camera"),F=I.get();function N(ct,st,et,K){var ot=["up","center","eye"],X=["x","y","z"];return st[ot[et]]&&ct[ot[et]][X[K]]===st[ot[et]][X[K]]}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},k.isAspectChanged=function(D){var B=this,R=B.glplot.getAspectratio(),I=r.nestedProperty(D,B.id+".aspectratio"),F=I.get();return F===void 0||F.x!==R.x||F.y!==R.y||F.z!==R.z},k.saveLayout=function(D){var B=this,R=B.fullLayout,I,F,N,j,G,rt,ct=B.isCameraChanged(D),st=B.isAspectChanged(D),et=ct||st;if(et){var K={};if(ct&&(I=B.getCamera(),F=r.nestedProperty(D,B.id+".camera"),N=F.get(),K[B.id+".camera"]=N),st&&(j=B.glplot.getAspectratio(),G=r.nestedProperty(D,B.id+".aspectratio"),rt=G.get(),K[B.id+".aspectratio"]=rt),e.call("_storeDirectGUIEdit",D,R._preGUI,K),ct){F.set(I);var ot=r.nestedProperty(R,B.id+".camera");ot.set(I)}if(st){G.set(j);var X=r.nestedProperty(R,B.id+".aspectratio");X.set(j),B.glplot.redraw()}}return et},k.updateFx=function(D,B){var R=this,I=R.camera;if(I)if(D==="orbit")I.mode="orbit",I.keyBindingMode="rotate";else if(D==="turntable"){I.up=[0,0,1],I.mode="turntable",I.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 st=R.id+".camera.up",et={x:0,y:0,z:1},K={};K[st]=et;var ot=F.layout;e.call("_storeDirectGUIEdit",ot,N._preGUI,K),j.up=et,r.nestedProperty(ot,st).set(et)}}else I.keyBindingMode=D;R.fullSceneLayout.hovermode=B};function P(D,B,R){for(var I=0,F=R-1;I<F;++I,--F)for(var N=0;N<B;++N)for(var j=0;j<4;++j){var G=4*(B*I+N)+j,rt=4*(B*F+N)+j,ct=D[G];D[G]=D[rt],D[rt]=ct}}function L(D,B,R){for(var I=0;I<R;++I)for(var F=0;F<B;++F){var N=4*(B*I+F),j=D[N+3];if(j>0)for(var G=255/j,rt=0;rt<3;++rt)D[N+rt]=Math.min(G*D[N+rt],255)}}k.toImage=function(D){var B=this;D||(D="png"),B.staticMode&&B.container.appendChild(l),B.glplot.redraw();var R=B.glplot.gl,I=R.drawingBufferWidth,F=R.drawingBufferHeight;R.bindFramebuffer(R.FRAMEBUFFER,null);var N=new Uint8Array(I*F*4);R.readPixels(0,0,I,F,R.RGBA,R.UNSIGNED_BYTE,N),P(N,I,F),L(N,I,F);var j=document.createElement("canvas");j.width=I,j.height=F;var G=j.getContext("2d",{willReadFrequently:!0}),rt=G.createImageData(I,F);rt.data.set(N),G.putImageData(rt,0,0);var ct;switch(D){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},k.setConvert=function(){for(var D=this,B=0;B<3;B++){var R=D.fullSceneLayout[T[B]];n.setConvert(R,D.fullLayout),R.setScale=r.noop}},k.make4thDimension=function(){var D=this,B=D.graphDiv,R=B._fullLayout;D._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(D._mockAxis,R)},V.exports=S}),NS=Vt((Z,V)=>{V.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),b3=Vt((Z,V)=>{var u=Pi(),d=Pf(),E=So().extendFlat,A=Cu().overrideAll;V.exports=A({visible:d.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:u.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:d.color,categoryorder:d.categoryorder,categoryarray:d.categoryarray,title:{text:d.title.text,font:d.title.font},type:E({},d.type,{values:["-","linear","log","date","category"]}),autotypenumbers:d.autotypenumbers,autorange:d.autorange,autorangeoptions:{minallowed:d.autorangeoptions.minallowed,maxallowed:d.autorangeoptions.maxallowed,clipmin:d.autorangeoptions.clipmin,clipmax:d.autorangeoptions.clipmax,include:d.autorangeoptions.include,editType:"plot"},rangemode:d.rangemode,minallowed:d.minallowed,maxallowed:d.maxallowed,range:E({},d.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:d.minor.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:d.ticks,mirror:d.mirror,ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,showticklabels:d.showticklabels,labelalias:d.labelalias,tickfont:d.tickfont,tickangle:d.tickangle,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,showexponent:d.showexponent,exponentformat:d.exponentformat,minexponent:d.minexponent,separatethousands:d.separatethousands,tickformat:d.tickformat,tickformatstops:d.tickformatstops,hoverformat:d.hoverformat,showline:d.showline,linecolor:d.linecolor,linewidth:d.linewidth,showgrid:d.showgrid,gridcolor:E({},d.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:d.gridwidth,zeroline:d.zeroline,zerolinecolor:d.zerolinecolor,zerolinewidth:d.zerolinewidth},"plot","from-root")}),w3=Vt((Z,V)=>{var u=b3(),d=Vu().attributes,E=So().extendFlat,A=Xr().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:d({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:u,yaxis:u,zaxis:u,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"}}),jS=Vt((Z,V)=>{var u=kf().mix,d=Xr(),E=cl(),A=b3(),t=Db(),e=Vg(),r=["xaxis","yaxis","zaxis"],i=13600/187;V.exports=function(n,o,a){var s,f;function v(w,l){return d.coerce(s,f,A,w,l)}for(var g=0;g<r.length;g++){var m=r[g];s=n[m]||{},f=E.newContainer(o,m),f._id=m[0]+a.scene,f._name=m,t(s,f,v,a),e(s,f,v,{font:a.font,letter:m[0],data:a.data,showGrid:!0,noAutotickangles:!0,noMinorloglabels:!0,noTicklabelindex:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,noInsiderange:!0,noUnifiedhovertitle:!0,bgColor:a.bgColor,calendar:a.calendar},a.fullLayout),v("gridcolor",u(f.color,a.bgColor,i).toRgbString()),v("title.text",m[0]),f.setScale=d.noop,v("showspikes")&&(v("spikesides"),v("spikethickness"),v("spikecolor",f.color)),v("showaxeslabels"),v("showbackground")&&v("backgroundcolor")}}}),US=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=ji(),A=zd(),t=jS(),e=w3(),r=If().getSubplotData,i="gl3d";V.exports=function(o,a,s){var f=a._basePlotModules.length>1;function v(g){if(!f){var m=u.validate(o[g],e[g]);if(m)return o[g]}}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,f){for(var v=s("bgcolor"),g=d.combine(v,f.paper_bgcolor),m=["up","center","eye"],w=0;w<m.length;w++)s("camera."+m[w]+".x"),s("camera."+m[w]+".y"),s("camera."+m[w]+".z");s("camera.projection.type");var l=!!s("aspectratio.x")&&!!s("aspectratio.y")&&!!s("aspectratio.z"),x=l?"manual":"auto",y=s("aspectmode",x);l||(o.aspectratio=a.aspectratio={x:1,y:1,z:1},y==="manual"&&(a.aspectmode="auto"),o.aspectmode=a.aspectmode);var S=r(f.fullData,i,f.id);t(o,a,{font:f.font,scene:f.id,data:S,bgColor:g,calendar:f.calendar,autotypenumbersDflt:f.autotypenumbersDflt,fullLayout:f.fullLayout}),E.getComponentMethod("annotations3d","handleDefaults")(o,a,f);var k=f.getDfltFromLayout("dragmode");if(k!==!1&&!k)if(k="orbit",o.camera&&o.camera.up){var M=o.camera.up.x,T=o.camera.up.y,c=o.camera.up.z;c!==0&&(!M||!T||!c||c/Math.sqrt(M*M+T*T+c*c)>.999)&&(k="turntable")}else k="turntable";s("dragmode",k),s("hovermode",f.getDfltFromLayout("hovermode"))}}),Rd=Vt(Z=>{var V=Cu().overrideAll,u=yd(),d=RS(),E=If().getSubplotData,A=Xr(),t=Eh(),e="gl3d",r="scene";Z.name=e,Z.attr=r,Z.idRoot=r,Z.idRegex=Z.attrRegex=A.counterRegex("scene"),Z.attributes=NS(),Z.layoutAttributes=w3(),Z.baseLayoutAttrOverrides=V({hoverlabel:u.hoverlabel},"plot","nested"),Z.supplyLayoutDefaults=US(),Z.plot=function(i){for(var n=i._fullLayout,o=i._fullData,a=n._subplots[e],s=0;s<a.length;s++){var f=a[s],v=E(o,e,f),g=n[f],m=g.camera,w=g._scene;w||(w=new d({id:f,graphDiv:i,container:i.querySelector(".gl-container"),staticPlot:i._context.staticPlot,plotGlPixelRatio:i._context.plotGlPixelRatio,camera:m},n),g._scene=w),w.viewInitial||(w.viewInitial={up:{x:m.up.x,y:m.up.y,z:m.up.z},eye:{x:m.eye.x,y:m.eye.y,z:m.eye.z},center:{x:m.center.x,y:m.center.y,z:m.center.z}}),w.plot(v,n,i.layout)}},Z.clean=function(i,n,o,a){for(var s=a._subplots[e]||[],f=0;f<s.length;f++){var v=s[f];!n[v]&&a[v]._scene&&(a[v]._scene.destroy(),a._infolayer&&a._infolayer.selectAll(".annotation-"+v).remove())}},Z.toSVG=function(i){for(var n=i._fullLayout,o=n._subplots[e],a=n._size,s=0;s<o.length;s++){var f=n[o[s]],v=f.domain,g=f._scene,m=g.toImage("png"),w=n._glimages.append("svg:image");w.attr({xmlns:t.svg,"xlink:href":m,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"}),g.destroy()}},Z.cleanId=function(i){if(i.match(/^scene[0-9]*$/)){var n=i.substr(5);return n==="1"&&(n=""),r+n}},Z.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)}}}),VS=Vt((Z,V)=>{V.exports={plot:LS(),attributes:x3(),markerSymbols:_x(),supplyDefaults:CS(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:IS(),moduleType:"trace",name:"scatter3d",basePlotModule:Rd(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),HS=Vt((Z,V)=>{V.exports=VS()}),Tv=Vt((Z,V)=>{var u=Pi(),d=Wl(),E=fc().axisHoverFormat,{hovertemplateAttrs:A,templatefallbackAttrs:t}=kl(),e=Tl(),r=So().extendFlat,i=Cu().overrideAll;function n(s){return{valType:"boolean",dflt:!1}}function o(s){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:n(),y:n(),z:n()},color:{valType:"color",dflt:u.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:u.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=V.exports=i(r({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(),hovertemplatefallback:t(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},d("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:o(),y:o(),z:o()},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,description:"Represents the level that incident rays are reflected in a single direction, causing shine."},roughness:{valType:"number",min:0,max:1,dflt:.5,description:"Alters specular reflection; the rougher the surface, the wider and less contrasty the shine."},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:r({},e.hoverinfo),showlegend:r({},e.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType="calc+clearAxisTypes"}),T3=Vt((Z,V)=>{var u=ji(),d=Xr(),E=gf(),A=Tv(),t=.1;function e(o,a){for(var s=[],f=32,v=0;v<f;v++){var g=v/(f-1),m=a+(1-a)*(1-Math.pow(Math.sin(o*g*Math.PI),2));s.push([g,Math.max(0,Math.min(1,m))])}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 f=o[s];if(f.length!==2||+f[0]<a)return!1;a=+f[0]}return!0}function i(o,a,s,f){var v,g;function m(c,h){return d.coerce(o,a,A,c,h)}var w=m("x"),l=m("y"),x=m("z");if(!x||!x.length||w&&w.length<1||l&&l.length<1){a.visible=!1;return}a._xlength=Array.isArray(w)&&d.isArrayOrTypedArray(w[0])?x.length:x[0].length,a._ylength=x.length;var y=u.getComponentMethod("calendars","handleTraceDefaults");y(o,a,["x","y","z"],f),m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("xhoverformat"),m("yhoverformat"),m("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach(function(c){m(c)}),m("surfacecolor");var S=["x","y","z"];for(v=0;v<3;++v){var k="contours."+S[v],M=m(k+".show"),T=m(k+".highlight");if(M||T)for(g=0;g<3;++g)m(k+".project."+S[g]);M&&(m(k+".color"),m(k+".width"),m(k+".usecolormap")),T&&(m(k+".highlightcolor"),m(k+".highlightwidth")),m(k+".start"),m(k+".end"),m(k+".size")}E(o,a,f,m,{prefix:"",cLetter:"c"}),n(o,a,f,m),a._length=null}function n(o,a,s,f){var v=f("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}}),qS=Vt((Z,V)=>{var u=ah();V.exports=function(d,E){E.surfacecolor?u(d,E,{vals:E.surfacecolor,containerStr:"",cLetter:"c"}):u(d,E,{vals:E.z,containerStr:"",cLetter:"c"})}}),WS=Vt((Z,V)=>{var u=Ff().gl_surface3d,d=Ff().ndarray,E=Ff().ndarray_linear_interpolate.d2,A=g1(),t=v1(),e=Xr().isArrayOrTypedArray,r=Hp().parseColorScale,i=Vp(),n=xu().extractOpts;function o(b,_,P){this.scene=b,this.uid=P,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(b,_,P,L){var D=e(this.data.x)?e(this.data.x[0])?this.data.x[_][b]:this.data.x[b]:b;return P===void 0?D:L.d2l(D,0,P)},a.getYat=function(b,_,P,L){var D=e(this.data.y)?e(this.data.y[0])?this.data.y[_][b]:this.data.y[_]:_;return P===void 0?D:L.d2l(D,0,P)},a.getZat=function(b,_,P,L){var D=this.data.z[_][b];return D===null&&this.data.connectgaps&&this.data._interpolatedZ&&(D=this.data._interpolatedZ[_][b]),P===void 0?D:L.d2l(D,0,P)},a.handlePick=function(b){if(b.object===this.surface){var _=(b.data.index[0]-1)/this.dataScaleX-1,P=(b.data.index[1]-1)/this.dataScaleY-1,L=Math.max(Math.min(Math.round(_),this.data.z[0].length-1),0),D=Math.max(Math.min(Math.round(P),this.data._ylength-1),0);b.index=[L,D],b.traceCoordinate=[this.getXat(L,D),this.getYat(L,D),this.getZat(L,D)],b.dataCoordinate=[this.getXat(L,D,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(L,D,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(L,D,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var B=0;B<3;B++){var R=b.dataCoordinate[B];R!=null&&(b.dataCoordinate[B]*=this.scene.dataScale[B])}var I=this.data.hovertext||this.data.text;return e(I)&&I[D]&&I[D][L]!==void 0?b.textLabel=I[D][L]:I?b.textLabel=I:b.textLabel="",b.data.dataCoordinate=b.dataCoordinate.slice(),this.surface.highlight(b.data),this.scene.glplot.spikes.position=b.dataCoordinate,!0}};function s(b){var _=b[0].rgb,P=b[b.length-1].rgb;return _[0]===P[0]&&_[1]===P[1]&&_[2]===P[2]&&_[3]===P[3]}var f=[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(b,_){if(b<_)return 0;for(var P=0;Math.floor(b%_)===0;)b/=_,P++;return P}function g(b){for(var _=[],P=0;P<f.length;P++){var L=f[P];_.push(v(b,L))}return _}function m(b){for(var _=g(b),P=b,L=0;L<f.length;L++)if(_[L]>0){P=f[L];break}return P}function w(b,_){if(!(b<1||_<1)){for(var P=g(b),L=g(_),D=1,B=0;B<f.length;B++)D*=Math.pow(f[B],Math.max(P[B],L[B]));return D}}function l(b){if(b.length!==0){for(var _=1,P=0;P<b.length;P++)_=w(_,b[P]);return _}}a.calcXnums=function(b){var _,P=[];for(_=1;_<b;_++){var L=this.getXat(_-1,0),D=this.getXat(_,0);D!==L&&L!==void 0&&L!==null&&D!==void 0&&D!==null?P[_-1]=Math.abs(D-L):P[_-1]=0}var B=0;for(_=1;_<b;_++)B+=P[_-1];for(_=1;_<b;_++)P[_-1]===0?P[_-1]=1:P[_-1]=Math.round(B/P[_-1]);return P},a.calcYnums=function(b){var _,P=[];for(_=1;_<b;_++){var L=this.getYat(0,_-1),D=this.getYat(0,_);D!==L&&L!==void 0&&L!==null&&D!==void 0&&D!==null?P[_-1]=Math.abs(D-L):P[_-1]=0}var B=0;for(_=1;_<b;_++)B+=P[_-1];for(_=1;_<b;_++)P[_-1]===0?P[_-1]=1:P[_-1]=Math.round(B/P[_-1]);return P};var x=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],y=x[9],S=x[13];a.estimateScale=function(b,_){for(var P=_===0?this.calcXnums(b):this.calcYnums(b),L=1+l(P);L<y;)L*=2;for(;L>S;)L--,L/=m(L),L++,L<y&&(L=S);var D=Math.round(L/b);return D>1?D:1};function k(b,_,P){var L=P[8]+P[2]*_[0]+P[5]*_[1];return b[0]=(P[6]+P[0]*_[0]+P[3]*_[1])/L,b[1]=(P[7]+P[1]*_[0]+P[4]*_[1])/L,b}function M(b,_,P){return T(b,_,k,P),b}function T(b,_,P,L){for(var D=[0,0],B=b.shape[0],R=b.shape[1],I=0;I<B;I++)for(var F=0;F<R;F++)P(D,[I,F],L),b.set(I,F,E(_,D[0],D[1]));return b}a.refineCoords=function(b){for(var _=this.dataScaleX,P=this.dataScaleY,L=b[0].shape[0],D=b[0].shape[1],B=Math.floor(b[0].shape[0]*_+1)|0,R=Math.floor(b[0].shape[1]*P+1)|0,I=1+L+1,F=1+D+1,N=d(new Float32Array(I*F),[I,F]),j=[1/_,0,0,0,1/P,0,0,0,1],G=0;G<b.length;++G){this.surface.padField(N,b[G]);var rt=d(new Float32Array(B*R),[B,R]);M(rt,N,j),b[G]=rt}};function c(b,_){for(var P=!1,L=0;L<b.length;L++)if(_===b[L]){P=!0;break}P===!1&&b.push(_)}a.setContourLevels=function(){var b=[[],[],[]],_=[!1,!1,!1],P=!1,L,D,B;for(L=0;L<3;++L)if(this.showContour[L]&&(P=!0,this.contourSize[L]>0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(_[L]=!0,D=this.contourStart[L];D<this.contourEnd[L];D+=this.contourSize[L])B=D*this.scene.dataScale[L],c(b[L],B);if(P){var R=[[],[],[]];for(L=0;L<3;++L)this.showContour[L]&&(R[L]=_[L]?b[L]:this.scene.contourLevels[L]);this.surface.update({levels:R})}},a.update=function(b){var _=this.scene,P=_.fullSceneLayout,L=this.surface,D=r(b),B=_.dataScale,R=b.z[0].length,I=b._ylength,F=_.contourLevels;this.data=b;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<I;G++)ct[0][j][G]=this.getXat(j,G,b.xcalendar,P.xaxis),ct[1][j][G]=this.getYat(j,G,b.ycalendar,P.yaxis),ct[2][j][G]=this.getZat(j,G,b.zcalendar,P.zaxis);if(b.connectgaps)for(b._emptypoints=t(ct[2]),A(ct[2],b._emptypoints),b._interpolatedZ=[],j=0;j<R;j++)for(b._interpolatedZ[j]=[],G=0;G<I;G++)b._interpolatedZ[j][G]=ct[2][j][G];for(N=0;N<3;N++)for(j=0;j<R;j++)for(G=0;G<I;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<I;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<I;G++)rt=ct[N][j][G],rt!=null&&(ct[N][j][G]-=this.objectOffset[N]);var st=[d(new Float32Array(R*I),[R,I]),d(new Float32Array(R*I),[R,I]),d(new Float32Array(R*I),[R,I])];for(N=0;N<3;N++)for(j=0;j<R;j++)for(G=0;G<I;G++)st[N].set(j,G,ct[N][j][G]);ct=[];var et={colormap:D,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!b.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:b.opacityscale,opacity:b.opacity},K=n(b);if(et.intensityBounds=[K.min,K.max],b.surfacecolor){var ot=d(new Float32Array(R*I),[R,I]);for(j=0;j<R;j++)for(G=0;G<I;G++)ot.set(j,G,b.surfacecolor[G][j]);st.push(ot)}else et.intensityBounds[0]*=B[2],et.intensityBounds[1]*=B[2];(S<st[0].shape[0]||S<st[0].shape[1])&&(this.refineData=!1),this.refineData===!0&&(this.dataScaleX=this.estimateScale(st[0].shape[0],0),this.dataScaleY=this.estimateScale(st[0].shape[1],1),(this.dataScaleX!==1||this.dataScaleY!==1)&&this.refineCoords(st)),b.surfacecolor&&(et.intensity=st.pop());var X=[!0,!0,!0],Q=["x","y","z"];for(N=0;N<3;++N){var ut=b.contours[Q[N]];X[N]=ut.highlight,et.showContour[N]=ut.show||ut.highlight,et.showContour[N]&&(et.contourProject[N]=[ut.project.x,ut.project.y,ut.project.z],ut.show?(this.showContour[N]=!0,et.levels[N]=F[N],L.highlightColor[N]=et.contourColor[N]=i(ut.color),ut.usecolormap?L.highlightTint[N]=et.contourTint[N]=0:L.highlightTint[N]=et.contourTint[N]=1,et.contourWidth[N]=ut.width,this.contourStart[N]=ut.start,this.contourEnd[N]=ut.end,this.contourSize[N]=ut.size):(this.showContour[N]=!1,this.contourStart[N]=null,this.contourEnd[N]=null,this.contourSize[N]=0),ut.highlight&&(et.dynamicColor[N]=i(ut.highlightcolor),et.dynamicWidth[N]=ut.highlightwidth))}s(D)&&(et.vertexColor=!0),et.objectOffset=this.objectOffset,et.coords=st,L.update(et),L.visible=b.visible,L.enableDynamic=X,L.enableHighlight=X,L.snapToData=!0,"lighting"in b&&(L.ambientLight=b.lighting.ambient,L.diffuseLight=b.lighting.diffuse,L.specularLight=b.lighting.specular,L.roughness=b.lighting.roughness,L.fresnel=b.lighting.fresnel),"lightposition"in b&&(L.lightPosition=[b.lightposition.x,b.lightposition.y,b.lightposition.z])},a.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()};function h(b,_){var P=b.glplot.gl,L=u({gl:P}),D=new o(b,L,_.uid);return L._trace=D,D.update(_),b.glplot.add(L),D}V.exports=h}),GS=Vt((Z,V)=>{V.exports={attributes:Tv(),supplyDefaults:T3().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:qS(),plot:WS(),moduleType:"trace",name:"surface",basePlotModule:Rd(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),ZS=Vt((Z,V)=>{V.exports=GS()}),Vm=Vt((Z,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Tv(),e=Tl(),r=So().extendFlat;V.exports=r({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"}),hovertemplatefallback:A({editType:"calc"}),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("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"}},u("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:t.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:r({},t.contours.x.show,{}),color:t.contours.x.color,width:t.contours.x.width,editType:"calc"},lightposition:{x:r({},t.lightposition.x,{dflt:1e5}),y:r({},t.lightposition.y,{dflt:1e5}),z:r({},t.lightposition.z,{dflt:0}),editType:"calc"},lighting:r({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},t.lighting),hoverinfo:r({},e.hoverinfo,{editType:"calc"}),showlegend:r({},e.showlegend,{dflt:!1})})}),bx=Vt((Z,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Vm(),e=Tl(),r=So().extendFlat,i=Cu().overrideAll;function n(s){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function o(s){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var a=V.exports=i(r({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:n(),y:n(),z:n()},caps:{x:o(),y:o(),z:o()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:E(),hovertemplatefallback:A(),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),valuehoverformat:d("value",1),showlegend:r({},e.showlegend,{dflt:!1})},u("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:t.opacity,lightposition:t.lightposition,lighting:t.lighting,flatshading:t.flatshading,contour:t.contour,hoverinfo:r({},e.hoverinfo)}),"calc","nested");a.flatshading.dflt=!0,a.lighting.facenormalsepsilon.dflt=0,a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}),k3=Vt((Z,V)=>{var u=Xr(),d=ji(),E=bx(),A=gf();function t(r,i,n,o){function a(s,f){return u.coerce(r,i,E,s,f)}e(r,i,n,o,a)}function e(r,i,n,o,a){var s=a("isomin"),f=a("isomax");f!=null&&s!==void 0&&s!==null&&s>f&&(i.isomin=null,i.isomax=null);var v=a("x"),g=a("y"),m=a("z"),w=a("value");if(!v||!v.length||!g||!g.length||!m||!m.length||!w||!w.length){i.visible=!1;return}var l=d.getComponentMethod("calendars","handleTraceDefaults");l(r,i,["x","y","z"],o),a("valuehoverformat"),["x","y","z"].forEach(function(k){a(k+"hoverformat");var M="caps."+k,T=a(M+".show");T&&a(M+".fill");var c="slices."+k,h=a(c+".show");h&&(a(c+".fill"),a(c+".locations"))});var x=a("spaceframe.show");x&&a("spaceframe.fill");var y=a("surface.show");y&&(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(k){a(k)}),A(r,i,o,a,{prefix:"",cLetter:"c"}),i._length=null}V.exports={supplyDefaults:t,supplyIsoDefaults:e}}),wx=Vt((Z,V)=>{var u=Xr(),d=ah();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,f;i.starts&&(a=e(i.starts.x||[]),s=e(i.starts.y||[]),f=e(i.starts.z||[]),o=Math.min(a.length,s.length,f.length)),i._startsX=a||[],i._startsY=s||[],i._startsZ=f||[];var v=0,g=1/0,m;for(m=0;m<i._len;m++){var w=i._u[m],l=i._v[m],x=i._w[m],y=Math.sqrt(w*w+l*l+x*x);v=Math.max(v,y),g=Math.min(g,y)}for(d(r,i,{vals:[g,v],containerStr:"",cLetter:"c"}),m=0;m<o;m++){var S=a[m];n.xMax=Math.max(n.xMax,S),n.xMin=Math.min(n.xMin,S);var k=s[m];n.yMax=Math.max(n.yMax,k),n.yMin=Math.min(n.yMin,k);var M=f[m];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,f,v,g=-1/0,m=1/0,w=-1/0,l=1/0,x=-1/0,y=1/0,S="",k,M,T,c,h,b,_,P,L;for(a&&(c=i[0],b=n[0],P=o[0]),a>1&&(h=i[a-1],_=n[a-1],L=o[a-1]),s=0;s<a;s++)g=Math.max(g,i[s]),m=Math.min(m,i[s]),w=Math.max(w,n[s]),l=Math.min(l,n[s]),x=Math.max(x,o[s]),y=Math.min(y,o[s]),!k&&i[s]!==c&&(k=!0,S+="x"),!M&&n[s]!==b&&(M=!0,S+="y"),!T&&o[s]!==P&&(T=!0,S+="z");k||(S+="x"),M||(S+="y"),T||(S+="z");var D=t(r._x),B=t(r._y),R=t(r._z);S=S.replace("x",(c>h?"-":"+")+"x"),S=S.replace("y",(b>_?"-":"+")+"y"),S=S.replace("z",(P>L?"-":"+")+"z");var I=function(){a=0,D=[],B=[],R=[]};(!a||a<D.length*B.length*R.length)&&I();var F=function(Tt){return Tt==="x"?i:Tt==="y"?n:o},N=function(Tt){return Tt==="x"?D:Tt==="y"?B:R},j=function(Tt){return Tt[a-1]<Tt[0]?-1:1},G=F(S[1]),rt=F(S[3]),ct=F(S[5]),st=N(S[1]).length,et=N(S[3]).length,K=N(S[5]).length,ot=!1,X=function(Tt,wt,It){return st*(et*Tt+wt)+It},Q=j(F(S[1])),ut=j(F(S[3])),J=j(F(S[5]));for(s=0;s<K-1;s++){for(f=0;f<et-1;f++){for(v=0;v<st-1;v++){var q=X(s,f,v),it=X(s,f,v+1),nt=X(s,f+1,v),dt=X(s+1,f,v);if((!(G[q]*Q<G[it]*Q)||!(rt[q]*ut<rt[nt]*ut)||!(ct[q]*J<ct[dt]*J))&&(ot=!0),ot)break}if(ot)break}if(ot)break}return ot&&(u.warn("Encountered arbitrary coordinates! Unable to input data grid."),I()),{xMin:m,yMin:l,zMin:y,xMax:g,yMax:w,zMax:x,Xs:D,Ys:B,Zs:R,len:a,fill:S}}function t(r){return u.distinctVals(r).vals}function e(r,i){if(i===void 0&&(i=r.length),u.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}}),A3=Vt((Z,V)=>{var u=ah(),d=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=d(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,u(A,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}}),Hm=Vt((Z,V)=>{V.exports=function(u,d,E,A){A=A||u.length;for(var t=new Array(A),e=0;e<A;e++)t[e]=[u[e],d[e],E[e]];return t}}),Tx=Vt((Z,V)=>{var u=Ff().gl_mesh3d,d=Hp().parseColorScale,E=Xr().isArrayOrTypedArray,A=Vp(),t=xu().extractOpts,e=Hm(),r=function(f,v){for(var g=v.length-1;g>0;g--){var m=Math.min(v[g],v[g-1]),w=Math.max(v[g],v[g-1]);if(w>m&&m<f&&f<=w)return{id:g,distRatio:(w-f)/(w-m)}}return{id:0,distRatio:0}};function i(f,v,g){this.scene=f,this.uid=g,this.mesh=v,this.name="",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(f){if(f.object===this.mesh){var v=f.data.index,g=this.data._meshX[v],m=this.data._meshY[v],w=this.data._meshZ[v],l=this.data._Ys.length,x=this.data._Zs.length,y=r(g,this.data._Xs).id,S=r(m,this.data._Ys).id,k=r(w,this.data._Zs).id,M=f.index=k+x*S+x*l*y;f.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var T=this.data.hovertext||this.data.text;return E(T)&&T[M]!==void 0?f.textLabel=T[M]:T&&(f.textLabel=T),!0}},n.update=function(f){var v=this.scene,g=v.fullSceneLayout;this.data=a(f);function m(S,k,M,T){return k.map(function(c){return S.d2l(c,0,T)*M})}var w=e(m(g.xaxis,f._meshX,v.dataScale[0],f.xcalendar),m(g.yaxis,f._meshY,v.dataScale[1],f.ycalendar),m(g.zaxis,f._meshZ,v.dataScale[2],f.zcalendar)),l=e(f._meshI,f._meshJ,f._meshK),x={positions:w,cells:l,lightPosition:[f.lightposition.x,f.lightposition.y,f.lightposition.z],ambient:f.lighting.ambient,diffuse:f.lighting.diffuse,specular:f.lighting.specular,roughness:f.lighting.roughness,fresnel:f.lighting.fresnel,vertexNormalsEpsilon:f.lighting.vertexnormalsepsilon,faceNormalsEpsilon:f.lighting.facenormalsepsilon,opacity:f.opacity,contourEnable:f.contour.show,contourColor:A(f.contour.color).slice(0,3),contourWidth:f.contour.width,useFacetNormals:f.flatshading},y=t(f);x.vertexIntensity=f._meshIntensity,x.vertexIntensityBounds=[y.min,y.max],x.colormap=d(f),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(f){f._meshI=[],f._meshJ=[],f._meshK=[];var v=f.surface.show,g=f.spaceframe.show,m=f.surface.fill,w=f.spaceframe.fill,l=!1,x=!1,y=0,S,k,M=f._Xs,T=f._Ys,c=f._Zs,h=M.length,b=T.length,_=c.length,P=o.indexOf(f._gridFill.replace(/-/g,"").replace(/\+/g,"")),L=function(de,Dt,qt){switch(P){case 5:return qt+_*Dt+_*b*de;case 4:return qt+_*de+_*h*Dt;case 3:return Dt+b*qt+b*_*de;case 2:return Dt+b*de+b*h*qt;case 1:return de+h*qt+h*_*Dt;default:return de+h*Dt+h*b*qt}},D=f._minValues,B=f._maxValues,R=f._vMin,I=f._vMax,F,N,j,G;function rt(de,Dt,qt){for(var _t=G.length,lt=k;lt<_t;lt++)if(de===F[lt]&&Dt===N[lt]&&qt===j[lt])return lt;return-1}function ct(){k=S}function st(){F=[],N=[],j=[],G=[],S=0,ct()}function et(de,Dt,qt,_t){return F.push(de),N.push(Dt),j.push(qt),G.push(_t),S++,S-1}function K(de,Dt,qt){return f._meshI.push(de),f._meshJ.push(Dt),f._meshK.push(qt),y++,y-1}function ot(de,Dt,qt){for(var _t=[],lt=0;lt<de.length;lt++)_t[lt]=(de[lt]+Dt[lt]+qt[lt])/3;return _t}function X(de,Dt,qt){for(var _t=[],lt=0;lt<de.length;lt++)_t[lt]=de[lt]*(1-qt)+qt*Dt[lt];return _t}var Q;function ut(de){Q=de}function J(de,Dt){var qt=de[0],_t=de[1],lt=de[2],yt=ot(qt,_t,lt),St=Math.sqrt(1-Q),Ht=X(yt,qt,St),Yt=X(yt,_t,St),se=X(yt,lt,St),ke=Dt[0],Ee=Dt[1],Ue=Dt[2];return{xyzv:[[qt,_t,Yt],[Yt,Ht,qt],[_t,lt,se],[se,Yt,_t],[lt,qt,Ht],[Ht,se,lt]],abc:[[ke,Ee,-1],[-1,-1,ke],[Ee,Ue,-1],[-1,-1,Ee],[Ue,ke,-1],[-1,-1,Ue]]}}function q(de,Dt){return de==="all"||de===null?!0:de.indexOf(Dt)>-1}function it(de,Dt){return de===null?Dt:de}function nt(de,Dt,qt){ct();var _t=[Dt],lt=[qt];if(Q>=1)_t=[Dt],lt=[qt];else if(Q>0){var yt=J(Dt,qt);_t=yt.xyzv,lt=yt.abc}for(var St=0;St<_t.length;St++){Dt=_t[St],qt=lt[St];for(var Ht=[],Yt=0;Yt<3;Yt++){var se=Dt[Yt][0],ke=Dt[Yt][1],Ee=Dt[Yt][2],Ue=Dt[Yt][3],ir=qt[Yt]>-1?qt[Yt]:rt(se,ke,Ee);ir>-1?Ht[Yt]=ir:Ht[Yt]=et(se,ke,Ee,it(de,Ue))}K(Ht[0],Ht[1],Ht[2])}}function dt(de,Dt,qt){var _t=function(lt,yt,St){nt(de,[Dt[lt],Dt[yt],Dt[St]],[qt[lt],qt[yt],qt[St]])};_t(0,1,2),_t(2,3,0)}function Tt(de,Dt,qt){var _t=function(lt,yt,St){nt(de,[Dt[lt],Dt[yt],Dt[St]],[qt[lt],qt[yt],qt[St]])};_t(0,1,2),_t(3,0,1),_t(2,3,0),_t(1,2,3)}function wt(de,Dt,qt,_t){var lt=de[3];lt<qt&&(lt=qt),lt>_t&&(lt=_t);for(var yt=(de[3]-lt)/(de[3]-Dt[3]+1e-9),St=[],Ht=0;Ht<4;Ht++)St[Ht]=(1-yt)*de[Ht]+yt*Dt[Ht];return St}function It(de,Dt,qt){return de>=Dt&&de<=qt}function Ct(de){var Dt=.001*(I-R);return de>=R-Dt&&de<=I+Dt}function Nt(de){for(var Dt=[],qt=0;qt<4;qt++){var _t=de[qt];Dt.push([f._x[_t],f._y[_t],f._z[_t],f._value[_t]])}return Dt}var ee=3;function Jt(de,Dt,qt,_t,lt,yt){yt||(yt=1),qt=[-1,-1,-1];var St=!1,Ht=[It(Dt[0][3],_t,lt),It(Dt[1][3],_t,lt),It(Dt[2][3],_t,lt)];if(!Ht[0]&&!Ht[1]&&!Ht[2])return!1;var Yt=function(ke,Ee,Ue){return Ct(Ee[0][3])&&Ct(Ee[1][3])&&Ct(Ee[2][3])?(nt(ke,Ee,Ue),!0):yt<ee?Jt(ke,Ee,Ue,R,I,++yt):!1};if(Ht[0]&&Ht[1]&&Ht[2])return Yt(de,Dt,qt)||St;var se=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(ke){if(Ht[ke[0]]&&Ht[ke[1]]&&!Ht[ke[2]]){var Ee=Dt[ke[0]],Ue=Dt[ke[1]],ir=Dt[ke[2]],ar=wt(ir,Ee,_t,lt),Ye=wt(ir,Ue,_t,lt);St=Yt(de,[Ye,ar,Ee],[-1,-1,qt[ke[0]]])||St,St=Yt(de,[Ee,Ue,Ye],[qt[ke[0]],qt[ke[1]],-1])||St,se=!0}}),se||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(ke){if(Ht[ke[0]]&&!Ht[ke[1]]&&!Ht[ke[2]]){var Ee=Dt[ke[0]],Ue=Dt[ke[1]],ir=Dt[ke[2]],ar=wt(Ue,Ee,_t,lt),Ye=wt(ir,Ee,_t,lt);St=Yt(de,[Ye,ar,Ee],[-1,-1,qt[ke[0]]])||St,se=!0}}),St}function te(de,Dt,qt,_t){var lt=!1,yt=Nt(Dt),St=[It(yt[0][3],qt,_t),It(yt[1][3],qt,_t),It(yt[2][3],qt,_t),It(yt[3][3],qt,_t)];if(!St[0]&&!St[1]&&!St[2]&&!St[3])return lt;if(St[0]&&St[1]&&St[2]&&St[3])return x&&(lt=Tt(de,yt,Dt)||lt),lt;var Ht=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(Yt){if(St[Yt[0]]&&St[Yt[1]]&&St[Yt[2]]&&!St[Yt[3]]){var se=yt[Yt[0]],ke=yt[Yt[1]],Ee=yt[Yt[2]],Ue=yt[Yt[3]];if(x)lt=nt(de,[se,ke,Ee],[Dt[Yt[0]],Dt[Yt[1]],Dt[Yt[2]]])||lt;else{var ir=wt(Ue,se,qt,_t),ar=wt(Ue,ke,qt,_t),Ye=wt(Ue,Ee,qt,_t);lt=nt(null,[ir,ar,Ye],[-1,-1,-1])||lt}Ht=!0}}),Ht||([[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(Yt){if(St[Yt[0]]&&St[Yt[1]]&&!St[Yt[2]]&&!St[Yt[3]]){var se=yt[Yt[0]],ke=yt[Yt[1]],Ee=yt[Yt[2]],Ue=yt[Yt[3]],ir=wt(Ee,se,qt,_t),ar=wt(Ee,ke,qt,_t),Ye=wt(Ue,ke,qt,_t),Er=wt(Ue,se,qt,_t);x?(lt=nt(de,[se,Er,ir],[Dt[Yt[0]],-1,-1])||lt,lt=nt(de,[ke,ar,Ye],[Dt[Yt[1]],-1,-1])||lt):lt=dt(null,[ir,ar,Ye,Er],[-1,-1,-1,-1])||lt,Ht=!0}}),Ht)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(Yt){if(St[Yt[0]]&&!St[Yt[1]]&&!St[Yt[2]]&&!St[Yt[3]]){var se=yt[Yt[0]],ke=yt[Yt[1]],Ee=yt[Yt[2]],Ue=yt[Yt[3]],ir=wt(ke,se,qt,_t),ar=wt(Ee,se,qt,_t),Ye=wt(Ue,se,qt,_t);x?(lt=nt(de,[se,ir,ar],[Dt[Yt[0]],-1,-1])||lt,lt=nt(de,[se,ar,Ye],[Dt[Yt[0]],-1,-1])||lt,lt=nt(de,[se,Ye,ir],[Dt[Yt[0]],-1,-1])||lt):lt=nt(null,[ir,ar,Ye],[-1,-1,-1])||lt,Ht=!0}}),lt}function Kt(de,Dt,qt,_t,lt,yt,St,Ht,Yt,se,ke){var Ee=!1;return l&&(q(de,"A")&&(Ee=te(null,[Dt,qt,_t,yt],se,ke)||Ee),q(de,"B")&&(Ee=te(null,[qt,_t,lt,Yt],se,ke)||Ee),q(de,"C")&&(Ee=te(null,[qt,yt,St,Yt],se,ke)||Ee),q(de,"D")&&(Ee=te(null,[_t,yt,Ht,Yt],se,ke)||Ee),q(de,"E")&&(Ee=te(null,[qt,_t,yt,Yt],se,ke)||Ee)),x&&(Ee=te(de,[qt,_t,yt,Yt],se,ke)||Ee),Ee}function mt(de,Dt,qt,_t,lt,yt,St,Ht){return[Ht[0]===!0?!0:Jt(de,Nt([Dt,qt,_t]),[Dt,qt,_t],yt,St),Ht[1]===!0?!0:Jt(de,Nt([_t,lt,Dt]),[_t,lt,Dt],yt,St)]}function bt(de,Dt,qt,_t,lt,yt,St,Ht,Yt){return Ht?mt(de,Dt,qt,lt,_t,yt,St,Yt):mt(de,qt,lt,_t,Dt,yt,St,Yt)}function vt(de,Dt,qt,_t,lt,yt,St){var Ht=!1,Yt,se,ke,Ee,Ue=function(){Ht=Jt(de,[Yt,se,ke],[-1,-1,-1],lt,yt)||Ht,Ht=Jt(de,[ke,Ee,Yt],[-1,-1,-1],lt,yt)||Ht},ir=St[0],ar=St[1],Ye=St[2];return ir&&(Yt=X(Nt([L(Dt,qt-0,_t-0)])[0],Nt([L(Dt-1,qt-0,_t-0)])[0],ir),se=X(Nt([L(Dt,qt-0,_t-1)])[0],Nt([L(Dt-1,qt-0,_t-1)])[0],ir),ke=X(Nt([L(Dt,qt-1,_t-1)])[0],Nt([L(Dt-1,qt-1,_t-1)])[0],ir),Ee=X(Nt([L(Dt,qt-1,_t-0)])[0],Nt([L(Dt-1,qt-1,_t-0)])[0],ir),Ue()),ar&&(Yt=X(Nt([L(Dt-0,qt,_t-0)])[0],Nt([L(Dt-0,qt-1,_t-0)])[0],ar),se=X(Nt([L(Dt-0,qt,_t-1)])[0],Nt([L(Dt-0,qt-1,_t-1)])[0],ar),ke=X(Nt([L(Dt-1,qt,_t-1)])[0],Nt([L(Dt-1,qt-1,_t-1)])[0],ar),Ee=X(Nt([L(Dt-1,qt,_t-0)])[0],Nt([L(Dt-1,qt-1,_t-0)])[0],ar),Ue()),Ye&&(Yt=X(Nt([L(Dt-0,qt-0,_t)])[0],Nt([L(Dt-0,qt-0,_t-1)])[0],Ye),se=X(Nt([L(Dt-0,qt-1,_t)])[0],Nt([L(Dt-0,qt-1,_t-1)])[0],Ye),ke=X(Nt([L(Dt-1,qt-1,_t)])[0],Nt([L(Dt-1,qt-1,_t-1)])[0],Ye),Ee=X(Nt([L(Dt-1,qt-0,_t)])[0],Nt([L(Dt-1,qt-0,_t-1)])[0],Ye),Ue()),Ht}function Ut(de,Dt,qt,_t,lt,yt,St,Ht,Yt,se,ke,Ee){var Ue=de;return Ee?(l&&de==="even"&&(Ue=null),Kt(Ue,Dt,qt,_t,lt,yt,St,Ht,Yt,se,ke)):(l&&de==="odd"&&(Ue=null),Kt(Ue,Yt,Ht,St,yt,lt,_t,qt,Dt,se,ke))}function re(de,Dt,qt,_t,lt){for(var yt=[],St=0,Ht=0;Ht<Dt.length;Ht++)for(var Yt=Dt[Ht],se=1;se<_;se++)for(var ke=1;ke<b;ke++)yt.push(bt(de,L(Yt,ke-1,se-1),L(Yt,ke-1,se),L(Yt,ke,se-1),L(Yt,ke,se),qt,_t,(Yt+ke+se)%2,lt&&lt[St]?lt[St]:[])),St++;return yt}function Zt(de,Dt,qt,_t,lt){for(var yt=[],St=0,Ht=0;Ht<Dt.length;Ht++)for(var Yt=Dt[Ht],se=1;se<h;se++)for(var ke=1;ke<_;ke++)yt.push(bt(de,L(se-1,Yt,ke-1),L(se,Yt,ke-1),L(se-1,Yt,ke),L(se,Yt,ke),qt,_t,(se+Yt+ke)%2,lt&&lt[St]?lt[St]:[])),St++;return yt}function ue(de,Dt,qt,_t,lt){for(var yt=[],St=0,Ht=0;Ht<Dt.length;Ht++)for(var Yt=Dt[Ht],se=1;se<b;se++)for(var ke=1;ke<h;ke++)yt.push(bt(de,L(ke-1,se-1,Yt),L(ke-1,se,Yt),L(ke,se-1,Yt),L(ke,se,Yt),qt,_t,(ke+se+Yt)%2,lt&&lt[St]?lt[St]:[])),St++;return yt}function Me(de,Dt,qt){for(var _t=1;_t<_;_t++)for(var lt=1;lt<b;lt++)for(var yt=1;yt<h;yt++)Ut(de,L(yt-1,lt-1,_t-1),L(yt-1,lt-1,_t),L(yt-1,lt,_t-1),L(yt-1,lt,_t),L(yt,lt-1,_t-1),L(yt,lt-1,_t),L(yt,lt,_t-1),L(yt,lt,_t),Dt,qt,(yt+lt+_t)%2)}function Ce(de,Dt,qt){x=!0,Me(de,Dt,qt),x=!1}function We(de,Dt,qt){l=!0,Me(de,Dt,qt),l=!1}function qe(de,Dt,qt,_t,lt,yt){for(var St=[],Ht=0,Yt=0;Yt<Dt.length;Yt++)for(var se=Dt[Yt],ke=1;ke<_;ke++)for(var Ee=1;Ee<b;Ee++)St.push(vt(de,se,Ee,ke,qt,_t,lt[Yt],yt&&yt[Ht]?yt[Ht]:[])),Ht++;return St}function vr(de,Dt,qt,_t,lt,yt){for(var St=[],Ht=0,Yt=0;Yt<Dt.length;Yt++)for(var se=Dt[Yt],ke=1;ke<h;ke++)for(var Ee=1;Ee<_;Ee++)St.push(vt(de,ke,se,Ee,qt,_t,lt[Yt],yt&&yt[Ht]?yt[Ht]:[])),Ht++;return St}function _r(de,Dt,qt,_t,lt,yt){for(var St=[],Ht=0,Yt=0;Yt<Dt.length;Yt++)for(var se=Dt[Yt],ke=1;ke<b;ke++)for(var Ee=1;Ee<h;Ee++)St.push(vt(de,Ee,ke,se,qt,_t,lt[Yt],yt&&yt[Ht]?yt[Ht]:[])),Ht++;return St}function er(de,Dt){for(var qt=[],_t=de;_t<Dt;_t++)qt.push(_t);return qt}function Mr(){for(var de=0;de<h;de++)for(var Dt=0;Dt<b;Dt++)for(var qt=0;qt<_;qt++){var _t=L(de,Dt,qt);et(f._x[_t],f._y[_t],f._z[_t],f._value[_t])}}function Ir(){st(),Mr();var de=null;if(g&&w&&(ut(w),Ce(de,R,I)),v&&m){ut(m);for(var Dt=f.surface.pattern,qt=f.surface.count,_t=0;_t<qt;_t++){var lt=qt===1?.5:_t/(qt-1),yt=(1-lt)*R+lt*I,St=Math.abs(yt-D),Ht=Math.abs(yt-B),Yt=St>Ht?[D,yt]:[yt,B];We(Dt,Yt[0],Yt[1])}}var se=[[Math.min(R,B),Math.max(R,B)],[Math.min(D,I),Math.max(D,I)]];["x","y","z"].forEach(function(ke){for(var Ee=[],Ue=0;Ue<se.length;Ue++){var ir=0,ar=se[Ue][0],Ye=se[Ue][1],Er=f.slices[ke];if(Er.show&&Er.fill){ut(Er.fill);var pn=[],dn=[],bn=[];if(Er.locations.length)for(var Zn=0;Zn<Er.locations.length;Zn++){var En=r(Er.locations[Zn],ke==="x"?M:ke==="y"?T:c);En.distRatio===0?pn.push(En.id):En.id>0&&(dn.push(En.id),ke==="x"?bn.push([En.distRatio,0,0]):ke==="y"?bn.push([0,En.distRatio,0]):bn.push([0,0,En.distRatio]))}else ke==="x"?pn=er(1,h-1):ke==="y"?pn=er(1,b-1):pn=er(1,_-1);dn.length>0&&(ke==="x"?Ee[ir]=qe(de,dn,ar,Ye,bn,Ee[ir]):ke==="y"?Ee[ir]=vr(de,dn,ar,Ye,bn,Ee[ir]):Ee[ir]=_r(de,dn,ar,Ye,bn,Ee[ir]),ir++),pn.length>0&&(ke==="x"?Ee[ir]=re(de,pn,ar,Ye,Ee[ir]):ke==="y"?Ee[ir]=Zt(de,pn,ar,Ye,Ee[ir]):Ee[ir]=ue(de,pn,ar,Ye,Ee[ir]),ir++)}var gn=f.caps[ke];gn.show&&gn.fill&&(ut(gn.fill),ke==="x"?Ee[ir]=re(de,[0,h-1],ar,Ye,Ee[ir]):ke==="y"?Ee[ir]=Zt(de,[0,b-1],ar,Ye,Ee[ir]):Ee[ir]=ue(de,[0,_-1],ar,Ye,Ee[ir]),ir++)}}),y===0&&st(),f._meshX=F,f._meshY=N,f._meshZ=j,f._meshIntensity=G,f._Xs=M,f._Ys=T,f._Zs=c}return Ir(),f}function s(f,v){var g=f.glplot.gl,m=u({gl:g}),w=new i(f,m,v.uid);return m._trace=w,w.update(v),f.glplot.add(m),w}V.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}),KS=Vt((Z,V)=>{V.exports={attributes:bx(),supplyDefaults:k3().supplyDefaults,calc:A3(),colorbar:{min:"cmin",max:"cmax"},plot:Tx().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:Rd(),categories:["gl3d","showLegend"],meta:{}}}),YS=Vt((Z,V)=>{V.exports=KS()}),M3=Vt((Z,V)=>{var u=Wl(),d=bx(),E=Tv(),A=Tl(),t=So().extendFlat,e=Cu().overrideAll,r=V.exports=e(t({x:d.x,y:d.y,z:d.z,value:d.value,isomin:d.isomin,isomax:d.isomax,surface:d.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:d.slices,caps:d.caps,text:d.text,hovertext:d.hovertext,xhoverformat:d.xhoverformat,yhoverformat:d.yhoverformat,zhoverformat:d.zhoverformat,valuehoverformat:d.valuehoverformat,hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback},u("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:d.colorbar,opacity:d.opacity,opacityscale:E.opacityscale,lightposition:d.lightposition,lighting:d.lighting,flatshading:d.flatshading,contour:d.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"}),XS=Vt((Z,V)=>{var u=Xr(),d=M3(),E=k3().supplyIsoDefaults,A=T3().opacityscaleDefaults;V.exports=function(t,e,r,i){function n(o,a){return u.coerce(t,e,d,o,a)}E(t,e,r,i,n),A(t,e,i,n)}}),$S=Vt((Z,V)=>{var u=Ff().gl_mesh3d,d=Hp().parseColorScale,E=Xr().isArrayOrTypedArray,A=Vp(),t=xu().extractOpts,e=Hm(),r=Tx().findNearestOnAxis,i=Tx().generateIsoMeshes;function n(s,f,v){this.scene=s,this.uid=v,this.mesh=f,this.name="",this.data=null,this.showContour=!1}var o=n.prototype;o.handlePick=function(s){if(s.object===this.mesh){var f=s.data.index,v=this.data._meshX[f],g=this.data._meshY[f],m=this.data._meshZ[f],w=this.data._Ys.length,l=this.data._Zs.length,x=r(v,this.data._Xs).id,y=r(g,this.data._Ys).id,S=r(m,this.data._Zs).id,k=s.index=S+l*y+l*w*x;s.traceCoordinate=[this.data._meshX[k],this.data._meshY[k],this.data._meshZ[k],this.data._value[k]];var M=this.data.hovertext||this.data.text;return E(M)&&M[k]!==void 0?s.textLabel=M[k]:M&&(s.textLabel=M),!0}},o.update=function(s){var f=this.scene,v=f.fullSceneLayout;this.data=i(s);function g(y,S,k,M){return S.map(function(T){return y.d2l(T,0,M)*k})}var m=e(g(v.xaxis,s._meshX,f.dataScale[0],s.xcalendar),g(v.yaxis,s._meshY,f.dataScale[1],s.ycalendar),g(v.zaxis,s._meshZ,f.dataScale[2],s.zcalendar)),w=e(s._meshI,s._meshJ,s._meshK),l={positions:m,cells:w,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=d(s),this.mesh.update(l)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function a(s,f){var v=s.glplot.gl,g=u({gl:v}),m=new n(s,g,f.uid);return g._trace=m,m.update(f),s.glplot.add(g),m}V.exports=a}),JS=Vt((Z,V)=>{V.exports={attributes:M3(),supplyDefaults:XS(),calc:A3(),colorbar:{min:"cmin",max:"cmax"},plot:$S(),moduleType:"trace",name:"volume",basePlotModule:Rd(),categories:["gl3d","showLegend"],meta:{}}}),QS=Vt((Z,V)=>{V.exports=JS()}),tE=Vt((Z,V)=>{var u=ji(),d=Xr(),E=gf(),A=Vm();V.exports=function(t,e,r,i){function n(v,g){return d.coerce(t,e,A,v,g)}function o(v){var g=v.map(function(m){var w=n(m);return w&&d.isArrayOrTypedArray(w)?w:null});return g.every(function(m){return m&&m.length===g[0].length})&&g}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=u.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 f=n("contour.show");f&&(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("hovertemplatefallback"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),e._length=null}}),eE=Vt((Z,V)=>{var u=ah();V.exports=function(d,E){E.intensity&&u(d,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}),rE=Vt((Z,V)=>{var u=Ff().gl_mesh3d,d=Ff().delaunay_triangulate,E=Ff().alpha_shape,A=Ff().convex_hull,t=Hp().parseColorScale,e=Xr().isArrayOrTypedArray,r=Vp(),i=xu().extractOpts,n=Hm();function o(l,x,y){this.scene=l,this.uid=y,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 y=this.data.hovertext||this.data.text;return e(y)&&y[x]!==void 0?l.textLabel=y[x]:y&&(l.textLabel=y),!0}};function s(l){for(var x=[],y=l.length,S=0;S<y;S++)x[S]=r(l[S]);return x}function f(l,x,y,S){for(var k=[],M=x.length,T=0;T<M;T++)k[T]=l.d2l(x[T],0,S)*y;return k}function v(l){for(var x=[],y=l.length,S=0;S<y;S++)x[S]=Math.round(l[S]);return x}function g(l,x){for(var y=["x","y","z"].indexOf(l),S=[],k=x.length,M=0;M<k;M++)S[M]=[x[M][(y+1)%3],x[M][(y+2)%3]];return d(S)}function m(l,x){for(var y=l.length,S=0;S<y;S++)if(l[S]<=-.5||l[S]>=x-.5)return!1;return!0}a.update=function(l){var x=this.scene,y=x.fullSceneLayout;this.data=l;var S=l.x.length,k=n(f(y.xaxis,l.x,x.dataScale[0],l.xcalendar),f(y.yaxis,l.y,x.dataScale[1],l.ycalendar),f(y.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||!m(l.i,S)||!m(l.j,S)||!m(l.k,S))return;M=n(v(l.i),v(l.j),v(l.k))}else l.alphahull===0?M=A(k):l.alphahull>0?M=E(l.alphahull,k):M=g(l.delaunayaxis,k);var T={positions:k,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 c=i(l);this.color="#fff";var h=l.intensitymode;T[h+"Intensity"]=l.intensity,T[h+"IntensityBounds"]=[c.min,c.max],T.colormap=t(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],T.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],T.cellColors=s(l.facecolor)):(this.color=l.color,T.meshColor=r(l.color));this.mesh.update(T)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function w(l,x){var y=l.glplot.gl,S=u({gl:y}),k=new o(l,S,x.uid);return S._trace=k,k.update(x),l.glplot.add(S),k}V.exports=w}),nE=Vt((Z,V)=>{V.exports={attributes:Vm(),supplyDefaults:tE(),calc:eE(),colorbar:{min:"cmin",max:"cmax"},plot:rE(),moduleType:"trace",name:"mesh3d",basePlotModule:Rd(),categories:["gl3d","showLegend"],meta:{}}}),aE=Vt((Z,V)=>{V.exports=nE()}),S3=Vt((Z,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Vm(),e=Tl(),r=So().extendFlat,i={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"]}),hovertemplatefallback:A({editType:"calc"}),uhoverformat:d("u",1),vhoverformat:d("v",1),whoverformat:d("w",1),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),showlegend:r({},e.showlegend,{dflt:!1})};r(i,u("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(o){i[o]=t[o]}),i.hoverinfo=r({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=i}),iE=Vt((Z,V)=>{var u=Xr(),d=gf(),E=S3();V.exports=function(A,t,e,r){function i(m,w){return u.coerce(A,t,E,m,w)}var n=i("u"),o=i("v"),a=i("w"),s=i("x"),f=i("y"),v=i("z");if(!n||!n.length||!o||!o.length||!a||!a.length||!s||!s.length||!f||!f.length||!v||!v.length){t.visible=!1;return}var g=i("sizemode");i("sizeref",g==="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"),d(A,t,r,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),t._length=null}}),oE=Vt((Z,V)=>{var u=ah();V.exports=function(d,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],f=e[o],v=Math.sqrt(a*a+s*s+f*f);i=Math.max(i,v),n=Math.min(n,v)}E._len=r,E._normMax=i,u(d,E,{vals:[n,i],containerStr:"",cLetter:"c"})}}),sE=Vt((Z,V)=>{var u=Ff().gl_cone3d,d=Ff().gl_cone3d.createConeMesh,E=Xr().simpleMap,A=Hp().parseColorScale,t=xu().extractOpts,e=Xr().isArrayOrTypedArray,r=Hm();function i(g,m){this.scene=g,this.uid=m,this.mesh=null,this.data=null}var n=i.prototype;n.handlePick=function(g){if(g.object===this.mesh){var m=g.index=g.data.index,w=this.data.x[m],l=this.data.y[m],x=this.data.z[m],y=this.data.u[m],S=this.data.v[m],k=this.data.w[m];g.traceCoordinate=[w,l,x,y,S,k,Math.sqrt(y*y+S*S+k*k)];var M=this.data.hovertext||this.data.text;return e(M)&&M[m]!==void 0?g.textLabel=M[m]:M&&(g.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 f(g,m){var w=g.fullSceneLayout,l=g.dataScale,x={};function y(c,h){var b=w[h],_=l[o[h]];return E(c,function(P){return b.d2l(P)*_})}x.vectors=r(y(m.u,"xaxis"),y(m.v,"yaxis"),y(m.w,"zaxis"),m._len),x.positions=r(y(m.x,"xaxis"),y(m.y,"yaxis"),y(m.z,"zaxis"),m._len);var S=t(m);x.colormap=A(m),x.vertexIntensityBounds=[S.min/m._normMax,S.max/m._normMax],x.coneOffset=a[m.anchor];var k=m.sizemode;k==="scaled"?x.coneSize=m.sizeref||.5:k==="absolute"?x.coneSize=m.sizeref&&m._normMax?m.sizeref/m._normMax:.5:k==="raw"&&(x.coneSize=m.sizeref),x.coneSizemode=k;var M=u(x),T=m.lightposition;return M.lightPosition=[T.x,T.y,T.z],M.ambient=m.lighting.ambient,M.diffuse=m.lighting.diffuse,M.specular=m.lighting.specular,M.roughness=m.lighting.roughness,M.fresnel=m.lighting.fresnel,M.opacity=m.opacity,m._pad=s[m.anchor]*M.vectorScale*M.coneScale*m._normMax,M}n.update=function(g){this.data=g;var m=f(this.scene,g);this.mesh.update(m)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function v(g,m){var w=g.glplot.gl,l=f(g,m),x=d(w,l),y=new i(g,m.uid);return y.mesh=x,y.data=m,x._trace=y,g.glplot.add(x),y}V.exports=v}),lE=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"cone",basePlotModule:Rd(),categories:["gl3d","showLegend"],attributes:S3(),supplyDefaults:iE(),colorbar:{min:"cmin",max:"cmax"},calc:oE(),plot:sE(),eventData:function(u,d){return u.norm=d.traceCoordinate[6],u},meta:{}}}),uE=Vt((Z,V)=>{V.exports=lE()}),E3=Vt((Z,V)=>{var u=Wl(),d=fc().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Vm(),e=Tl(),r=So().extendFlat,i={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"]}),hovertemplatefallback:A({editType:"calc"}),uhoverformat:d("u",1),vhoverformat:d("v",1),whoverformat:d("w",1),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),showlegend:r({},e.showlegend,{dflt:!1})};r(i,u("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(o){i[o]=t[o]}),i.hoverinfo=r({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),V.exports=i}),cE=Vt((Z,V)=>{var u=Xr(),d=gf(),E=E3();V.exports=function(A,t,e,r){function i(g,m){return u.coerce(A,t,E,g,m)}var n=i("u"),o=i("v"),a=i("w"),s=i("x"),f=i("y"),v=i("z");if(!n||!n.length||!o||!o.length||!a||!a.length||!s||!s.length||!f||!f.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"),d(A,t,r,i,{prefix:"",cLetter:"c"}),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("uhoverformat"),i("vhoverformat"),i("whoverformat"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),t._length=null}}),fE=Vt((Z,V)=>{var u=Ff().gl_streamtube3d,d=u.createTubeMesh,E=Xr(),A=Hp().parseColorScale,t=xu().extractOpts,e=Hm(),r={xaxis:0,yaxis:1,zaxis:2};function i(v,g){this.scene=v,this.uid=g,this.mesh=null,this.data=null}var n=i.prototype;n.handlePick=function(v){var g=this.scene.fullSceneLayout,m=this.scene.dataScale;function w(y,S){var k=g[S],M=m[r[S]];return k.l2c(y)/M}if(v.object===this.mesh){var l=v.data.position,x=v.data.velocity;return v.traceCoordinate=[w(l[0],"xaxis"),w(l[1],"yaxis"),w(l[2],"zaxis"),w(x[0],"xaxis"),w(x[1],"yaxis"),w(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 g=v.length,m;return g>2?m=v.slice(1,g-1):g===2?m=[(v[0]+v[1])/2]:m=v,m}function a(v){var g=v.length;return g===1?[.5,.5]:[v[1]-v[0],v[g-1]-v[g-2]]}function s(v,g){var m=v.fullSceneLayout,w=v.dataScale,l=g._len,x={};function y(et,K){var ot=m[K],X=w[r[K]];return E.simpleMap(et,function(Q){return ot.d2l(Q)*X})}if(x.vectors=e(y(g._u,"xaxis"),y(g._v,"yaxis"),y(g._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=y(g._Xs,"xaxis"),k=y(g._Ys,"yaxis"),M=y(g._Zs,"zaxis");x.meshgrid=[S,k,M],x.gridFill=g._gridFill;var T=g._slen;if(T)x.startingPositions=e(y(g._startsX,"xaxis"),y(g._startsY,"yaxis"),y(g._startsZ,"zaxis"));else{for(var c=k[0],h=o(S),b=o(M),_=new Array(h.length*b.length),P=0,L=0;L<h.length;L++)for(var D=0;D<b.length;D++)_[P++]=[h[L],c,b[D]];x.startingPositions=_}x.colormap=A(g),x.tubeSize=g.sizeref,x.maxLength=g.maxdisplayed;var B=y(g._xbnds,"xaxis"),R=y(g._ybnds,"yaxis"),I=y(g._zbnds,"zaxis"),F=a(S),N=a(k),j=a(M),G=[[B[0]-F[0],R[0]-N[0],I[0]-j[0]],[B[1]+F[1],R[1]+N[1],I[1]+j[1]]],rt=u(x,G),ct=t(g);rt.vertexIntensityBounds=[ct.min/g._normMax,ct.max/g._normMax];var st=g.lightposition;return rt.lightPosition=[st.x,st.y,st.z],rt.ambient=g.lighting.ambient,rt.diffuse=g.lighting.diffuse,rt.specular=g.lighting.specular,rt.roughness=g.lighting.roughness,rt.fresnel=g.lighting.fresnel,rt.opacity=g.opacity,g._pad=rt.tubeScale*g.sizeref*2,rt}n.update=function(v){this.data=v;var g=s(this.scene,v);this.mesh.update(g)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function f(v,g){var m=v.glplot.gl,w=s(v,g),l=d(m,w),x=new i(v,g.uid);return x.mesh=l,x.data=g,l._trace=x,v.glplot.add(l),x}V.exports=f}),hE=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"streamtube",basePlotModule:Rd(),categories:["gl3d","showLegend"],attributes:E3(),supplyDefaults:cE(),colorbar:{min:"cmin",max:"cmax"},calc:wx().calc,plot:fE(),eventData:function(u,d){return u.tubex=u.x,u.tubey=u.y,u.tubez=u.z,u.tubeu=d.traceCoordinate[3],u.tubev=d.traceCoordinate[4],u.tubew=d.traceCoordinate[5],u.norm=d.traceCoordinate[6],u.divergence=d.traceCoordinate[7],delete u.x,delete u.y,delete u.z,u},meta:{}}}),pE=Vt((Z,V)=>{V.exports=hE()}),M0=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Qh(),t=pc(),e=Tl(),r=Wl(),i=Cf().dash,n=So().extendFlat,o=Cu().overrideAll,a=t.marker,s=t.line,f=a.line;V.exports=o({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:n({},t.mode,{dflt:"markers"}),text:n({},t.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:n({},t.hovertext,{}),textfont:t.textfont,textposition:t.textposition,line:{color:s.color,width:s.width,dash:i},connectgaps:t.connectgaps,marker:n({symbol:a.symbol,opacity:a.opacity,angle:a.angle,angleref:n({},a.angleref,{values:["previous","up","north"]}),standoff:a.standoff,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,colorbar:a.colorbar,line:n({width:f.width},r("marker.line")),gradient:a.gradient},r("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:A(),selected:t.selected,unselected:t.unselected,hoverinfo:n({},e.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:u(),hovertemplatefallback:E()},"calc","nested")}),dE=Vt((Z,V)=>{var u=Xr(),d=nu(),E=zh(),A=Bh(),t=Rh(),e=ep(),r=M0(),i=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");V.exports=function(n,o,a,s){function f(S,k){return u.coerce(n,o,r,S,k)}var v=f("locations"),g;if(v&&v.length){var m=f("geojson"),w;(typeof m=="string"&&m!==""||u.isPlainObject(m))&&(w="geojson-id");var l=f("locationmode",w);l==="country names"&&u.warn(i),l==="geojson-id"&&f("featureidkey"),g=v.length}else{var x=f("lon")||[],y=f("lat")||[];g=Math.min(x.length,y.length)}if(!g){o.visible=!1;return}o._length=g,f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),d.hasMarkers(o)&&E(n,o,a,s,f,{gradient:!0}),d.hasLines(o)&&(A(n,o,a,s,f),f("connectgaps")),d.hasText(o)&&(f("texttemplate"),f("texttemplatefallback"),t(n,o,s,f)),f("fill"),o.fill!=="none"&&e(n,o,a,f),u.coerceSelectionMarkerOpacity(o,f)}}),mE=Vt((Z,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.geo]._subplot,r=e.mockAxis,i=d.lonlat;return t.lonLabel=u.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=u.tickText(r,r.c2l(i[1]),!0).text,t}}),kx=Vt((Z,V)=>{var u=Lo(),d=ks().BADNUM,E=Nh(),A=vp(),t=jh(),e=Xr().isArrayOrTypedArray,r=Xr()._;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,f=new Array(s),v;o.geojson?v=function(y){return i(y)||u(y)}:v=i;for(var g=0;g<s;g++){var m=f[g]={};if(a){var w=o.locations[g];m.loc=v(w)?w:null}else{var l=o.lon[g],x=o.lat[g];u(l)&&u(x)?m.lonlat=[+l,+x]:m.lonlat=[d,d]}}return A(f,o),E(n,o),t(f,o),s&&(f[0].t={labels:{lat:r(n,"lat:")+" ",lon:r(n,"lon:")+" "}}),f}}),kv=Vt(Z=>{Z.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"},Z.axesNames=["lonaxis","lataxis"],Z.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},Z.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},Z.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]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},Z.clipPad=.001,Z.precision=.1,Z.landColor="#F0DC82",Z.waterColor="#3399FF",Z.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},Z.sphereSVG={type:"Sphere"},Z.fillLayers={ocean:1,land:1,lakes:1},Z.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},Z.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],Z.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],Z.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),z3=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.topojson=u.topojson||{}))})(Z,function(u){function d(y){return y}function E(y){if(y==null)return d;var S,k,M=y.scale[0],T=y.scale[1],c=y.translate[0],h=y.translate[1];return function(b,_){_||(S=k=0);var P=2,L=b.length,D=new Array(L);for(D[0]=(S+=b[0])*M+c,D[1]=(k+=b[1])*T+h;P<L;)D[P]=b[P],++P;return D}}function A(y){var S=E(y.transform),k,M=1/0,T=M,c=-M,h=-M;function b(P){P=S(P),P[0]<M&&(M=P[0]),P[0]>c&&(c=P[0]),P[1]<T&&(T=P[1]),P[1]>h&&(h=P[1])}function _(P){switch(P.type){case"GeometryCollection":P.geometries.forEach(_);break;case"Point":b(P.coordinates);break;case"MultiPoint":P.coordinates.forEach(b);break}}y.arcs.forEach(function(P){for(var L=-1,D=P.length,B;++L<D;)B=S(P[L],L),B[0]<M&&(M=B[0]),B[0]>c&&(c=B[0]),B[1]<T&&(T=B[1]),B[1]>h&&(h=B[1])});for(k in y.objects)_(y.objects[k]);return[M,T,c,h]}function t(y,S){for(var k,M=y.length,T=M-S;T<--M;)k=y[T],y[T++]=y[M],y[M]=k}function e(y,S){return typeof S=="string"&&(S=y.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(k){return r(y,k)})}:r(y,S)}function r(y,S){var k=S.id,M=S.bbox,T=S.properties==null?{}:S.properties,c=i(y,S);return k==null&&M==null?{type:"Feature",properties:T,geometry:c}:M==null?{type:"Feature",id:k,properties:T,geometry:c}:{type:"Feature",id:k,bbox:M,properties:T,geometry:c}}function i(y,S){var k=E(y.transform),M=y.arcs;function T(L,D){D.length&&D.pop();for(var B=M[L<0?~L:L],R=0,I=B.length;R<I;++R)D.push(k(B[R],R));L<0&&t(D,I)}function c(L){return k(L)}function h(L){for(var D=[],B=0,R=L.length;B<R;++B)T(L[B],D);return D.length<2&&D.push(D[0]),D}function b(L){for(var D=h(L);D.length<4;)D.push(D[0]);return D}function _(L){return L.map(b)}function P(L){var D=L.type,B;switch(D){case"GeometryCollection":return{type:D,geometries:L.geometries.map(P)};case"Point":B=c(L.coordinates);break;case"MultiPoint":B=L.coordinates.map(c);break;case"LineString":B=h(L.arcs);break;case"MultiLineString":B=L.arcs.map(h);break;case"Polygon":B=_(L.arcs);break;case"MultiPolygon":B=L.arcs.map(_);break;default:return null}return{type:D,coordinates:B}}return P(S)}function n(y,S){var k={},M={},T={},c=[],h=-1;S.forEach(function(P,L){var D=y.arcs[P<0?~P:P],B;D.length<3&&!D[1][0]&&!D[1][1]&&(B=S[++h],S[h]=P,S[L]=B)}),S.forEach(function(P){var L=b(P),D=L[0],B=L[1],R,I;if(R=T[D])if(delete T[R.end],R.push(P),R.end=B,I=M[B]){delete M[I.start];var F=I===R?R:R.concat(I);M[F.start=R.start]=T[F.end=I.end]=F}else M[R.start]=T[R.end]=R;else if(R=M[B])if(delete M[R.start],R.unshift(P),R.start=D,I=T[D]){delete T[I.end];var N=I===R?R:I.concat(R);M[N.start=I.start]=T[N.end=R.end]=N}else M[R.start]=T[R.end]=R;else R=[P],M[R.start=D]=T[R.end=B]=R});function b(P){var L=y.arcs[P<0?~P:P],D=L[0],B;return y.transform?(B=[0,0],L.forEach(function(R){B[0]+=R[0],B[1]+=R[1]})):B=L[L.length-1],P<0?[B,D]:[D,B]}function _(P,L){for(var D in P){var B=P[D];delete L[B.start],delete B.start,delete B.end,B.forEach(function(R){k[R<0?~R:R]=1}),c.push(B)}}return _(T,M),_(M,T),S.forEach(function(P){k[P<0?~P:P]||c.push([P])}),c}function o(y){return i(y,a.apply(this,arguments))}function a(y,S,k){var M,T,c;if(arguments.length>1)M=s(y,S,k);else for(T=0,M=new Array(c=y.arcs.length);T<c;++T)M[T]=T;return{type:"MultiLineString",arcs:n(y,M)}}function s(y,S,k){var M=[],T=[],c;function h(D){var B=D<0?~D:D;(T[B]||(T[B]=[])).push({i:D,g:c})}function b(D){D.forEach(h)}function _(D){D.forEach(b)}function P(D){D.forEach(_)}function L(D){switch(c=D,D.type){case"GeometryCollection":D.geometries.forEach(L);break;case"LineString":b(D.arcs);break;case"MultiLineString":case"Polygon":_(D.arcs);break;case"MultiPolygon":P(D.arcs);break}}return L(S),T.forEach(k==null?function(D){M.push(D[0].i)}:function(D){k(D[0].g,D[D.length-1].g)&&M.push(D[0].i)}),M}function f(y){for(var S=-1,k=y.length,M,T=y[k-1],c=0;++S<k;)M=T,T=y[S],c+=M[0]*T[1]-M[1]*T[0];return Math.abs(c)}function v(y){return i(y,g.apply(this,arguments))}function g(y,S){var k={},M=[],T=[];S.forEach(c);function c(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(c);break;case"Polygon":h(_.arcs);break;case"MultiPolygon":_.arcs.forEach(h);break}}function h(_){_.forEach(function(P){P.forEach(function(L){(k[L=L<0?~L:L]||(k[L]=[])).push(_)})}),M.push(_)}function b(_){return f(i(y,{type:"Polygon",arcs:[_]}).coordinates[0])}return M.forEach(function(_){if(!_._){var P=[],L=[_];for(_._=1,T.push(P);_=L.pop();)P.push(_),_.forEach(function(D){D.forEach(function(B){k[B<0?~B:B].forEach(function(R){R._||(R._=1,L.push(R))})})})}}),M.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:T.map(function(_){var P=[],L;if(_.forEach(function(F){F.forEach(function(N){N.forEach(function(j){k[j<0?~j:j].length<2&&P.push(j)})})}),P=n(y,P),(L=P.length)>1)for(var D=1,B=b(P[0]),R,I;D<L;++D)(R=b(P[D]))>B&&(I=P[0],P[0]=P[D],P[D]=I,B=R);return P}).filter(function(_){return _.length>0})}}function m(y,S){for(var k=0,M=y.length;k<M;){var T=k+M>>>1;y[T]<S?k=T+1:M=T}return k}function w(y){var S={},k=y.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 T(F,N){F.forEach(function(j){M(j,N)})}function c(F,N){F.type==="GeometryCollection"?F.geometries.forEach(function(j){c(j,N)}):F.type in h&&h[F.type](F.arcs,N)}var h={LineString:M,MultiLineString:T,Polygon:T,MultiPolygon:function(F,N){F.forEach(function(j){T(j,N)})}};y.forEach(c);for(var b in S)for(var _=S[b],P=_.length,L=0;L<P;++L)for(var D=L+1;D<P;++D){var B=_[L],R=_[D],I;(I=k[B])[b=m(I,R)]!==R&&I.splice(b,0,R),(I=k[R])[b=m(I,B)]!==B&&I.splice(b,0,B)}return k}function l(y){if(y==null)return d;var S,k,M=y.scale[0],T=y.scale[1],c=y.translate[0],h=y.translate[1];return function(b,_){_||(S=k=0);var P=2,L=b.length,D=new Array(L),B=Math.round((b[0]-c)/M),R=Math.round((b[1]-h)/T);for(D[0]=B-S,S=B,D[1]=R-k,k=R;P<L;)D[P]=b[P],++P;return D}}function x(y,S){if(y.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((h=Math.floor(S))>=2))throw new Error("n must be ≥2");_=y.bbox||A(y);var k=_[0],M=_[1],T=_[2],c=_[3],h;S={scale:[T-k?(T-k)/(h-1):1,c-M?(c-M)/(h-1):1],translate:[k,M]}}else _=y.bbox;var b=l(S),_,P,L=y.objects,D={};function B(F){return b(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 I(F){var N=0,j=1,G=F.length,rt,ct=new Array(G);for(ct[0]=b(F[0],0);++N<G;)((rt=b(F[N],N))[0]||rt[1])&&(ct[j++]=rt);return j===1&&(ct[j++]=[0,0]),ct.length=j,ct}for(P in L)D[P]=R(L[P]);return{type:"Topology",bbox:_,transform:S,objects:D,arcs:y.arcs.map(I)}}u.bbox=A,u.feature=e,u.merge=v,u.mergeArcs=g,u.mesh=o,u.meshArcs=a,u.neighbors=w,u.quantize=x,u.transform=E,u.untransform=l,Object.defineProperty(u,"__esModule",{value:!0})})}),Ax=Vt((Z,V)=>{var u=V.exports={},d=kv().locationmodeToLayer,E=z3().feature;u.getTopojsonName=function(A){return[A.scope.replace(/ /g,"-"),"_",A.resolution.toString(),"m"].join("")},u.getTopojsonPath=function(A,t){return A+=A.endsWith("/")?"":"/",`${A}${t}.json`},u.getTopojsonFeatures=function(A,t){var e=d[A.locationmode],r=t.objects[e];return E(t,r).features}}),Nd=Vt(Z=>{var V=ks().BADNUM;Z.calcTraceToLineCoords=function(u){for(var d=u[0].trace,E=d.connectgaps,A=[],t=[],e=0;e<u.length;e++){var r=u[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},Z.makeLine=function(u){return u.length===1?{type:"LineString",coordinates:u[0]}:{type:"MultiLineString",coordinates:u}},Z.makePolygon=function(u){if(u.length===1)return{type:"Polygon",coordinates:u};for(var d=new Array(u.length),E=0;E<u.length;E++)d[E]=[u[E]];return{type:"MultiPolygon",coordinates:d}},Z.makeBlank=function(){return{type:"Point",coordinates:[]}}}),gE=Vt((Z,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(Z=>{Object.defineProperty(Z,"__esModule",{value:!0});var V=63710088e-1,u={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},d={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(L,D,B={}){let R={type:"Feature"};return(B.id===0||B.id)&&(R.id=B.id),B.bbox&&(R.bbox=B.bbox),R.properties=D||{},R.geometry=L,R}function A(L,D,B={}){switch(L){case"Point":return t(D).geometry;case"LineString":return n(D).geometry;case"Polygon":return r(D).geometry;case"MultiPoint":return f(D).geometry;case"MultiLineString":return s(D).geometry;case"MultiPolygon":return v(D).geometry;default:throw new Error(L+" is invalid")}}function t(L,D,B={}){if(!L)throw new Error("coordinates is required");if(!Array.isArray(L))throw new Error("coordinates must be an Array");if(L.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!h(L[0])||!h(L[1]))throw new Error("coordinates must contain numbers");return E({type:"Point",coordinates:L},D,B)}function e(L,D,B={}){return a(L.map(R=>t(R,D)),B)}function r(L,D,B={}){for(let R of L){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 I=0;I<R[R.length-1].length;I++)if(R[R.length-1][I]!==R[0][I])throw new Error("First and last Position are not equivalent.")}return E({type:"Polygon",coordinates:L},D,B)}function i(L,D,B={}){return a(L.map(R=>r(R,D)),B)}function n(L,D,B={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return E({type:"LineString",coordinates:L},D,B)}function o(L,D,B={}){return a(L.map(R=>n(R,D)),B)}function a(L,D={}){let B={type:"FeatureCollection"};return D.id&&(B.id=D.id),D.bbox&&(B.bbox=D.bbox),B.features=L,B}function s(L,D,B={}){return E({type:"MultiLineString",coordinates:L},D,B)}function f(L,D,B={}){return E({type:"MultiPoint",coordinates:L},D,B)}function v(L,D,B={}){return E({type:"MultiPolygon",coordinates:L},D,B)}function g(L,D,B={}){return E({type:"GeometryCollection",geometries:L},D,B)}function m(L,D=0){if(D&&!(D>=0))throw new Error("precision must be a positive number");let B=Math.pow(10,D||0);return Math.round(L*B)/B}function w(L,D="kilometers"){let B=u[D];if(!B)throw new Error(D+" units is invalid");return L*B}function l(L,D="kilometers"){let B=u[D];if(!B)throw new Error(D+" units is invalid");return L/B}function x(L,D){return k(l(L,D))}function y(L){let D=L%360;return D<0&&(D+=360),D}function S(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function k(L){return L%(2*Math.PI)*180/Math.PI}function M(L){return L%360*Math.PI/180}function T(L,D="kilometers",B="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return w(l(L,D),B)}function c(L,D="meters",B="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");let R=d[D];if(!R)throw new Error("invalid original units");let I=d[B];if(!I)throw new Error("invalid final units");return L/R*I}function h(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function b(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function _(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(D=>{if(!h(D))throw new Error("bbox must only contain numbers")})}function P(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}Z.areaFactors=d,Z.azimuthToBearing=S,Z.bearingToAzimuth=y,Z.convertArea=c,Z.convertLength=T,Z.degreesToRadians=M,Z.earthRadius=V,Z.factors=u,Z.feature=E,Z.featureCollection=a,Z.geometry=A,Z.geometryCollection=g,Z.isNumber=h,Z.isObject=b,Z.lengthToDegrees=x,Z.lengthToRadians=l,Z.lineString=n,Z.lineStrings=o,Z.multiLineString=s,Z.multiPoint=f,Z.multiPolygon=v,Z.point=t,Z.points=e,Z.polygon=r,Z.polygons=i,Z.radiansToDegrees=k,Z.radiansToLength=w,Z.round=m,Z.validateBBox=_,Z.validateId=P}),Sx=Vt(Z=>{Object.defineProperty(Z,"__esModule",{value:!0});var V=Mx();function u(l,x,y){if(l!==null)for(var S,k,M,T,c,h,b,_=0,P=0,L,D=l.type,B=D==="FeatureCollection",R=D==="Feature",I=B?l.features.length:1,F=0;F<I;F++){b=B?l.features[F].geometry:R?l.geometry:l,L=b?b.type==="GeometryCollection":!1,c=L?b.geometries.length:1;for(var N=0;N<c;N++){var j=0,G=0;if(T=L?b.geometries[N]:b,T!==null){h=T.coordinates;var rt=T.type;switch(_=y&&(rt==="Polygon"||rt==="MultiPolygon")?1:0,rt){case null:break;case"Point":if(x(h,P,F,j,G)===!1)return!1;P++,j++;break;case"LineString":case"MultiPoint":for(S=0;S<h.length;S++){if(x(h[S],P,F,j,G)===!1)return!1;P++,rt==="MultiPoint"&&j++}rt==="LineString"&&j++;break;case"Polygon":case"MultiLineString":for(S=0;S<h.length;S++){for(k=0;k<h[S].length-_;k++){if(x(h[S][k],P,F,j,G)===!1)return!1;P++}rt==="MultiLineString"&&j++,rt==="Polygon"&&G++}rt==="Polygon"&&j++;break;case"MultiPolygon":for(S=0;S<h.length;S++){for(G=0,k=0;k<h[S].length;k++){for(M=0;M<h[S][k].length-_;M++){if(x(h[S][k][M],P,F,j,G)===!1)return!1;P++}G++}j++}break;case"GeometryCollection":for(S=0;S<T.geometries.length;S++)if(u(T.geometries[S],x,y)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function d(l,x,y,S){var k=y;return u(l,function(M,T,c,h,b){T===0&&y===void 0?k=M:k=x(k,M,T,c,h,b)},S),k}function E(l,x){var y;switch(l.type){case"FeatureCollection":for(y=0;y<l.features.length&&x(l.features[y].properties,y)!==!1;y++);break;case"Feature":x(l.properties,0);break}}function A(l,x,y){var S=y;return E(l,function(k,M){M===0&&y===void 0?S=k:S=x(S,k,M)}),S}function t(l,x){if(l.type==="Feature")x(l,0);else if(l.type==="FeatureCollection")for(var y=0;y<l.features.length&&x(l.features[y],y)!==!1;y++);}function e(l,x,y){var S=y;return t(l,function(k,M){M===0&&y===void 0?S=k:S=x(S,k,M)}),S}function r(l){var x=[];return u(l,function(y){x.push(y)}),x}function i(l,x){var y,S,k,M,T,c,h,b,_,P,L=0,D=l.type==="FeatureCollection",B=l.type==="Feature",R=D?l.features.length:1;for(y=0;y<R;y++){for(c=D?l.features[y].geometry:B?l.geometry:l,b=D?l.features[y].properties:B?l.properties:{},_=D?l.features[y].bbox:B?l.bbox:void 0,P=D?l.features[y].id:B?l.id:void 0,h=c?c.type==="GeometryCollection":!1,T=h?c.geometries.length:1,k=0;k<T;k++){if(M=h?c.geometries[k]:c,M===null){if(x(null,L,b,_,P)===!1)return!1;continue}switch(M.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(x(M,L,b,_,P)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<M.geometries.length;S++)if(x(M.geometries[S],L,b,_,P)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}L++}}function n(l,x,y){var S=y;return i(l,function(k,M,T,c,h){M===0&&y===void 0?S=k:S=x(S,k,M,T,c,h)}),S}function o(l,x){i(l,function(y,S,k,M,T){var c=y===null?null:y.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return x(V.feature.call(void 0,y,k,{bbox:M,id:T}),S,0)===!1?!1:void 0}var h;switch(c){case"MultiPoint":h="Point";break;case"MultiLineString":h="LineString";break;case"MultiPolygon":h="Polygon";break}for(var b=0;b<y.coordinates.length;b++){var _=y.coordinates[b],P={type:h,coordinates:_};if(x(V.feature.call(void 0,P,k),S,b)===!1)return!1}})}function a(l,x,y){var S=y;return o(l,function(k,M,T){M===0&&T===0&&y===void 0?S=k:S=x(S,k,M,T)}),S}function s(l,x){o(l,function(y,S,k){var M=0;if(y.geometry){var T=y.geometry.type;if(!(T==="Point"||T==="MultiPoint")){var c,h=0,b=0,_=0;if(u(y,function(P,L,D,B,R){if(c===void 0||S>h||B>b||R>_){c=P,h=S,b=B,_=R,M=0;return}var I=V.lineString.call(void 0,[c,P],y.properties);if(x(I,S,k,R,M)===!1)return!1;M++,c=P})===!1)return!1}}})}function f(l,x,y){var S=y,k=!1;return s(l,function(M,T,c,h,b){k===!1&&y===void 0?S=M:S=x(S,M,T,c,h,b),k=!0}),S}function v(l,x){if(!l)throw new Error("geojson is required");o(l,function(y,S,k){if(y.geometry!==null){var M=y.geometry.type,T=y.geometry.coordinates;switch(M){case"LineString":if(x(y,S,k,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<T.length;c++)if(x(V.lineString.call(void 0,T[c],y.properties),S,k,c)===!1)return!1;break}}})}function g(l,x,y){var S=y;return v(l,function(k,M,T,c){M===0&&y===void 0?S=k:S=x(S,k,M,T,c)}),S}function m(l,x){if(x=x||{},!V.isObject.call(void 0,x))throw new Error("options is invalid");var y=x.featureIndex||0,S=x.multiFeatureIndex||0,k=x.geometryIndex||0,M=x.segmentIndex||0,T=x.properties,c;switch(l.type){case"FeatureCollection":y<0&&(y=l.features.length+y),T=T||l.features[y].properties,c=l.features[y].geometry;break;case"Feature":T=T||l.properties,c=l.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=l;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var h=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return M<0&&(M=h.length+M-1),V.lineString.call(void 0,[h[M],h[M+1]],T,x);case"Polygon":return k<0&&(k=h.length+k),M<0&&(M=h[k].length+M-1),V.lineString.call(void 0,[h[k][M],h[k][M+1]],T,x);case"MultiLineString":return S<0&&(S=h.length+S),M<0&&(M=h[S].length+M-1),V.lineString.call(void 0,[h[S][M],h[S][M+1]],T,x);case"MultiPolygon":return S<0&&(S=h.length+S),k<0&&(k=h[S].length+k),M<0&&(M=h[S][k].length-M-1),V.lineString.call(void 0,[h[S][k][M],h[S][k][M+1]],T,x)}throw new Error("geojson is invalid")}function w(l,x){if(x=x||{},!V.isObject.call(void 0,x))throw new Error("options is invalid");var y=x.featureIndex||0,S=x.multiFeatureIndex||0,k=x.geometryIndex||0,M=x.coordIndex||0,T=x.properties,c;switch(l.type){case"FeatureCollection":y<0&&(y=l.features.length+y),T=T||l.features[y].properties,c=l.features[y].geometry;break;case"Feature":T=T||l.properties,c=l.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=l;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var h=c.coordinates;switch(c.type){case"Point":return V.point.call(void 0,h,T,x);case"MultiPoint":return S<0&&(S=h.length+S),V.point.call(void 0,h[S],T,x);case"LineString":return M<0&&(M=h.length+M),V.point.call(void 0,h[M],T,x);case"Polygon":return k<0&&(k=h.length+k),M<0&&(M=h[k].length+M),V.point.call(void 0,h[k][M],T,x);case"MultiLineString":return S<0&&(S=h.length+S),M<0&&(M=h[S].length+M),V.point.call(void 0,h[S][M],T,x);case"MultiPolygon":return S<0&&(S=h.length+S),k<0&&(k=h[S].length+k),M<0&&(M=h[S][k].length-M),V.point.call(void 0,h[S][k][M],T,x)}throw new Error("geojson is invalid")}Z.coordAll=r,Z.coordEach=u,Z.coordReduce=d,Z.featureEach=t,Z.featureReduce=e,Z.findPoint=w,Z.findSegment=m,Z.flattenEach=o,Z.flattenReduce=a,Z.geomEach=i,Z.geomReduce=n,Z.lineEach=v,Z.lineReduce=g,Z.propEach=E,Z.propReduce=A,Z.segmentEach=s,Z.segmentReduce=f}),vE=Vt(Z=>{Object.defineProperty(Z,"__esModule",{value:!0});var V=Mx(),u=Sx();function d(n){return u.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 f=n[s],v=n[s+1===o?0:s+1],g=n[s+2>=o?(s+2)%o:s+2],m=f[0]*e,w=v[1]*e,l=g[0]*e;a+=(l-m)*Math.sin(w),s++}return a*t}var i=d;Z.area=d,Z.default=i}),yE=Vt(Z=>{Object.defineProperty(Z,"__esModule",{value:!0});var V=Mx(),u=Sx();function d(A,t={}){let e=0,r=0,i=0;return u.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=d;Z.centroid=d,Z.default=E}),xE=Vt(Z=>{Object.defineProperty(Z,"__esModule",{value:!0});var V=Sx();function u(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 d=u;Z.bbox=u,Z.default=d}),jd=Vt((Z,V)=>{var u=Ni(),d=gE(),{area:E}=vE(),{centroid:A}=yE(),{bbox:t}=xE(),e=Ig(),r=_d(),i=Fp(),n=Eg(),o=Rg(),a=Object.keys(d),s={"ISO-3":e,"USA-states":e,"country names":f};function f(S){for(var k=0;k<a.length;k++){var M=a[k],T=new RegExp(d[M]);if(T.test(S.trim().toLowerCase()))return M}return r.log("Unrecognized country name: "+S+"."),!1}function v(S,k,M){if(!k||typeof k!="string")return!1;var T=s[S](k),c,h,b;if(T){if(S==="USA-states")for(c=[],b=0;b<M.length;b++)h=M[b],h.properties&&h.properties.gu&&h.properties.gu==="USA"&&c.push(h);else c=M;for(b=0;b<c.length;b++)if(h=c[b],h.id===T)return h;r.log(["Location with id",T,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}function g(S){var k=S.geometry,M=k.coordinates,T=S.id,c=[],h,b,_,P;function L(D){for(var B=0;B<D.length-1;B++)if(D[B][0]>0&&D[B+1][0]<0)return B;return null}switch(T==="RUS"||T==="FJI"?h=function(D){var B;if(L(D)===null)B=D;else for(B=new Array(D.length),P=0;P<D.length;P++)B[P]=[D[P][0]<0?D[P][0]+360:D[P][0],D[P][1]];c.push(o.tester(B))}:T==="ATA"?h=function(D){var B=L(D);if(B===null)return c.push(o.tester(D));var R=new Array(D.length+1),I=0;for(P=0;P<D.length;P++)P>B?R[I++]=[D[P][0]+360,D[P][1]]:P===B?(R[I++]=D[P],R[I++]=[D[P][0],-90]):R[I++]=D[P];var F=o.tester(R);F.pts.pop(),c.push(F)}:h=function(D){c.push(o.tester(D))},k.type){case"MultiPolygon":for(b=0;b<M.length;b++)for(_=0;_<M[b].length;_++)h(M[b][_]);break;case"Polygon":for(b=0;b<M.length;b++)h(M[b]);break}return c}function m(S){var k=S.geojson,M=window.PlotlyGeoAssets||{},T=typeof k=="string"?M[k]:k;return i(T)?T:(r.error("Oops ... something went wrong when fetching "+k),!1)}function w(S){var k=S[0].trace,M=m(k);if(!M)return!1;var T={},c=[],h;for(h=0;h<k._length;h++){var b=S[h];(b.loc||b.loc===0)&&(T[b.loc]=b)}function _(D){var B=n(D,k.featureidkey||"id").get(),R=T[B];if(R){var I=D.geometry;if(I.type==="Polygon"||I.type==="MultiPolygon"){var F={type:"Feature",id:B,geometry:I,properties:{}};F.geometry.coordinates.length>0?F.properties.ct=l(F):F.properties.ct=[NaN,NaN],R.fIn=D,R.fOut=F,c.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 T[B]}switch(M.type){case"FeatureCollection":var P=M.features;for(h=0;h<P.length;h++)_(P[h]);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 L in T)r.log(["Location *"+L+"*","does not have a matching feature with id-key","*"+k.featureidkey+"*."].join(" "));return c}function l(S){var k=S.geometry,M;if(k.type==="MultiPolygon")for(var T=k.coordinates,c=0,h=0;h<T.length;h++){var b={type:"Polygon",coordinates:T[h]},_=E(b);_>c&&(c=_,M=b)}else M=k;return A(M).geometry.coordinates}function x(S){var k=window.PlotlyGeoAssets||{},M=[];function T(P){return new Promise(function(L,D){u.json(P,function(B,R){if(B){delete k[P];var I=B.status===404?'GeoJSON at URL "'+P+'" does not exist.':"Unexpected error while fetching from "+P;return D(new Error(I))}return k[P]=R,L(R)})})}function c(P){return new Promise(function(L,D){var B=0,R=setInterval(function(){if(k[P]&&k[P]!=="pending")return clearInterval(R),L(k[P]);if(B>100)return clearInterval(R),D("Unexpected error while fetching from "+P);B++},50)})}for(var h=0;h<S.length;h++){var b=S[h][0].trace,_=b.geojson;typeof _=="string"&&(k[_]?k[_]==="pending"&&M.push(c(_)):(k[_]="pending",M.push(T(_))))}return M}function y(S){return t(S)}V.exports={locationToFeature:v,feature2polygons:g,getTraceGeojson:m,extractTraceFeature:w,fetchTraceGeoData:x,computeBbox:y}}),L3=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=Pi(),A=mh(),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 f=u.select(this),v=s.trace,g=v.line||{};f.call(E.stroke,g.color).call(d.dashLine,g.dash||"",g.width||0),v.fill!=="none"&&f.call(E.fill,v.fillcolor)})}}),C3=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=Ax().getTopojsonFeatures,A=Nd(),t=jd(),e=Xh().findExtremes,r=ks().BADNUM,i=Uh().calcMarkerSize,n=nu(),o=L3();function a(f,v,g){var m=v.layers.frontplot.select(".scatterlayer"),w=d.makeTraceGroups(m,g,"trace scattergeo");function l(x,y){x.lonlat[0]===r&&u.select(y).remove()}w.selectAll("*").remove(),w.each(function(x){var y=u.select(this),S=x[0].trace;if(n.hasLines(S)||S.fill!=="none"){var k=A.calcTraceToLineCoords(x),M=S.fill!=="none"?A.makePolygon(k):A.makeLine(k);y.selectAll("path.js-line").data([{geojson:M,trace:S}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}n.hasMarkers(S)&&y.selectAll("path.point").data(d.identity).enter().append("path").classed("point",!0).each(function(T){l(T,this)}),n.hasText(S)&&y.selectAll("g").data(d.identity).enter().append("g").append("text").each(function(T){l(T,this)}),o(f,x)})}function s(f,v){var g=f[0].trace,m=v[g.geo],w=m._subplot,l=g._length,x,y;if(d.isArrayOrTypedArray(g.locations)){var S=g.locationmode,k=S==="geojson-id"?t.extractTraceFeature(f):E(g,w.topojson);for(x=0;x<l;x++){y=f[x];var M=S==="geojson-id"?y.fOut:t.locationToFeature(S,y.loc,k);y.lonlat=M?M.properties.ct:[r,r]}}var T={padded:!0},c,h;if(m.fitbounds==="geojson"&&g.locationmode==="geojson-id"){var b=t.computeBbox(t.getTraceGeojson(g));c=[b[0],b[2]],h=[b[1],b[3]]}else{for(c=new Array(l),h=new Array(l),x=0;x<l;x++)y=f[x],c[x]=y.lonlat[0],h[x]=y.lonlat[1];T.ppad=i(g,l)}g._extremes.lon=e(m.lonaxis._ax,c,T),g._extremes.lat=e(m.lataxis._ax,h,T)}V.exports={calcGeoJSON:s,plot:a}}),_E=Vt((Z,V)=>{var u=hc(),d=ks().BADNUM,E=km(),A=Xr().fillText,t=M0();V.exports=function(r,i,n){var o=r.cd,a=o[0].trace,s=r.xa,f=r.ya,v=r.subplot,g=v.projection.isLonLatOverEdges,m=v.project;function w(T){var c=T.lonlat;if(c[0]===d||g(c))return 1/0;var h=m(c),b=m([i,n]),_=Math.abs(h[0]-b[0]),P=Math.abs(h[1]-b[1]),L=Math.max(3,T.mrc||0);return Math.max(Math.sqrt(_*_+P*P)-L,1-3/L)}if(u.getClosest(o,w,r),r.index!==!1){var l=o[r.index],x=l.lonlat,y=[s.c2p(x),f.c2p(x)],S=l.mrc||1;r.x0=y[0]-S,r.x1=y[0]+S,r.y0=y[1]-S,r.y1=y[1]+S,r.loc=l.loc,r.lon=x[0],r.lat=x[1];var k={};k[a.geo]={_subplot:v};var M=a._module.formatLabels(l,a,k);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("+"),f=s.indexOf("location")!==-1&&Array.isArray(r.locations),v=s.indexOf("lon")!==-1,g=s.indexOf("lat")!==-1,m=s.indexOf("text")!==-1,w=[];function l(x){return x+"°"}return f?w.push(i.loc):v&&g?w.push("("+l(n.latLabel)+", "+l(n.lonLabel)+")"):v?w.push(o.lon+l(n.lonLabel)):g&&w.push(o.lat+l(n.latLabel)),m&&A(i,r,w),w.join("<br>")}}),bE=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){u.lon=d.lon,u.lat=d.lat,u.location=d.loc?d.loc:null;var e=A[t];return e.fIn&&e.fIn.properties&&(u.properties=e.fIn.properties),u}}),wE=Vt((Z,V)=>{var u=nu(),d=ks().BADNUM;V.exports=function(E,A){var t=E.cd,e=E.xaxis,r=E.yaxis,i=[],n=t[0].trace,o,a,s,f,v,g=!u.hasMarkers(n)&&!u.hasText(n);if(g)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]!==d&&(s=e.c2p(a),f=r.c2p(a),A.contains([s,f],null,v,E)?(i.push({pointNumber:v,lon:a[0],lat:a[1]}),o.selected=1):o.selected=0);return i}}),Av=Vt((Z,V)=>{(function(u,d){d(typeof Z=="object"&&typeof V<"u"?Z:u.d3=u.d3||{})})(Z,function(u){function d(X,Q){return X<Q?-1:X>Q?1:X>=Q?0:NaN}function E(X){return X.length===1&&(X=A(X)),{left:function(Q,ut,J,q){for(J==null&&(J=0),q==null&&(q=Q.length);J<q;){var it=J+q>>>1;X(Q[it],ut)<0?J=it+1:q=it}return J},right:function(Q,ut,J,q){for(J==null&&(J=0),q==null&&(q=Q.length);J<q;){var it=J+q>>>1;X(Q[it],ut)>0?q=it:J=it+1}return J}}}function A(X){return function(Q,ut){return d(X(Q),ut)}}var t=E(d),e=t.right,r=t.left;function i(X,Q){Q==null&&(Q=n);for(var ut=0,J=X.length-1,q=X[0],it=new Array(J<0?0:J);ut<J;)it[ut]=Q(q,q=X[++ut]);return it}function n(X,Q){return[X,Q]}function o(X,Q,ut){var J=X.length,q=Q.length,it=new Array(J*q),nt,dt,Tt,wt;for(ut==null&&(ut=n),nt=Tt=0;nt<J;++nt)for(wt=X[nt],dt=0;dt<q;++dt,++Tt)it[Tt]=ut(wt,Q[dt]);return it}function a(X,Q){return Q<X?-1:Q>X?1:Q>=X?0:NaN}function s(X){return X===null?NaN:+X}function f(X,Q){var ut=X.length,J=0,q=-1,it=0,nt,dt,Tt=0;if(Q==null)for(;++q<ut;)isNaN(nt=s(X[q]))||(dt=nt-it,it+=dt/++J,Tt+=dt*(nt-it));else for(;++q<ut;)isNaN(nt=s(Q(X[q],q,X)))||(dt=nt-it,it+=dt/++J,Tt+=dt*(nt-it));if(J>1)return Tt/(J-1)}function v(X,Q){var ut=f(X,Q);return ut&&Math.sqrt(ut)}function g(X,Q){var ut=X.length,J=-1,q,it,nt;if(Q==null){for(;++J<ut;)if((q=X[J])!=null&&q>=q)for(it=nt=q;++J<ut;)(q=X[J])!=null&&(it>q&&(it=q),nt<q&&(nt=q))}else for(;++J<ut;)if((q=Q(X[J],J,X))!=null&&q>=q)for(it=nt=q;++J<ut;)(q=Q(X[J],J,X))!=null&&(it>q&&(it=q),nt<q&&(nt=q));return[it,nt]}var m=Array.prototype,w=m.slice,l=m.map;function x(X){return function(){return X}}function y(X){return X}function S(X,Q,ut){X=+X,Q=+Q,ut=(q=arguments.length)<2?(Q=X,X=0,1):q<3?1:+ut;for(var J=-1,q=Math.max(0,Math.ceil((Q-X)/ut))|0,it=new Array(q);++J<q;)it[J]=X+J*ut;return it}var k=Math.sqrt(50),M=Math.sqrt(10),T=Math.sqrt(2);function c(X,Q,ut){var J,q=-1,it,nt,dt;if(Q=+Q,X=+X,ut=+ut,X===Q&&ut>0)return[X];if((J=Q<X)&&(it=X,X=Q,Q=it),(dt=h(X,Q,ut))===0||!isFinite(dt))return[];if(dt>0)for(X=Math.ceil(X/dt),Q=Math.floor(Q/dt),nt=new Array(it=Math.ceil(Q-X+1));++q<it;)nt[q]=(X+q)*dt;else for(X=Math.floor(X*dt),Q=Math.ceil(Q*dt),nt=new Array(it=Math.ceil(X-Q+1));++q<it;)nt[q]=(X-q)/dt;return J&&nt.reverse(),nt}function h(X,Q,ut){var J=(Q-X)/Math.max(0,ut),q=Math.floor(Math.log(J)/Math.LN10),it=J/Math.pow(10,q);return q>=0?(it>=k?10:it>=M?5:it>=T?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(it>=k?10:it>=M?5:it>=T?2:1)}function b(X,Q,ut){var J=Math.abs(Q-X)/Math.max(0,ut),q=Math.pow(10,Math.floor(Math.log(J)/Math.LN10)),it=J/q;return it>=k?q*=10:it>=M?q*=5:it>=T&&(q*=2),Q<X?-q:q}function _(X){return Math.ceil(Math.log(X.length)/Math.LN2)+1}function P(){var X=y,Q=g,ut=_;function J(q){var it,nt=q.length,dt,Tt=new Array(nt);for(it=0;it<nt;++it)Tt[it]=X(q[it],it,q);var wt=Q(Tt),It=wt[0],Ct=wt[1],Nt=ut(Tt,It,Ct);Array.isArray(Nt)||(Nt=b(It,Ct,Nt),Nt=S(Math.ceil(It/Nt)*Nt,Ct,Nt));for(var ee=Nt.length;Nt[0]<=It;)Nt.shift(),--ee;for(;Nt[ee-1]>Ct;)Nt.pop(),--ee;var Jt=new Array(ee+1),te;for(it=0;it<=ee;++it)te=Jt[it]=[],te.x0=it>0?Nt[it-1]:It,te.x1=it<ee?Nt[it]:Ct;for(it=0;it<nt;++it)dt=Tt[it],It<=dt&&dt<=Ct&&Jt[e(Nt,dt,0,ee)].push(q[it]);return Jt}return J.value=function(q){return arguments.length?(X=typeof q=="function"?q:x(q),J):X},J.domain=function(q){return arguments.length?(Q=typeof q=="function"?q:x([q[0],q[1]]),J):Q},J.thresholds=function(q){return arguments.length?(ut=typeof q=="function"?q:Array.isArray(q)?x(w.call(q)):x(q),J):ut},J}function L(X,Q,ut){if(ut==null&&(ut=s),!!(J=X.length)){if((Q=+Q)<=0||J<2)return+ut(X[0],0,X);if(Q>=1)return+ut(X[J-1],J-1,X);var J,q=(J-1)*Q,it=Math.floor(q),nt=+ut(X[it],it,X),dt=+ut(X[it+1],it+1,X);return nt+(dt-nt)*(q-it)}}function D(X,Q,ut){return X=l.call(X,s).sort(d),Math.ceil((ut-Q)/(2*(L(X,.75)-L(X,.25))*Math.pow(X.length,-1/3)))}function B(X,Q,ut){return Math.ceil((ut-Q)/(3.5*v(X)*Math.pow(X.length,-1/3)))}function R(X,Q){var ut=X.length,J=-1,q,it;if(Q==null){for(;++J<ut;)if((q=X[J])!=null&&q>=q)for(it=q;++J<ut;)(q=X[J])!=null&&q>it&&(it=q)}else for(;++J<ut;)if((q=Q(X[J],J,X))!=null&&q>=q)for(it=q;++J<ut;)(q=Q(X[J],J,X))!=null&&q>it&&(it=q);return it}function I(X,Q){var ut=X.length,J=ut,q=-1,it,nt=0;if(Q==null)for(;++q<ut;)isNaN(it=s(X[q]))?--J:nt+=it;else for(;++q<ut;)isNaN(it=s(Q(X[q],q,X)))?--J:nt+=it;if(J)return nt/J}function F(X,Q){var ut=X.length,J=-1,q,it=[];if(Q==null)for(;++J<ut;)isNaN(q=s(X[J]))||it.push(q);else for(;++J<ut;)isNaN(q=s(Q(X[J],J,X)))||it.push(q);return L(it.sort(d),.5)}function N(X){for(var Q=X.length,ut,J=-1,q=0,it,nt;++J<Q;)q+=X[J].length;for(it=new Array(q);--Q>=0;)for(nt=X[Q],ut=nt.length;--ut>=0;)it[--q]=nt[ut];return it}function j(X,Q){var ut=X.length,J=-1,q,it;if(Q==null){for(;++J<ut;)if((q=X[J])!=null&&q>=q)for(it=q;++J<ut;)(q=X[J])!=null&&it>q&&(it=q)}else for(;++J<ut;)if((q=Q(X[J],J,X))!=null&&q>=q)for(it=q;++J<ut;)(q=Q(X[J],J,X))!=null&&it>q&&(it=q);return it}function G(X,Q){for(var ut=Q.length,J=new Array(ut);ut--;)J[ut]=X[Q[ut]];return J}function rt(X,Q){if(ut=X.length){var ut,J=0,q=0,it,nt=X[q];for(Q==null&&(Q=d);++J<ut;)(Q(it=X[J],nt)<0||Q(nt,nt)!==0)&&(nt=it,q=J);if(Q(nt,nt)===0)return q}}function ct(X,Q,ut){for(var J=(ut??X.length)-(Q=Q==null?0:+Q),q,it;J;)it=Math.random()*J--|0,q=X[J+Q],X[J+Q]=X[it+Q],X[it+Q]=q;return X}function st(X,Q){var ut=X.length,J=-1,q,it=0;if(Q==null)for(;++J<ut;)(q=+X[J])&&(it+=q);else for(;++J<ut;)(q=+Q(X[J],J,X))&&(it+=q);return it}function et(X){if(!(it=X.length))return[];for(var Q=-1,ut=j(X,K),J=new Array(ut);++Q<ut;)for(var q=-1,it,nt=J[Q]=new Array(it);++q<it;)nt[q]=X[q][Q];return J}function K(X){return X.length}function ot(){return et(arguments)}u.bisect=e,u.bisectRight=e,u.bisectLeft=r,u.ascending=d,u.bisector=E,u.cross=o,u.descending=a,u.deviation=v,u.extent=g,u.histogram=P,u.thresholdFreedmanDiaconis=D,u.thresholdScott=B,u.thresholdSturges=_,u.max=R,u.mean=I,u.median=F,u.merge=N,u.min=j,u.pairs=i,u.permute=G,u.quantile=L,u.range=S,u.scan=rt,u.shuffle=ct,u.sum=st,u.ticks=c,u.tickIncrement=h,u.tickStep=b,u.transpose=et,u.variance=f,u.zip=ot,Object.defineProperty(u,"__esModule",{value:!0})})}),I3=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,Av()):(u=u||self,d(u.d3=u.d3||{},u.d3))})(Z,function(u,d){function E(){return new A}function A(){this.reset()}A.prototype={constructor:A,reset:function(){this.s=this.t=0},add:function(Xe){e(t,Xe,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(Xe,yr,Kr){var Rr=Xe.s=yr+Kr,mn=Rr-yr,Pn=Rr-mn;Xe.t=yr-Pn+(Kr-mn)}var r=1e-6,i=1e-12,n=Math.PI,o=n/2,a=n/4,s=n*2,f=180/n,v=n/180,g=Math.abs,m=Math.atan,w=Math.atan2,l=Math.cos,x=Math.ceil,y=Math.exp,S=Math.log,k=Math.pow,M=Math.sin,T=Math.sign||function(Xe){return Xe>0?1:Xe<0?-1:0},c=Math.sqrt,h=Math.tan;function b(Xe){return Xe>1?0:Xe<-1?n:Math.acos(Xe)}function _(Xe){return Xe>1?o:Xe<-1?-o:Math.asin(Xe)}function P(Xe){return(Xe=M(Xe/2))*Xe}function L(){}function D(Xe,yr){Xe&&R.hasOwnProperty(Xe.type)&&R[Xe.type](Xe,yr)}var B={Feature:function(Xe,yr){D(Xe.geometry,yr)},FeatureCollection:function(Xe,yr){for(var Kr=Xe.features,Rr=-1,mn=Kr.length;++Rr<mn;)D(Kr[Rr].geometry,yr)}},R={Sphere:function(Xe,yr){yr.sphere()},Point:function(Xe,yr){Xe=Xe.coordinates,yr.point(Xe[0],Xe[1],Xe[2])},MultiPoint:function(Xe,yr){for(var Kr=Xe.coordinates,Rr=-1,mn=Kr.length;++Rr<mn;)Xe=Kr[Rr],yr.point(Xe[0],Xe[1],Xe[2])},LineString:function(Xe,yr){I(Xe.coordinates,yr,0)},MultiLineString:function(Xe,yr){for(var Kr=Xe.coordinates,Rr=-1,mn=Kr.length;++Rr<mn;)I(Kr[Rr],yr,0)},Polygon:function(Xe,yr){F(Xe.coordinates,yr)},MultiPolygon:function(Xe,yr){for(var Kr=Xe.coordinates,Rr=-1,mn=Kr.length;++Rr<mn;)F(Kr[Rr],yr)},GeometryCollection:function(Xe,yr){for(var Kr=Xe.geometries,Rr=-1,mn=Kr.length;++Rr<mn;)D(Kr[Rr],yr)}};function I(Xe,yr,Kr){var Rr=-1,mn=Xe.length-Kr,Pn;for(yr.lineStart();++Rr<mn;)Pn=Xe[Rr],yr.point(Pn[0],Pn[1],Pn[2]);yr.lineEnd()}function F(Xe,yr){var Kr=-1,Rr=Xe.length;for(yr.polygonStart();++Kr<Rr;)I(Xe[Kr],yr,1);yr.polygonEnd()}function N(Xe,yr){Xe&&B.hasOwnProperty(Xe.type)?B[Xe.type](Xe,yr):D(Xe,yr)}var j=E(),G=E(),rt,ct,st,et,K,ot={point:L,lineStart:L,lineEnd:L,polygonStart:function(){j.reset(),ot.lineStart=X,ot.lineEnd=Q},polygonEnd:function(){var Xe=+j;G.add(Xe<0?s+Xe:Xe),this.lineStart=this.lineEnd=this.point=L},sphere:function(){G.add(s)}};function X(){ot.point=ut}function Q(){J(rt,ct)}function ut(Xe,yr){ot.point=J,rt=Xe,ct=yr,Xe*=v,yr*=v,st=Xe,et=l(yr=yr/2+a),K=M(yr)}function J(Xe,yr){Xe*=v,yr*=v,yr=yr/2+a;var Kr=Xe-st,Rr=Kr>=0?1:-1,mn=Rr*Kr,Pn=l(yr),ha=M(yr),Ta=K*ha,Ua=et*Pn+Ta*l(mn),Ya=Ta*Rr*M(mn);j.add(w(Ya,Ua)),st=Xe,et=Pn,K=ha}function q(Xe){return G.reset(),N(Xe,ot),G*2}function it(Xe){return[w(Xe[1],Xe[0]),_(Xe[2])]}function nt(Xe){var yr=Xe[0],Kr=Xe[1],Rr=l(Kr);return[Rr*l(yr),Rr*M(yr),M(Kr)]}function dt(Xe,yr){return Xe[0]*yr[0]+Xe[1]*yr[1]+Xe[2]*yr[2]}function Tt(Xe,yr){return[Xe[1]*yr[2]-Xe[2]*yr[1],Xe[2]*yr[0]-Xe[0]*yr[2],Xe[0]*yr[1]-Xe[1]*yr[0]]}function wt(Xe,yr){Xe[0]+=yr[0],Xe[1]+=yr[1],Xe[2]+=yr[2]}function It(Xe,yr){return[Xe[0]*yr,Xe[1]*yr,Xe[2]*yr]}function Ct(Xe){var yr=c(Xe[0]*Xe[0]+Xe[1]*Xe[1]+Xe[2]*Xe[2]);Xe[0]/=yr,Xe[1]/=yr,Xe[2]/=yr}var Nt,ee,Jt,te,Kt,mt,bt,vt,Ut=E(),re,Zt,ue={point:Me,lineStart:We,lineEnd:qe,polygonStart:function(){ue.point=vr,ue.lineStart=_r,ue.lineEnd=er,Ut.reset(),ot.polygonStart()},polygonEnd:function(){ot.polygonEnd(),ue.point=Me,ue.lineStart=We,ue.lineEnd=qe,j<0?(Nt=-(Jt=180),ee=-(te=90)):Ut>r?te=90:Ut<-r&&(ee=-90),Zt[0]=Nt,Zt[1]=Jt},sphere:function(){Nt=-(Jt=180),ee=-(te=90)}};function Me(Xe,yr){re.push(Zt=[Nt=Xe,Jt=Xe]),yr<ee&&(ee=yr),yr>te&&(te=yr)}function Ce(Xe,yr){var Kr=nt([Xe*v,yr*v]);if(vt){var Rr=Tt(vt,Kr),mn=[Rr[1],-Rr[0],0],Pn=Tt(mn,Rr);Ct(Pn),Pn=it(Pn);var ha=Xe-Kt,Ta=ha>0?1:-1,Ua=Pn[0]*f*Ta,Ya,va=g(ha)>180;va^(Ta*Kt<Ua&&Ua<Ta*Xe)?(Ya=Pn[1]*f,Ya>te&&(te=Ya)):(Ua=(Ua+360)%360-180,va^(Ta*Kt<Ua&&Ua<Ta*Xe)?(Ya=-Pn[1]*f,Ya<ee&&(ee=Ya)):(yr<ee&&(ee=yr),yr>te&&(te=yr))),va?Xe<Kt?Mr(Nt,Xe)>Mr(Nt,Jt)&&(Jt=Xe):Mr(Xe,Jt)>Mr(Nt,Jt)&&(Nt=Xe):Jt>=Nt?(Xe<Nt&&(Nt=Xe),Xe>Jt&&(Jt=Xe)):Xe>Kt?Mr(Nt,Xe)>Mr(Nt,Jt)&&(Jt=Xe):Mr(Xe,Jt)>Mr(Nt,Jt)&&(Nt=Xe)}else re.push(Zt=[Nt=Xe,Jt=Xe]);yr<ee&&(ee=yr),yr>te&&(te=yr),vt=Kr,Kt=Xe}function We(){ue.point=Ce}function qe(){Zt[0]=Nt,Zt[1]=Jt,ue.point=Me,vt=null}function vr(Xe,yr){if(vt){var Kr=Xe-Kt;Ut.add(g(Kr)>180?Kr+(Kr>0?360:-360):Kr)}else mt=Xe,bt=yr;ot.point(Xe,yr),Ce(Xe,yr)}function _r(){ot.lineStart()}function er(){vr(mt,bt),ot.lineEnd(),g(Ut)>r&&(Nt=-(Jt=180)),Zt[0]=Nt,Zt[1]=Jt,vt=null}function Mr(Xe,yr){return(yr-=Xe)<0?yr+360:yr}function Ir(Xe,yr){return Xe[0]-yr[0]}function de(Xe,yr){return Xe[0]<=Xe[1]?Xe[0]<=yr&&yr<=Xe[1]:yr<Xe[0]||Xe[1]<yr}function Dt(Xe){var yr,Kr,Rr,mn,Pn,ha,Ta;if(te=Jt=-(Nt=ee=1/0),re=[],N(Xe,ue),Kr=re.length){for(re.sort(Ir),yr=1,Rr=re[0],Pn=[Rr];yr<Kr;++yr)mn=re[yr],de(Rr,mn[0])||de(Rr,mn[1])?(Mr(Rr[0],mn[1])>Mr(Rr[0],Rr[1])&&(Rr[1]=mn[1]),Mr(mn[0],Rr[1])>Mr(Rr[0],Rr[1])&&(Rr[0]=mn[0])):Pn.push(Rr=mn);for(ha=-1/0,Kr=Pn.length-1,yr=0,Rr=Pn[Kr];yr<=Kr;Rr=mn,++yr)mn=Pn[yr],(Ta=Mr(Rr[1],mn[0]))>ha&&(ha=Ta,Nt=mn[0],Jt=Rr[1])}return re=Zt=null,Nt===1/0||ee===1/0?[[NaN,NaN],[NaN,NaN]]:[[Nt,ee],[Jt,te]]}var qt,_t,lt,yt,St,Ht,Yt,se,ke,Ee,Ue,ir,ar,Ye,Er,pn,dn={sphere:L,point:bn,lineStart:En,lineEnd:ra,polygonStart:function(){dn.lineStart=Se,dn.lineEnd=Re},polygonEnd:function(){dn.lineStart=En,dn.lineEnd=ra}};function bn(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr);Zn(Kr*l(Xe),Kr*M(Xe),M(yr))}function Zn(Xe,yr,Kr){++qt,lt+=(Xe-lt)/qt,yt+=(yr-yt)/qt,St+=(Kr-St)/qt}function En(){dn.point=gn}function gn(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr);Ye=Kr*l(Xe),Er=Kr*M(Xe),pn=M(yr),dn.point=da,Zn(Ye,Er,pn)}function da(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr),Rr=Kr*l(Xe),mn=Kr*M(Xe),Pn=M(yr),ha=w(c((ha=Er*Pn-pn*mn)*ha+(ha=pn*Rr-Ye*Pn)*ha+(ha=Ye*mn-Er*Rr)*ha),Ye*Rr+Er*mn+pn*Pn);_t+=ha,Ht+=ha*(Ye+(Ye=Rr)),Yt+=ha*(Er+(Er=mn)),se+=ha*(pn+(pn=Pn)),Zn(Ye,Er,pn)}function ra(){dn.point=bn}function Se(){dn.point=Ze}function Re(){tr(ir,ar),dn.point=bn}function Ze(Xe,yr){ir=Xe,ar=yr,Xe*=v,yr*=v,dn.point=tr;var Kr=l(yr);Ye=Kr*l(Xe),Er=Kr*M(Xe),pn=M(yr),Zn(Ye,Er,pn)}function tr(Xe,yr){Xe*=v,yr*=v;var Kr=l(yr),Rr=Kr*l(Xe),mn=Kr*M(Xe),Pn=M(yr),ha=Er*Pn-pn*mn,Ta=pn*Rr-Ye*Pn,Ua=Ye*mn-Er*Rr,Ya=c(ha*ha+Ta*Ta+Ua*Ua),va=_(Ya),Ba=Ya&&-va/Ya;ke+=Ba*ha,Ee+=Ba*Ta,Ue+=Ba*Ua,_t+=va,Ht+=va*(Ye+(Ye=Rr)),Yt+=va*(Er+(Er=mn)),se+=va*(pn+(pn=Pn)),Zn(Ye,Er,pn)}function zr(Xe){qt=_t=lt=yt=St=Ht=Yt=se=ke=Ee=Ue=0,N(Xe,dn);var yr=ke,Kr=Ee,Rr=Ue,mn=yr*yr+Kr*Kr+Rr*Rr;return mn<i&&(yr=Ht,Kr=Yt,Rr=se,_t<r&&(yr=lt,Kr=yt,Rr=St),mn=yr*yr+Kr*Kr+Rr*Rr,mn<i)?[NaN,NaN]:[w(Kr,yr)*f,_(Rr/c(mn))*f]}function tn(Xe){return function(){return Xe}}function Yr(Xe,yr){function Kr(Rr,mn){return Rr=Xe(Rr,mn),yr(Rr[0],Rr[1])}return Xe.invert&&yr.invert&&(Kr.invert=function(Rr,mn){return Rr=yr.invert(Rr,mn),Rr&&Xe.invert(Rr[0],Rr[1])}),Kr}function $r(Xe,yr){return[g(Xe)>n?Xe+Math.round(-Xe/s)*s:Xe,yr]}$r.invert=$r;function In(Xe,yr,Kr){return(Xe%=s)?yr||Kr?Yr(Kn(Xe),$n(yr,Kr)):Kn(Xe):yr||Kr?$n(yr,Kr):$r}function Nn(Xe){return function(yr,Kr){return yr+=Xe,[yr>n?yr-s:yr<-n?yr+s:yr,Kr]}}function Kn(Xe){var yr=Nn(Xe);return yr.invert=Nn(-Xe),yr}function $n(Xe,yr){var Kr=l(Xe),Rr=M(Xe),mn=l(yr),Pn=M(yr);function ha(Ta,Ua){var Ya=l(Ua),va=l(Ta)*Ya,Ba=M(Ta)*Ya,za=M(Ua),ca=za*Kr+va*Rr;return[w(Ba*mn-ca*Pn,va*Kr-za*Rr),_(ca*mn+Ba*Pn)]}return ha.invert=function(Ta,Ua){var Ya=l(Ua),va=l(Ta)*Ya,Ba=M(Ta)*Ya,za=M(Ua),ca=za*mn-Ba*Pn;return[w(Ba*mn+za*Pn,va*Kr+ca*Rr),_(ca*Kr-va*Rr)]},ha}function ia(Xe){Xe=In(Xe[0]*v,Xe[1]*v,Xe.length>2?Xe[2]*v:0);function yr(Kr){return Kr=Xe(Kr[0]*v,Kr[1]*v),Kr[0]*=f,Kr[1]*=f,Kr}return yr.invert=function(Kr){return Kr=Xe.invert(Kr[0]*v,Kr[1]*v),Kr[0]*=f,Kr[1]*=f,Kr},yr}function Cn(Xe,yr,Kr,Rr,mn,Pn){if(Kr){var ha=l(yr),Ta=M(yr),Ua=Rr*Kr;mn==null?(mn=yr+Rr*s,Pn=yr-Ua/2):(mn=Fa(ha,mn),Pn=Fa(ha,Pn),(Rr>0?mn<Pn:mn>Pn)&&(mn+=Rr*s));for(var Ya,va=mn;Rr>0?va>Pn:va<Pn;va-=Ua)Ya=it([ha,-Ta*l(va),-Ta*M(va)]),Xe.point(Ya[0],Ya[1])}}function Fa(Xe,yr){yr=nt(yr),yr[0]-=Xe,Ct(yr);var Kr=b(-yr[1]);return((-yr[2]<0?-Kr:Kr)+s-r)%s}function Ga(){var Xe=tn([0,0]),yr=tn(90),Kr=tn(6),Rr,mn,Pn={point:ha};function ha(Ua,Ya){Rr.push(Ua=mn(Ua,Ya)),Ua[0]*=f,Ua[1]*=f}function Ta(){var Ua=Xe.apply(this,arguments),Ya=yr.apply(this,arguments)*v,va=Kr.apply(this,arguments)*v;return Rr=[],mn=In(-Ua[0]*v,-Ua[1]*v,0).invert,Cn(Pn,Ya,va,1),Ua={type:"Polygon",coordinates:[Rr]},Rr=mn=null,Ua}return Ta.center=function(Ua){return arguments.length?(Xe=typeof Ua=="function"?Ua:tn([+Ua[0],+Ua[1]]),Ta):Xe},Ta.radius=function(Ua){return arguments.length?(yr=typeof Ua=="function"?Ua:tn(+Ua),Ta):yr},Ta.precision=function(Ua){return arguments.length?(Kr=typeof Ua=="function"?Ua:tn(+Ua),Ta):Kr},Ta}function ve(){var Xe=[],yr;return{point:function(Kr,Rr,mn){yr.push([Kr,Rr,mn])},lineStart:function(){Xe.push(yr=[])},lineEnd:L,rejoin:function(){Xe.length>1&&Xe.push(Xe.pop().concat(Xe.shift()))},result:function(){var Kr=Xe;return Xe=[],yr=null,Kr}}}function ge(Xe,yr){return g(Xe[0]-yr[0])<r&&g(Xe[1]-yr[1])<r}function dr(Xe,yr,Kr,Rr){this.x=Xe,this.z=yr,this.o=Kr,this.e=Rr,this.v=!1,this.n=this.p=null}function br(Xe,yr,Kr,Rr,mn){var Pn=[],ha=[],Ta,Ua;if(Xe.forEach(function(ei){if(!((Vi=ei.length-1)<=0)){var Vi,Oi=ei[0],Wi=ei[Vi],Xi;if(ge(Oi,Wi)){if(!Oi[2]&&!Wi[2]){for(mn.lineStart(),Ta=0;Ta<Vi;++Ta)mn.point((Oi=ei[Ta])[0],Oi[1]);mn.lineEnd();return}Wi[0]+=2*r}Pn.push(Xi=new dr(Oi,ei,null,!0)),ha.push(Xi.o=new dr(Oi,null,Xi,!1)),Pn.push(Xi=new dr(Wi,ei,null,!1)),ha.push(Xi.o=new dr(Wi,null,Xi,!0))}}),!!Pn.length){for(ha.sort(yr),Tr(Pn),Tr(ha),Ta=0,Ua=ha.length;Ta<Ua;++Ta)ha[Ta].e=Kr=!Kr;for(var Ya=Pn[0],va,Ba;;){for(var za=Ya,ca=!0;za.v;)if((za=za.n)===Ya)return;va=za.z,mn.lineStart();do{if(za.v=za.o.v=!0,za.e){if(ca)for(Ta=0,Ua=va.length;Ta<Ua;++Ta)mn.point((Ba=va[Ta])[0],Ba[1]);else Rr(za.x,za.n.x,1,mn);za=za.n}else{if(ca)for(va=za.p.z,Ta=va.length-1;Ta>=0;--Ta)mn.point((Ba=va[Ta])[0],Ba[1]);else Rr(za.x,za.p.x,-1,mn);za=za.p}za=za.o,va=za.z,ca=!ca}while(!za.v);mn.lineEnd()}}}function Tr(Xe){if(yr=Xe.length){for(var yr,Kr=0,Rr=Xe[0],mn;++Kr<yr;)Rr.n=mn=Xe[Kr],mn.p=Rr,Rr=mn;Rr.n=mn=Xe[0],mn.p=Rr}}var mr=E();function kr(Xe){return g(Xe[0])<=n?Xe[0]:T(Xe[0])*((g(Xe[0])+n)%s-n)}function Ur(Xe,yr){var Kr=kr(yr),Rr=yr[1],mn=M(Rr),Pn=[M(Kr),-l(Kr),0],ha=0,Ta=0;mr.reset(),mn===1?Rr=o+r:mn===-1&&(Rr=-o-r);for(var Ua=0,Ya=Xe.length;Ua<Ya;++Ua)if(Ba=(va=Xe[Ua]).length)for(var va,Ba,za=va[Ba-1],ca=kr(za),ei=za[1]/2+a,Vi=M(ei),Oi=l(ei),Wi=0;Wi<Ba;++Wi,ca=ni,Vi=$i,Oi=Do,za=Xi){var Xi=va[Wi],ni=kr(Xi),Za=Xi[1]/2+a,$i=M(Za),Do=l(Za),ss=ni-ca,Ps=ss>=0?1:-1,ys=Ps*ss,Os=ys>n,Yo=Vi*$i;if(mr.add(w(Yo*Ps*M(ys),Oi*Do+Yo*l(ys))),ha+=Os?ss+Ps*s:ss,Os^ca>=Kr^ni>=Kr){var ll=Tt(nt(za),nt(Xi));Ct(ll);var el=Tt(Pn,ll);Ct(el);var Rs=(Os^ss>=0?-1:1)*_(el[2]);(Rr>Rs||Rr===Rs&&(ll[0]||ll[1]))&&(Ta+=Os^ss>=0?1:-1)}}return(ha<-r||ha<r&&mr<-r)^Ta&1}function Or(Xe,yr,Kr,Rr){return function(mn){var Pn=yr(mn),ha=ve(),Ta=yr(ha),Ua=!1,Ya,va,Ba,za={point:ca,lineStart:Vi,lineEnd:Oi,polygonStart:function(){za.point=Wi,za.lineStart=Xi,za.lineEnd=ni,va=[],Ya=[]},polygonEnd:function(){za.point=ca,za.lineStart=Vi,za.lineEnd=Oi,va=d.merge(va);var Za=Ur(Ya,Rr);va.length?(Ua||(mn.polygonStart(),Ua=!0),br(va,Ke,Za,Kr,mn)):Za&&(Ua||(mn.polygonStart(),Ua=!0),mn.lineStart(),Kr(null,null,1,mn),mn.lineEnd()),Ua&&(mn.polygonEnd(),Ua=!1),va=Ya=null},sphere:function(){mn.polygonStart(),mn.lineStart(),Kr(null,null,1,mn),mn.lineEnd(),mn.polygonEnd()}};function ca(Za,$i){Xe(Za,$i)&&mn.point(Za,$i)}function ei(Za,$i){Pn.point(Za,$i)}function Vi(){za.point=ei,Pn.lineStart()}function Oi(){za.point=ca,Pn.lineEnd()}function Wi(Za,$i){Ba.push([Za,$i]),Ta.point(Za,$i)}function Xi(){Ta.lineStart(),Ba=[]}function ni(){Wi(Ba[0][0],Ba[0][1]),Ta.lineEnd();var Za=Ta.clean(),$i=ha.result(),Do,ss=$i.length,Ps,ys,Os;if(Ba.pop(),Ya.push(Ba),Ba=null,!!ss){if(Za&1){if(ys=$i[0],(Ps=ys.length-1)>0){for(Ua||(mn.polygonStart(),Ua=!0),mn.lineStart(),Do=0;Do<Ps;++Do)mn.point((Os=ys[Do])[0],Os[1]);mn.lineEnd()}return}ss>1&&Za&2&&$i.push($i.pop().concat($i.shift())),va.push($i.filter(pe))}}return za}}function pe(Xe){return Xe.length>1}function Ke(Xe,yr){return((Xe=Xe.x)[0]<0?Xe[1]-o-r:o-Xe[1])-((yr=yr.x)[0]<0?yr[1]-o-r:o-yr[1])}var xr=Or(function(){return!0},Gr,wn,[-n,-o]);function Gr(Xe){var yr=NaN,Kr=NaN,Rr=NaN,mn;return{lineStart:function(){Xe.lineStart(),mn=1},point:function(Pn,ha){var Ta=Pn>0?n:-n,Ua=g(Pn-yr);g(Ua-n)<r?(Xe.point(yr,Kr=(Kr+ha)/2>0?o:-o),Xe.point(Rr,Kr),Xe.lineEnd(),Xe.lineStart(),Xe.point(Ta,Kr),Xe.point(Pn,Kr),mn=0):Rr!==Ta&&Ua>=n&&(g(yr-Rr)<r&&(yr-=Rr*r),g(Pn-Ta)<r&&(Pn-=Ta*r),Kr=ln(yr,Kr,Pn,ha),Xe.point(Rr,Kr),Xe.lineEnd(),Xe.lineStart(),Xe.point(Ta,Kr),mn=0),Xe.point(yr=Pn,Kr=ha),Rr=Ta},lineEnd:function(){Xe.lineEnd(),yr=Kr=NaN},clean:function(){return 2-mn}}}function ln(Xe,yr,Kr,Rr){var mn,Pn,ha=M(Xe-Kr);return g(ha)>r?m((M(yr)*(Pn=l(Rr))*M(Kr)-M(Rr)*(mn=l(yr))*M(Xe))/(mn*Pn*ha)):(yr+Rr)/2}function wn(Xe,yr,Kr,Rr){var mn;if(Xe==null)mn=Kr*o,Rr.point(-n,mn),Rr.point(0,mn),Rr.point(n,mn),Rr.point(n,0),Rr.point(n,-mn),Rr.point(0,-mn),Rr.point(-n,-mn),Rr.point(-n,0),Rr.point(-n,mn);else if(g(Xe[0]-yr[0])>r){var Pn=Xe[0]<yr[0]?n:-n;mn=Kr*Pn/2,Rr.point(-Pn,mn),Rr.point(0,mn),Rr.point(Pn,mn)}else Rr.point(yr[0],yr[1])}function rn(Xe){var yr=l(Xe),Kr=6*v,Rr=yr>0,mn=g(yr)>r;function Pn(va,Ba,za,ca){Cn(ca,Xe,Kr,za,va,Ba)}function ha(va,Ba){return l(va)*l(Ba)>yr}function Ta(va){var Ba,za,ca,ei,Vi;return{lineStart:function(){ei=ca=!1,Vi=1},point:function(Oi,Wi){var Xi=[Oi,Wi],ni,Za=ha(Oi,Wi),$i=Rr?Za?0:Ya(Oi,Wi):Za?Ya(Oi+(Oi<0?n:-n),Wi):0;if(!Ba&&(ei=ca=Za)&&va.lineStart(),Za!==ca&&(ni=Ua(Ba,Xi),(!ni||ge(Ba,ni)||ge(Xi,ni))&&(Xi[2]=1)),Za!==ca)Vi=0,Za?(va.lineStart(),ni=Ua(Xi,Ba),va.point(ni[0],ni[1])):(ni=Ua(Ba,Xi),va.point(ni[0],ni[1],2),va.lineEnd()),Ba=ni;else if(mn&&Ba&&Rr^Za){var Do;!($i&za)&&(Do=Ua(Xi,Ba,!0))&&(Vi=0,Rr?(va.lineStart(),va.point(Do[0][0],Do[0][1]),va.point(Do[1][0],Do[1][1]),va.lineEnd()):(va.point(Do[1][0],Do[1][1]),va.lineEnd(),va.lineStart(),va.point(Do[0][0],Do[0][1],3)))}Za&&(!Ba||!ge(Ba,Xi))&&va.point(Xi[0],Xi[1]),Ba=Xi,ca=Za,za=$i},lineEnd:function(){ca&&va.lineEnd(),Ba=null},clean:function(){return Vi|(ei&&ca)<<1}}}function Ua(va,Ba,za){var ca=nt(va),ei=nt(Ba),Vi=[1,0,0],Oi=Tt(ca,ei),Wi=dt(Oi,Oi),Xi=Oi[0],ni=Wi-Xi*Xi;if(!ni)return!za&&va;var Za=yr*Wi/ni,$i=-yr*Xi/ni,Do=Tt(Vi,Oi),ss=It(Vi,Za),Ps=It(Oi,$i);wt(ss,Ps);var ys=Do,Os=dt(ss,ys),Yo=dt(ys,ys),ll=Os*Os-Yo*(dt(ss,ss)-1);if(!(ll<0)){var el=c(ll),Rs=It(ys,(-Os-el)/Yo);if(wt(Rs,ss),Rs=it(Rs),!za)return Rs;var bi=va[0],so=Ba[0],ws=va[1],fs=Ba[1],Ll;so<bi&&(Ll=bi,bi=so,so=Ll);var $l=so-bi,jl=g($l-n)<r,Bu=jl||$l<r;if(!jl&&fs<ws&&(Ll=ws,ws=fs,fs=Ll),Bu?jl?ws+fs>0^Rs[1]<(g(Rs[0]-bi)<r?ws:fs):ws<=Rs[1]&&Rs[1]<=fs:$l>n^(bi<=Rs[0]&&Rs[0]<=so)){var Jl=It(ys,(-Os+el)/Yo);return wt(Jl,ss),[Rs,it(Jl)]}}}function Ya(va,Ba){var za=Rr?Xe:n-Xe,ca=0;return va<-za?ca|=1:va>za&&(ca|=2),Ba<-za?ca|=4:Ba>za&&(ca|=8),ca}return Or(ha,Ta,Pn,Rr?[0,-Xe]:[-n,Xe-n])}function Qr(Xe,yr,Kr,Rr,mn,Pn){var ha=Xe[0],Ta=Xe[1],Ua=yr[0],Ya=yr[1],va=0,Ba=1,za=Ua-ha,ca=Ya-Ta,ei;if(ei=Kr-ha,!(!za&&ei>0)){if(ei/=za,za<0){if(ei<va)return;ei<Ba&&(Ba=ei)}else if(za>0){if(ei>Ba)return;ei>va&&(va=ei)}if(ei=mn-ha,!(!za&&ei<0)){if(ei/=za,za<0){if(ei>Ba)return;ei>va&&(va=ei)}else if(za>0){if(ei<va)return;ei<Ba&&(Ba=ei)}if(ei=Rr-Ta,!(!ca&&ei>0)){if(ei/=ca,ca<0){if(ei<va)return;ei<Ba&&(Ba=ei)}else if(ca>0){if(ei>Ba)return;ei>va&&(va=ei)}if(ei=Pn-Ta,!(!ca&&ei<0)){if(ei/=ca,ca<0){if(ei>Ba)return;ei>va&&(va=ei)}else if(ca>0){if(ei<va)return;ei<Ba&&(Ba=ei)}return va>0&&(Xe[0]=ha+va*za,Xe[1]=Ta+va*ca),Ba<1&&(yr[0]=ha+Ba*za,yr[1]=Ta+Ba*ca),!0}}}}}var vn=1e9,Oa=-vn;function Qn(Xe,yr,Kr,Rr){function mn(Ya,va){return Xe<=Ya&&Ya<=Kr&&yr<=va&&va<=Rr}function Pn(Ya,va,Ba,za){var ca=0,ei=0;if(Ya==null||(ca=ha(Ya,Ba))!==(ei=ha(va,Ba))||Ua(Ya,va)<0^Ba>0)do za.point(ca===0||ca===3?Xe:Kr,ca>1?Rr:yr);while((ca=(ca+Ba+4)%4)!==ei);else za.point(va[0],va[1])}function ha(Ya,va){return g(Ya[0]-Xe)<r?va>0?0:3:g(Ya[0]-Kr)<r?va>0?2:1:g(Ya[1]-yr)<r?va>0?1:0:va>0?3:2}function Ta(Ya,va){return Ua(Ya.x,va.x)}function Ua(Ya,va){var Ba=ha(Ya,1),za=ha(va,1);return Ba!==za?Ba-za:Ba===0?va[1]-Ya[1]:Ba===1?Ya[0]-va[0]:Ba===2?Ya[1]-va[1]:va[0]-Ya[0]}return function(Ya){var va=Ya,Ba=ve(),za,ca,ei,Vi,Oi,Wi,Xi,ni,Za,$i,Do,ss={point:Ps,lineStart:ll,lineEnd:el,polygonStart:Os,polygonEnd:Yo};function Ps(bi,so){mn(bi,so)&&va.point(bi,so)}function ys(){for(var bi=0,so=0,ws=ca.length;so<ws;++so)for(var fs=ca[so],Ll=1,$l=fs.length,jl=fs[0],Bu,Jl,Ru=jl[0],nl=jl[1];Ll<$l;++Ll)Bu=Ru,Jl=nl,jl=fs[Ll],Ru=jl[0],nl=jl[1],Jl<=Rr?nl>Rr&&(Ru-Bu)*(Rr-Jl)>(nl-Jl)*(Xe-Bu)&&++bi:nl<=Rr&&(Ru-Bu)*(Rr-Jl)<(nl-Jl)*(Xe-Bu)&&--bi;return bi}function Os(){va=Ba,za=[],ca=[],Do=!0}function Yo(){var bi=ys(),so=Do&&bi,ws=(za=d.merge(za)).length;(so||ws)&&(Ya.polygonStart(),so&&(Ya.lineStart(),Pn(null,null,1,Ya),Ya.lineEnd()),ws&&br(za,Ta,bi,Pn,Ya),Ya.polygonEnd()),va=Ya,za=ca=ei=null}function ll(){ss.point=Rs,ca&&ca.push(ei=[]),$i=!0,Za=!1,Xi=ni=NaN}function el(){za&&(Rs(Vi,Oi),Wi&&Za&&Ba.rejoin(),za.push(Ba.result())),ss.point=Ps,Za&&va.lineEnd()}function Rs(bi,so){var ws=mn(bi,so);if(ca&&ei.push([bi,so]),$i)Vi=bi,Oi=so,Wi=ws,$i=!1,ws&&(va.lineStart(),va.point(bi,so));else if(ws&&Za)va.point(bi,so);else{var fs=[Xi=Math.max(Oa,Math.min(vn,Xi)),ni=Math.max(Oa,Math.min(vn,ni))],Ll=[bi=Math.max(Oa,Math.min(vn,bi)),so=Math.max(Oa,Math.min(vn,so))];Qr(fs,Ll,Xe,yr,Kr,Rr)?(Za||(va.lineStart(),va.point(fs[0],fs[1])),va.point(Ll[0],Ll[1]),ws||va.lineEnd(),Do=!1):ws&&(va.lineStart(),va.point(bi,so),Do=!1)}Xi=bi,ni=so,Za=ws}return ss}}function Qa(){var Xe=0,yr=0,Kr=960,Rr=500,mn,Pn,ha;return ha={stream:function(Ta){return mn&&Pn===Ta?mn:mn=Qn(Xe,yr,Kr,Rr)(Pn=Ta)},extent:function(Ta){return arguments.length?(Xe=+Ta[0][0],yr=+Ta[0][1],Kr=+Ta[1][0],Rr=+Ta[1][1],mn=Pn=null,ha):[[Xe,yr],[Kr,Rr]]}}}var Ja=E(),wi,ci,Ti,Ra={sphere:L,point:L,lineStart:Qi,lineEnd:L,polygonStart:L,polygonEnd:L};function Qi(){Ra.point=Ho,Ra.lineEnd=Hi}function Hi(){Ra.point=Ra.lineEnd=L}function Ho(Xe,yr){Xe*=v,yr*=v,wi=Xe,ci=M(yr),Ti=l(yr),Ra.point=Ci}function Ci(Xe,yr){Xe*=v,yr*=v;var Kr=M(yr),Rr=l(yr),mn=g(Xe-wi),Pn=l(mn),ha=M(mn),Ta=Rr*ha,Ua=Ti*Kr-ci*Rr*Pn,Ya=ci*Kr+Ti*Rr*Pn;Ja.add(w(c(Ta*Ta+Ua*Ua),Ya)),wi=Xe,ci=Kr,Ti=Rr}function zo(Xe){return Ja.reset(),N(Xe,Ra),+Ja}var qi=[null,null],qo={type:"LineString",coordinates:qi};function Po(Xe,yr){return qi[0]=Xe,qi[1]=yr,zo(qo)}var hs={Feature:function(Xe,yr){return uo(Xe.geometry,yr)},FeatureCollection:function(Xe,yr){for(var Kr=Xe.features,Rr=-1,mn=Kr.length;++Rr<mn;)if(uo(Kr[Rr].geometry,yr))return!0;return!1}},Gi={Sphere:function(){return!0},Point:function(Xe,yr){return yi(Xe.coordinates,yr)},MultiPoint:function(Xe,yr){for(var Kr=Xe.coordinates,Rr=-1,mn=Kr.length;++Rr<mn;)if(yi(Kr[Rr],yr))return!0;return!1},LineString:function(Xe,yr){return ao(Xe.coordinates,yr)},MultiLineString:function(Xe,yr){for(var Kr=Xe.coordinates,Rr=-1,mn=Kr.length;++Rr<mn;)if(ao(Kr[Rr],yr))return!0;return!1},Polygon:function(Xe,yr){return ts(Xe.coordinates,yr)},MultiPolygon:function(Xe,yr){for(var Kr=Xe.coordinates,Rr=-1,mn=Kr.length;++Rr<mn;)if(ts(Kr[Rr],yr))return!0;return!1},GeometryCollection:function(Xe,yr){for(var Kr=Xe.geometries,Rr=-1,mn=Kr.length;++Rr<mn;)if(uo(Kr[Rr],yr))return!0;return!1}};function uo(Xe,yr){return Xe&&Gi.hasOwnProperty(Xe.type)?Gi[Xe.type](Xe,yr):!1}function yi(Xe,yr){return Po(Xe,yr)===0}function ao(Xe,yr){for(var Kr,Rr,mn,Pn=0,ha=Xe.length;Pn<ha;Pn++){if(Rr=Po(Xe[Pn],yr),Rr===0||Pn>0&&(mn=Po(Xe[Pn],Xe[Pn-1]),mn>0&&Kr<=mn&&Rr<=mn&&(Kr+Rr-mn)*(1-Math.pow((Kr-Rr)/mn,2))<i*mn))return!0;Kr=Rr}return!1}function ts(Xe,yr){return!!Ur(Xe.map(vs),As(yr))}function vs(Xe){return Xe=Xe.map(As),Xe.pop(),Xe}function As(Xe){return[Xe[0]*v,Xe[1]*v]}function _o(Xe,yr){return(Xe&&hs.hasOwnProperty(Xe.type)?hs[Xe.type]:uo)(Xe,yr)}function Da(Xe,yr,Kr){var Rr=d.range(Xe,yr-r,Kr).concat(yr);return function(mn){return Rr.map(function(Pn){return[mn,Pn]})}}function li(Xe,yr,Kr){var Rr=d.range(Xe,yr-r,Kr).concat(yr);return function(mn){return Rr.map(function(Pn){return[Pn,mn]})}}function wo(){var Xe,yr,Kr,Rr,mn,Pn,ha,Ta,Ua=10,Ya=Ua,va=90,Ba=360,za,ca,ei,Vi,Oi=2.5;function Wi(){return{type:"MultiLineString",coordinates:Xi()}}function Xi(){return d.range(x(Rr/va)*va,Kr,va).map(ei).concat(d.range(x(Ta/Ba)*Ba,ha,Ba).map(Vi)).concat(d.range(x(yr/Ua)*Ua,Xe,Ua).filter(function(ni){return g(ni%va)>r}).map(za)).concat(d.range(x(Pn/Ya)*Ya,mn,Ya).filter(function(ni){return g(ni%Ba)>r}).map(ca))}return Wi.lines=function(){return Xi().map(function(ni){return{type:"LineString",coordinates:ni}})},Wi.outline=function(){return{type:"Polygon",coordinates:[ei(Rr).concat(Vi(ha).slice(1),ei(Kr).reverse().slice(1),Vi(Ta).reverse().slice(1))]}},Wi.extent=function(ni){return arguments.length?Wi.extentMajor(ni).extentMinor(ni):Wi.extentMinor()},Wi.extentMajor=function(ni){return arguments.length?(Rr=+ni[0][0],Kr=+ni[1][0],Ta=+ni[0][1],ha=+ni[1][1],Rr>Kr&&(ni=Rr,Rr=Kr,Kr=ni),Ta>ha&&(ni=Ta,Ta=ha,ha=ni),Wi.precision(Oi)):[[Rr,Ta],[Kr,ha]]},Wi.extentMinor=function(ni){return arguments.length?(yr=+ni[0][0],Xe=+ni[1][0],Pn=+ni[0][1],mn=+ni[1][1],yr>Xe&&(ni=yr,yr=Xe,Xe=ni),Pn>mn&&(ni=Pn,Pn=mn,mn=ni),Wi.precision(Oi)):[[yr,Pn],[Xe,mn]]},Wi.step=function(ni){return arguments.length?Wi.stepMajor(ni).stepMinor(ni):Wi.stepMinor()},Wi.stepMajor=function(ni){return arguments.length?(va=+ni[0],Ba=+ni[1],Wi):[va,Ba]},Wi.stepMinor=function(ni){return arguments.length?(Ua=+ni[0],Ya=+ni[1],Wi):[Ua,Ya]},Wi.precision=function(ni){return arguments.length?(Oi=+ni,za=Da(Pn,mn,90),ca=li(yr,Xe,Oi),ei=Da(Ta,ha,90),Vi=li(Rr,Kr,Oi),Wi):Oi},Wi.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Ms(){return wo()()}function Di(Xe,yr){var Kr=Xe[0]*v,Rr=Xe[1]*v,mn=yr[0]*v,Pn=yr[1]*v,ha=l(Rr),Ta=M(Rr),Ua=l(Pn),Ya=M(Pn),va=ha*l(Kr),Ba=ha*M(Kr),za=Ua*l(mn),ca=Ua*M(mn),ei=2*_(c(P(Pn-Rr)+ha*Ua*P(mn-Kr))),Vi=M(ei),Oi=ei?function(Wi){var Xi=M(Wi*=ei)/Vi,ni=M(ei-Wi)/Vi,Za=ni*va+Xi*za,$i=ni*Ba+Xi*ca,Do=ni*Ta+Xi*Ya;return[w($i,Za)*f,w(Do,c(Za*Za+$i*$i))*f]}:function(){return[Kr*f,Rr*f]};return Oi.distance=ei,Oi}function _s(Xe){return Xe}var No=E(),is=E(),al,ii,io,co,Is={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Is.lineStart=Wo,Is.lineEnd=fl},polygonEnd:function(){Is.lineStart=Is.lineEnd=Is.point=L,No.add(g(is)),is.reset()},result:function(){var Xe=No/2;return No.reset(),Xe}};function Wo(){Is.point=Bi}function Bi(Xe,yr){Is.point=$s,al=io=Xe,ii=co=yr}function $s(Xe,yr){is.add(co*Xe-io*yr),io=Xe,co=yr}function fl(){$s(al,ii)}var Jo=1/0,us=Jo,Ss=-Jo,Ls=Ss,yl={point:bu,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var Xe=[[Jo,us],[Ss,Ls]];return Ss=Ls=-(us=Jo=1/0),Xe}};function bu(Xe,yr){Xe<Jo&&(Jo=Xe),Xe>Ss&&(Ss=Xe),yr<us&&(us=yr),yr>Ls&&(Ls=yr)}var au=0,fu=0,Ec=0,xc=0,cs=0,Gl=0,zc=0,Al=0,xl=0,Ml,hu,Fs,_l,Fo={point:bs,lineStart:Iu,lineEnd:qs,polygonStart:function(){Fo.lineStart=of,Fo.lineEnd=Oo},polygonEnd:function(){Fo.point=bs,Fo.lineStart=Iu,Fo.lineEnd=qs},result:function(){var Xe=xl?[zc/xl,Al/xl]:Gl?[xc/Gl,cs/Gl]:Ec?[au/Ec,fu/Ec]:[NaN,NaN];return au=fu=Ec=xc=cs=Gl=zc=Al=xl=0,Xe}};function bs(Xe,yr){au+=Xe,fu+=yr,++Ec}function Iu(){Fo.point=Nl}function Nl(Xe,yr){Fo.point=Hu,bs(Fs=Xe,_l=yr)}function Hu(Xe,yr){var Kr=Xe-Fs,Rr=yr-_l,mn=c(Kr*Kr+Rr*Rr);xc+=mn*(Fs+Xe)/2,cs+=mn*(_l+yr)/2,Gl+=mn,bs(Fs=Xe,_l=yr)}function qs(){Fo.point=bs}function of(){Fo.point=vf}function Oo(){os(Ml,hu)}function vf(Xe,yr){Fo.point=os,bs(Ml=Fs=Xe,hu=_l=yr)}function os(Xe,yr){var Kr=Xe-Fs,Rr=yr-_l,mn=c(Kr*Kr+Rr*Rr);xc+=mn*(Fs+Xe)/2,cs+=mn*(_l+yr)/2,Gl+=mn,mn=_l*Xe-Fs*yr,zc+=mn*(Fs+Xe),Al+=mn*(_l+yr),xl+=mn*3,bs(Fs=Xe,_l=yr)}function Fi(Xe){this._context=Xe}Fi.prototype={_radius:4.5,pointRadius:function(Xe){return this._radius=Xe,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(Xe,yr){switch(this._point){case 0:{this._context.moveTo(Xe,yr),this._point=1;break}case 1:{this._context.lineTo(Xe,yr);break}default:{this._context.moveTo(Xe+this._radius,yr),this._context.arc(Xe,yr,this._radius,0,s);break}}},result:L};var nc=E(),pu,ml,Lc,qu,dc,bl={point:L,lineStart:function(){bl.point=Yc},lineEnd:function(){pu&&Fc(ml,Lc),bl.point=L},polygonStart:function(){pu=!0},polygonEnd:function(){pu=null},result:function(){var Xe=+nc;return nc.reset(),Xe}};function Yc(Xe,yr){bl.point=Fc,ml=qu=Xe,Lc=dc=yr}function Fc(Xe,yr){qu-=Xe,dc-=yr,nc.add(c(qu*qu+dc*dc)),qu=Xe,dc=yr}function mc(){this._string=[]}mc.prototype={_radius:4.5,_circle:Wu(4.5),pointRadius:function(Xe){return(Xe=+Xe)!==this._radius&&(this._radius=Xe,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(Xe,yr){switch(this._point){case 0:{this._string.push("M",Xe,",",yr),this._point=1;break}case 1:{this._string.push("L",Xe,",",yr);break}default:{this._circle==null&&(this._circle=Wu(this._radius)),this._string.push("M",Xe,",",yr,this._circle);break}}},result:function(){if(this._string.length){var Xe=this._string.join("");return this._string=[],Xe}else return null}};function Wu(Xe){return"m0,"+Xe+"a"+Xe+","+Xe+" 0 1,1 0,"+-2*Xe+"a"+Xe+","+Xe+" 0 1,1 0,"+2*Xe+"z"}function Cc(Xe,yr){var Kr=4.5,Rr,mn;function Pn(ha){return ha&&(typeof Kr=="function"&&mn.pointRadius(+Kr.apply(this,arguments)),N(ha,Rr(mn))),mn.result()}return Pn.area=function(ha){return N(ha,Rr(Is)),Is.result()},Pn.measure=function(ha){return N(ha,Rr(bl)),bl.result()},Pn.bounds=function(ha){return N(ha,Rr(yl)),yl.result()},Pn.centroid=function(ha){return N(ha,Rr(Fo)),Fo.result()},Pn.projection=function(ha){return arguments.length?(Rr=ha==null?(Xe=null,_s):(Xe=ha).stream,Pn):Xe},Pn.context=function(ha){return arguments.length?(mn=ha==null?(yr=null,new mc):new Fi(yr=ha),typeof Kr!="function"&&mn.pointRadius(Kr),Pn):yr},Pn.pointRadius=function(ha){return arguments.length?(Kr=typeof ha=="function"?ha:(mn.pointRadius(+ha),+ha),Pn):Kr},Pn.projection(Xe).context(yr)}function Ic(Xe){return{stream:du(Xe)}}function du(Xe){return function(yr){var Kr=new Bc;for(var Rr in Xe)Kr[Rr]=Xe[Rr];return Kr.stream=yr,Kr}}function Bc(){}Bc.prototype={constructor:Bc,point:function(Xe,yr){this.stream.point(Xe,yr)},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 Pu(Xe,yr,Kr){var Rr=Xe.clipExtent&&Xe.clipExtent();return Xe.scale(150).translate([0,0]),Rr!=null&&Xe.clipExtent(null),N(Kr,Xe.stream(yl)),yr(yl.result()),Rr!=null&&Xe.clipExtent(Rr),Xe}function wu(Xe,yr,Kr){return Pu(Xe,function(Rr){var mn=yr[1][0]-yr[0][0],Pn=yr[1][1]-yr[0][1],ha=Math.min(mn/(Rr[1][0]-Rr[0][0]),Pn/(Rr[1][1]-Rr[0][1])),Ta=+yr[0][0]+(mn-ha*(Rr[1][0]+Rr[0][0]))/2,Ua=+yr[0][1]+(Pn-ha*(Rr[1][1]+Rr[0][1]))/2;Xe.scale(150*ha).translate([Ta,Ua])},Kr)}function wl(Xe,yr,Kr){return wu(Xe,[[0,0],yr],Kr)}function Ju(Xe,yr,Kr){return Pu(Xe,function(Rr){var mn=+yr,Pn=mn/(Rr[1][0]-Rr[0][0]),ha=(mn-Pn*(Rr[1][0]+Rr[0][0]))/2,Ta=-Pn*Rr[0][1];Xe.scale(150*Pn).translate([ha,Ta])},Kr)}function Pc(Xe,yr,Kr){return Pu(Xe,function(Rr){var mn=+yr,Pn=mn/(Rr[1][1]-Rr[0][1]),ha=-Pn*Rr[0][0],Ta=(mn-Pn*(Rr[1][1]+Rr[0][1]))/2;Xe.scale(150*Pn).translate([ha,Ta])},Kr)}var Es=16,_c=l(30*v);function sf(Xe,yr){return+yr?gc(Xe,yr):Rc(Xe)}function Rc(Xe){return du({point:function(yr,Kr){yr=Xe(yr,Kr),this.stream.point(yr[0],yr[1])}})}function gc(Xe,yr){function Kr(Rr,mn,Pn,ha,Ta,Ua,Ya,va,Ba,za,ca,ei,Vi,Oi){var Wi=Ya-Rr,Xi=va-mn,ni=Wi*Wi+Xi*Xi;if(ni>4*yr&&Vi--){var Za=ha+za,$i=Ta+ca,Do=Ua+ei,ss=c(Za*Za+$i*$i+Do*Do),Ps=_(Do/=ss),ys=g(g(Do)-1)<r||g(Pn-Ba)<r?(Pn+Ba)/2:w($i,Za),Os=Xe(ys,Ps),Yo=Os[0],ll=Os[1],el=Yo-Rr,Rs=ll-mn,bi=Xi*el-Wi*Rs;(bi*bi/ni>yr||g((Wi*el+Xi*Rs)/ni-.5)>.3||ha*za+Ta*ca+Ua*ei<_c)&&(Kr(Rr,mn,Pn,ha,Ta,Ua,Yo,ll,ys,Za/=ss,$i/=ss,Do,Vi,Oi),Oi.point(Yo,ll),Kr(Yo,ll,ys,Za,$i,Do,Ya,va,Ba,za,ca,ei,Vi,Oi))}}return function(Rr){var mn,Pn,ha,Ta,Ua,Ya,va,Ba,za,ca,ei,Vi,Oi={point:Wi,lineStart:Xi,lineEnd:Za,polygonStart:function(){Rr.polygonStart(),Oi.lineStart=$i},polygonEnd:function(){Rr.polygonEnd(),Oi.lineStart=Xi}};function Wi(Ps,ys){Ps=Xe(Ps,ys),Rr.point(Ps[0],Ps[1])}function Xi(){Ba=NaN,Oi.point=ni,Rr.lineStart()}function ni(Ps,ys){var Os=nt([Ps,ys]),Yo=Xe(Ps,ys);Kr(Ba,za,va,ca,ei,Vi,Ba=Yo[0],za=Yo[1],va=Ps,ca=Os[0],ei=Os[1],Vi=Os[2],Es,Rr),Rr.point(Ba,za)}function Za(){Oi.point=Wi,Rr.lineEnd()}function $i(){Xi(),Oi.point=Do,Oi.lineEnd=ss}function Do(Ps,ys){ni(mn=Ps,ys),Pn=Ba,ha=za,Ta=ca,Ua=ei,Ya=Vi,Oi.point=ni}function ss(){Kr(Ba,za,va,ca,ei,Vi,Pn,ha,mn,Ta,Ua,Ya,Es,Rr),Oi.lineEnd=Za,Za()}return Oi}}var Nc=du({point:function(Xe,yr){this.stream.point(Xe*v,yr*v)}});function Zl(Xe){return du({point:function(yr,Kr){var Rr=Xe(yr,Kr);return this.stream.point(Rr[0],Rr[1])}})}function jc(Xe,yr,Kr,Rr,mn){function Pn(ha,Ta){return ha*=Rr,Ta*=mn,[yr+Xe*ha,Kr-Xe*Ta]}return Pn.invert=function(ha,Ta){return[(ha-yr)/Xe*Rr,(Kr-Ta)/Xe*mn]},Pn}function rl(Xe,yr,Kr,Rr,mn,Pn){var ha=l(Pn),Ta=M(Pn),Ua=ha*Xe,Ya=Ta*Xe,va=ha/Xe,Ba=Ta/Xe,za=(Ta*Kr-ha*yr)/Xe,ca=(Ta*yr+ha*Kr)/Xe;function ei(Vi,Oi){return Vi*=Rr,Oi*=mn,[Ua*Vi-Ya*Oi+yr,Kr-Ya*Vi-Ua*Oi]}return ei.invert=function(Vi,Oi){return[Rr*(va*Vi-Ba*Oi+za),mn*(ca-Ba*Vi-va*Oi)]},ei}function Kl(Xe){return Gu(function(){return Xe})()}function Gu(Xe){var yr,Kr=150,Rr=480,mn=250,Pn=0,ha=0,Ta=0,Ua=0,Ya=0,va,Ba=0,za=1,ca=1,ei=null,Vi=xr,Oi=null,Wi,Xi,ni,Za=_s,$i=.5,Do,ss,Ps,ys,Os;function Yo(bi){return Ps(bi[0]*v,bi[1]*v)}function ll(bi){return bi=Ps.invert(bi[0],bi[1]),bi&&[bi[0]*f,bi[1]*f]}Yo.stream=function(bi){return ys&&Os===bi?ys:ys=Nc(Zl(va)(Vi(Do(Za(Os=bi)))))},Yo.preclip=function(bi){return arguments.length?(Vi=bi,ei=void 0,Rs()):Vi},Yo.postclip=function(bi){return arguments.length?(Za=bi,Oi=Wi=Xi=ni=null,Rs()):Za},Yo.clipAngle=function(bi){return arguments.length?(Vi=+bi?rn(ei=bi*v):(ei=null,xr),Rs()):ei*f},Yo.clipExtent=function(bi){return arguments.length?(Za=bi==null?(Oi=Wi=Xi=ni=null,_s):Qn(Oi=+bi[0][0],Wi=+bi[0][1],Xi=+bi[1][0],ni=+bi[1][1]),Rs()):Oi==null?null:[[Oi,Wi],[Xi,ni]]},Yo.scale=function(bi){return arguments.length?(Kr=+bi,el()):Kr},Yo.translate=function(bi){return arguments.length?(Rr=+bi[0],mn=+bi[1],el()):[Rr,mn]},Yo.center=function(bi){return arguments.length?(Pn=bi[0]%360*v,ha=bi[1]%360*v,el()):[Pn*f,ha*f]},Yo.rotate=function(bi){return arguments.length?(Ta=bi[0]%360*v,Ua=bi[1]%360*v,Ya=bi.length>2?bi[2]%360*v:0,el()):[Ta*f,Ua*f,Ya*f]},Yo.angle=function(bi){return arguments.length?(Ba=bi%360*v,el()):Ba*f},Yo.reflectX=function(bi){return arguments.length?(za=bi?-1:1,el()):za<0},Yo.reflectY=function(bi){return arguments.length?(ca=bi?-1:1,el()):ca<0},Yo.precision=function(bi){return arguments.length?(Do=sf(ss,$i=bi*bi),Rs()):c($i)},Yo.fitExtent=function(bi,so){return wu(Yo,bi,so)},Yo.fitSize=function(bi,so){return wl(Yo,bi,so)},Yo.fitWidth=function(bi,so){return Ju(Yo,bi,so)},Yo.fitHeight=function(bi,so){return Pc(Yo,bi,so)};function el(){var bi=rl(Kr,0,0,za,ca,Ba).apply(null,yr(Pn,ha)),so=(Ba?rl:jc)(Kr,Rr-bi[0],mn-bi[1],za,ca,Ba);return va=In(Ta,Ua,Ya),ss=Yr(yr,so),Ps=Yr(va,ss),Do=sf(ss,$i),Rs()}function Rs(){return ys=Os=null,Yo}return function(){return yr=Xe.apply(this,arguments),Yo.invert=yr.invert&&ll,el()}}function Bs(Xe){var yr=0,Kr=n/3,Rr=Gu(Xe),mn=Rr(yr,Kr);return mn.parallels=function(Pn){return arguments.length?Rr(yr=Pn[0]*v,Kr=Pn[1]*v):[yr*f,Kr*f]},mn}function Ou(Xe){var yr=l(Xe);function Kr(Rr,mn){return[Rr*yr,M(mn)/yr]}return Kr.invert=function(Rr,mn){return[Rr/yr,_(mn*yr)]},Kr}function Rl(Xe,yr){var Kr=M(Xe),Rr=(Kr+M(yr))/2;if(g(Rr)<r)return Ou(Xe);var mn=1+Kr*(2*Rr-Kr),Pn=c(mn)/Rr;function ha(Ta,Ua){var Ya=c(mn-2*Rr*M(Ua))/Rr;return[Ya*M(Ta*=Rr),Pn-Ya*l(Ta)]}return ha.invert=function(Ta,Ua){var Ya=Pn-Ua,va=w(Ta,g(Ya))*T(Ya);return Ya*Rr<0&&(va-=n*T(Ta)*T(Ya)),[va/Rr,_((mn-(Ta*Ta+Ya*Ya)*Rr*Rr)/(2*Rr))]},ha}function Yl(){return Bs(Rl).scale(155.424).center([0,33.6442])}function Ws(){return Yl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ac(Xe){var yr=Xe.length;return{point:function(Kr,Rr){for(var mn=-1;++mn<yr;)Xe[mn].point(Kr,Rr)},sphere:function(){for(var Kr=-1;++Kr<yr;)Xe[Kr].sphere()},lineStart:function(){for(var Kr=-1;++Kr<yr;)Xe[Kr].lineStart()},lineEnd:function(){for(var Kr=-1;++Kr<yr;)Xe[Kr].lineEnd()},polygonStart:function(){for(var Kr=-1;++Kr<yr;)Xe[Kr].polygonStart()},polygonEnd:function(){for(var Kr=-1;++Kr<yr;)Xe[Kr].polygonEnd()}}}function Tu(){var Xe,yr,Kr=Ws(),Rr,mn=Yl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),Pn,ha=Yl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),Ta,Ua,Ya={point:function(za,ca){Ua=[za,ca]}};function va(za){var ca=za[0],ei=za[1];return Ua=null,Rr.point(ca,ei),Ua||(Pn.point(ca,ei),Ua)||(Ta.point(ca,ei),Ua)}va.invert=function(za){var ca=Kr.scale(),ei=Kr.translate(),Vi=(za[0]-ei[0])/ca,Oi=(za[1]-ei[1])/ca;return(Oi>=.12&&Oi<.234&&Vi>=-.425&&Vi<-.214?mn:Oi>=.166&&Oi<.234&&Vi>=-.214&&Vi<-.115?ha:Kr).invert(za)},va.stream=function(za){return Xe&&yr===za?Xe:Xe=ac([Kr.stream(yr=za),mn.stream(za),ha.stream(za)])},va.precision=function(za){return arguments.length?(Kr.precision(za),mn.precision(za),ha.precision(za),Ba()):Kr.precision()},va.scale=function(za){return arguments.length?(Kr.scale(za),mn.scale(za*.35),ha.scale(za),va.translate(Kr.translate())):Kr.scale()},va.translate=function(za){if(!arguments.length)return Kr.translate();var ca=Kr.scale(),ei=+za[0],Vi=+za[1];return Rr=Kr.translate(za).clipExtent([[ei-.455*ca,Vi-.238*ca],[ei+.455*ca,Vi+.238*ca]]).stream(Ya),Pn=mn.translate([ei-.307*ca,Vi+.201*ca]).clipExtent([[ei-.425*ca+r,Vi+.12*ca+r],[ei-.214*ca-r,Vi+.234*ca-r]]).stream(Ya),Ta=ha.translate([ei-.205*ca,Vi+.212*ca]).clipExtent([[ei-.214*ca+r,Vi+.166*ca+r],[ei-.115*ca-r,Vi+.234*ca-r]]).stream(Ya),Ba()},va.fitExtent=function(za,ca){return wu(va,za,ca)},va.fitSize=function(za,ca){return wl(va,za,ca)},va.fitWidth=function(za,ca){return Ju(va,za,ca)},va.fitHeight=function(za,ca){return Pc(va,za,ca)};function Ba(){return Xe=yr=null,va}return va.scale(1070)}function Zu(Xe){return function(yr,Kr){var Rr=l(yr),mn=l(Kr),Pn=Xe(Rr*mn);return[Pn*mn*M(yr),Pn*M(Kr)]}}function bc(Xe){return function(yr,Kr){var Rr=c(yr*yr+Kr*Kr),mn=Xe(Rr),Pn=M(mn),ha=l(mn);return[w(yr*Pn,Rr*ha),_(Rr&&Kr*Pn/Rr)]}}var lf=Zu(function(Xe){return c(2/(1+Xe))});lf.invert=bc(function(Xe){return 2*_(Xe/2)});function Mf(){return Kl(lf).scale(124.75).clipAngle(180-.001)}var ic=Zu(function(Xe){return(Xe=b(Xe))&&Xe/M(Xe)});ic.invert=bc(function(Xe){return Xe});function wc(){return Kl(ic).scale(79.4188).clipAngle(180-.001)}function Fl(Xe,yr){return[Xe,S(h((o+yr)/2))]}Fl.invert=function(Xe,yr){return[Xe,2*m(y(yr))-o]};function oc(){return iu(Fl).scale(961/s)}function iu(Xe){var yr=Kl(Xe),Kr=yr.center,Rr=yr.scale,mn=yr.translate,Pn=yr.clipExtent,ha=null,Ta,Ua,Ya;yr.scale=function(Ba){return arguments.length?(Rr(Ba),va()):Rr()},yr.translate=function(Ba){return arguments.length?(mn(Ba),va()):mn()},yr.center=function(Ba){return arguments.length?(Kr(Ba),va()):Kr()},yr.clipExtent=function(Ba){return arguments.length?(Ba==null?ha=Ta=Ua=Ya=null:(ha=+Ba[0][0],Ta=+Ba[0][1],Ua=+Ba[1][0],Ya=+Ba[1][1]),va()):ha==null?null:[[ha,Ta],[Ua,Ya]]};function va(){var Ba=n*Rr(),za=yr(ia(yr.rotate()).invert([0,0]));return Pn(ha==null?[[za[0]-Ba,za[1]-Ba],[za[0]+Ba,za[1]+Ba]]:Xe===Fl?[[Math.max(za[0]-Ba,ha),Ta],[Math.min(za[0]+Ba,Ua),Ya]]:[[ha,Math.max(za[1]-Ba,Ta)],[Ua,Math.min(za[1]+Ba,Ya)]])}return va()}function sc(Xe){return h((o+Xe)/2)}function Tc(Xe,yr){var Kr=l(Xe),Rr=Xe===yr?M(Xe):S(Kr/l(yr))/S(sc(yr)/sc(Xe)),mn=Kr*k(sc(Xe),Rr)/Rr;if(!Rr)return Fl;function Pn(ha,Ta){mn>0?Ta<-o+r&&(Ta=-o+r):Ta>o-r&&(Ta=o-r);var Ua=mn/k(sc(Ta),Rr);return[Ua*M(Rr*ha),mn-Ua*l(Rr*ha)]}return Pn.invert=function(ha,Ta){var Ua=mn-Ta,Ya=T(Rr)*c(ha*ha+Ua*Ua),va=w(ha,g(Ua))*T(Ua);return Ua*Rr<0&&(va-=n*T(ha)*T(Ua)),[va/Rr,2*m(k(mn/Ya,1/Rr))-o]},Pn}function ku(){return Bs(Tc).scale(109.5).parallels([30,30])}function Gs(Xe,yr){return[Xe,yr]}Gs.invert=Gs;function Du(){return Kl(Gs).scale(152.63)}function Xl(Xe,yr){var Kr=l(Xe),Rr=Xe===yr?M(Xe):(Kr-l(yr))/(yr-Xe),mn=Kr/Rr+Xe;if(g(Rr)<r)return Gs;function Pn(ha,Ta){var Ua=mn-Ta,Ya=Rr*ha;return[Ua*M(Ya),mn-Ua*l(Ya)]}return Pn.invert=function(ha,Ta){var Ua=mn-Ta,Ya=w(ha,g(Ua))*T(Ua);return Ua*Rr<0&&(Ya-=n*T(ha)*T(Ua)),[Ya/Rr,mn-T(Rr)*c(ha*ha+Ua*Ua)]},Pn}function Xc(){return Bs(Xl).scale(131.154).center([0,13.9389])}var Vs=1.340264,vc=-.081106,Ku=893e-6,ou=.003796,Qu=c(3)/2,Yu=12;function yc(Xe,yr){var Kr=_(Qu*M(yr)),Rr=Kr*Kr,mn=Rr*Rr*Rr;return[Xe*l(Kr)/(Qu*(Vs+3*vc*Rr+mn*(7*Ku+9*ou*Rr))),Kr*(Vs+vc*Rr+mn*(Ku+ou*Rr))]}yc.invert=function(Xe,yr){for(var Kr=yr,Rr=Kr*Kr,mn=Rr*Rr*Rr,Pn=0,ha,Ta,Ua;Pn<Yu&&(Ta=Kr*(Vs+vc*Rr+mn*(Ku+ou*Rr))-yr,Ua=Vs+3*vc*Rr+mn*(7*Ku+9*ou*Rr),Kr-=ha=Ta/Ua,Rr=Kr*Kr,mn=Rr*Rr*Rr,!(g(ha)<i));++Pn);return[Qu*Xe*(Vs+3*vc*Rr+mn*(7*Ku+9*ou*Rr))/l(Kr),_(M(Kr)/Qu)]};function uf(){return Kl(yc).scale(177.158)}function zl(Xe,yr){var Kr=l(yr),Rr=l(Xe)*Kr;return[Kr*M(Xe)/Rr,M(yr)/Rr]}zl.invert=bc(m);function Uc(){return Kl(zl).scale(144.049).clipAngle(60)}function su(){var Xe=1,yr=0,Kr=0,Rr=1,mn=1,Pn=0,ha,Ta,Ua=null,Ya,va,Ba,za=1,ca=1,ei=du({point:function(Za,$i){var Do=ni([Za,$i]);this.stream.point(Do[0],Do[1])}}),Vi=_s,Oi,Wi;function Xi(){return za=Xe*Rr,ca=Xe*mn,Oi=Wi=null,ni}function ni(Za){var $i=Za[0]*za,Do=Za[1]*ca;if(Pn){var ss=Do*ha-$i*Ta;$i=$i*ha+Do*Ta,Do=ss}return[$i+yr,Do+Kr]}return ni.invert=function(Za){var $i=Za[0]-yr,Do=Za[1]-Kr;if(Pn){var ss=Do*ha+$i*Ta;$i=$i*ha-Do*Ta,Do=ss}return[$i/za,Do/ca]},ni.stream=function(Za){return Oi&&Wi===Za?Oi:Oi=ei(Vi(Wi=Za))},ni.postclip=function(Za){return arguments.length?(Vi=Za,Ua=Ya=va=Ba=null,Xi()):Vi},ni.clipExtent=function(Za){return arguments.length?(Vi=Za==null?(Ua=Ya=va=Ba=null,_s):Qn(Ua=+Za[0][0],Ya=+Za[0][1],va=+Za[1][0],Ba=+Za[1][1]),Xi()):Ua==null?null:[[Ua,Ya],[va,Ba]]},ni.scale=function(Za){return arguments.length?(Xe=+Za,Xi()):Xe},ni.translate=function(Za){return arguments.length?(yr=+Za[0],Kr=+Za[1],Xi()):[yr,Kr]},ni.angle=function(Za){return arguments.length?(Pn=Za%360*v,Ta=M(Pn),ha=l(Pn),Xi()):Pn*f},ni.reflectX=function(Za){return arguments.length?(Rr=Za?-1:1,Xi()):Rr<0},ni.reflectY=function(Za){return arguments.length?(mn=Za?-1:1,Xi()):mn<0},ni.fitExtent=function(Za,$i){return wu(ni,Za,$i)},ni.fitSize=function(Za,$i){return wl(ni,Za,$i)},ni.fitWidth=function(Za,$i){return Ju(ni,Za,$i)},ni.fitHeight=function(Za,$i){return Pc(ni,Za,$i)},ni}function Fu(Xe,yr){var Kr=yr*yr,Rr=Kr*Kr;return[Xe*(.8707-.131979*Kr+Rr*(-.013791+Rr*(.003971*Kr-.001529*Rr))),yr*(1.007226+Kr*(.015085+Rr*(-.044475+.028874*Kr-.005916*Rr)))]}Fu.invert=function(Xe,yr){var Kr=yr,Rr=25,mn;do{var Pn=Kr*Kr,ha=Pn*Pn;Kr-=mn=(Kr*(1.007226+Pn*(.015085+ha*(-.044475+.028874*Pn-.005916*ha)))-yr)/(1.007226+Pn*(.015085*3+ha*(-.044475*7+.028874*9*Pn-.005916*11*ha)))}while(g(mn)>r&&--Rr>0);return[Xe/(.8707+(Pn=Kr*Kr)*(-.131979+Pn*(-.013791+Pn*Pn*Pn*(.003971-.001529*Pn)))),Kr]};function Au(){return Kl(Fu).scale(175.295)}function il(Xe,yr){return[l(yr)*M(Xe),M(yr)]}il.invert=bc(_);function Cs(){return Kl(il).scale(249.5).clipAngle(90+r)}function Mu(Xe,yr){var Kr=l(yr),Rr=1+l(Xe)*Kr;return[Kr*M(Xe)/Rr,M(yr)/Rr]}Mu.invert=bc(function(Xe){return 2*m(Xe)});function lc(){return Kl(Mu).scale(250).clipAngle(142)}function Su(Xe,yr){return[S(h((o+yr)/2)),-Xe]}Su.invert=function(Xe,yr){return[-yr,2*m(y(Xe))-o]};function Oc(){var Xe=iu(Su),yr=Xe.center,Kr=Xe.rotate;return Xe.center=function(Rr){return arguments.length?yr([-Rr[1],Rr[0]]):(Rr=yr(),[Rr[1],-Rr[0]])},Xe.rotate=function(Rr){return arguments.length?Kr([Rr[0],Rr[1],Rr.length>2?Rr[2]+90:90]):(Rr=Kr(),[Rr[0],Rr[1],Rr[2]-90])},Kr([0,0,90]).scale(159.155)}u.geoAlbers=Ws,u.geoAlbersUsa=Tu,u.geoArea=q,u.geoAzimuthalEqualArea=Mf,u.geoAzimuthalEqualAreaRaw=lf,u.geoAzimuthalEquidistant=wc,u.geoAzimuthalEquidistantRaw=ic,u.geoBounds=Dt,u.geoCentroid=zr,u.geoCircle=Ga,u.geoClipAntimeridian=xr,u.geoClipCircle=rn,u.geoClipExtent=Qa,u.geoClipRectangle=Qn,u.geoConicConformal=ku,u.geoConicConformalRaw=Tc,u.geoConicEqualArea=Yl,u.geoConicEqualAreaRaw=Rl,u.geoConicEquidistant=Xc,u.geoConicEquidistantRaw=Xl,u.geoContains=_o,u.geoDistance=Po,u.geoEqualEarth=uf,u.geoEqualEarthRaw=yc,u.geoEquirectangular=Du,u.geoEquirectangularRaw=Gs,u.geoGnomonic=Uc,u.geoGnomonicRaw=zl,u.geoGraticule=wo,u.geoGraticule10=Ms,u.geoIdentity=su,u.geoInterpolate=Di,u.geoLength=zo,u.geoMercator=oc,u.geoMercatorRaw=Fl,u.geoNaturalEarth1=Au,u.geoNaturalEarth1Raw=Fu,u.geoOrthographic=Cs,u.geoOrthographicRaw=il,u.geoPath=Cc,u.geoProjection=Kl,u.geoProjectionMutator=Gu,u.geoRotation=ia,u.geoStereographic=lc,u.geoStereographicRaw=Mu,u.geoStream=N,u.geoTransform=Ic,u.geoTransverseMercator=Oc,u.geoTransverseMercatorRaw=Su,Object.defineProperty(u,"__esModule",{value:!0})})}),TE=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,I3(),Av()):d(u.d3=u.d3||{},u.d3,u.d3)})(Z,function(u,d,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,f=Math.pow,v=Math.round,g=Math.sign||function(Rt){return Rt>0?1:Rt<0?-1:0},m=Math.sin,w=Math.tan,l=1e-6,x=1e-12,y=Math.PI,S=y/2,k=y/4,M=Math.SQRT1_2,T=B(2),c=B(y),h=y*2,b=180/y,_=y/180;function P(Rt){return Rt?Rt/Math.sin(Rt):1}function L(Rt){return Rt>1?S:Rt<-1?-S:Math.asin(Rt)}function D(Rt){return Rt>1?0:Rt<-1?y: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 I(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=w(Rt/2),ae=2*o(r(Rt/2))/(Gt*Gt);function ce(Te,ye){var ze=r(Te),rr=r(ye),fr=m(ye),gr=rr*ze,Lr=-((1-gr?o((1+gr)/2)/(1-gr):-.5)+ae/(1+gr));return[Lr*rr*m(Te),Lr*fr]}return ce.invert=function(Te,ye){var ze=B(Te*Te+ye*ye),rr=-Rt/2,fr=50,gr;if(!ze)return[0,0];do{var Lr=rr/2,Hr=r(Lr),nn=m(Lr),cn=nn/Hr,Mn=-o(A(Hr));rr-=gr=(2/cn*Mn-ae*cn-ze)/(-Mn/(nn*nn)+1-ae/(2*Hr*Hr))*(Hr<0?.7:1)}while(A(gr)>l&&--fr>0);var Jn=m(rr);return[e(Te*Jn,ze*r(rr)),L(ye*Jn/ze)]},ce}function rt(){var Rt=S,Gt=d.geoProjectionMutator(G),ae=Gt(Rt);return ae.radius=function(ce){return arguments.length?Gt(Rt=ce*_):Rt*b},ae.scale(179.976).clipAngle(147)}function ct(Rt,Gt){var ae=r(Gt),ce=P(D(ae*r(Rt/=2)));return[2*ae*m(Rt)*ce,m(Gt)*ce]}ct.invert=function(Rt,Gt){if(!(Rt*Rt+4*Gt*Gt>y*y+l)){var ae=Rt,ce=Gt,Te=25;do{var ye=m(ae),ze=m(ae/2),rr=r(ae/2),fr=m(ce),gr=r(ce),Lr=m(2*ce),Hr=fr*fr,nn=gr*gr,cn=ze*ze,Mn=1-nn*rr*rr,Jn=Mn?D(gr*rr)*B(_a=1/Mn):_a=0,_a,xa=2*Jn*gr*ze-Rt,La=Jn*fr-Gt,ai=_a*(nn*cn+Jn*gr*rr*Hr),Ai=_a*(.5*ye*Lr-Jn*2*fr*ze),mi=_a*.25*(Lr*ze-Jn*fr*nn*ye),Yi=_a*(Hr*rr+Jn*cn*gr),Go=Ai*mi-Yi*ai;if(!Go)break;var Xo=(La*Ai-xa*Yi)/Go,po=(xa*mi-La*ai)/Go;ae-=Xo,ce-=po}while((A(Xo)>l||A(po)>l)&&--Te>0);return[ae,ce]}};function st(){return d.geoProjection(ct).scale(152.63)}function et(Rt){var Gt=m(Rt),ae=r(Rt),ce=Rt>=0?1:-1,Te=w(ce*Rt),ye=(1+Gt-ae)/2;function ze(rr,fr){var gr=r(fr),Lr=r(rr/=2);return[(1+gr)*m(rr),(ce*fr>-e(Lr,Te)-.001?0:-ce*10)+ye+m(fr)*ae-(1+gr)*Gt*Lr]}return ze.invert=function(rr,fr){var gr=0,Lr=0,Hr=50;do{var nn=r(gr),cn=m(gr),Mn=r(Lr),Jn=m(Lr),_a=1+Mn,xa=_a*cn-rr,La=ye+Jn*ae-_a*Gt*nn-fr,ai=_a*nn/2,Ai=-cn*Jn,mi=Gt*_a*cn/2,Yi=ae*Mn+Gt*nn*Jn,Go=Ai*mi-Yi*ai,Xo=(La*Ai-xa*Yi)/Go/2,po=(xa*mi-La*ai)/Go;A(po)>2&&(po/=2),gr-=Xo,Lr-=po}while((A(Xo)>l||A(po)>l)&&--Hr>0);return ce*Lr>-e(r(gr),Te)-.001?[gr*2,Lr]:null},ze}function K(){var Rt=20*_,Gt=Rt>=0?1:-1,ae=w(Gt*Rt),ce=d.geoProjectionMutator(et),Te=ce(Rt),ye=Te.stream;return Te.parallel=function(ze){return arguments.length?(ae=w((Gt=(Rt=ze*_)>=0?1:-1)*Rt),ce(Rt)):Rt*b},Te.stream=function(ze){var rr=Te.rotate(),fr=ye(ze),gr=(Te.rotate([0,0]),ye(ze)),Lr=Te.precision();return Te.rotate(rr),fr.sphere=function(){gr.polygonStart(),gr.lineStart();for(var Hr=Gt*-180;Gt*Hr<180;Hr+=Gt*90)gr.point(Hr,Gt*90);if(Rt)for(;Gt*(Hr-=3*Gt*Lr)>=-180;)gr.point(Hr,Gt*-e(r(Hr*_/2),ae)*b);gr.lineEnd(),gr.polygonEnd()},fr},Te.scale(218.695).center([0,28.0974])}function ot(Rt,Gt){var ae=w(Gt/2),ce=B(1-ae*ae),Te=1+ce*r(Rt/=2),ye=m(Rt)*ce/Te,ze=ae/Te,rr=ye*ye,fr=ze*ze;return[4/3*ye*(3+rr-3*fr),4/3*ze*(3+3*rr-fr)]}ot.invert=function(Rt,Gt){if(Rt*=3/8,Gt*=3/8,!Rt&&A(Gt)>1)return null;var ae=Rt*Rt,ce=Gt*Gt,Te=1+ae+ce,ye=B((Te-B(Te*Te-4*Gt*Gt))/2),ze=L(ye)/3,rr=ye?j(A(Gt/ye))/3:N(A(Rt))/3,fr=r(ze),gr=F(rr),Lr=gr*gr-fr*fr;return[g(Rt)*2*e(I(rr)*fr,.25-Lr),g(Gt)*2*e(gr*m(ze),.25+Lr)]};function X(){return d.geoProjection(ot).scale(66.1603)}var Q=B(8),ut=o(1+T);function J(Rt,Gt){var ae=A(Gt);return ae<k?[Rt,o(w(k+Gt/2))]:[Rt*r(ae)*(2*T-1/m(ae)),g(Gt)*(2*T*(ae-k)-o(w(ae/2)))]}J.invert=function(Rt,Gt){if((ye=A(Gt))<ut)return[Rt,2*t(i(Gt))-S];var ae=k,ce=25,Te,ye;do{var ze=r(ae/2),rr=w(ae/2);ae-=Te=(Q*(ae-k)-o(rr)-ye)/(Q-ze*ze/(2*rr))}while(A(Te)>x&&--ce>0);return[Rt/(r(ae)*(Q-1/m(ae))),g(Gt)*ae]};function q(){return d.geoProjection(J).scale(112.314)}function it(Rt){var Gt=2*y/Rt;function ae(ce,Te){var ye=d.geoAzimuthalEquidistantRaw(ce,Te);if(A(ce)>S){var ze=e(ye[1],ye[0]),rr=B(ye[0]*ye[0]+ye[1]*ye[1]),fr=Gt*v((ze-S)/Gt)+S,gr=e(m(ze-=fr),2-r(ze));ze=fr+L(y/rr*m(gr))-gr,ye[0]=rr*r(ze),ye[1]=rr*m(ze)}return ye}return ae.invert=function(ce,Te){var ye=B(ce*ce+Te*Te);if(ye>S){var ze=e(Te,ce),rr=Gt*v((ze-S)/Gt)+S,fr=ze>rr?-1:1,gr=ye*r(rr-ze),Lr=1/w(fr*D((gr-y)/B(y*(y-2*gr)+ye*ye)));ze=rr+2*t((Lr+fr*B(Lr*Lr-3))/3),ce=ye*r(ze),Te=ye*m(ze)}return d.geoAzimuthalEquidistantRaw.invert(ce,Te)},ae}function nt(){var Rt=5,Gt=d.geoProjectionMutator(it),ae=Gt(Rt),ce=ae.stream,Te=.01,ye=-r(Te*_),ze=m(Te*_);return ae.lobes=function(rr){return arguments.length?Gt(Rt=+rr):Rt},ae.stream=function(rr){var fr=ae.rotate(),gr=ce(rr),Lr=(ae.rotate([0,0]),ce(rr));return ae.rotate(fr),gr.sphere=function(){Lr.polygonStart(),Lr.lineStart();for(var Hr=0,nn=360/Rt,cn=2*y/Rt,Mn=90-180/Rt,Jn=S;Hr<Rt;++Hr,Mn-=nn,Jn-=cn)Lr.point(e(ze*r(Jn),ye)*b,L(ze*m(Jn))*b),Mn<-90?(Lr.point(-90,-180-Mn-Te),Lr.point(-90,-180-Mn+Te)):(Lr.point(90,Mn+Te),Lr.point(90,Mn-Te));Lr.lineEnd(),Lr.polygonEnd()},gr},ae.scale(87.8076).center([0,17.1875]).clipAngle(180-.001)}function dt(Rt,Gt){if(arguments.length<2&&(Gt=Rt),Gt===1)return d.geoAzimuthalEqualAreaRaw;if(Gt===1/0)return Tt;function ae(ce,Te){var ye=d.geoAzimuthalEqualAreaRaw(ce/Gt,Te);return ye[0]*=Rt,ye}return ae.invert=function(ce,Te){var ye=d.geoAzimuthalEqualAreaRaw.invert(ce/Rt,Te);return ye[0]*=Gt,ye},ae}function Tt(Rt,Gt){return[Rt*r(Gt)/r(Gt/=2),2*m(Gt)]}Tt.invert=function(Rt,Gt){var ae=2*L(Gt/2);return[Rt*r(ae/2)/r(ae),ae]};function wt(){var Rt=2,Gt=d.geoProjectionMutator(dt),ae=Gt(Rt);return ae.coefficient=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(169.529)}function It(Rt,Gt,ae){var ce=100,Te,ye,ze;ae=ae===void 0?0:+ae,Gt=+Gt;do ye=Rt(ae),ze=Rt(ae+l),ye===ze&&(ze=ye+l),ae-=Te=-1*l*(ye-Gt)/(ye-ze);while(ce-- >0&&A(Te)>l);return ce<0?NaN:ae}function Ct(Rt,Gt,ae){return Gt===void 0&&(Gt=40),ae===void 0&&(ae=x),function(ce,Te,ye,ze){var rr,fr,gr;ye=ye===void 0?0:+ye,ze=ze===void 0?0:+ze;for(var Lr=0;Lr<Gt;Lr++){var Hr=Rt(ye,ze),nn=Hr[0]-ce,cn=Hr[1]-Te;if(A(nn)<ae&&A(cn)<ae)break;var Mn=nn*nn+cn*cn;if(Mn>rr){ye-=fr/=2,ze-=gr/=2;continue}rr=Mn;var Jn=(ye>0?-1:1)*ae,_a=(ze>0?-1:1)*ae,xa=Rt(ye+Jn,ze),La=Rt(ye,ze+_a),ai=(xa[0]-Hr[0])/Jn,Ai=(xa[1]-Hr[1])/Jn,mi=(La[0]-Hr[0])/_a,Yi=(La[1]-Hr[1])/_a,Go=Yi*ai-Ai*mi,Xo=(A(Go)<.5?.5:1)/Go;if(fr=(cn*mi-nn*Yi)*Xo,gr=(nn*Ai-cn*ai)*Xo,ye+=fr,ze+=gr,A(fr)<ae&&A(gr)<ae)break}return[ye,ze]}}function Nt(){var Rt=dt(1.68,2),Gt=1.4,ae=12;function ce(Te,ye){if(Te+ye<-Gt){var ze=(Te-ye+1.6)*(Te+ye+Gt)/8;Te+=ze,ye-=.8*ze*m(ye+y/2)}var rr=Rt(Te,ye),fr=(1-r(Te*ye))/ae;return rr[1]<0&&(rr[0]*=1+fr),rr[1]>0&&(rr[1]*=1+fr/1.5*rr[0]*rr[0]),rr}return ce.invert=Ct(ce),ce}function ee(){return d.geoProjection(Nt()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function Jt(Rt,Gt){var ae=Rt*m(Gt),ce=30,Te;do Gt-=Te=(Gt+m(Gt)-ae)/(1+r(Gt));while(A(Te)>l&&--ce>0);return Gt/2}function te(Rt,Gt,ae){function ce(Te,ye){return[Rt*Te*r(ye=Jt(ae,ye)),Gt*m(ye)]}return ce.invert=function(Te,ye){return ye=L(ye/Gt),[Te/(Rt*r(ye)),L((2*ye+m(2*ye))/ae)]},ce}var Kt=te(T/S,T,y);function mt(){return d.geoProjection(Kt).scale(169.529)}var bt=2.00276,vt=1.11072;function Ut(Rt,Gt){var ae=Jt(y,Gt);return[bt*Rt/(1/r(Gt)+vt/r(ae)),(Gt+T*m(ae))/bt]}Ut.invert=function(Rt,Gt){var ae=bt*Gt,ce=Gt<0?-k:k,Te=25,ye,ze;do ze=ae-T*m(ce),ce-=ye=(m(2*ce)+2*ce-y*m(ze))/(2*r(2*ce)+2+y*r(ze)*T*r(ce));while(A(ye)>l&&--Te>0);return ze=ae-T*m(ce),[Rt*(1/r(ze)+vt/r(ce))/bt,ze]};function re(){return d.geoProjection(Ut).scale(160.857)}function Zt(Rt){var Gt=0,ae=d.geoProjectionMutator(Rt),ce=ae(Gt);return ce.parallel=function(Te){return arguments.length?ae(Gt=Te*_):Gt*b},ce}function ue(Rt,Gt){return[Rt*r(Gt),Gt]}ue.invert=function(Rt,Gt){return[Rt/r(Gt),Gt]};function Me(){return d.geoProjection(ue).scale(152.63)}function Ce(Rt){if(!Rt)return ue;var Gt=1/w(Rt);function ae(ce,Te){var ye=Gt+Rt-Te,ze=ye&&ce*r(Te)/ye;return[ye*m(ze),Gt-ye*r(ze)]}return ae.invert=function(ce,Te){var ye=B(ce*ce+(Te=Gt-Te)*Te),ze=Gt+Rt-ye;return[ye/r(ze)*e(ce,Te),ze]},ae}function We(){return Zt(Ce).scale(123.082).center([0,26.1441]).parallel(45)}function qe(Rt){function Gt(ae,ce){var Te=S-ce,ye=Te&&ae*Rt*m(Te)/Te;return[Te*m(ye)/Rt,S-Te*r(ye)]}return Gt.invert=function(ae,ce){var Te=ae*Rt,ye=S-ce,ze=B(Te*Te+ye*ye),rr=e(Te,ye);return[(ze?ze/m(ze):1)*rr/Rt,S-ze]},Gt}function vr(){var Rt=.5,Gt=d.geoProjectionMutator(qe),ae=Gt(Rt);return ae.fraction=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(158.837)}var _r=te(1,4/y,y);function er(){return d.geoProjection(_r).scale(152.63)}function Mr(Rt,Gt,ae,ce,Te,ye){var ze=r(ye),rr;if(A(Rt)>1||A(ye)>1)rr=D(ae*Te+Gt*ce*ze);else{var fr=m(Rt/2),gr=m(ye/2);rr=2*L(B(fr*fr+Gt*ce*gr*gr))}return A(rr)>l?[rr,e(ce*m(ye),Gt*Te-ae*ce*ze)]:[0,0]}function Ir(Rt,Gt,ae){return D((Rt*Rt+Gt*Gt-ae*ae)/(2*Rt*Gt))}function de(Rt){return Rt-2*y*n((Rt+y)/(2*y))}function Dt(Rt,Gt,ae){for(var ce=[[Rt[0],Rt[1],m(Rt[1]),r(Rt[1])],[Gt[0],Gt[1],m(Gt[1]),r(Gt[1])],[ae[0],ae[1],m(ae[1]),r(ae[1])]],Te=ce[2],ye,ze=0;ze<3;++ze,Te=ye)ye=ce[ze],Te.v=Mr(ye[1]-Te[1],Te[3],Te[2],ye[3],ye[2],ye[0]-Te[0]),Te.point=[0,0];var rr=Ir(ce[0].v[0],ce[2].v[0],ce[1].v[0]),fr=Ir(ce[0].v[0],ce[1].v[0],ce[2].v[0]),gr=y-rr;ce[2].point[1]=0,ce[0].point[0]=-(ce[1].point[0]=ce[0].v[0]/2);var Lr=[ce[2].point[0]=ce[0].point[0]+ce[2].v[0]*r(rr),2*(ce[0].point[1]=ce[1].point[1]=ce[2].v[0]*m(rr))];function Hr(nn,cn){var Mn=m(cn),Jn=r(cn),_a=new Array(3),xa;for(xa=0;xa<3;++xa){var La=ce[xa];if(_a[xa]=Mr(cn-La[1],La[3],La[2],Jn,Mn,nn-La[0]),!_a[xa][0])return La.point;_a[xa][1]=de(_a[xa][1]-La.v[1])}var ai=Lr.slice();for(xa=0;xa<3;++xa){var Ai=xa==2?0:xa+1,mi=Ir(ce[xa].v[0],_a[xa][0],_a[Ai][0]);_a[xa][1]<0&&(mi=-mi),xa?xa==1?(mi=fr-mi,ai[0]-=_a[xa][0]*r(mi),ai[1]-=_a[xa][0]*m(mi)):(mi=gr-mi,ai[0]+=_a[xa][0]*r(mi),ai[1]+=_a[xa][0]*m(mi)):(ai[0]+=_a[xa][0]*r(mi),ai[1]-=_a[xa][0]*m(mi))}return ai[0]/=3,ai[1]/=3,ai}return Hr}function qt(Rt){return Rt[0]*=_,Rt[1]*=_,Rt}function _t(){return lt([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function lt(Rt,Gt,ae){var ce=d.geoCentroid({type:"MultiPoint",coordinates:[Rt,Gt,ae]}),Te=[-ce[0],-ce[1]],ye=d.geoRotation(Te),ze=Dt(qt(ye(Rt)),qt(ye(Gt)),qt(ye(ae)));ze.invert=Ct(ze);var rr=d.geoProjection(ze).rotate(Te),fr=rr.center;return delete rr.rotate,rr.center=function(gr){return arguments.length?fr(ye(gr)):ye.invert(fr())},rr.clipAngle(90)}function yt(Rt,Gt){var ae=B(1-m(Gt));return[2/c*Rt*ae,c*(1-ae)]}yt.invert=function(Rt,Gt){var ae=(ae=Gt/c-1)*ae;return[ae>0?Rt*B(y/ae)/2:0,L(1-ae)]};function St(){return d.geoProjection(yt).scale(95.6464).center([0,30])}function Ht(Rt){var Gt=w(Rt);function ae(ce,Te){return[ce,(ce?ce/m(ce):1)*(m(Te)*r(ce)-Gt*r(Te))]}return ae.invert=Gt?function(ce,Te){ce&&(Te*=m(ce)/ce);var ye=r(ce);return[ce,2*e(B(ye*ye+Gt*Gt-Te*Te)-ye,Gt-Te)]}:function(ce,Te){return[ce,L(ce?Te*w(ce)/ce:Te)]},ae}function Yt(){return Zt(Ht).scale(249.828).clipAngle(90)}var se=B(3);function ke(Rt,Gt){return[se*Rt*(2*r(2*Gt/3)-1)/c,se*c*m(Gt/3)]}ke.invert=function(Rt,Gt){var ae=3*L(Gt/(se*c));return[c*Rt/(se*(2*r(2*ae/3)-1)),ae]};function Ee(){return d.geoProjection(ke).scale(156.19)}function Ue(Rt){var Gt=r(Rt);function ae(ce,Te){return[ce*Gt,m(Te)/Gt]}return ae.invert=function(ce,Te){return[ce/Gt,L(Te*Gt)]},ae}function ir(){return Zt(Ue).parallel(38.58).scale(195.044)}function ar(Rt){var Gt=r(Rt);function ae(ce,Te){return[ce*Gt,(1+Gt)*w(Te/2)]}return ae.invert=function(ce,Te){return[ce/Gt,t(Te/(1+Gt))*2]},ae}function Ye(){return Zt(ar).scale(124.75)}function Er(Rt,Gt){var ae=B(8/(3*y));return[ae*Rt*(1-A(Gt)/y),ae*Gt]}Er.invert=function(Rt,Gt){var ae=B(8/(3*y)),ce=Gt/ae;return[Rt/(ae*(1-A(ce)/y)),ce]};function pn(){return d.geoProjection(Er).scale(165.664)}function dn(Rt,Gt){var ae=B(4-3*m(A(Gt)));return[2/B(6*y)*Rt*ae,g(Gt)*B(2*y/3)*(2-ae)]}dn.invert=function(Rt,Gt){var ae=2-A(Gt)/B(2*y/3);return[Rt*B(6*y)/(2*ae),g(Gt)*L((4-ae*ae)/3)]};function bn(){return d.geoProjection(dn).scale(165.664)}function Zn(Rt,Gt){var ae=B(y*(4+y));return[2/ae*Rt*(1+B(1-4*Gt*Gt/(y*y))),4/ae*Gt]}Zn.invert=function(Rt,Gt){var ae=B(y*(4+y))/2;return[Rt*ae/(1+B(1-Gt*Gt*(4+y)/(4*y))),Gt*ae/2]};function En(){return d.geoProjection(Zn).scale(180.739)}function gn(Rt,Gt){var ae=(2+S)*m(Gt);Gt/=2;for(var ce=0,Te=1/0;ce<10&&A(Te)>l;ce++){var ye=r(Gt);Gt-=Te=(Gt+m(Gt)*(ye+2)-ae)/(2*ye*(1+ye))}return[2/B(y*(4+y))*Rt*(1+r(Gt)),2*B(y/(4+y))*m(Gt)]}gn.invert=function(Rt,Gt){var ae=Gt*B((4+y)/y)/2,ce=L(ae),Te=r(ce);return[Rt/(2/B(y*(4+y))*(1+Te)),L((ce+ae*(Te+2))/(2+S))]};function da(){return d.geoProjection(gn).scale(180.739)}function ra(Rt,Gt){return[Rt*(1+r(Gt))/B(2+y),2*Gt/B(2+y)]}ra.invert=function(Rt,Gt){var ae=B(2+y),ce=Gt*ae/2;return[ae*Rt/(1+r(ce)),ce]};function Se(){return d.geoProjection(ra).scale(173.044)}function Re(Rt,Gt){for(var ae=(1+S)*m(Gt),ce=0,Te=1/0;ce<10&&A(Te)>l;ce++)Gt-=Te=(Gt+m(Gt)-ae)/(1+r(Gt));return ae=B(2+y),[Rt*(1+r(Gt))/ae,2*Gt/ae]}Re.invert=function(Rt,Gt){var ae=1+S,ce=B(ae/2);return[Rt*2*ce/(1+r(Gt*=ce)),L((Gt+m(Gt))/ae)]};function Ze(){return d.geoProjection(Re).scale(173.044)}var tr=3+2*T;function zr(Rt,Gt){var ae=m(Rt/=2),ce=r(Rt),Te=B(r(Gt)),ye=r(Gt/=2),ze=m(Gt)/(ye+T*ce*Te),rr=B(2/(1+ze*ze)),fr=B((T*ye+(ce+ae)*Te)/(T*ye+(ce-ae)*Te));return[tr*(rr*(fr-1/fr)-2*o(fr)),tr*(rr*ze*(fr+1/fr)-2*t(ze))]}zr.invert=function(Rt,Gt){if(!(ye=ot.invert(Rt/1.2,Gt*1.065)))return null;var ae=ye[0],ce=ye[1],Te=20,ye;Rt/=tr,Gt/=tr;do{var ze=ae/2,rr=ce/2,fr=m(ze),gr=r(ze),Lr=m(rr),Hr=r(rr),nn=r(ce),cn=B(nn),Mn=Lr/(Hr+T*gr*cn),Jn=Mn*Mn,_a=B(2/(1+Jn)),xa=T*Hr+(gr+fr)*cn,La=T*Hr+(gr-fr)*cn,ai=xa/La,Ai=B(ai),mi=Ai-1/Ai,Yi=Ai+1/Ai,Go=_a*mi-2*o(Ai)-Rt,Xo=_a*Mn*Yi-2*t(Mn)-Gt,po=Lr&&M*cn*fr*Jn/Lr,Qo=(T*gr*Hr+cn)/(2*(Hr+T*gr*cn)*(Hr+T*gr*cn)*cn),Js=-.5*Mn*_a*_a*_a,Us=Js*po,To=Js*Qo,ko=(ko=2*Hr+T*cn*(gr-fr))*ko*Ai,hl=(T*gr*Hr*cn+nn)/ko,Sl=-(T*fr*Lr)/(cn*ko),tu=mi*Us-2*hl/Ai+_a*(hl+hl/ai),gt=mi*To-2*Sl/Ai+_a*(Sl+Sl/ai),Et=Mn*Yi*Us-2*po/(1+Jn)+_a*Yi*po+_a*Mn*(hl-hl/ai),Xt=Mn*Yi*To-2*Qo/(1+Jn)+_a*Yi*Qo+_a*Mn*(Sl-Sl/ai),fe=gt*Et-Xt*tu;if(!fe)break;var me=(Xo*gt-Go*Xt)/fe,we=(Go*Et-Xo*tu)/fe;ae-=me,ce=a(-S,s(S,ce-we))}while((A(me)>l||A(we)>l)&&--Te>0);return A(A(ce)-S)<l?[0,ce]:Te&&[ae,ce]};function tn(){return d.geoProjection(zr).scale(62.5271)}var Yr=r(35*_);function $r(Rt,Gt){var ae=w(Gt/2);return[Rt*Yr*B(1-ae*ae),(1+Yr)*ae]}$r.invert=function(Rt,Gt){var ae=Gt/(1+Yr);return[Rt&&Rt/(Yr*B(1-ae*ae)),2*t(ae)]};function In(){return d.geoProjection($r).scale(137.152)}function Nn(Rt,Gt){var ae=Gt/2,ce=r(ae);return[2*Rt/c*r(Gt)*ce*ce,c*w(ae)]}Nn.invert=function(Rt,Gt){var ae=t(Gt/c),ce=r(ae),Te=2*ae;return[Rt*c/2/(r(Te)*ce*ce),Te]};function Kn(){return d.geoProjection(Nn).scale(135.264)}function $n(Rt){var Gt=1-Rt,ae=ye(y,0)[0]-ye(-y,0)[0],ce=ye(0,S)[1]-ye(0,-S)[1],Te=B(2*ce/ae);function ye(fr,gr){var Lr=r(gr),Hr=m(gr);return[Lr/(Gt+Rt*Lr)*fr,Gt*gr+Rt*Hr]}function ze(fr,gr){var Lr=ye(fr,gr);return[Lr[0]*Te,Lr[1]/Te]}function rr(fr){return ze(0,fr)[1]}return ze.invert=function(fr,gr){var Lr=It(rr,gr),Hr=fr/Te*(Rt+Gt/r(Lr));return[Hr,Lr]},ze}function ia(){var Rt=.5,Gt=d.geoProjectionMutator($n),ae=Gt(Rt);return ae.alpha=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(168.725)}function Cn(Rt){return[Rt[0]/2,L(w(Rt[1]/2*_))*b]}function Fa(Rt){return[Rt[0]*2,2*t(m(Rt[1]*_))*b]}function Ga(Rt){Rt==null&&(Rt=d.geoOrthographic);var Gt=Rt(),ae=d.geoEquirectangular().scale(b).precision(0).clipAngle(null).translate([0,0]);function ce(ye){return Gt(Cn(ye))}Gt.invert&&(ce.invert=function(ye){return Fa(Gt.invert(ye))}),ce.stream=function(ye){var ze=Gt.stream(ye),rr=ae.stream({point:function(fr,gr){ze.point(fr/2,L(w(-gr/2*_))*b)},lineStart:function(){ze.lineStart()},lineEnd:function(){ze.lineEnd()},polygonStart:function(){ze.polygonStart()},polygonEnd:function(){ze.polygonEnd()}});return rr.sphere=ze.sphere,rr};function Te(ye){ce[ye]=function(){return arguments.length?(Gt[ye].apply(Gt,arguments),ce):Gt[ye]()}}return ce.rotate=function(ye){return arguments.length?(ae.rotate(ye),ce):ae.rotate()},ce.center=function(ye){return arguments.length?(Gt.center(Cn(ye)),ce):Fa(Gt.center())},Te("angle"),Te("clipAngle"),Te("clipExtent"),Te("fitExtent"),Te("fitHeight"),Te("fitSize"),Te("fitWidth"),Te("scale"),Te("translate"),Te("precision"),ce.scale(249.5)}function ve(Rt,Gt){var ae=2*y/Gt,ce=Rt*Rt;function Te(ye,ze){var rr=d.geoAzimuthalEquidistantRaw(ye,ze),fr=rr[0],gr=rr[1],Lr=fr*fr+gr*gr;if(Lr>ce){var Hr=B(Lr),nn=e(gr,fr),cn=ae*v(nn/ae),Mn=nn-cn,Jn=Rt*r(Mn),_a=(Rt*m(Mn)-Mn*m(Jn))/(S-Jn),xa=ge(Mn,_a),La=(y-Rt)/dr(xa,Jn,y);fr=Hr;var ai=50,Ai;do fr-=Ai=(Rt+dr(xa,Jn,fr)*La-Hr)/(xa(fr)*La);while(A(Ai)>l&&--ai>0);gr=Mn*m(fr),fr<S&&(gr-=_a*(fr-S));var mi=m(cn),Yi=r(cn);rr[0]=fr*Yi-gr*mi,rr[1]=fr*mi+gr*Yi}return rr}return Te.invert=function(ye,ze){var rr=ye*ye+ze*ze;if(rr>ce){var fr=B(rr),gr=e(ze,ye),Lr=ae*v(gr/ae),Hr=gr-Lr;ye=fr*r(Hr),ze=fr*m(Hr);for(var nn=ye-S,cn=m(ye),Mn=ze/cn,Jn=ye<S?1/0:0,_a=10;;){var xa=Rt*m(Mn),La=Rt*r(Mn),ai=m(La),Ai=S-La,mi=(xa-Mn*ai)/Ai,Yi=ge(Mn,mi);if(A(Jn)<x||!--_a)break;Mn-=Jn=(Mn*cn-mi*nn-ze)/(cn-nn*2*(Ai*(La+Mn*xa*r(La)-ai)-xa*(xa-Mn*ai))/(Ai*Ai))}fr=Rt+dr(Yi,La,ye)*(y-Rt)/dr(Yi,La,y),gr=Lr+Mn,ye=fr*r(gr),ze=fr*m(gr)}return d.geoAzimuthalEquidistantRaw.invert(ye,ze)},Te}function ge(Rt,Gt){return function(ae){var ce=Rt*r(ae);return ae<S&&(ce-=Gt),B(1+ce*ce)}}function dr(Rt,Gt,ae){for(var ce=50,Te=(ae-Gt)/ce,ye=Rt(Gt)+Rt(ae),ze=1,rr=Gt;ze<ce;++ze)ye+=2*Rt(rr+=Te);return ye*.5*Te}function br(){var Rt=6,Gt=30*_,ae=r(Gt),ce=m(Gt),Te=d.geoProjectionMutator(ve),ye=Te(Gt,Rt),ze=ye.stream,rr=.01,fr=-r(rr*_),gr=m(rr*_);return ye.radius=function(Lr){return arguments.length?(ae=r(Gt=Lr*_),ce=m(Gt),Te(Gt,Rt)):Gt*b},ye.lobes=function(Lr){return arguments.length?Te(Gt,Rt=+Lr):Rt},ye.stream=function(Lr){var Hr=ye.rotate(),nn=ze(Lr),cn=(ye.rotate([0,0]),ze(Lr));return ye.rotate(Hr),nn.sphere=function(){cn.polygonStart(),cn.lineStart();for(var Mn=0,Jn=2*y/Rt,_a=0;Mn<Rt;++Mn,_a-=Jn)cn.point(e(gr*r(_a),fr)*b,L(gr*m(_a))*b),cn.point(e(ce*r(_a-Jn/2),ae)*b,L(ce*m(_a-Jn/2))*b);cn.lineEnd(),cn.polygonEnd()},nn},ye.rotate([90,-40]).scale(91.7095).clipAngle(180-.001)}function Tr(Rt,Gt,ae,ce,Te,ye,ze,rr){arguments.length<8&&(rr=0);function fr(gr,Lr){if(!Lr)return[Rt*gr/y,0];var Hr=Lr*Lr,nn=Rt+Hr*(Gt+Hr*(ae+Hr*ce)),cn=Lr*(Te-1+Hr*(ye-rr+Hr*ze)),Mn=(nn*nn+cn*cn)/(2*cn),Jn=gr*L(nn/Mn)/y;return[Mn*m(Jn),Lr*(1+Hr*rr)+Mn*(1-r(Jn))]}return fr.invert=function(gr,Lr){var Hr=y*gr/Rt,nn=Lr,cn,Mn,Jn=50;do{var _a=nn*nn,xa=Rt+_a*(Gt+_a*(ae+_a*ce)),La=nn*(Te-1+_a*(ye-rr+_a*ze)),ai=xa*xa+La*La,Ai=2*La,mi=ai/Ai,Yi=mi*mi,Go=L(xa/mi)/y,Xo=Hr*Go,po=xa*xa,Qo=(2*Gt+_a*(4*ae+_a*6*ce))*nn,Js=Te+_a*(3*ye+_a*5*ze),Us=2*(xa*Qo+La*(Js-1)),To=2*(Js-1),ko=(Us*Ai-ai*To)/(Ai*Ai),hl=r(Xo),Sl=m(Xo),tu=mi*hl,gt=mi*Sl,Et=Hr/y*(1/B(1-po/Yi))*(Qo*mi-xa*ko)/Yi,Xt=gt-gr,fe=nn*(1+_a*rr)+mi-tu-Lr,me=ko*Sl+tu*Et,we=tu*Go,Ve=1+ko-(ko*hl-gt*Et),je=gt*Go,or=me*je-Ve*we;if(!or)break;Hr-=cn=(fe*me-Xt*Ve)/or,nn-=Mn=(Xt*je-fe*we)/or}while((A(cn)>l||A(Mn)>l)&&--Jn>0);return[Hr,nn]},fr}var mr=Tr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function kr(){return d.geoProjection(mr).scale(149.995)}var Ur=Tr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Or(){return d.geoProjection(Ur).scale(153.93)}var pe=Tr(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Ke(){return d.geoProjection(pe).scale(130.945)}function xr(Rt,Gt){var ae=Rt*Rt,ce=Gt*Gt;return[Rt*(1-.162388*ce)*(.87-952426e-9*ae*ae),Gt*(1+ce/12)]}xr.invert=function(Rt,Gt){var ae=Rt,ce=Gt,Te=50,ye;do{var ze=ce*ce;ce-=ye=(ce*(1+ze/12)-Gt)/(1+ze/4)}while(A(ye)>l&&--Te>0);Te=50,Rt/=1-.162388*ze;do{var rr=(rr=ae*ae)*rr;ae-=ye=(ae*(.87-952426e-9*rr)-Rt)/(.87-.00476213*rr)}while(A(ye)>l&&--Te>0);return[ae,ce]};function Gr(){return d.geoProjection(xr).scale(131.747)}var ln=Tr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function wn(){return d.geoProjection(ln).scale(131.087)}function rn(Rt){var Gt=Rt(S,0)[0]-Rt(-S,0)[0];function ae(ce,Te){var ye=ce>0?-.5:.5,ze=Rt(ce+ye*y,Te);return ze[0]-=ye*Gt,ze}return Rt.invert&&(ae.invert=function(ce,Te){var ye=ce>0?-.5:.5,ze=Rt.invert(ce+ye*Gt,Te),rr=ze[0]-ye*y;return rr<-y?rr+=2*y:rr>y&&(rr-=2*y),ze[0]=rr,ze}),ae}function Qr(Rt,Gt){var ae=g(Rt),ce=g(Gt),Te=r(Gt),ye=r(Rt)*Te,ze=m(Rt)*Te,rr=m(ce*Gt);Rt=A(e(ze,rr)),Gt=L(ye),A(Rt-S)>l&&(Rt%=S);var fr=vn(Rt>y/4?S-Rt:Rt,Gt);return Rt>y/4&&(rr=fr[0],fr[0]=-fr[1],fr[1]=-rr),fr[0]*=ae,fr[1]*=-ce,fr}Qr.invert=function(Rt,Gt){A(Rt)>1&&(Rt=g(Rt)*2-Rt),A(Gt)>1&&(Gt=g(Gt)*2-Gt);var ae=g(Rt),ce=g(Gt),Te=-ae*Rt,ye=-ce*Gt,ze=ye/Te<1,rr=Oa(ze?ye:Te,ze?Te:ye),fr=rr[0],gr=rr[1],Lr=r(gr);return ze&&(fr=-S-fr),[ae*(e(m(fr)*Lr,-m(gr))+y),ce*L(r(fr)*Lr)]};function vn(Rt,Gt){if(Gt===S)return[0,0];var ae=m(Gt),ce=ae*ae,Te=ce*ce,ye=1+Te,ze=1+3*Te,rr=1-Te,fr=L(1/B(ye)),gr=rr+ce*ye*fr,Lr=(1-ae)/gr,Hr=B(Lr),nn=Lr*ye,cn=B(nn),Mn=Hr*rr,Jn,_a;if(Rt===0)return[0,-(Mn+ce*cn)];var xa=r(Gt),La=1/xa,ai=2*ae*xa,Ai=(-3*ce+fr*ze)*ai,mi=(-gr*xa-(1-ae)*Ai)/(gr*gr),Yi=.5*mi/Hr,Go=rr*Yi-2*ce*Hr*ai,Xo=ce*ye*mi+Lr*ze*ai,po=-La*ai,Qo=-La*Xo,Js=-2*La*Go,Us=4*Rt/y,To;if(Rt>.222*y||Gt<y/4&&Rt>.175*y){if(Jn=(Mn+ce*B(nn*(1+Te)-Mn*Mn))/(1+Te),Rt>y/4)return[Jn,Jn];var ko=Jn,hl=.5*Jn;Jn=.5*(hl+ko),_a=50;do{var Sl=B(nn-Jn*Jn),tu=Jn*(Js+po*Sl)+Qo*L(Jn/cn)-Us;if(!tu)break;tu<0?hl=Jn:ko=Jn,Jn=.5*(hl+ko)}while(A(ko-hl)>l&&--_a>0)}else{Jn=l,_a=25;do{var gt=Jn*Jn,Et=B(nn-gt),Xt=Js+po*Et,fe=Jn*Xt+Qo*L(Jn/cn)-Us,me=Xt+(Qo-po*gt)/Et;Jn-=To=Et?fe/me:0}while(A(To)>l&&--_a>0)}return[Jn,-Mn-ce*B(nn-Jn*Jn)]}function Oa(Rt,Gt){for(var ae=0,ce=1,Te=.5,ye=50;;){var ze=Te*Te,rr=B(Te),fr=L(1/B(1+ze)),gr=1-ze+Te*(1+ze)*fr,Lr=(1-rr)/gr,Hr=B(Lr),nn=Lr*(1+ze),cn=Hr*(1-ze),Mn=nn-Rt*Rt,Jn=B(Mn),_a=Gt+cn+Te*Jn;if(A(ce-ae)<x||--ye===0||_a===0)break;_a>0?ae=Te:ce=Te,Te=.5*(ae+ce)}if(!ye)return null;var xa=L(rr),La=r(xa),ai=1/La,Ai=2*rr*La,mi=(-3*Te+fr*(1+3*ze))*Ai,Yi=(-gr*La-(1-rr)*mi)/(gr*gr),Go=.5*Yi/Hr,Xo=(1-ze)*Go-2*Te*Hr*Ai,po=-2*ai*Xo,Qo=-ai*Ai,Js=-ai*(Te*(1+ze)*Yi+Lr*(1+3*ze)*Ai);return[y/4*(Rt*(po+Qo*Jn)+Js*L(Rt/B(nn))),xa]}function Qn(){return d.geoProjection(rn(Qr)).scale(239.75)}function Qa(Rt,Gt,ae){var ce,Te,ye;return Rt?(ce=Ja(Rt,ae),Gt?(Te=Ja(Gt,1-ae),ye=Te[1]*Te[1]+ae*ce[0]*ce[0]*Te[0]*Te[0],[[ce[0]*Te[2]/ye,ce[1]*ce[2]*Te[0]*Te[1]/ye],[ce[1]*Te[1]/ye,-ce[0]*ce[2]*Te[0]*Te[2]/ye],[ce[2]*Te[1]*Te[2]/ye,-ae*ce[0]*ce[1]*Te[0]/ye]]):[[ce[0],0],[ce[1],0],[ce[2],0]]):(Te=Ja(Gt,1-ae),[[0,Te[0]/Te[1]],[1/Te[1],0],[Te[2]/Te[1],0]])}function Ja(Rt,Gt){var ae,ce,Te,ye,ze;if(Gt<l)return ye=m(Rt),ce=r(Rt),ae=Gt*(Rt-ye*ce)/4,[ye-ae*ce,ce+ae*ye,1-Gt*ye*ye/2,Rt-ae];if(Gt>=1-l)return ae=(1-Gt)/4,ce=F(Rt),ye=R(Rt),Te=1/ce,ze=ce*I(Rt),[ye+ae*(ze-Rt)/(ce*ce),Te-ae*ye*Te*(ze-Rt),Te+ae*ye*Te*(ze+Rt),2*t(i(Rt))-S+ae*(ze-Rt)/ce];var rr=[1,0,0,0,0,0,0,0,0],fr=[B(Gt),0,0,0,0,0,0,0,0],gr=0;for(ce=B(1-Gt),ze=1;A(fr[gr]/rr[gr])>l&&gr<8;)ae=rr[gr++],fr[gr]=(ae-ce)/2,rr[gr]=(ae+ce)/2,ce=B(ae*ce),ze*=2;Te=ze*rr[gr]*Rt;do ye=fr[gr]*m(ce=Te)/rr[gr],Te=(L(ye)+Te)/2;while(--gr);return[m(Te),ye=r(Te),ye/r(Te-ce),Te]}function wi(Rt,Gt,ae){var ce=A(Rt),Te=A(Gt),ye=I(Te);if(ce){var ze=1/m(ce),rr=1/(w(ce)*w(ce)),fr=-(rr+ae*(ye*ye*ze*ze)-1+ae),gr=(ae-1)*rr,Lr=(-fr+B(fr*fr-4*gr))/2;return[ci(t(1/B(Lr)),ae)*g(Rt),ci(t(B((Lr/rr-1)/ae)),1-ae)*g(Gt)]}return[0,ci(t(ye),1-ae)*g(Gt)]}function ci(Rt,Gt){if(!Gt)return Rt;if(Gt===1)return o(w(Rt/2+k));for(var ae=1,ce=B(1-Gt),Te=B(Gt),ye=0;A(Te)>l;ye++){if(Rt%y){var ze=t(ce*w(Rt)/ae);ze<0&&(ze+=y),Rt+=ze+~~(Rt/y)*y}else Rt+=Rt;Te=(ae+ce)/2,ce=B(ae*ce),Te=((ae=Te)-ce)/2}return Rt/(f(2,ye)*ae)}function Ti(Rt,Gt){var ae=(T-1)/(T+1),ce=B(1-ae*ae),Te=ci(S,ce*ce),ye=-1,ze=o(w(y/4+A(Gt)/2)),rr=i(ye*ze)/B(ae),fr=Ra(rr*r(ye*Rt),rr*m(ye*Rt)),gr=wi(fr[0],fr[1],ce*ce);return[-gr[1],(Gt>=0?1:-1)*(.5*Te-gr[0])]}function Ra(Rt,Gt){var ae=Rt*Rt,ce=Gt+1,Te=1-ae-Gt*Gt;return[.5*((Rt>=0?S:-S)-e(Te,2*Rt)),-.25*o(Te*Te+4*ae)+.5*o(ce*ce+ae)]}function Qi(Rt,Gt){var ae=Gt[0]*Gt[0]+Gt[1]*Gt[1];return[(Rt[0]*Gt[0]+Rt[1]*Gt[1])/ae,(Rt[1]*Gt[0]-Rt[0]*Gt[1])/ae]}Ti.invert=function(Rt,Gt){var ae=(T-1)/(T+1),ce=B(1-ae*ae),Te=ci(S,ce*ce),ye=-1,ze=Qa(.5*Te-Gt,-Rt,ce*ce),rr=Qi(ze[0],ze[1]),fr=e(rr[1],rr[0])/ye;return[fr,2*t(i(.5/ye*o(ae*rr[0]*rr[0]+ae*rr[1]*rr[1])))-S]};function Hi(){return d.geoProjection(rn(Ti)).scale(151.496)}function Ho(Rt){var Gt=m(Rt),ae=r(Rt),ce=Ci(Rt);ce.invert=Ci(-Rt);function Te(ye,ze){var rr=ce(ye,ze);ye=rr[0],ze=rr[1];var fr=m(ze),gr=r(ze),Lr=r(ye),Hr=D(Gt*fr+ae*gr*Lr),nn=m(Hr),cn=A(nn)>l?Hr/nn:1;return[cn*ae*m(ye),(A(ye)>S?cn:-cn)*(Gt*gr-ae*fr*Lr)]}return Te.invert=function(ye,ze){var rr=B(ye*ye+ze*ze),fr=-m(rr),gr=r(rr),Lr=rr*gr,Hr=-ze*fr,nn=rr*Gt,cn=B(Lr*Lr+Hr*Hr-nn*nn),Mn=e(Lr*nn+Hr*cn,Hr*nn-Lr*cn),Jn=(rr>S?-1:1)*e(ye*fr,rr*r(Mn)*gr+ze*m(Mn)*fr);return ce.invert(Jn,Mn)},Te}function Ci(Rt){var Gt=m(Rt),ae=r(Rt);return function(ce,Te){var ye=r(Te),ze=r(ce)*ye,rr=m(ce)*ye,fr=m(Te);return[e(rr,ze*ae-fr*Gt),L(fr*ae+ze*Gt)]}}function zo(){var Rt=0,Gt=d.geoProjectionMutator(Ho),ae=Gt(Rt),ce=ae.rotate,Te=ae.stream,ye=d.geoCircle();return ae.parallel=function(ze){if(!arguments.length)return Rt*b;var rr=ae.rotate();return Gt(Rt=ze*_).rotate(rr)},ae.rotate=function(ze){return arguments.length?(ce.call(ae,[ze[0],ze[1]-Rt*b]),ye.center([-ze[0],-ze[1]]),ae):(ze=ce.call(ae),ze[1]+=Rt*b,ze)},ae.stream=function(ze){return ze=Te(ze),ze.sphere=function(){ze.polygonStart();var rr=.01,fr=ye.radius(90-rr)().coordinates[0],gr=fr.length-1,Lr=-1,Hr;for(ze.lineStart();++Lr<gr;)ze.point((Hr=fr[Lr])[0],Hr[1]);for(ze.lineEnd(),fr=ye.radius(90+rr)().coordinates[0],gr=fr.length-1,ze.lineStart();--Lr>=0;)ze.point((Hr=fr[Lr])[0],Hr[1]);ze.lineEnd(),ze.polygonEnd()},ze},ae.scale(79.4187).parallel(45).clipAngle(180-.001)}var qi=3,qo=L(1-1/qi)*b,Po=Ue(0);function hs(Rt){var Gt=qo*_,ae=yt(y,Gt)[0]-yt(-y,Gt)[0],ce=Po(0,Gt)[1],Te=yt(0,Gt)[1],ye=c-Te,ze=h/Rt,rr=4/h,fr=ce+ye*ye*4/h;function gr(Lr,Hr){var nn,cn=A(Hr);if(cn>Gt){var Mn=s(Rt-1,a(0,n((Lr+y)/ze)));Lr+=y*(Rt-1)/Rt-Mn*ze,nn=yt(Lr,cn),nn[0]=nn[0]*h/ae-h*(Rt-1)/(2*Rt)+Mn*h/Rt,nn[1]=ce+(nn[1]-Te)*4*ye/h,Hr<0&&(nn[1]=-nn[1])}else nn=Po(Lr,Hr);return nn[0]*=rr,nn[1]/=fr,nn}return gr.invert=function(Lr,Hr){Lr/=rr,Hr*=fr;var nn=A(Hr);if(nn>ce){var cn=s(Rt-1,a(0,n((Lr+y)/ze)));Lr=(Lr+y*(Rt-1)/Rt-cn*ze)*ae/h;var Mn=yt.invert(Lr,.25*(nn-ce)*h/ye+Te);return Mn[0]-=y*(Rt-1)/Rt-cn*ze,Hr<0&&(Mn[1]=-Mn[1]),Mn}return Po.invert(Lr,Hr)},gr}function Gi(Rt,Gt){return[Rt,Gt&1?90-l:qo]}function uo(Rt,Gt){return[Rt,Gt&1?-90+l:-qo]}function yi(Rt){return[Rt[0]*(1-l),Rt[1]]}function ao(Rt){var Gt=[].concat(E.range(-180,180+Rt/2,Rt).map(Gi),E.range(180,-180-Rt/2,-Rt).map(uo));return{type:"Polygon",coordinates:[Rt===180?Gt.map(yi):Gt]}}function ts(){var Rt=4,Gt=d.geoProjectionMutator(hs),ae=Gt(Rt),ce=ae.stream;return ae.lobes=function(Te){return arguments.length?Gt(Rt=+Te):Rt},ae.stream=function(Te){var ye=ae.rotate(),ze=ce(Te),rr=(ae.rotate([0,0]),ce(Te));return ae.rotate(ye),ze.sphere=function(){d.geoStream(ao(180/Rt),rr)},ze},ae.scale(239.75)}function vs(Rt){var Gt=1+Rt,ae=m(1/Gt),ce=L(ae),Te=2*B(y/(ye=y+4*ce*Gt)),ye,ze=.5*Te*(Gt+B(Rt*(2+Rt))),rr=Rt*Rt,fr=Gt*Gt;function gr(Lr,Hr){var nn=1-m(Hr),cn,Mn;if(nn&&nn<2){var Jn=S-Hr,_a=25,xa;do{var La=m(Jn),ai=r(Jn),Ai=ce+e(La,Gt-ai),mi=1+fr-2*Gt*ai;Jn-=xa=(Jn-rr*ce-Gt*La+mi*Ai-.5*nn*ye)/(2*Gt*La*Ai)}while(A(xa)>x&&--_a>0);cn=Te*B(mi),Mn=Lr*Ai/y}else cn=Te*(Rt+nn),Mn=Lr*ce/y;return[cn*m(Mn),ze-cn*r(Mn)]}return gr.invert=function(Lr,Hr){var nn=Lr*Lr+(Hr-=ze)*Hr,cn=(1+fr-nn/(Te*Te))/(2*Gt),Mn=D(cn),Jn=m(Mn),_a=ce+e(Jn,Gt-cn);return[L(Lr/B(nn))*y/_a,L(1-2*(Mn-rr*ce-Gt*Jn+(1+fr-2*Gt*cn)*_a)/ye)]},gr}function As(){var Rt=1,Gt=d.geoProjectionMutator(vs),ae=Gt(Rt);return ae.ratio=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(167.774).center([0,18.67])}var _o=.7109889596207567,Da=.0528035274542;function li(Rt,Gt){return Gt>-_o?(Rt=Kt(Rt,Gt),Rt[1]+=Da,Rt):ue(Rt,Gt)}li.invert=function(Rt,Gt){return Gt>-_o?Kt.invert(Rt,Gt-Da):ue.invert(Rt,Gt)};function wo(){return d.geoProjection(li).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Ms(Rt,Gt){return A(Gt)>_o?(Rt=Kt(Rt,Gt),Rt[1]-=Gt>0?Da:-Da,Rt):ue(Rt,Gt)}Ms.invert=function(Rt,Gt){return A(Gt)>_o?Kt.invert(Rt,Gt+(Gt>0?Da:-Da)):ue.invert(Rt,Gt)};function Di(){return d.geoProjection(Ms).scale(152.63)}function _s(Rt,Gt,ae,ce){var Te=B(4*y/(2*ae+(1+Rt-Gt/2)*m(2*ae)+(Rt+Gt)/2*m(4*ae)+Gt/2*m(6*ae))),ye=B(ce*m(ae)*B((1+Rt*r(2*ae)+Gt*r(4*ae))/(1+Rt+Gt))),ze=ae*fr(1);function rr(Hr){return B(1+Rt*r(2*Hr)+Gt*r(4*Hr))}function fr(Hr){var nn=Hr*ae;return(2*nn+(1+Rt-Gt/2)*m(2*nn)+(Rt+Gt)/2*m(4*nn)+Gt/2*m(6*nn))/ae}function gr(Hr){return rr(Hr)*m(Hr)}var Lr=function(Hr,nn){var cn=ae*It(fr,ze*m(nn)/ae,nn/y);isNaN(cn)&&(cn=ae*g(nn));var Mn=Te*rr(cn);return[Mn*ye*Hr/y*r(cn),Mn/ye*m(cn)]};return Lr.invert=function(Hr,nn){var cn=It(gr,nn*ye/Te);return[Hr*y/(r(cn)*Te*ye*rr(cn)),L(ae*fr(cn/ae)/ze)]},ae===0&&(Te=B(ce/y),Lr=function(Hr,nn){return[Hr*Te,m(nn)/Te]},Lr.invert=function(Hr,nn){return[Hr/Te,L(nn*Te)]}),Lr}function No(){var Rt=1,Gt=0,ae=45*_,ce=2,Te=d.geoProjectionMutator(_s),ye=Te(Rt,Gt,ae,ce);return ye.a=function(ze){return arguments.length?Te(Rt=+ze,Gt,ae,ce):Rt},ye.b=function(ze){return arguments.length?Te(Rt,Gt=+ze,ae,ce):Gt},ye.psiMax=function(ze){return arguments.length?Te(Rt,Gt,ae=+ze*_,ce):ae*b},ye.ratio=function(ze){return arguments.length?Te(Rt,Gt,ae,ce=+ze):ce},ye.scale(180.739)}function is(Rt,Gt,ae,ce,Te,ye,ze,rr,fr,gr,Lr){if(Lr.nanEncountered)return NaN;var Hr,nn,cn,Mn,Jn,_a,xa,La,ai,Ai;if(Hr=ae-Gt,nn=Rt(Gt+Hr*.25),cn=Rt(ae-Hr*.25),isNaN(nn)){Lr.nanEncountered=!0;return}if(isNaN(cn)){Lr.nanEncountered=!0;return}return Mn=Hr*(ce+4*nn+Te)/12,Jn=Hr*(Te+4*cn+ye)/12,_a=Mn+Jn,Ai=(_a-ze)/15,gr>fr?(Lr.maxDepthCount++,_a+Ai):Math.abs(Ai)<rr?_a+Ai:(xa=Gt+Hr*.5,La=is(Rt,Gt,xa,ce,nn,Te,Mn,rr*.5,fr,gr+1,Lr),isNaN(La)?(Lr.nanEncountered=!0,NaN):(ai=is(Rt,xa,ae,Te,cn,ye,Jn,rr*.5,fr,gr+1,Lr),isNaN(ai)?(Lr.nanEncountered=!0,NaN):La+ai))}function al(Rt,Gt,ae,ce,Te){var ye={maxDepthCount:0,nanEncountered:!1};Te===void 0&&(Te=20);var ze=Rt(Gt),rr=Rt(.5*(Gt+ae)),fr=Rt(ae),gr=(ze+4*rr+fr)*(ae-Gt)/6,Lr=is(Rt,Gt,ae,ze,rr,fr,gr,ce,Te,1,ye);return Lr}function ii(Rt,Gt,ae){function ce(cn){return Rt+(1-Rt)*f(1-f(cn,Gt),1/Gt)}function Te(cn){return al(ce,0,cn,1e-4)}for(var ye=1/Te(1),ze=1e3,rr=(1+1e-8)*ye,fr=[],gr=0;gr<=ze;gr++)fr.push(Te(gr/ze)*rr);function Lr(cn){var Mn=0,Jn=ze,_a=ze>>1;do fr[_a]>cn?Jn=_a:Mn=_a,_a=Mn+Jn>>1;while(_a>Mn);var xa=fr[_a+1]-fr[_a];return xa&&(xa=(cn-fr[_a+1])/xa),(_a+1+xa)/ze}var Hr=2*Lr(1)/y*ye/ae,nn=function(cn,Mn){var Jn=Lr(A(m(Mn))),_a=ce(Jn)*cn;return Jn/=Hr,[_a,Mn>=0?Jn:-Jn]};return nn.invert=function(cn,Mn){var Jn;return Mn*=Hr,A(Mn)<1&&(Jn=g(Mn)*L(Te(A(Mn))*ye)),[cn/ce(A(Mn)),Jn]},nn}function io(){var Rt=0,Gt=2.5,ae=1.183136,ce=d.geoProjectionMutator(ii),Te=ce(Rt,Gt,ae);return Te.alpha=function(ye){return arguments.length?ce(Rt=+ye,Gt,ae):Rt},Te.k=function(ye){return arguments.length?ce(Rt,Gt=+ye,ae):Gt},Te.gamma=function(ye){return arguments.length?ce(Rt,Gt,ae=+ye):ae},Te.scale(152.63)}function co(Rt,Gt){return A(Rt[0]-Gt[0])<l&&A(Rt[1]-Gt[1])<l}function Is(Rt,Gt){for(var ae=-1,ce=Rt.length,Te=Rt[0],ye,ze,rr,fr=[];++ae<ce;){ye=Rt[ae],ze=(ye[0]-Te[0])/Gt,rr=(ye[1]-Te[1])/Gt;for(var gr=0;gr<Gt;++gr)fr.push([Te[0]+gr*ze,Te[1]+gr*rr]);Te=ye}return fr.push(ye),fr}function Wo(Rt){var Gt=[],ae,ce,Te,ye,ze,rr,fr,gr=Rt[0].length;for(fr=0;fr<gr;++fr)ae=Rt[0][fr],ce=ae[0][0],Te=ae[0][1],ye=ae[1][1],ze=ae[2][0],rr=ae[2][1],Gt.push(Is([[ce+l,Te+l],[ce+l,ye-l],[ze-l,ye-l],[ze-l,rr+l]],30));for(fr=Rt[1].length-1;fr>=0;--fr)ae=Rt[1][fr],ce=ae[0][0],Te=ae[0][1],ye=ae[1][1],ze=ae[2][0],rr=ae[2][1],Gt.push(Is([[ze-l,rr-l],[ze-l,ye+l],[ce+l,ye+l],[ce+l,Te-l]],30));return{type:"Polygon",coordinates:[E.merge(Gt)]}}function Bi(Rt,Gt,ae){var ce,Te;function ye(fr,gr){for(var Lr=gr<0?-1:1,Hr=Gt[+(gr<0)],nn=0,cn=Hr.length-1;nn<cn&&fr>Hr[nn][2][0];++nn);var Mn=Rt(fr-Hr[nn][1][0],gr);return Mn[0]+=Rt(Hr[nn][1][0],Lr*gr>Lr*Hr[nn][0][1]?Hr[nn][0][1]:gr)[0],Mn}ae?ye.invert=ae(ye):Rt.invert&&(ye.invert=function(fr,gr){for(var Lr=Te[+(gr<0)],Hr=Gt[+(gr<0)],nn=0,cn=Lr.length;nn<cn;++nn){var Mn=Lr[nn];if(Mn[0][0]<=fr&&fr<Mn[1][0]&&Mn[0][1]<=gr&&gr<Mn[1][1]){var Jn=Rt.invert(fr-Rt(Hr[nn][1][0],0)[0],gr);return Jn[0]+=Hr[nn][1][0],co(ye(Jn[0],Jn[1]),[fr,gr])?Jn:null}}});var ze=d.geoProjection(ye),rr=ze.stream;return ze.stream=function(fr){var gr=ze.rotate(),Lr=rr(fr),Hr=(ze.rotate([0,0]),rr(fr));return ze.rotate(gr),Lr.sphere=function(){d.geoStream(ce,Hr)},Lr},ze.lobes=function(fr){return arguments.length?(ce=Wo(fr),Gt=fr.map(function(gr){return gr.map(function(Lr){return[[Lr[0][0]*_,Lr[0][1]*_],[Lr[1][0]*_,Lr[1][1]*_],[Lr[2][0]*_,Lr[2][1]*_]]})}),Te=Gt.map(function(gr){return gr.map(function(Lr){var Hr=Rt(Lr[0][0],Lr[0][1])[0],nn=Rt(Lr[2][0],Lr[2][1])[0],cn=Rt(Lr[1][0],Lr[0][1])[1],Mn=Rt(Lr[1][0],Lr[1][1])[1],Jn;return cn>Mn&&(Jn=cn,cn=Mn,Mn=Jn),[[Hr,cn],[nn,Mn]]})}),ze):Gt.map(function(gr){return gr.map(function(Lr){return[[Lr[0][0]*b,Lr[0][1]*b],[Lr[1][0]*b,Lr[1][1]*b],[Lr[2][0]*b,Lr[2][1]*b]]})})},Gt!=null&&ze.lobes(Gt),ze}var $s=[[[[-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 fl(){return Bi(Ut,$s).scale(160.857)}var Jo=[[[[-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 us(){return Bi(Ms,Jo).scale(152.63)}var Ss=[[[[-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 Ls(){return Bi(Kt,Ss).scale(169.529)}var yl=[[[[-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 bu(){return Bi(Kt,yl).scale(169.529).rotate([20,0])}var au=[[[[-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 Bi(li,au,Ct).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Ec=[[[[-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 xc(){return Bi(ue,Ec).scale(152.63).rotate([-20,0])}function cs(Rt,Gt){return[3/h*Rt*B(y*y/3-Gt*Gt),Gt]}cs.invert=function(Rt,Gt){return[h/3*Rt/B(y*y/3-Gt*Gt),Gt]};function Gl(){return d.geoProjection(cs).scale(158.837)}function zc(Rt){function Gt(ae,ce){if(A(A(ce)-S)<l)return[0,ce<0?-2:2];var Te=m(ce),ye=f((1+Te)/(1-Te),Rt/2),ze=.5*(ye+1/ye)+r(ae*=Rt);return[2*m(ae)/ze,(ye-1/ye)/ze]}return Gt.invert=function(ae,ce){var Te=A(ce);if(A(Te-2)<l)return ae?null:[0,g(ce)*S];if(Te>2)return null;ae/=2,ce/=2;var ye=ae*ae,ze=ce*ce,rr=2*ce/(1+ye+ze);return rr=f((1+rr)/(1-rr),1/Rt),[e(2*ae,1-ye-ze)/Rt,L((rr-1)/(rr+1))]},Gt}function Al(){var Rt=.5,Gt=d.geoProjectionMutator(zc),ae=Gt(Rt);return ae.spacing=function(ce){return arguments.length?Gt(Rt=+ce):Rt},ae.scale(124.75)}var xl=y/T;function Ml(Rt,Gt){return[Rt*(1+B(r(Gt)))/2,Gt/(r(Gt/2)*r(Rt/6))]}Ml.invert=function(Rt,Gt){var ae=A(Rt),ce=A(Gt),Te=l,ye=S;ce<xl?ye*=ce/xl:Te+=6*D(xl/ce);for(var ze=0;ze<25;ze++){var rr=m(ye),fr=B(r(ye)),gr=m(ye/2),Lr=r(ye/2),Hr=m(Te/6),nn=r(Te/6),cn=.5*Te*(1+fr)-ae,Mn=ye/(Lr*nn)-ce,Jn=fr?-.25*Te*rr/fr:0,_a=.5*(1+fr),xa=(1+.5*ye*gr/Lr)/(Lr*nn),La=ye/Lr*(Hr/6)/(nn*nn),ai=Jn*La-xa*_a,Ai=(cn*La-Mn*_a)/ai,mi=(Mn*Jn-cn*xa)/ai;if(ye-=Ai,Te-=mi,A(Ai)<l&&A(mi)<l)break}return[Rt<0?-Te:Te,Gt<0?-ye:ye]};function hu(){return d.geoProjection(Ml).scale(97.2672)}function Fs(Rt,Gt){var ae=Rt*Rt,ce=Gt*Gt;return[Rt*(.975534+ce*(-.119161+ae*-.0143059+ce*-.0547009)),Gt*(1.00384+ae*(.0802894+ce*-.02855+ae*199025e-9)+ce*(.0998909+ce*-.0491032))]}Fs.invert=function(Rt,Gt){var ae=g(Rt)*y,ce=Gt/2,Te=50;do{var ye=ae*ae,ze=ce*ce,rr=ae*ce,fr=ae*(.975534+ze*(-.119161+ye*-.0143059+ze*-.0547009))-Rt,gr=ce*(1.00384+ye*(.0802894+ze*-.02855+ye*199025e-9)+ze*(.0998909+ze*-.0491032))-Gt,Lr=.975534-ze*(.119161+3*ye*.0143059+ze*.0547009),Hr=-rr*(2*.119161+4*.0547009*ze+2*.0143059*ye),nn=rr*(2*.0802894+4*199025e-9*ye+2*-.02855*ze),cn=1.00384+ye*(.0802894+199025e-9*ye)+ze*(3*(.0998909-.02855*ye)-5*.0491032*ze),Mn=Hr*nn-cn*Lr,Jn=(gr*Hr-fr*cn)/Mn,_a=(fr*nn-gr*Lr)/Mn;ae-=Jn,ce-=_a}while((A(Jn)>l||A(_a)>l)&&--Te>0);return Te&&[ae,ce]};function _l(){return d.geoProjection(Fs).scale(139.98)}function Fo(Rt,Gt){return[m(Rt)/r(Gt),w(Gt)*r(Rt)]}Fo.invert=function(Rt,Gt){var ae=Rt*Rt,ce=Gt*Gt,Te=ce+1,ye=ae+Te,ze=Rt?M*B((ye-B(ye*ye-4*ae))/ae):1/B(Te);return[L(Rt*ze),g(Gt)*D(ze)]};function bs(){return d.geoProjection(Fo).scale(144.049).clipAngle(90-.001)}function Iu(Rt){var Gt=r(Rt),ae=w(k+Rt/2);function ce(Te,ye){var ze=ye-Rt,rr=A(ze)<l?Te*Gt:A(rr=k+ye/2)<l||A(A(rr)-S)<l?0:Te*ze/o(w(rr)/ae);return[rr,ze]}return ce.invert=function(Te,ye){var ze,rr=ye+Rt;return[A(ye)<l?Te/Gt:A(ze=k+rr/2)<l||A(A(ze)-S)<l?0:Te*o(w(ze)/ae)/ye,rr]},ce}function Nl(){return Zt(Iu).parallel(40).scale(158.837)}function Hu(Rt,Gt){return[Rt,1.25*o(w(k+.4*Gt))]}Hu.invert=function(Rt,Gt){return[Rt,2.5*t(i(.8*Gt))-.625*y]};function qs(){return d.geoProjection(Hu).scale(108.318)}function of(Rt){var Gt=Rt.length-1;function ae(ce,Te){for(var ye=r(Te),ze=2/(1+ye*r(ce)),rr=ze*ye*m(ce),fr=ze*m(Te),gr=Gt,Lr=Rt[gr],Hr=Lr[0],nn=Lr[1],cn;--gr>=0;)Lr=Rt[gr],Hr=Lr[0]+rr*(cn=Hr)-fr*nn,nn=Lr[1]+rr*nn+fr*cn;return Hr=rr*(cn=Hr)-fr*nn,nn=rr*nn+fr*cn,[Hr,nn]}return ae.invert=function(ce,Te){var ye=20,ze=ce,rr=Te;do{for(var fr=Gt,gr=Rt[fr],Lr=gr[0],Hr=gr[1],nn=0,cn=0,Mn;--fr>=0;)gr=Rt[fr],nn=Lr+ze*(Mn=nn)-rr*cn,cn=Hr+ze*cn+rr*Mn,Lr=gr[0]+ze*(Mn=Lr)-rr*Hr,Hr=gr[1]+ze*Hr+rr*Mn;nn=Lr+ze*(Mn=nn)-rr*cn,cn=Hr+ze*cn+rr*Mn,Lr=ze*(Mn=Lr)-rr*Hr-ce,Hr=ze*Hr+rr*Mn-Te;var Jn=nn*nn+cn*cn,_a,xa;ze-=_a=(Lr*nn+Hr*cn)/Jn,rr-=xa=(Hr*nn-Lr*cn)/Jn}while(A(_a)+A(xa)>l*l&&--ye>0);if(ye){var La=B(ze*ze+rr*rr),ai=2*t(La*.5),Ai=m(ai);return[e(ze*Ai,La*r(ai)),La?L(rr*Ai/La):0]}},ae}var Oo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],vf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],os=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Fi=[[.9245,0],[0,0],[.01943,0]],nc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function pu(){return bl(Oo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function ml(){return bl(vf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Lc(){return bl(os,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function qu(){return bl(Fi,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function dc(){return bl(nc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function bl(Rt,Gt){var ae=d.geoProjection(of(Rt)).rotate(Gt).clipAngle(90),ce=d.geoRotation(Gt),Te=ae.center;return delete ae.rotate,ae.center=function(ye){return arguments.length?Te(ce(ye)):ce.invert(Te())},ae}var Yc=B(6),Fc=B(7);function mc(Rt,Gt){var ae=L(7*m(Gt)/(3*Yc));return[Yc*Rt*(2*r(2*ae/3)-1)/Fc,9*m(ae/3)/Fc]}mc.invert=function(Rt,Gt){var ae=3*L(Gt*Fc/9);return[Rt*Fc/(Yc*(2*r(2*ae/3)-1)),L(m(ae)*3*Yc/7)]};function Wu(){return d.geoProjection(mc).scale(164.859)}function Cc(Rt,Gt){for(var ae=(1+M)*m(Gt),ce=Gt,Te=0,ye;Te<25&&(ce-=ye=(m(ce/2)+m(ce)-ae)/(.5*r(ce/2)+r(ce)),!(A(ye)<l));Te++);return[Rt*(1+2*r(ce)/r(ce/2))/(3*T),2*B(3)*m(ce/2)/B(2+T)]}Cc.invert=function(Rt,Gt){var ae=Gt*B(2+T)/(2*B(3)),ce=2*L(ae);return[3*T*Rt/(1+2*r(ce)/r(ce/2)),L((ae+m(ce))/(1+M))]};function Ic(){return d.geoProjection(Cc).scale(188.209)}function du(Rt,Gt){for(var ae=B(6/(4+y)),ce=(1+y/4)*m(Gt),Te=Gt/2,ye=0,ze;ye<25&&(Te-=ze=(Te/2+m(Te)-ce)/(.5+r(Te)),!(A(ze)<l));ye++);return[ae*(.5+r(Te))*Rt/1.5,ae*Te]}du.invert=function(Rt,Gt){var ae=B(6/(4+y)),ce=Gt/ae;return A(A(ce)-S)<l&&(ce=ce<0?-S:S),[1.5*Rt/(ae*(.5+r(ce))),L((ce/2+m(ce))/(1+y/4))]};function Bc(){return d.geoProjection(du).scale(166.518)}function Pu(Rt,Gt){var ae=Gt*Gt,ce=ae*ae,Te=ae*ce;return[Rt*(.84719-.13063*ae+Te*Te*(-.04515+.05494*ae-.02326*ce+.00331*Te)),Gt*(1.01183+ce*ce*(-.02625+.01926*ae-.00396*ce))]}Pu.invert=function(Rt,Gt){var ae=Gt,ce=25,Te,ye,ze,rr;do ye=ae*ae,ze=ye*ye,ae-=Te=(ae*(1.01183+ze*ze*(-.02625+.01926*ye-.00396*ze))-Gt)/(1.01183+ze*ze*(9*-.02625+11*.01926*ye+13*-.00396*ze));while(A(Te)>x&&--ce>0);return ye=ae*ae,ze=ye*ye,rr=ye*ze,[Rt/(.84719-.13063*ye+rr*rr*(-.04515+.05494*ye-.02326*ze+.00331*rr)),ae]};function wu(){return d.geoProjection(Pu).scale(175.295)}function wl(Rt,Gt){return[Rt*(1+r(Gt))/2,2*(Gt-w(Gt/2))]}wl.invert=function(Rt,Gt){for(var ae=Gt/2,ce=0,Te=1/0;ce<10&&A(Te)>l;++ce){var ye=r(Gt/2);Gt-=Te=(Gt-w(Gt/2)-ae)/(1-.5/(ye*ye))}return[2*Rt/(1+r(Gt)),Gt]};function Ju(){return d.geoProjection(wl).scale(152.63)}var Pc=[[[[-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 Es(){return Bi(dt(1/0),Pc).rotate([20,0]).scale(152.63)}function _c(Rt,Gt){var ae=m(Gt),ce=r(Gt),Te=g(Rt);if(Rt===0||A(Gt)===S)return[0,Gt];if(Gt===0)return[Rt,0];if(A(Rt)===S)return[Rt*ce,S*ae];var ye=y/(2*Rt)-2*Rt/y,ze=2*Gt/y,rr=(1-ze*ze)/(ae-ze),fr=ye*ye,gr=rr*rr,Lr=1+fr/gr,Hr=1+gr/fr,nn=(ye*ae/rr-ye/2)/Lr,cn=(gr*ae/fr+rr/2)/Hr,Mn=nn*nn+ce*ce/Lr,Jn=cn*cn-(gr*ae*ae/fr+rr*ae-1)/Hr;return[S*(nn+B(Mn)*Te),S*(cn+B(Jn<0?0:Jn)*g(-Gt*ye)*Te)]}_c.invert=function(Rt,Gt){Rt/=S,Gt/=S;var ae=Rt*Rt,ce=Gt*Gt,Te=ae+ce,ye=y*y;return[Rt?(Te-1+B((1-Te)*(1-Te)+4*ae))/(2*Rt)*S:0,It(function(ze){return Te*(y*m(ze)-2*ze)*y+4*ze*ze*(Gt-m(ze))+2*y*ze-ye*Gt},0)]};function sf(){return d.geoProjection(_c).scale(127.267)}var Rc=1.0148,gc=.23185,Nc=-.14499,Zl=.02406,jc=Rc,rl=5*gc,Kl=7*Nc,Gu=9*Zl,Bs=1.790857183;function Ou(Rt,Gt){var ae=Gt*Gt;return[Rt,Gt*(Rc+ae*ae*(gc+ae*(Nc+Zl*ae)))]}Ou.invert=function(Rt,Gt){Gt>Bs?Gt=Bs:Gt<-Bs&&(Gt=-Bs);var ae=Gt,ce;do{var Te=ae*ae;ae-=ce=(ae*(Rc+Te*Te*(gc+Te*(Nc+Zl*Te)))-Gt)/(jc+Te*Te*(rl+Te*(Kl+Gu*Te)))}while(A(ce)>l);return[Rt,ae]};function Rl(){return d.geoProjection(Ou).scale(139.319)}function Yl(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ae=w(Gt),ce=Rt*m(Gt);return[m(ce)/ae,Gt+(1-r(ce))/ae]}Yl.invert=function(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ae=Rt*Rt+Gt*Gt,ce=Gt*.5,Te=10,ye;do{var ze=w(ce),rr=1/r(ce),fr=ae-2*Gt*ce+ce*ce;ce-=ye=(ze*fr+2*(ce-Gt))/(2+fr*rr*rr+2*(ce-Gt)*ze)}while(A(ye)>l&&--Te>0);return ze=w(ce),[(A(Gt)<A(ce+1/ze)?L(Rt*ze):g(Gt)*g(Rt)*(D(A(Rt*ze))+S))/m(ce),ce]};function Ws(){return d.geoProjection(Yl).scale(103.74)}function ac(Rt,Gt){var ae=bc(Rt[1],Rt[0]),ce=bc(Gt[1],Gt[0]),Te=Mf(ae,ce),ye=lf(ae)/lf(ce);return Zu([1,0,Rt[0][0],0,1,Rt[0][1]],Zu([ye,0,0,0,ye,0],Zu([r(Te),m(Te),0,-m(Te),r(Te),0],[1,0,-Gt[0][0],0,1,-Gt[0][1]])))}function Tu(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 Zu(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 bc(Rt,Gt){return[Rt[0]-Gt[0],Rt[1]-Gt[1]]}function lf(Rt){return B(Rt[0]*Rt[0]+Rt[1]*Rt[1])}function Mf(Rt,Gt){return e(Rt[0]*Gt[1]-Rt[1]*Gt[0],Rt[0]*Gt[0]+Rt[1]*Gt[1])}function ic(Rt,Gt,ae){ce(Rt,{transform:null});function ce(gr,Lr){if(gr.edges=iu(gr.face),Lr.face){var Hr=gr.shared=oc(gr.face,Lr.face),nn=ac(Hr.map(Lr.project),Hr.map(gr.project));gr.transform=Lr.transform?Zu(Lr.transform,nn):nn;for(var cn=Lr.edges,Mn=0,Jn=cn.length;Mn<Jn;++Mn)Fl(Hr[0],cn[Mn][1])&&Fl(Hr[1],cn[Mn][0])&&(cn[Mn]=gr),Fl(Hr[0],cn[Mn][0])&&Fl(Hr[1],cn[Mn][1])&&(cn[Mn]=gr);for(cn=gr.edges,Mn=0,Jn=cn.length;Mn<Jn;++Mn)Fl(Hr[0],cn[Mn][0])&&Fl(Hr[1],cn[Mn][1])&&(cn[Mn]=Lr),Fl(Hr[0],cn[Mn][1])&&Fl(Hr[1],cn[Mn][0])&&(cn[Mn]=Lr)}else gr.transform=Lr.transform;return gr.children&&gr.children.forEach(function(_a){ce(_a,gr)}),gr}function Te(gr,Lr){var Hr=Gt(gr,Lr),nn=Hr.project([gr*b,Lr*b]),cn;return(cn=Hr.transform)?[cn[0]*nn[0]+cn[1]*nn[1]+cn[2],-(cn[3]*nn[0]+cn[4]*nn[1]+cn[5])]:(nn[1]=-nn[1],nn)}sc(Rt)&&(Te.invert=function(gr,Lr){var Hr=ye(Rt,[gr,-Lr]);return Hr&&(Hr[0]*=_,Hr[1]*=_,Hr)});function ye(gr,Lr){var Hr=gr.project.invert,nn=gr.transform,cn=Lr;if(nn&&(nn=Tu(nn),cn=[nn[0]*cn[0]+nn[1]*cn[1]+nn[2],nn[3]*cn[0]+nn[4]*cn[1]+nn[5]]),Hr&&gr===ze(Mn=Hr(cn)))return Mn;for(var Mn,Jn=gr.children,_a=0,xa=Jn&&Jn.length;_a<xa;++_a)if(Mn=ye(Jn[_a],Lr))return Mn}function ze(gr){return Gt(gr[0]*_,gr[1]*_)}var rr=d.geoProjection(Te),fr=rr.stream;return rr.stream=function(gr){var Lr=rr.rotate(),Hr=fr(gr),nn=(rr.rotate([0,0]),fr(gr));return rr.rotate(Lr),Hr.sphere=function(){nn.polygonStart(),nn.lineStart(),wc(nn,Rt),nn.lineEnd(),nn.polygonEnd()},Hr},rr.angle(ae==null?-30:ae*b)}function wc(Rt,Gt,ae){var ce,Te=Gt.edges,ye=Te.length,ze,rr={type:"MultiPoint",coordinates:Gt.face},fr=Gt.face.filter(function(Jn){return A(Jn[1])!==90}),gr=d.geoBounds({type:"MultiPoint",coordinates:fr}),Lr=!1,Hr=-1,nn=gr[1][0]-gr[0][0],cn=nn===180||nn===360?[(gr[0][0]+gr[1][0])/2,(gr[0][1]+gr[1][1])/2]:d.geoCentroid(rr);if(ae)for(;++Hr<ye&&Te[Hr]!==ae;);++Hr;for(var Mn=0;Mn<ye;++Mn)ze=Te[(Mn+Hr)%ye],Array.isArray(ze)?(Lr||(Rt.point((ce=d.geoInterpolate(ze[0],cn)(l))[0],ce[1]),Lr=!0),Rt.point((ce=d.geoInterpolate(ze[1],cn)(l))[0],ce[1])):(Lr=!1,ze!==ae&&wc(Rt,ze,Gt))}function Fl(Rt,Gt){return Rt&&Gt&&Rt[0]===Gt[0]&&Rt[1]===Gt[1]}function oc(Rt,Gt){for(var ae,ce,Te=Rt.length,ye=null,ze=0;ze<Te;++ze){ae=Rt[ze];for(var rr=Gt.length;--rr>=0;)if(ce=Gt[rr],ae[0]===ce[0]&&ae[1]===ce[1]){if(ye)return[ye,ae];ye=ae}}}function iu(Rt){for(var Gt=Rt.length,ae=[],ce=Rt[Gt-1],Te=0;Te<Gt;++Te)ae.push([ce,ce=Rt[Te]]);return ae}function sc(Rt){return Rt.project.invert||Rt.children&&Rt.children.some(sc)}var Tc=[[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 Tc[Gt]})});function Gs(Rt){Rt=Rt||function(ae){var ce=d.geoCentroid({type:"MultiPoint",coordinates:ae});return d.geoGnomonic().scale(1).translate([0,0]).rotate([-ce[0],-ce[1]])};var Gt=ku.map(function(ae){return{face:ae,project:Rt(ae)}});return[-1,0,0,1,0,1,4,5].forEach(function(ae,ce){var Te=Gt[ae];Te&&(Te.children||(Te.children=[])).push(Gt[ce])}),ic(Gt[0],function(ae,ce){return Gt[ae<-y/2?ce<0?6:4:ae<0?ce<0?2:0:ae<y/2?ce<0?3:1:ce<0?7:5]}).angle(-30).scale(101.858).center([0,45])}var Du=2/B(3);function Xl(Rt,Gt){var ae=yt(Rt,Gt);return[ae[0]*Du,ae[1]]}Xl.invert=function(Rt,Gt){return yt.invert(Rt/Du,Gt)};function Xc(Rt){Rt=Rt||function(ae){var ce=d.geoCentroid({type:"MultiPoint",coordinates:ae});return d.geoProjection(Xl).translate([0,0]).scale(1).rotate(ce[1]>0?[-ce[0],0]:[180-ce[0],180])};var Gt=ku.map(function(ae){return{face:ae,project:Rt(ae)}});return[-1,0,0,1,0,1,4,5].forEach(function(ae,ce){var Te=Gt[ae];Te&&(Te.children||(Te.children=[])).push(Gt[ce])}),ic(Gt[0],function(ae,ce){return Gt[ae<-y/2?ce<0?6:4:ae<0?ce<0?2:0:ae<y/2?ce<0?3:1:ce<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])}function Vs(Rt){Rt=Rt||function(ze){var rr=ze.length===6?d.geoCentroid({type:"MultiPoint",coordinates:ze}):ze[0];return d.geoGnomonic().scale(1).translate([0,0]).rotate([-rr[0],-rr[1]])};var Gt=ku.map(function(ze){for(var rr=ze.map(Qu),fr=rr.length,gr=rr[fr-1],Lr,Hr=[],nn=0;nn<fr;++nn)Lr=rr[nn],Hr.push(ou([gr[0]*.9486832980505138+Lr[0]*.31622776601683794,gr[1]*.9486832980505138+Lr[1]*.31622776601683794,gr[2]*.9486832980505138+Lr[2]*.31622776601683794]),ou([Lr[0]*.9486832980505138+gr[0]*.31622776601683794,Lr[1]*.9486832980505138+gr[1]*.31622776601683794,Lr[2]*.9486832980505138+gr[2]*.31622776601683794])),gr=Lr;return Hr}),ae=[],ce=[-1,0,0,1,0,1,4,5];Gt.forEach(function(ze,rr){for(var fr=ku[rr],gr=fr.length,Lr=ae[rr]=[],Hr=0;Hr<gr;++Hr)Gt.push([fr[Hr],ze[(Hr*2+2)%(2*gr)],ze[(Hr*2+1)%(2*gr)]]),ce.push(rr),Lr.push(Ku(Qu(ze[(Hr*2+2)%(2*gr)]),Qu(ze[(Hr*2+1)%(2*gr)])))});var Te=Gt.map(function(ze){return{project:Rt(ze),face:ze}});ce.forEach(function(ze,rr){var fr=Te[ze];fr&&(fr.children||(fr.children=[])).push(Te[rr])});function ye(ze,rr){var fr=r(rr),gr=[fr*r(ze),fr*m(ze),m(rr)],Lr=ze<-y/2?rr<0?6:4:ze<0?rr<0?2:0:ze<y/2?rr<0?3:1:rr<0?7:5,Hr=ae[Lr];return Te[vc(Hr[0],gr)<0?8+3*Lr:vc(Hr[1],gr)<0?8+3*Lr+1:vc(Hr[2],gr)<0?8+3*Lr+2:Lr]}return ic(Te[0],ye).angle(-30).scale(110.625).center([0,45])}function vc(Rt,Gt){for(var ae=0,ce=Rt.length,Te=0;ae<ce;++ae)Te+=Rt[ae]*Gt[ae];return Te}function Ku(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 ou(Rt){return[e(Rt[1],Rt[0])*b,L(a(-1,s(1,Rt[2])))*b]}function Qu(Rt){var Gt=Rt[0]*_,ae=Rt[1]*_,ce=r(ae);return[ce*r(Gt),ce*m(Gt),m(ae)]}function Yu(){}function yc(Rt){if((ae=Rt.length)<4)return!1;for(var Gt=0,ae,ce=Rt[ae-1][1]*Rt[0][0]-Rt[ae-1][0]*Rt[0][1];++Gt<ae;)ce+=Rt[Gt-1][1]*Rt[Gt][0]-Rt[Gt-1][0]*Rt[Gt][1];return ce<=0}function uf(Rt,Gt){for(var ae=Gt[0],ce=Gt[1],Te=!1,ye=0,ze=Rt.length,rr=ze-1;ye<ze;rr=ye++){var fr=Rt[ye],gr=fr[0],Lr=fr[1],Hr=Rt[rr],nn=Hr[0],cn=Hr[1];Lr>ce^cn>ce&&ae<(nn-gr)*(ce-Lr)/(cn-Lr)+gr&&(Te=!Te)}return Te}function zl(Rt,Gt){var ae=Gt.stream,ce;if(!ae)throw new Error("invalid projection");switch(Rt&&Rt.type){case"Feature":ce=su;break;case"FeatureCollection":ce=Uc;break;default:ce=Au;break}return ce(Rt,ae)}function Uc(Rt,Gt){return{type:"FeatureCollection",features:Rt.features.map(function(ae){return su(ae,Gt)})}}function su(Rt,Gt){return{type:"Feature",id:Rt.id,properties:Rt.properties,geometry:Au(Rt.geometry,Gt)}}function Fu(Rt,Gt){return{type:"GeometryCollection",geometries:Rt.geometries.map(function(ae){return Au(ae,Gt)})}}function Au(Rt,Gt){if(!Rt)return null;if(Rt.type==="GeometryCollection")return Fu(Rt,Gt);var ae;switch(Rt.type){case"Point":ae=Mu;break;case"MultiPoint":ae=Mu;break;case"LineString":ae=lc;break;case"MultiLineString":ae=lc;break;case"Polygon":ae=Su;break;case"MultiPolygon":ae=Su;break;case"Sphere":ae=Su;break;default:return null}return d.geoStream(Rt,Gt(ae)),ae.result()}var il=[],Cs=[],Mu={point:function(Rt,Gt){il.push([Rt,Gt])},result:function(){var Rt=il.length?il.length<2?{type:"Point",coordinates:il[0]}:{type:"MultiPoint",coordinates:il}:null;return il=[],Rt}},lc={lineStart:Yu,point:function(Rt,Gt){il.push([Rt,Gt])},lineEnd:function(){il.length&&(Cs.push(il),il=[])},result:function(){var Rt=Cs.length?Cs.length<2?{type:"LineString",coordinates:Cs[0]}:{type:"MultiLineString",coordinates:Cs}:null;return Cs=[],Rt}},Su={polygonStart:Yu,lineStart:Yu,point:function(Rt,Gt){il.push([Rt,Gt])},lineEnd:function(){var Rt=il.length;if(Rt){do il.push(il[0].slice());while(++Rt<4);Cs.push(il),il=[]}},polygonEnd:Yu,result:function(){if(!Cs.length)return null;var Rt=[],Gt=[];return Cs.forEach(function(ae){yc(ae)?Rt.push([ae]):Gt.push(ae)}),Gt.forEach(function(ae){var ce=ae[0];Rt.some(function(Te){if(uf(Te[0],ce))return Te.push(ae),!0})||Rt.push([ae])}),Cs=[],Rt.length?Rt.length>1?{type:"MultiPolygon",coordinates:Rt}:{type:"Polygon",coordinates:Rt[0]}:null}};function Oc(Rt){var Gt=Rt(S,0)[0]-Rt(-S,0)[0];function ae(ce,Te){var ye=A(ce)<S,ze=Rt(ye?ce:ce>0?ce-y:ce+y,Te),rr=(ze[0]-ze[1])*M,fr=(ze[0]+ze[1])*M;if(ye)return[rr,fr];var gr=Gt*M,Lr=rr>0^fr>0?-1:1;return[Lr*rr-g(fr)*gr,Lr*fr-g(rr)*gr]}return Rt.invert&&(ae.invert=function(ce,Te){var ye=(ce+Te)*M,ze=(Te-ce)*M,rr=A(ye)<.5*Gt&&A(ze)<.5*Gt;if(!rr){var fr=Gt*M,gr=ye>0^ze>0?-1:1,Lr=-gr*ce+(ze>0?1:-1)*fr,Hr=-gr*Te+(ye>0?1:-1)*fr;ye=(-Lr-Hr)*M,ze=(Lr-Hr)*M}var nn=Rt.invert(ye,ze);return rr||(nn[0]+=ye>0?y:-y),nn}),d.geoProjection(ae).rotate([-90,-90,45]).clipAngle(180-.001)}function Xe(){return Oc(Qr).scale(176.423)}function yr(){return Oc(Ti).scale(111.48)}function Kr(Rt,Gt){if(!(0<=(Gt=+Gt)&&Gt<=20))throw new Error("invalid digits");function ae(gr){var Lr=gr.length,Hr=2,nn=new Array(Lr);for(nn[0]=+gr[0].toFixed(Gt),nn[1]=+gr[1].toFixed(Gt);Hr<Lr;)nn[Hr]=gr[Hr],++Hr;return nn}function ce(gr){return gr.map(ae)}function Te(gr){for(var Lr=ae(gr[0]),Hr=[Lr],nn=1;nn<gr.length;nn++){var cn=ae(gr[nn]);(cn.length>2||cn[0]!=Lr[0]||cn[1]!=Lr[1])&&(Hr.push(cn),Lr=cn)}return Hr.length===1&&gr.length>1&&Hr.push(ae(gr[gr.length-1])),Hr}function ye(gr){return gr.map(Te)}function ze(gr){if(gr==null)return gr;var Lr;switch(gr.type){case"GeometryCollection":Lr={type:"GeometryCollection",geometries:gr.geometries.map(ze)};break;case"Point":Lr={type:"Point",coordinates:ae(gr.coordinates)};break;case"MultiPoint":Lr={type:gr.type,coordinates:ce(gr.coordinates)};break;case"LineString":Lr={type:gr.type,coordinates:Te(gr.coordinates)};break;case"MultiLineString":case"Polygon":Lr={type:gr.type,coordinates:ye(gr.coordinates)};break;case"MultiPolygon":Lr={type:"MultiPolygon",coordinates:gr.coordinates.map(ye)};break;default:return gr}return gr.bbox!=null&&(Lr.bbox=gr.bbox),Lr}function rr(gr){var Lr={type:"Feature",properties:gr.properties,geometry:ze(gr.geometry)};return gr.id!=null&&(Lr.id=gr.id),gr.bbox!=null&&(Lr.bbox=gr.bbox),Lr}if(Rt!=null)switch(Rt.type){case"Feature":return rr(Rt);case"FeatureCollection":{var fr={type:"FeatureCollection",features:Rt.features.map(rr)};return Rt.bbox!=null&&(fr.bbox=Rt.bbox),fr}default:return ze(Rt)}return Rt}function Rr(Rt){var Gt=m(Rt);function ae(ce,Te){var ye=Gt?w(ce*Gt/2)/Gt:ce/2;if(!Te)return[2*ye,-Rt];var ze=2*t(ye*m(Te)),rr=1/w(Te);return[m(ze)*rr,Te+(1-r(ze))*rr-Rt]}return ae.invert=function(ce,Te){if(A(Te+=Rt)<l)return[Gt?2*t(Gt*ce/2)/Gt:ce,0];var ye=ce*ce+Te*Te,ze=0,rr=10,fr;do{var gr=w(ze),Lr=1/r(ze),Hr=ye-2*Te*ze+ze*ze;ze-=fr=(gr*Hr+2*(ze-Te))/(2+Hr*Lr*Lr+2*(ze-Te)*gr)}while(A(fr)>l&&--rr>0);var nn=ce*(gr=w(ze)),cn=w(A(Te)<A(ze+1/gr)?L(nn)*.5:D(nn)*.5+y/4)/m(ze);return[Gt?2*t(Gt*cn)/Gt:2*cn,ze]},ae}function mn(){return Zt(Rr).scale(131.215)}var Pn=[[.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]];Pn.forEach(function(Rt){Rt[1]*=1.0144});function ha(Rt,Gt){var ae=s(18,A(Gt)*36/y),ce=n(ae),Te=ae-ce,ye=(Hr=Pn[ce])[0],ze=Hr[1],rr=(Hr=Pn[++ce])[0],fr=Hr[1],gr=(Hr=Pn[s(19,++ce)])[0],Lr=Hr[1],Hr;return[Rt*(rr+Te*(gr-ye)/2+Te*Te*(gr-2*rr+ye)/2),(Gt>0?S:-S)*(fr+Te*(Lr-ze)/2+Te*Te*(Lr-2*fr+ze)/2)]}ha.invert=function(Rt,Gt){var ae=Gt/S,ce=ae*90,Te=s(18,A(ce/5)),ye=a(0,n(Te));do{var ze=Pn[ye][1],rr=Pn[ye+1][1],fr=Pn[s(19,ye+2)][1],gr=fr-ze,Lr=fr-2*rr+ze,Hr=2*(A(ae)-rr)/gr,nn=Lr/gr,cn=Hr*(1-nn*Hr*(1-2*nn*Hr));if(cn>=0||ye===1){ce=(Gt>=0?5:-5)*(cn+Te);var Mn=50,Jn;do Te=s(18,A(ce)/5),ye=n(Te),cn=Te-ye,ze=Pn[ye][1],rr=Pn[ye+1][1],fr=Pn[s(19,ye+2)][1],ce-=(Jn=(Gt>=0?S:-S)*(rr+cn*(fr-ze)/2+cn*cn*(fr-2*rr+ze)/2)-Gt)*b;while(A(Jn)>x&&--Mn>0);break}}while(--ye>=0);var _a=Pn[ye][0],xa=Pn[ye+1][0],La=Pn[s(19,ye+2)][0];return[Rt/(xa+cn*(La-_a)/2+cn*cn*(La-2*xa+_a)/2),ce*_]};function Ta(){return d.geoProjection(ha).scale(152.63)}function Ua(Rt){function Gt(ae,ce){var Te=r(ce),ye=(Rt-1)/(Rt-Te*r(ae));return[ye*Te*m(ae),ye*m(ce)]}return Gt.invert=function(ae,ce){var Te=ae*ae+ce*ce,ye=B(Te),ze=(Rt-B(1-Te*(Rt+1)/(Rt-1)))/((Rt-1)/ye+ye/(Rt-1));return[e(ae*ze,ye*B(1-ze*ze)),ye?L(ce*ze/ye):0]},Gt}function Ya(Rt,Gt){var ae=Ua(Rt);if(!Gt)return ae;var ce=r(Gt),Te=m(Gt);function ye(ze,rr){var fr=ae(ze,rr),gr=fr[1],Lr=gr*Te/(Rt-1)+ce;return[fr[0]*ce/Lr,gr/Lr]}return ye.invert=function(ze,rr){var fr=(Rt-1)/(Rt-1-rr*Te);return ae.invert(fr*ze,fr*rr*ce)},ye}function va(){var Rt=2,Gt=0,ae=d.geoProjectionMutator(Ya),ce=ae(Rt,Gt);return ce.distance=function(Te){return arguments.length?ae(Rt=+Te,Gt):Rt},ce.tilt=function(Te){return arguments.length?ae(Rt,Gt=Te*_):Gt*b},ce.scale(432.147).clipAngle(D(1/Rt)*b-1e-6)}var Ba=1e-4,za=1e4,ca=-180,ei=ca+Ba,Vi=180,Oi=Vi-Ba,Wi=-90,Xi=Wi+Ba,ni=90,Za=ni-Ba;function $i(Rt){return Rt.length>0}function Do(Rt){return Math.floor(Rt*za)/za}function ss(Rt){return Rt===Wi||Rt===ni?[0,Rt]:[ca,Do(Rt)]}function Ps(Rt){var Gt=Rt[0],ae=Rt[1],ce=!1;return Gt<=ei?(Gt=ca,ce=!0):Gt>=Oi&&(Gt=Vi,ce=!0),ae<=Xi?(ae=Wi,ce=!0):ae>=Za&&(ae=ni,ce=!0),ce?[Gt,ae]:Rt}function ys(Rt){return Rt.map(Ps)}function Os(Rt,Gt,ae){for(var ce=0,Te=Rt.length;ce<Te;++ce){var ye=Rt[ce].slice();ae.push({index:-1,polygon:Gt,ring:ye});for(var ze=0,rr=ye.length;ze<rr;++ze){var fr=ye[ze],gr=fr[0],Lr=fr[1];if(gr<=ei||gr>=Oi||Lr<=Xi||Lr>=Za){ye[ze]=Ps(fr);for(var Hr=ze+1;Hr<rr;++Hr){var nn=ye[Hr],cn=nn[0],Mn=nn[1];if(cn>ei&&cn<Oi&&Mn>Xi&&Mn<Za)break}if(Hr===ze+1)continue;if(ze){var Jn={index:-1,polygon:Gt,ring:ye.slice(0,ze+1)};Jn.ring[Jn.ring.length-1]=ss(Lr),ae[ae.length-1]=Jn}else ae.pop();if(Hr>=rr)break;ae.push({index:-1,polygon:Gt,ring:ye=ye.slice(Hr-1)}),ye[0]=ss(ye[0][1]),ze=-1,rr=ye.length}}}}function Yo(Rt){var Gt,ae=Rt.length,ce={},Te={},ye,ze,rr,fr,gr;for(Gt=0;Gt<ae;++Gt){if(ye=Rt[Gt],ze=ye.ring[0],fr=ye.ring[ye.ring.length-1],ze[0]===fr[0]&&ze[1]===fr[1]){ye.polygon.push(ye.ring),Rt[Gt]=null;continue}ye.index=Gt,ce[ze]=Te[fr]=ye}for(Gt=0;Gt<ae;++Gt)if(ye=Rt[Gt],ye){if(ze=ye.ring[0],fr=ye.ring[ye.ring.length-1],rr=Te[ze],gr=ce[fr],delete ce[ze],delete Te[fr],ze[0]===fr[0]&&ze[1]===fr[1]){ye.polygon.push(ye.ring);continue}rr?(delete Te[ze],delete ce[rr.ring[0]],rr.ring.pop(),Rt[rr.index]=null,ye={index:-1,polygon:rr.polygon,ring:rr.ring.concat(ye.ring)},rr===gr?ye.polygon.push(ye.ring):(ye.index=ae++,Rt.push(ce[ye.ring[0]]=Te[ye.ring[ye.ring.length-1]]=ye))):gr?(delete ce[fr],delete Te[gr.ring[gr.ring.length-1]],ye.ring.pop(),ye={index:ae++,polygon:gr.polygon,ring:ye.ring.concat(gr.ring)},Rt[gr.index]=null,Rt.push(ce[ye.ring[0]]=Te[ye.ring[ye.ring.length-1]]=ye)):(ye.ring.push(ye.ring[0]),ye.polygon.push(ye.ring))}}function ll(Rt){var Gt={type:"Feature",geometry:el(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 el(Rt){if(Rt==null)return Rt;var Gt,ae,ce,Te;switch(Rt.type){case"GeometryCollection":Gt={type:"GeometryCollection",geometries:Rt.geometries.map(el)};break;case"Point":Gt={type:"Point",coordinates:Ps(Rt.coordinates)};break;case"MultiPoint":case"LineString":Gt={type:Rt.type,coordinates:ys(Rt.coordinates)};break;case"MultiLineString":Gt={type:"MultiLineString",coordinates:Rt.coordinates.map(ys)};break;case"Polygon":{var ye=[];Os(Rt.coordinates,ye,ae=[]),Yo(ae),Gt={type:"Polygon",coordinates:ye};break}case"MultiPolygon":{ae=[],ce=-1,Te=Rt.coordinates.length;for(var ze=new Array(Te);++ce<Te;)Os(Rt.coordinates[ce],ze[ce]=[],ae);Yo(ae),Gt={type:"MultiPolygon",coordinates:ze.filter($i)};break}default:return Rt}return Rt.bbox!=null&&(Gt.bbox=Rt.bbox),Gt}function Rs(Rt){if(Rt==null)return Rt;switch(Rt.type){case"Feature":return ll(Rt);case"FeatureCollection":{var Gt={type:"FeatureCollection",features:Rt.features.map(ll)};return Rt.bbox!=null&&(Gt.bbox=Rt.bbox),Gt}default:return el(Rt)}}function bi(Rt,Gt){var ae=w(Gt/2),ce=m(k*ae);return[Rt*(.74482-.34588*ce*ce),1.70711*ae]}bi.invert=function(Rt,Gt){var ae=Gt/1.70711,ce=m(k*ae);return[Rt/(.74482-.34588*ce*ce),2*t(ae)]};function so(){return d.geoProjection(bi).scale(146.153)}function ws(Rt,Gt,ae){var ce=d.geoInterpolate(Gt,ae),Te=ce(.5),ye=d.geoRotation([-Te[0],-Te[1]])(Gt),ze=ce.distance/2,rr=-L(m(ye[1]*_)/m(ze)),fr=[-Te[0],-Te[1],-(ye[0]>0?y-rr:rr)*b],gr=d.geoProjection(Rt(ze)).rotate(fr),Lr=d.geoRotation(fr),Hr=gr.center;return delete gr.rotate,gr.center=function(nn){return arguments.length?Hr(Lr(nn)):Lr.invert(Hr())},gr.clipAngle(90)}function fs(Rt){var Gt=r(Rt);function ae(ce,Te){var ye=d.geoGnomonicRaw(ce,Te);return ye[0]*=Gt,ye}return ae.invert=function(ce,Te){return d.geoGnomonicRaw.invert(ce/Gt,Te)},ae}function Ll(){return $l([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function $l(Rt,Gt){return ws(fs,Rt,Gt)}function jl(Rt){if(!(Rt*=2))return d.geoAzimuthalEquidistantRaw;var Gt=-Rt/2,ae=-Gt,ce=Rt*Rt,Te=w(ae),ye=.5/m(ae);function ze(rr,fr){var gr=D(r(fr)*r(rr-Gt)),Lr=D(r(fr)*r(rr-ae)),Hr=fr<0?-1:1;return gr*=gr,Lr*=Lr,[(gr-Lr)/(2*Rt),Hr*B(4*ce*Lr-(ce-gr+Lr)*(ce-gr+Lr))/(2*Rt)]}return ze.invert=function(rr,fr){var gr=fr*fr,Lr=r(B(gr+(nn=rr+Gt)*nn)),Hr=r(B(gr+(nn=rr+ae)*nn)),nn,cn;return[e(cn=Lr-Hr,nn=(Lr+Hr)*Te),(fr<0?-1:1)*D(B(nn*nn+cn*cn)*ye)]},ze}function Bu(){return Jl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Jl(Rt,Gt){return ws(jl,Rt,Gt)}function Ru(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ae=A(Gt/S),ce=L(ae);if(A(Rt)<l||A(A(Gt)-S)<l)return[0,g(Gt)*y*w(ce/2)];var Te=r(ce),ye=A(y/Rt-Rt/y)/2,ze=ye*ye,rr=Te/(ae+Te-1),fr=rr*(2/ae-1),gr=fr*fr,Lr=gr+ze,Hr=rr-gr,nn=ze+rr;return[g(Rt)*y*(ye*Hr+B(ze*Hr*Hr-Lr*(rr*rr-gr)))/Lr,g(Gt)*y*(fr*nn-ye*B((ze+1)*Lr-nn*nn))/Lr]}Ru.invert=function(Rt,Gt){if(A(Gt)<l)return[Rt,0];if(A(Rt)<l)return[0,S*m(2*t(Gt/y))];var ae=(Rt/=y)*Rt,ce=(Gt/=y)*Gt,Te=ae+ce,ye=Te*Te,ze=-A(Gt)*(1+Te),rr=ze-2*ce+ae,fr=-2*ze+1+2*ce+ye,gr=ce/fr+(2*rr*rr*rr/(fr*fr*fr)-9*ze*rr/(fr*fr))/27,Lr=(ze-rr*rr/(3*fr))/fr,Hr=2*B(-Lr/3),nn=D(3*gr/(Lr*Hr))/3;return[y*(Te-1+B(1+2*(ae-ce)+ye))/(2*Rt),g(Gt)*y*(-Hr*r(nn+y/3)-rr/(3*fr))]};function nl(){return d.geoProjection(Ru).scale(79.4183)}function Nu(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ae=A(Gt/S),ce=L(ae);if(A(Rt)<l||A(A(Gt)-S)<l)return[0,g(Gt)*y*w(ce/2)];var Te=r(ce),ye=A(y/Rt-Rt/y)/2,ze=ye*ye,rr=Te*(B(1+ze)-ye*Te)/(1+ze*ae*ae);return[g(Rt)*y*rr,g(Gt)*y*B(1-rr*(2*ye+rr))]}Nu.invert=function(Rt,Gt){if(!Rt)return[0,S*m(2*t(Gt/y))];var ae=A(Rt/y),ce=(1-ae*ae-(Gt/=y)*Gt)/(2*ae),Te=ce*ce,ye=B(Te+1);return[g(Rt)*y*(ye-ce),g(Gt)*S*m(2*e(B((1-2*ce*ae)*(ce+ye)-ae),B(ye+ce+ae)))]};function Ui(){return d.geoProjection(Nu).scale(79.4183)}function fo(Rt,Gt){if(A(Gt)<l)return[Rt,0];var ae=Gt/S,ce=L(ae);if(A(Rt)<l||A(A(Gt)-S)<l)return[0,y*w(ce/2)];var Te=(y/Rt-Rt/y)/2,ye=ae/(1+r(ce));return[y*(g(Rt)*B(Te*Te+1-ye*ye)-Te),y*ye]}fo.invert=function(Rt,Gt){if(!Gt)return[Rt,0];var ae=Gt/y,ce=(y*y*(1-ae*ae)-Rt*Rt)/(2*y*Rt);return[Rt?y*(g(Rt)*B(ce*ce+1)-ce):0,S*m(2*t(ae))]};function Ql(){return d.geoProjection(fo).scale(79.4183)}function ul(Rt,Gt){if(!Gt)return[Rt,0];var ae=A(Gt);if(!Rt||ae===S)return[0,Gt];var ce=ae/S,Te=ce*ce,ye=(8*ce-Te*(Te+2)-5)/(2*Te*(ce-1)),ze=ye*ye,rr=ce*ye,fr=Te+ze+2*rr,gr=ce+3*ye,Lr=Rt/S,Hr=Lr+1/Lr,nn=g(A(Rt)-S)*B(Hr*Hr-4),cn=nn*nn,Mn=fr*(Te+ze*cn-1)+(1-Te)*(Te*(gr*gr+4*ze)+12*rr*ze+4*ze*ze),Jn=(nn*(fr+ze-1)+2*B(Mn))/(4*fr+cn);return[g(Rt)*S*Jn,g(Gt)*S*B(1+nn*A(Jn)-Jn*Jn)]}ul.invert=function(Rt,Gt){var ae;if(!Rt||!Gt)return[Rt,Gt];Gt/=y;var ce=g(Rt)*Rt/S,Te=(ce*ce-1+4*Gt*Gt)/A(ce),ye=Te*Te,ze=2*Gt,rr=50;do{var fr=ze*ze,gr=(8*ze-fr*(fr+2)-5)/(2*fr*(ze-1)),Lr=(3*ze-fr*ze-10)/(2*fr*ze),Hr=gr*gr,nn=ze*gr,cn=ze+gr,Mn=cn*cn,Jn=ze+3*gr,_a=Mn*(fr+Hr*ye-1)+(1-fr)*(fr*(Jn*Jn+4*Hr)+Hr*(12*nn+4*Hr)),xa=-2*cn*(4*nn*Hr+(1-4*fr+3*fr*fr)*(1+Lr)+Hr*(-6+14*fr-ye+(-8+8*fr-2*ye)*Lr)+nn*(-8+12*fr+(-10+10*fr-ye)*Lr)),La=B(_a),ai=Te*(Mn+Hr-1)+2*La-ce*(4*Mn+ye),Ai=Te*(2*gr*Lr+2*cn*(1+Lr))+xa/La-8*cn*(Te*(-1+Hr+Mn)+2*La)*(1+Lr)/(ye+4*Mn);ze-=ae=ai/Ai}while(ae>l&&--rr>0);return[g(Rt)*(B(Te*Te+4)+Te)*y/4,S*ze]};function Dc(){return d.geoProjection(ul).scale(127.16)}function Pt(Rt,Gt,ae,ce,Te){function ye(ze,rr){var fr=ae*m(ce*rr),gr=B(1-fr*fr),Lr=B(2/(1+gr*r(ze*=Te)));return[Rt*gr*Lr*m(ze),Gt*fr*Lr]}return ye.invert=function(ze,rr){var fr=ze/Rt,gr=rr/Gt,Lr=B(fr*fr+gr*gr),Hr=2*L(Lr/2);return[e(ze*w(Hr),Rt*Lr)/Te,Lr&&L(rr*m(Hr)/(Gt*ae*Lr))/ce]},ye}function z(Rt,Gt,ae,ce){var Te=y/3;Rt=a(Rt,l),Gt=a(Gt,l),Rt=s(Rt,S),Gt=s(Gt,y-l),ae=a(ae,0),ae=s(ae,100-l),ce=a(ce,l);var ye=ae/100+1,ze=ce/100,rr=D(ye*r(Te))/Te,fr=m(Rt)/m(rr*S),gr=Gt/y,Lr=B(ze*m(Rt/2)/m(Gt/2)),Hr=Lr/B(gr*fr*rr),nn=1/(Lr*B(gr*fr*rr));return Pt(Hr,nn,fr,rr,gr)}function at(){var Rt=65*_,Gt=60*_,ae=20,ce=200,Te=d.geoProjectionMutator(z),ye=Te(Rt,Gt,ae,ce);return ye.poleline=function(ze){return arguments.length?Te(Rt=+ze*_,Gt,ae,ce):Rt*b},ye.parallels=function(ze){return arguments.length?Te(Rt,Gt=+ze*_,ae,ce):Gt*b},ye.inflation=function(ze){return arguments.length?Te(Rt,Gt,ae=+ze,ce):ae},ye.ratio=function(ze){return arguments.length?Te(Rt,Gt,ae,ce=+ze):ce},ye.scale(163.775)}function xt(){return at().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var kt=4*y+3*B(3),Lt=2*B(2*y*B(3)/kt),le=te(Lt*B(3)/y,Lt,kt/6);function xe(){return d.geoProjection(le).scale(176.84)}function Pe(Rt,Gt){return[Rt*B(1-3*Gt*Gt/(y*y)),Gt]}Pe.invert=function(Rt,Gt){return[Rt/B(1-3*Gt*Gt/(y*y)),Gt]};function $e(){return d.geoProjection(Pe).scale(152.63)}function hr(Rt,Gt){var ae=r(Gt),ce=r(Rt)*ae,Te=1-ce,ye=r(Rt=e(m(Rt)*ae,-m(Gt))),ze=m(Rt);return ae=B(1-ce*ce),[ze*ae-ye*Te,-ye*ae-ze*Te]}hr.invert=function(Rt,Gt){var ae=(Rt*Rt+Gt*Gt)/-2,ce=B(-ae*(2+ae)),Te=Gt*ae+Rt*ce,ye=Rt*ae-Gt*ce,ze=B(ye*ye+Te*Te);return[e(ce*Te,ze*(1+ae)),ze?-L(ce*ye/ze):0]};function pr(){return d.geoProjection(hr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Br(Rt,Gt){var ae=ct(Rt,Gt);return[(ae[0]+Rt/S)/2,(ae[1]+Gt)/2]}Br.invert=function(Rt,Gt){var ae=Rt,ce=Gt,Te=25;do{var ye=r(ce),ze=m(ce),rr=m(2*ce),fr=ze*ze,gr=ye*ye,Lr=m(ae),Hr=r(ae/2),nn=m(ae/2),cn=nn*nn,Mn=1-gr*Hr*Hr,Jn=Mn?D(ye*Hr)*B(_a=1/Mn):_a=0,_a,xa=.5*(2*Jn*ye*nn+ae/S)-Rt,La=.5*(Jn*ze+ce)-Gt,ai=.5*_a*(gr*cn+Jn*ye*Hr*fr)+.5/S,Ai=_a*(Lr*rr/4-Jn*ze*nn),mi=.125*_a*(rr*nn-Jn*ze*gr*Lr),Yi=.5*_a*(fr*Hr+Jn*cn*ye)+.5,Go=Ai*mi-Yi*ai,Xo=(La*Ai-xa*Yi)/Go,po=(xa*mi-La*ai)/Go;ae-=Xo,ce-=po}while((A(Xo)>l||A(po)>l)&&--Te>0);return[ae,ce]};function Jr(){return d.geoProjection(Br).scale(158.837)}u.geoNaturalEarth=d.geoNaturalEarth1,u.geoNaturalEarthRaw=d.geoNaturalEarth1Raw,u.geoAiry=rt,u.geoAiryRaw=G,u.geoAitoff=st,u.geoAitoffRaw=ct,u.geoArmadillo=K,u.geoArmadilloRaw=et,u.geoAugust=X,u.geoAugustRaw=ot,u.geoBaker=q,u.geoBakerRaw=J,u.geoBerghaus=nt,u.geoBerghausRaw=it,u.geoBertin1953=ee,u.geoBertin1953Raw=Nt,u.geoBoggs=re,u.geoBoggsRaw=Ut,u.geoBonne=We,u.geoBonneRaw=Ce,u.geoBottomley=vr,u.geoBottomleyRaw=qe,u.geoBromley=er,u.geoBromleyRaw=_r,u.geoChamberlin=lt,u.geoChamberlinRaw=Dt,u.geoChamberlinAfrica=_t,u.geoCollignon=St,u.geoCollignonRaw=yt,u.geoCraig=Yt,u.geoCraigRaw=Ht,u.geoCraster=Ee,u.geoCrasterRaw=ke,u.geoCylindricalEqualArea=ir,u.geoCylindricalEqualAreaRaw=Ue,u.geoCylindricalStereographic=Ye,u.geoCylindricalStereographicRaw=ar,u.geoEckert1=pn,u.geoEckert1Raw=Er,u.geoEckert2=bn,u.geoEckert2Raw=dn,u.geoEckert3=En,u.geoEckert3Raw=Zn,u.geoEckert4=da,u.geoEckert4Raw=gn,u.geoEckert5=Se,u.geoEckert5Raw=ra,u.geoEckert6=Ze,u.geoEckert6Raw=Re,u.geoEisenlohr=tn,u.geoEisenlohrRaw=zr,u.geoFahey=In,u.geoFaheyRaw=$r,u.geoFoucaut=Kn,u.geoFoucautRaw=Nn,u.geoFoucautSinusoidal=ia,u.geoFoucautSinusoidalRaw=$n,u.geoGilbert=Ga,u.geoGingery=br,u.geoGingeryRaw=ve,u.geoGinzburg4=kr,u.geoGinzburg4Raw=mr,u.geoGinzburg5=Or,u.geoGinzburg5Raw=Ur,u.geoGinzburg6=Ke,u.geoGinzburg6Raw=pe,u.geoGinzburg8=Gr,u.geoGinzburg8Raw=xr,u.geoGinzburg9=wn,u.geoGinzburg9Raw=ln,u.geoGringorten=Qn,u.geoGringortenRaw=Qr,u.geoGuyou=Hi,u.geoGuyouRaw=Ti,u.geoHammer=wt,u.geoHammerRaw=dt,u.geoHammerRetroazimuthal=zo,u.geoHammerRetroazimuthalRaw=Ho,u.geoHealpix=ts,u.geoHealpixRaw=hs,u.geoHill=As,u.geoHillRaw=vs,u.geoHomolosine=Di,u.geoHomolosineRaw=Ms,u.geoHufnagel=No,u.geoHufnagelRaw=_s,u.geoHyperelliptical=io,u.geoHyperellipticalRaw=ii,u.geoInterrupt=Bi,u.geoInterruptedBoggs=fl,u.geoInterruptedHomolosine=us,u.geoInterruptedMollweide=Ls,u.geoInterruptedMollweideHemispheres=bu,u.geoInterruptedSinuMollweide=fu,u.geoInterruptedSinusoidal=xc,u.geoKavrayskiy7=Gl,u.geoKavrayskiy7Raw=cs,u.geoLagrange=Al,u.geoLagrangeRaw=zc,u.geoLarrivee=hu,u.geoLarriveeRaw=Ml,u.geoLaskowski=_l,u.geoLaskowskiRaw=Fs,u.geoLittrow=bs,u.geoLittrowRaw=Fo,u.geoLoximuthal=Nl,u.geoLoximuthalRaw=Iu,u.geoMiller=qs,u.geoMillerRaw=Hu,u.geoModifiedStereographic=bl,u.geoModifiedStereographicRaw=of,u.geoModifiedStereographicAlaska=pu,u.geoModifiedStereographicGs48=ml,u.geoModifiedStereographicGs50=Lc,u.geoModifiedStereographicMiller=qu,u.geoModifiedStereographicLee=dc,u.geoMollweide=mt,u.geoMollweideRaw=Kt,u.geoMtFlatPolarParabolic=Wu,u.geoMtFlatPolarParabolicRaw=mc,u.geoMtFlatPolarQuartic=Ic,u.geoMtFlatPolarQuarticRaw=Cc,u.geoMtFlatPolarSinusoidal=Bc,u.geoMtFlatPolarSinusoidalRaw=du,u.geoNaturalEarth2=wu,u.geoNaturalEarth2Raw=Pu,u.geoNellHammer=Ju,u.geoNellHammerRaw=wl,u.geoInterruptedQuarticAuthalic=Es,u.geoNicolosi=sf,u.geoNicolosiRaw=_c,u.geoPatterson=Rl,u.geoPattersonRaw=Ou,u.geoPolyconic=Ws,u.geoPolyconicRaw=Yl,u.geoPolyhedral=ic,u.geoPolyhedralButterfly=Gs,u.geoPolyhedralCollignon=Xc,u.geoPolyhedralWaterman=Vs,u.geoProject=zl,u.geoGringortenQuincuncial=Xe,u.geoPeirceQuincuncial=yr,u.geoPierceQuincuncial=yr,u.geoQuantize=Kr,u.geoQuincuncial=Oc,u.geoRectangularPolyconic=mn,u.geoRectangularPolyconicRaw=Rr,u.geoRobinson=Ta,u.geoRobinsonRaw=ha,u.geoSatellite=va,u.geoSatelliteRaw=Ya,u.geoSinuMollweide=wo,u.geoSinuMollweideRaw=li,u.geoSinusoidal=Me,u.geoSinusoidalRaw=ue,u.geoStitch=Rs,u.geoTimes=so,u.geoTimesRaw=bi,u.geoTwoPointAzimuthal=$l,u.geoTwoPointAzimuthalRaw=fs,u.geoTwoPointAzimuthalUsa=Ll,u.geoTwoPointEquidistant=Jl,u.geoTwoPointEquidistantRaw=jl,u.geoTwoPointEquidistantUsa=Bu,u.geoVanDerGrinten=nl,u.geoVanDerGrintenRaw=Ru,u.geoVanDerGrinten2=Ui,u.geoVanDerGrinten2Raw=Nu,u.geoVanDerGrinten3=Ql,u.geoVanDerGrinten3Raw=fo,u.geoVanDerGrinten4=Dc,u.geoVanDerGrinten4Raw=ul,u.geoWagner=at,u.geoWagner7=xt,u.geoWagnerRaw=z,u.geoWagner4=xe,u.geoWagner4Raw=le,u.geoWagner6=$e,u.geoWagner6Raw=Pe,u.geoWiechel=pr,u.geoWiechelRaw=hr,u.geoWinkel3=Jr,u.geoWinkel3Raw=Br,Object.defineProperty(u,"__esModule",{value:!0})})}),kE=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=ji(),A=Math.PI/180,t=180/Math.PI,e={cursor:"pointer"},r={cursor:"auto"};function i(b,_){var P=b.projection,L;return _._isScoped?L=a:_._isClipped?L=f:L=s,L(b,P)}V.exports=i;function n(b,_){return u.behavior.zoom().translate(_.translate()).scale(_.scale())}function o(b,_,P){var L=b.id,D=b.graphDiv,B=D.layout,R=B[L],I=D._fullLayout,F=I[L],N={},j={};function G(rt,ct){N[L+"."+rt]=d.nestedProperty(R,rt).get(),E.call("_storeDirectGUIEdit",B,I._preGUI,N);var st=d.nestedProperty(F,rt);st.get()!==ct&&(st.set(ct),d.nestedProperty(R,rt).set(ct),j[L+"."+rt]=ct)}P(G),G("projection.scale",_.scale()/b.fitScale),G("fitbounds",!1),D.emit("plotly_relayout",j)}function a(b,_){var P=n(b,_);function L(){u.select(this).style(e)}function D(){_.scale(u.event.scale).translate(u.event.translate),b.render(!0);var I=_.invert(b.midPt);b.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/b.fitScale,"geo.center.lon":I[0],"geo.center.lat":I[1]})}function B(I){var F=_.invert(b.midPt);I("center.lon",F[0]),I("center.lat",F[1])}function R(){u.select(this).style(r),o(b,_,B)}return P.on("zoomstart",L).on("zoom",D).on("zoomend",R),P}function s(b,_){var P=n(b,_),L=2,D,B,R,I,F,N,j,G,rt;function ct(Q){return _.invert(Q)}function st(Q){var ut=ct(Q);if(!ut)return!0;var J=_(ut);return Math.abs(J[0]-Q[0])>L||Math.abs(J[1]-Q[1])>L}function et(){u.select(this).style(e),D=u.mouse(this),B=_.rotate(),R=_.translate(),I=B,F=ct(D)}function K(){if(N=u.mouse(this),st(D)){P.scale(_.scale()),P.translate(_.translate());return}_.scale(u.event.scale),_.translate([R[0],u.event.translate[1]]),F?ct(N)&&(G=ct(N),j=[I[0]+(G[0]-F[0]),B[1],B[2]],_.rotate(j),I=j):(D=N,F=ct(D)),rt=!0,b.render(!0);var Q=_.rotate(),ut=_.invert(b.midPt);b.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/b.fitScale,"geo.center.lon":ut[0],"geo.center.lat":ut[1],"geo.projection.rotation.lon":-Q[0]})}function ot(){u.select(this).style(r),rt&&o(b,_,X)}function X(Q){var ut=_.rotate(),J=_.invert(b.midPt);Q("projection.rotation.lon",-ut[0]),Q("center.lon",J[0]),Q("center.lat",J[1])}return P.on("zoomstart",et).on("zoom",K).on("zoomend",ot),P}function f(b,_){_.rotate(),_.scale();var P=n(b,_),L=h(P,"zoomstart","zoom","zoomend"),D=0,B=P.on,R;P.on("zoomstart",function(){u.select(this).style(e);var G=u.mouse(this),rt=_.rotate(),ct=rt,st=_.translate(),et=g(rt);R=v(_,G),B.call(P,"zoom",function(){var K=u.mouse(this);if(_.scale(u.event.scale),!R)G=K,R=v(_,G);else if(v(_,K)){_.rotate(rt).translate(st);var ot=v(_,K),X=w(R,ot),Q=k(m(et,X)),ut=l(Q,R,ct);(!isFinite(ut[0])||!isFinite(ut[1])||!isFinite(ut[2]))&&(ut=ct),_.rotate(ut),ct=ut}F(L.of(this,arguments))}),I(L.of(this,arguments))}).on("zoomend",function(){u.select(this).style(r),B.call(P,"zoom",null),N(L.of(this,arguments)),o(b,_,j)}).on("zoom.redraw",function(){b.render(!0);var G=_.rotate();b.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":_.scale()/b.fitScale,"geo.projection.rotation.lon":-G[0],"geo.projection.rotation.lat":-G[1]})});function I(G){D++||G({type:"zoomstart"})}function F(G){G({type:"zoom"})}function N(G){--D||G({type:"zoomend"})}function j(G){var rt=_.rotate();G("projection.rotation.lon",-rt[0]),G("projection.rotation.lat",-rt[1])}return u.rebind(P,L,"on")}function v(b,_){var P=b.invert(_);return P&&isFinite(P[0])&&isFinite(P[1])&&M(P)}function g(b){var _=.5*b[0]*A,P=.5*b[1]*A,L=.5*b[2]*A,D=Math.sin(_),B=Math.cos(_),R=Math.sin(P),I=Math.cos(P),F=Math.sin(L),N=Math.cos(L);return[B*I*N+D*R*F,D*I*N-B*R*F,B*R*N+D*I*F,B*I*F-D*R*N]}function m(b,_){var P=b[0],L=b[1],D=b[2],B=b[3],R=_[0],I=_[1],F=_[2],N=_[3];return[P*R-L*I-D*F-B*N,P*I+L*R+D*N-B*F,P*F-L*N+D*R+B*I,P*N+L*F-D*I+B*R]}function w(b,_){if(!(!b||!_)){var P=c(b,_),L=Math.sqrt(T(P,P)),D=.5*Math.acos(Math.max(-1,Math.min(1,T(b,_)))),B=Math.sin(D)/L;return L&&[Math.cos(D),P[2]*B,-P[1]*B,P[0]*B]}}function l(b,_,P){var L=S(_,2,b[0]);L=S(L,1,b[1]),L=S(L,0,b[2]-P[2]);var D=_[0],B=_[1],R=_[2],I=L[0],F=L[1],N=L[2],j=Math.atan2(B,D)*t,G=Math.sqrt(D*D+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 st=180-ct-2*j,et=(Math.atan2(N,I)-Math.atan2(R,rt))*t,K=(Math.atan2(N,I)-Math.atan2(R,-rt))*t,ot=x(P[0],P[1],ct,et),X=x(P[0],P[1],st,K);return ot<=X?[ct,et,P[2]]:[st,K,P[2]]}function x(b,_,P,L){var D=y(P-b),B=y(L-_);return Math.sqrt(D*D+B*B)}function y(b){return(b%360+540)%360-180}function S(b,_,P){var L=P*A,D=b.slice(),B=_===0?1:0,R=_===2?1:2,I=Math.cos(L),F=Math.sin(L);return D[B]=b[B]*I-b[R]*F,D[R]=b[R]*I+b[B]*F,D}function k(b){return[Math.atan2(2*(b[0]*b[1]+b[2]*b[3]),1-2*(b[1]*b[1]+b[2]*b[2]))*t,Math.asin(Math.max(-1,Math.min(1,2*(b[0]*b[2]-b[3]*b[1]))))*t,Math.atan2(2*(b[0]*b[3]+b[1]*b[2]),1-2*(b[2]*b[2]+b[3]*b[3]))*t]}function M(b){var _=b[0]*A,P=b[1]*A,L=Math.cos(P);return[L*Math.cos(_),L*Math.sin(_),Math.sin(P)]}function T(b,_){for(var P=0,L=0,D=b.length;L<D;++L)P+=b[L]*_[L];return P}function c(b,_){return[b[1]*_[2]-b[2]*_[1],b[2]*_[0]-b[0]*_[2],b[0]*_[1]-b[1]*_[0]]}function h(b){for(var _=0,P=arguments.length,L=[];++_<P;)L.push(arguments[_]);var D=u.dispatch.apply(null,L);return D.of=function(B,R){return function(I){var F;try{F=I.sourceEvent=u.event,I.target=b,u.event=I,D[I.type].apply(B,R)}finally{u.event=F}}},D}}),AE=Vt((Z,V)=>{var u=Ni(),d=I3(),E=d.geoPath,A=d.geoDistance,t=TE(),e=ji(),r=Xr(),i=r.strTranslate,n=Pi(),o=Eo(),a=hc(),s=Uu(),f=yo(),v=Xh().getAutoRange,g=ih(),m=Sc().prepSelect,w=Sc().clearOutline,l=Sc().selectOnClick,x=kE(),y=kv(),S=jd(),k=Ax(),M=z3().feature;function T(P){this.id=P.id,this.graphDiv=P.graphDiv,this.container=P.container,this.topojsonURL=P.topojsonURL,this.isStatic=P.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 c=T.prototype;V.exports=function(P){return new T(P)},c.plot=function(P,L,D,B){var R=this;if(B)return R.update(P,L,!0);R._geoCalcData=P,R._fullLayout=L;var I=L[this.id],F=[],N=!1;for(var j in y.layerNameToAdjective)if(j!=="frame"&&I["show"+j]){N=!0;break}for(var G=!1,rt=0;rt<P.length;rt++){var ct=P[0][0].trace;ct._geo=R,ct.locationmode&&(N=!0);var st=ct.marker;if(st){var et=st.angle,K=st.angleref;(et||K==="north"||K==="previous")&&(G=!0)}}if(this._hasMarkerAngles=G,N){var ot=k.getTopojsonName(I);(R.topojson===null||ot!==R.topojsonName)&&(R.topojsonName=ot,PlotlyGeoAssets.topojson[R.topojsonName]===void 0&&F.push(R.fetchTopojson()))}F=F.concat(S.fetchTraceGeoData(P)),D.push(new Promise(function(X,Q){Promise.all(F).then(function(){R.topojson=PlotlyGeoAssets.topojson[R.topojsonName],R.update(P,L),X()}).catch(Q)}))},c.fetchTopojson=function(){var P=this,L=k.getTopojsonPath(P.topojsonURL,P.topojsonName);return new Promise(function(D,B){u.json(L,function(R,I){if(R)return R.status===404?B(new Error(["plotly.js could not find topojson file at",L+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):B(new Error(["unexpected error while fetching topojson file at",L].join(" ")));PlotlyGeoAssets.topojson[P.topojsonName]=I,D()})})},c.update=function(P,L,D){var B=L[this.id];this.hasChoropleth=!1;for(var R=0;R<P.length;R++){var I=P[R],F=I[0].trace;F.type==="choropleth"&&(this.hasChoropleth=!0),F.visible===!0&&F._length>0&&F._module.calcGeoJSON(I,L)}if(!D){var N=this.updateProjection(P,L);if(N)return;(!this.viewInitial||this.scope!==B.scope)&&this.saveViewInitial(B)}this.scope=B.scope,this.updateBaseLayers(L,B),this.updateDims(L,B),this.updateFx(L,B),s.generalUpdatePerTraceModule(this.graphDiv,this,P,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()},c.updateProjection=function(P,L){var D=this.graphDiv,B=L[this.id],R=L._size,I=B.domain,F=B.projection,N=B.lonaxis,j=B.lataxis,G=N._ax,rt=j._ax,ct=this.projection=h(B),st=[[R.l+R.w*I.x[0],R.t+R.h*(1-I.y[1])],[R.l+R.w*I.x[1],R.t+R.h*(1-I.y[0])]],et=B.center||{},K=F.rotation||{},ot=N.range||[],X=j.range||[];if(B.fitbounds){G._length=st[1][0]-st[0][0],rt._length=st[1][1]-st[0][1],G.range=v(D,G),rt.range=v(D,rt);var Q=(G.range[0]+G.range[1])/2,ut=(rt.range[0]+rt.range[1])/2;if(B._isScoped)et={lon:Q,lat:ut};else if(B._isClipped){et={lon:Q,lat:ut},K={lon:Q,lat:ut,roll:K.roll};var J=F.type,q=y.lonaxisSpan[J]/2||180,it=y.lataxisSpan[J]/2||90;ot=[Q-q,Q+q],X=[ut-it,ut+it]}else et={lon:Q,lat:ut},K={lon:Q,lat:K.lat,roll:K.roll}}ct.center([et.lon-K.lon,et.lat-K.lat]).rotate([-K.lon,-K.lat,K.roll]).parallels(F.parallels);var nt=_(ot,X);ct.fitExtent(st,nt);var dt=this.bounds=ct.getBounds(nt),Tt=this.fitScale=ct.scale(),wt=ct.translate();if(B.fitbounds){var It=ct.getBounds(_(G.range,rt.range)),Ct=Math.min((dt[1][0]-dt[0][0])/(It[1][0]-It[0][0]),(dt[1][1]-dt[0][1])/(It[1][1]-It[0][1]));isFinite(Ct)?ct.scale(Ct*Tt):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ct.scale(F.scale*Tt);var Nt=this.midPt=[(dt[0][0]+dt[1][0])/2,(dt[0][1]+dt[1][1])/2];if(ct.translate([wt[0]+(Nt[0]-wt[0]),wt[1]+(Nt[1]-wt[1])]).clipExtent(dt),B._isAlbersUsa){var ee=ct([et.lon,et.lat]),Jt=ct.translate();ct.translate([Jt[0]-(ee[0]-Jt[0]),Jt[1]-(ee[1]-Jt[1])])}},c.updateBaseLayers=function(P,L){var D=this,B=D.topojson,R=D.layers,I=D.basePaths;function F(st){return st==="lonaxis"||st==="lataxis"}function N(st){return!!y.lineLayers[st]}function j(st){return!!y.fillLayers[st]}var G=this.hasChoropleth?y.layersForChoropleth:y.layers,rt=G.filter(function(st){return N(st)||j(st)?L["show"+st]:F(st)?L[st].showgrid:!0}),ct=D.framework.selectAll(".layer").data(rt,String);ct.exit().each(function(st){delete R[st],delete I[st],u.select(this).remove()}),ct.enter().append("g").attr("class",function(st){return"layer "+st}).each(function(st){var et=R[st]=u.select(this);st==="bg"?D.bgRect=et.append("rect").style("pointer-events","all"):F(st)?I[st]=et.append("path").style("fill","none"):st==="backplot"?et.append("g").classed("choroplethlayer",!0):st==="frontplot"?et.append("g").classed("scatterlayer",!0):N(st)?I[st]=et.append("path").style("fill","none").style("stroke-miterlimit",2):j(st)&&(I[st]=et.append("path").style("stroke","none"))}),ct.order(),ct.each(function(st){var et=I[st],K=y.layerNameToAdjective[st];st==="frame"?et.datum(y.sphereSVG):N(st)||j(st)?et.datum(M(B,B.objects[st])):F(st)&&et.datum(b(st,L,P)).call(n.stroke,L[st].gridcolor).call(o.dashLine,L[st].griddash,L[st].gridwidth),N(st)?et.call(n.stroke,L[K+"color"]).call(o.dashLine,"",L[K+"width"]):j(st)&&et.call(n.fill,L[K+"color"])})},c.updateDims=function(P,L){var D=this.bounds,B=(L.framewidth||0)/2,R=D[0][0]-B,I=D[0][1]-B,F=D[1][0]-R+B,N=D[1][1]-I+B;o.setRect(this.clipRect,R,I,F,N),this.bgRect.call(o.setRect,R,I,F,N).call(n.fill,L.bgcolor),this.xaxis._offset=R,this.xaxis._length=F,this.yaxis._offset=I,this.yaxis._length=N},c.updateFx=function(P,L){var D=this,B=D.graphDiv,R=D.bgRect,I=P.dragmode,F=P.clickmode;if(D.isStatic)return;function N(){var ct=D.viewInitial,st={};for(var et in ct)st[D.id+"."+et]=ct[et];e.call("_guiRelayout",B,st),B.emit("plotly_doubleclick",null)}function j(ct){return D.projection.invert([ct[0]+D.xaxis._offset,ct[1]+D.yaxis._offset])}var G=function(ct,st){if(st.isRect){var et=ct.range={};et[D.id]=[j([st.xmin,st.ymin]),j([st.xmax,st.ymax])]}else{var K=ct.lassoPoints={};K[D.id]=st.map(j)}},rt={element:D.bgRect.node(),gd:B,plotinfo:{id:D.id,xaxis:D.xaxis,yaxis:D.yaxis,fillRangeItems:G},xaxes:[D.xaxis],yaxes:[D.yaxis],subplot:D.id,clickFn:function(ct){ct===2&&w(B)}};I==="pan"?(R.node().onmousedown=null,R.call(x(D,L)),R.on("dblclick.zoom",N),B._context._scrollZoom.geo||R.on("wheel.zoom",null)):(I==="select"||I==="lasso")&&(R.on(".zoom",null),rt.prepFn=function(ct,st,et){m(ct,st,et,rt,I)},g.init(rt)),R.on("mousemove",function(){var ct=D.projection.invert(r.getPositionFromD3Event());if(!ct)return g.unhover(B,u.event);D.xaxis.p2c=function(){return ct[0]},D.yaxis.p2c=function(){return ct[1]},a.hover(B,u.event,D.id)}),R.on("mouseout",function(){B._dragging||g.unhover(B,u.event)}),R.on("click",function(){I!=="select"&&I!=="lasso"&&(F.indexOf("select")>-1&&l(u.event,B,[D.xaxis],[D.yaxis],D.id,rt),F.indexOf("event")>-1&&a.click(B,u.event))})},c.makeFramework=function(){var P=this,L=P.graphDiv,D=L._fullLayout,B="clip"+D._uid+P.id;P.clipDef=D._clips.append("clipPath").attr("id",B),P.clipRect=P.clipDef.append("rect"),P.framework=u.select(P.container).append("g").attr("class","geo "+P.id).call(o.setClipUrl,B,L),P.project=function(R){var I=P.projection(R);return I?[I[0]-P.xaxis._offset,I[1]-P.yaxis._offset]:[null,null]},P.xaxis={_id:"x",c2p:function(R){return P.project(R)[0]}},P.yaxis={_id:"y",c2p:function(R){return P.project(R)[1]}},P.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(P.mockAxis,D)},c.saveViewInitial=function(P){var L=P.center||{},D=P.projection,B=D.rotation||{};this.viewInitial={fitbounds:P.fitbounds,"projection.scale":D.scale};var R;P._isScoped?R={"center.lon":L.lon,"center.lat":L.lat}:P._isClipped?R={"projection.rotation.lon":B.lon,"projection.rotation.lat":B.lat}:R={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":B.lon},r.extendFlat(this.viewInitial,R)},c.render=function(P){this._hasMarkerAngles&&P?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},c._render=function(){var P=this.projection,L=P.getPath(),D;function B(I){var F=P(I.lonlat);return F?i(F[0],F[1]):null}function R(I){return P.isLonLatOverEdges(I.lonlat)?"none":null}for(D in this.basePaths)this.basePaths[D].attr("d",L);for(D in this.dataPaths)this.dataPaths[D].attr("d",function(I){return L(I.geojson)});for(D in this.dataPoints)this.dataPoints[D].attr("display",R).attr("transform",B)};function h(P){var L=P.projection,D=L.type,B=y.projNames[D];B="geo"+r.titleCase(B);for(var R=d[B]||t[B],I=R(),F=P._isSatellite?Math.acos(1/L.distance)*180/Math.PI:P._isClipped?y.lonaxisSpan[D]/2:null,N=["center","rotate","parallels","clipExtent"],j=function(ct){return ct?I:[]},G=0;G<N.length;G++){var rt=N[G];typeof I[rt]!="function"&&(I[rt]=j)}return I.isLonLatOverEdges=function(ct){if(I(ct)===null)return!0;if(F){var st=I.rotate(),et=A(ct,[-st[0],-st[1]]),K=F*Math.PI/180;return et>K}else return!1},I.getPath=function(){return E().projection(I)},I.getBounds=function(ct){return I.getPath().bounds(ct)},I.precision(y.precision),P._isSatellite&&I.tilt(L.tilt).distance(L.distance),F&&I.clipAngle(F-y.clipPad),I}function b(P,L,D){var B=1e-6,R=2.5,I=L[P],F=y.scopeDefaults[L.scope],N,j,G;P==="lonaxis"?(N=F.lonaxisRange,j=F.lataxisRange,G=function(ut,J){return[ut,J]}):P==="lataxis"&&(N=F.lataxisRange,j=F.lonaxisRange,G=function(ut,J){return[J,ut]});var rt={type:"linear",range:[N[0],N[1]-B],tick0:I.tick0,dtick:I.dtick};f.setConvert(rt,D);var ct=f.calcTicks(rt);!L.isScoped&&P==="lonaxis"&&ct.pop();for(var st=ct.length,et=new Array(st),K=0;K<st;K++)for(var ot=ct[K].x,X=et[K]=[],Q=j[0];Q<j[1]+R;Q+=R)X.push(G(ot,Q));return{type:"MultiLineString",coordinates:et}}function _(P,L){var D=y.clipPad,B=P[0]+D,R=P[1]-D,I=L[0]+D,F=L[1]-D;B>0&&R<0&&(R+=360);var N=(R-B)/4;return{type:"Polygon",coordinates:[[[B,I],[B,F],[B+N,F],[B+2*N,F],[B+3*N,F],[R,F],[R,I],[R-N,I],[R-2*N,I],[R-3*N,I],[B,I]]]}}}),P3=Vt((Z,V)=>{var u=nf(),d=Vu().attributes,E=Cf().dash,A=kv(),t=Cu().overrideAll,e=bd(),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:u.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:E},i=V.exports=t({domain:d({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:u.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:u.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:u.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:u.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:u.background},lonaxis:r,lataxis:r},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}),ME=Vt((Z,V)=>{var u=Xr(),d=zd(),E=If().getSubplotData,A=kv(),t=P3(),e=A.axesNames;V.exports=function(i,n,o){d(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),f=s.map(function(X){return X.index}),v=o("resolution"),g=o("scope"),m=A.scopeDefaults[g],w=o("projection.type",m.projType),l=n._isAlbersUsa=w==="albers usa";l&&(g=n.scope="usa");var x=n._isScoped=g!=="world",y=n._isSatellite=w==="satellite",S=n._isConic=w.indexOf("conic")!==-1||w==="albers",k=n._isClipped=!!A.lonaxisSpan[w];if(i.visible===!1){var M=u.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 T=o("visible"),c,h=0;h<e.length;h++){var b=e[h],_=[30,10][h],P;if(x)P=m[b+"Range"];else{var L=A[b+"Span"],D=(L[w]||L["*"])/2,B=o("projection.rotation."+b.substr(0,3),m.projRotate[h]);P=[B-D,B+D]}var R=o(b+".range",P);o(b+".tick0"),o(b+".dtick",_),c=o(b+".showgrid",T?void 0:!1),c&&(o(b+".gridcolor"),o(b+".gridwidth"),o(b+".griddash")),n[b]._ax={type:"linear",_id:b.slice(0,3),_traceIndices:f,setScale:u.identity,c2l:u.identity,r2l:u.identity,autorange:!0,range:R.slice(),_m:1,_input:{}}}var I=n.lonaxis.range,F=n.lataxis.range,N=I[0],j=I[1];N>0&&j<0&&(j+=360);var G=(N+j)/2,rt;if(!l){var ct=x?m.projRotate:[G,0,0];rt=o("projection.rotation.lon",ct[0]),o("projection.rotation.lat",ct[1]),o("projection.rotation.roll",ct[2]),c=o("showcoastlines",!x&&T),c&&(o("coastlinecolor"),o("coastlinewidth")),c=o("showocean",T?void 0:!1),c&&o("oceancolor")}var st,et;if(l?(st=-96.6,et=38.7):(st=x?G:rt,et=(F[0]+F[1])/2),o("center.lon",st),o("center.lat",et),y&&(o("projection.tilt"),o("projection.distance")),S){var K=m.projParallels||[0,60];o("projection.parallels",K)}o("projection.scale"),c=o("showland",T?void 0:!1),c&&o("landcolor"),c=o("showlakes",T?void 0:!1),c&&o("lakecolor"),c=o("showrivers",T?void 0:!1),c&&(o("rivercolor"),o("riverwidth")),c=o("showcountries",x&&g!=="usa"&&T),c&&(o("countrycolor"),o("countrywidth")),(g==="usa"||g==="north america"&&v===50)&&(o("showsubunits",T),o("subunitcolor"),o("subunitwidth")),x||(c=o("showframe",T),c&&(o("framecolor"),o("framewidth"))),o("bgcolor");var ot=o("fitbounds");ot&&(delete n.projection.scale,x?(delete n.center.lon,delete n.center.lat):k?(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))}}),O3=Vt((Z,V)=>{var u=If().getSubplotCalcData,d=Xr().counterRegex,E=AE(),A="geo",t=d(A),e={};e[A]={valType:"subplotid",dflt:A,editType:"calc"};function r(o){for(var a=o._fullLayout,s=o.calcdata,f=a._subplots[A],v=0;v<f.length;v++){var g=f[v],m=u(s,A,g),w=a[g],l=w._subplot;l||(l=E({id:g,graphDiv:o,container:a._geolayer.node(),topojsonURL:o._context.topojsonURL,staticPlot:o._context.staticPlot}),a[g]._subplot=l),l.plot(m,a,o._promises)}}function i(o,a,s,f){for(var v=f._subplots[A]||[],g=0;g<v.length;g++){var m=v[g],w=f[m]._subplot;!a[m]&&w&&(w.framework.remove(),w.clipDef.remove())}}function n(o){for(var a=o._fullLayout,s=a._subplots[A],f=0;f<s.length;f++){var v=a[s[f]],g=v._subplot;g.updateFx(a,v)}}V.exports={attr:A,name:A,idRoot:A,idRegex:t,attrRegex:t,attributes:e,layoutAttributes:P3(),supplyLayoutDefaults:ME(),plot:r,updateFx:n,clean:i}}),SE=Vt((Z,V)=>{V.exports={attributes:M0(),supplyDefaults:dE(),colorbar:Gf(),formatLabels:mE(),calc:kx(),calcGeoJSON:C3().calcGeoJSON,plot:C3().plot,style:L3(),styleOnSelect:mh().styleOnSelect,hoverPoints:_E(),eventData:bE(),selectPoints:wE(),moduleType:"trace",name:"scattergeo",basePlotModule:O3(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),EE=Vt((Z,V)=>{V.exports=SE()}),qm=Vt((Z,V)=>{var{hovertemplateAttrs:u,templatefallbackAttrs:d}=kl(),E=M0(),A=Wl(),t=Tl(),e=nf().defaultLine,r=So().extendFlat,i=E.marker.line;V.exports=r({locations:{valType:"data_array",editType:"calc"},locationmode:E.locationmode,z:{valType:"data_array",editType:"calc"},geojson:r({},E.geojson,{}),featureidkey:E.featureidkey,text:r({},E.text,{}),hovertext:r({},E.hovertext,{}),marker:{line:{color:r({},i.color,{dflt:e}),width:r({},i.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:E.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:E.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:r({},t.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:u(),hovertemplatefallback:d(),showlegend:r({},t.showlegend,{dflt:!1})},A("",{cLetter:"z",editTypeOverride:"calc"}))}),zE=Vt((Z,V)=>{var u=Xr(),d=gf(),E=qm(),A=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");V.exports=function(t,e,r,i){function n(m,w){return u.coerce(t,e,E,m,w)}var o=n("locations"),a=n("z");if(!(o&&o.length&&u.isArrayOrTypedArray(a)&&a.length)){e.visible=!1;return}e._length=Math.min(o.length,a.length);var s=n("geojson"),f;(typeof s=="string"&&s!==""||u.isPlainObject(s))&&(f="geojson-id");var v=n("locationmode",f);v==="country names"&&u.warn(A),v==="geojson-id"&&n("featureidkey"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback");var g=n("marker.line.width");g&&n("marker.line.color"),n("marker.opacity"),d(t,e,i,n,{prefix:"",cLetter:"z"}),u.coerceSelectionMarkerOpacity(e,n)}}),Ex=Vt((Z,V)=>{var u=Lo(),d=ks().BADNUM,E=ah(),A=vp(),t=jh();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(m){return e(m)||u(m)}:a=e;for(var s=0;s<n;s++){var f=o[s]={},v=i.locations[s],g=i.z[s];a(v)&&u(g)?(f.loc=v,f.z=g):(f.loc=null,f.z=d),f.index=s}return A(o,i),E(r,i,{vals:i.z,containerStr:"",cLetter:"z"}),t(o,i),o}}),zx=Vt((Z,V)=>{var u=Ni(),d=Pi(),E=Eo(),A=xu();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"),f=o.marker||{},v=f.line||{},g=A.makeColorScaleFuncFromTrace(o);s.each(function(m){u.select(this).attr("fill",g(m.z)).call(d.stroke,m.mlc||v.color).call(E.dashLine,"",m.mlw||v.width||0).style("opacity",f.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}}),D3=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=jd(),A=Ax().getTopojsonFeatures,t=Xh().findExtremes,e=zx().style;function r(n,o,a){var s=o.layers.backplot.select(".choroplethlayer");d.makeTraceGroups(s,a,"trace choropleth").each(function(f){var v=u.select(this),g=v.selectAll("path.choroplethlocation").data(d.identity);g.enter().append("path").classed("choroplethlocation",!0),g.exit().remove(),e(n,f)})}function i(n,o){for(var a=n[0].trace,s=o[a.geo],f=s._subplot,v=a.locationmode,g=a._length,m=v==="geojson-id"?E.extractTraceFeature(n):A(a,f.topojson),w=[],l=[],x=0;x<g;x++){var y=n[x],S=v==="geojson-id"?y.fOut:E.locationToFeature(v,y.loc,m);if(S){y.geojson=S,y.ct=S.properties.ct,y._polygons=E.feature2polygons(S);var k=E.computeBbox(S);w.push(k[0],k[2]),l.push(k[1],k[3])}else y.geojson=null}if(s.fitbounds==="geojson"&&v==="geojson-id"){var M=E.computeBbox(E.getTraceGeojson(a));w=[M[0],M[2]],l=[M[1],M[3]]}var T={padded:!0};a._extremes.lon=t(s.lonaxis._ax,w,T),a._extremes.lat=t(s.lataxis._ax,l,T)}V.exports={calcGeoJSON:i,plot:r}}),Lx=Vt((Z,V)=>{var u=yo(),d=qm(),E=Xr().fillText;V.exports=function(t,e,r){var i=t.cd,n=i[0].trace,o=t.subplot,a,s,f,v,g=[e,r],m=[e+360,r];for(s=0;s<i.length;s++)if(a=i[s],v=!1,a._polygons){for(f=0;f<a._polygons.length;f++)a._polygons[f].contains(g)&&(v=!v),a._polygons[f].contains(m)&&(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=u.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"?d.hoverinfo.flags:i.split("+"),a=o.indexOf("name")!==-1,s=o.indexOf("location")!==-1,f=o.indexOf("z")!==-1,v=o.indexOf("text")!==-1,g=!a&&s,m=[];g?t.nameOverride=n:(a&&(t.nameOverride=e.name),s&&m.push(n)),f&&m.push(t.zLabel),v&&E(r,e,m),t.extraText=m.join("<br>")}}}),Cx=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){u.location=d.location,u.z=d.z;var e=A[t];return e.fIn&&e.fIn.properties&&(u.properties=e.fIn.properties),u.ct=e.ct,u}}),Ix=Vt((Z,V)=>{V.exports=function(u,d){var E=u.cd,A=u.xaxis,t=u.yaxis,e=[],r,i,n,o,a;if(d===!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),d.contains([o,a],null,r,u)?(e.push({pointNumber:r,lon:n[0],lat:n[1]}),i.selected=1):i.selected=0);return e}}),LE=Vt((Z,V)=>{V.exports={attributes:qm(),supplyDefaults:zE(),colorbar:Ed(),calc:Ex(),calcGeoJSON:D3().calcGeoJSON,plot:D3().plot,style:zx().style,styleOnSelect:zx().styleOnSelect,hoverPoints:Lx(),eventData:Cx(),selectPoints:Ix(),moduleType:"trace",name:"choropleth",basePlotModule:O3(),categories:["geo","noOpacity","showLegend"],meta:{}}}),CE=Vt((Z,V)=>{V.exports=LE()}),Px=Vt((Z,V)=>{var u=ji(),d=Xr(),E=km();function A(e,r,i,n){var o=e.cd,a=o[0].t,s=o[0].trace,f=e.xa,v=e.ya,g=a.x,m=a.y,w=f.c2p(r),l=v.c2p(i),x=e.distance,y;if(a.tree){var S=f.p2c(w-x),k=f.p2c(w+x),M=v.p2c(l-x),T=v.p2c(l+x);n==="x"?y=a.tree.range(Math.min(S,k),Math.min(v._rl[0],v._rl[1]),Math.max(S,k),Math.max(v._rl[0],v._rl[1])):y=a.tree.range(Math.min(S,k),Math.min(M,T),Math.max(S,k),Math.max(M,T))}else y=a.ids;var c,h,b,_,P,L,D,B,R,I=x;if(n==="x"){var F=!!s.xperiodalignment,N=!!s.yperiodalignment;for(P=0;P<y.length;P++){if(c=y[P],b=g[c],L=Math.abs(f.c2p(b)-w),F){var j=f.c2p(s._xStarts[c]),G=f.c2p(s._xEnds[c]);L=w>=Math.min(j,G)&&w<=Math.max(j,G)?0:1/0}if(L<I){if(I=L,_=m[c],D=v.c2p(_)-l,N){var rt=v.c2p(s._yStarts[c]),ct=v.c2p(s._yEnds[c]);D=l>=Math.min(rt,ct)&&l<=Math.max(rt,ct)?0:1/0}R=Math.sqrt(L*L+D*D),h=y[P]}}}else for(P=y.length-1;P>-1;P--)c=y[P],b=g[c],_=m[c],L=f.c2p(b)-w,D=v.c2p(_)-l,B=Math.sqrt(L*L+D*D),B<I&&(I=R=B,h=c);return e.index=h,e.distance=I,e.dxy=R,h===void 0?[e]:[t(e,g,m,s)]}function t(e,r,i,n){var o=e.xa,a=e.ya,s=e.distance,f=e.dxy,v=e.index,g={pointNumber:v,x:r[v],y:i[v]};g.tx=d.isArrayOrTypedArray(n.text)?n.text[v]:n.text,g.htx=Array.isArray(n.hovertext)?n.hovertext[v]:n.hovertext,g.data=Array.isArray(n.customdata)?n.customdata[v]:n.customdata,g.tp=Array.isArray(n.textposition)?n.textposition[v]:n.textposition;var m=n.textfont;m&&(g.ts=d.isArrayOrTypedArray(m.size)?m.size[v]:m.size,g.tc=d.isArrayOrTypedArray(m.color)?m.color[v]:m.color,g.tf=Array.isArray(m.family)?m.family[v]:m.family,g.tw=Array.isArray(m.weight)?m.weight[v]:m.weight,g.ty=Array.isArray(m.style)?m.style[v]:m.style,g.tv=Array.isArray(m.variant)?m.variant[v]:m.variant);var w=n.marker;w&&(g.ms=d.isArrayOrTypedArray(w.size)?w.size[v]:w.size,g.mo=d.isArrayOrTypedArray(w.opacity)?w.opacity[v]:w.opacity,g.mx=d.isArrayOrTypedArray(w.symbol)?w.symbol[v]:w.symbol,g.ma=d.isArrayOrTypedArray(w.angle)?w.angle[v]:w.angle,g.mc=d.isArrayOrTypedArray(w.color)?w.color[v]:w.color);var l=w&&w.line;l&&(g.mlc=Array.isArray(l.color)?l.color[v]:l.color,g.mlw=d.isArrayOrTypedArray(l.width)?l.width[v]:l.width);var x=w&&w.gradient;x&&x.type!=="none"&&(g.mgt=Array.isArray(x.type)?x.type[v]:x.type,g.mgc=Array.isArray(x.color)?x.color[v]:x.color);var y=o.c2p(g.x,!0),S=a.c2p(g.y,!0),k=g.mrc||1,M=n.hoverlabel;M&&(g.hbg=Array.isArray(M.bgcolor)?M.bgcolor[v]:M.bgcolor,g.hbc=Array.isArray(M.bordercolor)?M.bordercolor[v]:M.bordercolor,g.hts=d.isArrayOrTypedArray(M.font.size)?M.font.size[v]:M.font.size,g.htc=Array.isArray(M.font.color)?M.font.color[v]:M.font.color,g.htf=Array.isArray(M.font.family)?M.font.family[v]:M.font.family,g.hnl=d.isArrayOrTypedArray(M.namelength)?M.namelength[v]:M.namelength);var T=n.hoverinfo;T&&(g.hi=Array.isArray(T)?T[v]:T);var c=n.hovertemplate;c&&(g.ht=Array.isArray(c)?c[v]:c);var h={};h[e.index]=g;var b=n._origX,_=n._origY,P=d.extendFlat({},e,{color:E(n,g),x0:y-k,x1:y+k,xLabelVal:b?b[v]:g.x,y0:S-k,y1:S+k,yLabelVal:_?_[v]:g.y,cd:h,distance:s,spikeDistance:f,hovertemplate:g.ht});return g.htx?P.text=g.htx:g.tx?P.text=g.tx:n.text&&(P.text=n.text),d.fillText(g,n,P),u.getComponentMethod("errorbars","hoverInfo")(g,n,P),P}V.exports={hoverPoints:A,calcHover:t}}),Ud=Vt((Z,V)=>{var u=20;V.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:u,SYMBOL_STROKE:u/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]}}}),Mv=Vt((Z,V)=>{var u=Tl(),d=yu(),E=Qh(),A=pc(),t=fc().axisHoverFormat,e=Wl(),r=bd(),i=So().extendFlat,n=Cu().overrideAll,o=Ud().DASHES,a=A.line,s=A.marker,f=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:d({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:f.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:u.opacity},"calc","nested");v.x.editType=v.y.editType=v.x0.editType=v.y0.editType="calc+clearAxisTypes",v.hovertemplate=A.hovertemplate,v.hovertemplatefallback=A.hovertemplatefallback,v.texttemplate=A.texttemplate,v.texttemplatefallback=A.texttemplatefallback}),Ox=Vt(Z=>{var V=Ud();Z.isOpenSymbol=function(u){return typeof u=="string"?V.OPEN_RE.test(u):u%200>100},Z.isDotSymbol=function(u){return typeof u=="string"?V.DOT_RE.test(u):u>200}}),IE=Vt((Z,V)=>{var u=Xr(),d=ji(),E=Ox(),A=Mv(),t=gp(),e=nu(),r=bm(),i=tp(),n=zh(),o=Bh(),a=ep(),s=Rh();V.exports=function(f,v,g,m){function w(c,h){return u.coerce(f,v,A,c,h)}var l=f.marker?E.isOpenSymbol(f.marker.symbol):!1,x=e.isBubble(f),y=r(f,v,m,w);if(!y){v.visible=!1;return}i(f,v,m,w),w("xhoverformat"),w("yhoverformat");var S=y<t.PTS_LINESONLY?"lines+markers":"lines";w("text"),w("hovertext"),w("hovertemplate"),w("hovertemplatefallback"),w("mode",S),e.hasMarkers(v)&&(n(f,v,g,m,w,{noAngleRef:!0,noStandOff:!0}),w("marker.line.width",l||x?1:0)),e.hasLines(v)&&(w("connectgaps"),o(f,v,g,m,w),w("line.shape")),e.hasText(v)&&(w("texttemplate"),w("texttemplatefallback"),s(f,v,m,w,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var k=(v.line||{}).color,M=(v.marker||{}).color;w("fill"),v.fill!=="none"&&a(f,v,g,w);var T=d.getComponentMethod("errorbars","supplyDefaults");T(f,v,k||M||g,{axis:"y"}),T(f,v,k||M||g,{axis:"x",inherit:"y"}),u.coerceSelectionMarkerOpacity(v,w)}}),PE=Vt((Z,V)=>{var u=$y();V.exports=function(d,E,A){var t=d.i;return"x"in d||(d.x=E._x[t]),"y"in d||(d.y=E._y[t]),u(d,E,A)}}),OE=Vt((Z,V)=>{function u(r,i,n,o,a){for(var s=a+1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g>=0?(s=f,a=f-1):o=f+1}return s}function d(r,i,n,o,a){for(var s=a+1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g>0?(s=f,a=f-1):o=f+1}return s}function E(r,i,n,o,a){for(var s=o-1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g<0?(s=f,o=f+1):a=f-1}return s}function A(r,i,n,o,a){for(var s=o-1;o<=a;){var f=o+a>>>1,v=r[f],g=n!==void 0?n(v,i):v-i;g<=0?(s=f,o=f+1):a=f-1}return s}function t(r,i,n,o,a){for(;o<=a;){var s=o+a>>>1,f=r[s],v=n!==void 0?n(f,i):f-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,u)},gt:function(r,i,n,o,a){return e(r,i,n,o,a,d)},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)}}}),_p=Vt((Z,V)=>{V.exports=function(E,A,t){var e={},r,i;if(typeof A=="string"&&(A=d(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]=d(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 f=i;f<a.length;f++)o[a[f]]=!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 u={};function d(E){return u[E]?u[E]:(typeof E=="string"&&(E=u[E]=E.split(/\s*,\s*|\s+/)),E)}}),Wm=Vt((Z,V)=>{var u=_p();V.exports=d;function d(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=u(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}}),S0=Vt((Z,V)=>{V.exports=u;function u(d,E){if(!d||d.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=d.length;i<n;i+=E)d[i]>e&&(e=d[i]),d[i]<r&&(r=d[i]);A[t]=r,A[E+t]=e}return A}}),DE=Vt((Z,V)=>{V.exports=function(){for(var u=0;u<arguments.length;u++)if(arguments[u]!==void 0)return arguments[u]}}),E0=Vt((Z,V)=>{var u=xx();V.exports=d;function d(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(u(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 f=u(A||"float32");if(Array.isArray(E)||A==="array")for(A=new f(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 f(E):(A=new f(E.length+t),A.set(E,t))}else A.set(E,t);return A}}),FE=Vt((Z,V)=>{V.exports=function(u){var d=typeof u;return u!==null&&(d==="object"||d==="function")}}),BE=Vt((Z,V)=>{V.exports=Math.log2||function(u){return Math.log(u)*Math.LOG2E}}),RE=Vt((Z,V)=>{var u=OE(),d=wv(),E=Wm(),A=S0(),t=_p(),e=DE(),r=E0(),i=FE(),n=xx(),o=BE(),a=1073741824;V.exports=function(f,v){v||(v={}),f=r(f,"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 g=e(v.maxDepth,255),m=e(v.bounds,A(f,2));m[0]===m[2]&&m[2]++,m[1]===m[3]&&m[3]++;let w=s(f,m),l=f.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 P=0;P<l;++P)x[P]=P;let y=[],S=[],k=[],M=[];c(0,0,1,x,0,1);let T=0;for(let P=0;P<y.length;P++){let L=y[P];if(x.set)x.set(L,T);else for(let B=0,R=L.length;B<R;B++)x[B+T]=L[B];let D=T+y[P].length;M[P]=[T,D],T=D}return x.range=h,x;function c(P,L,D,B,R,I){if(!B.length)return null;let F=y[R]||(y[R]=[]),N=k[R]||(k[R]=[]),j=S[R]||(S[R]=[]),G=F.length;if(R++,R>g||I>a){for(let Q=0;Q<B.length;Q++)F.push(B[Q]),N.push(I),j.push(null,null,null,null);return G}if(F.push(B[0]),N.push(I),B.length<=1)return j.push(null,null,null,null),G;let rt=D*.5,ct=P+rt,st=L+rt,et=[],K=[],ot=[],X=[];for(let Q=1,ut=B.length;Q<ut;Q++){let J=B[Q],q=w[J*2],it=w[J*2+1];q<ct?it<st?et.push(J):K.push(J):it<st?ot.push(J):X.push(J)}return I<<=2,j.push(c(P,L,rt,et,R,I),c(P,st,rt,K,R,I+1),c(ct,L,rt,ot,R,I+2),c(ct,st,rt,X,R,I+3)),G}function h(...P){let L;if(i(P[P.length-1])){let ot=P.pop();!P.length&&(ot.x!=null||ot.l!=null||ot.left!=null)&&(P=[ot],L={}),L=t(ot,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else L={};P.length||(P=m);let D=E(...P),[B,R,I,F]=[Math.min(D.x,D.x+D.width),Math.min(D.y,D.y+D.height),Math.max(D.x,D.x+D.width),Math.max(D.y,D.y+D.height)],[N,j,G,rt]=s([B,R,I,F],m),ct=e(L.level,y.length);if(L.d!=null){let ot;typeof L.d=="number"?ot=[L.d,L.d]:L.d.length&&(ot=L.d),ct=Math.min(Math.max(Math.ceil(-o(Math.abs(ot[0])/(m[2]-m[0]))),Math.ceil(-o(Math.abs(ot[1])/(m[3]-m[1])))),ct)}if(ct=Math.min(ct,y.length),L.lod)return b(N,j,G,rt,ct);let st=[];et(0,0,1,0,0,1);function et(ot,X,Q,ut,J,q){if(J===null||q===null)return;let it=ot+Q,nt=X+Q;if(N>it||j>nt||G<ot||rt<X||ut>=ct||J===q)return;let dt=y[ut];q===void 0&&(q=dt.length);for(let Kt=J;Kt<q;Kt++){let mt=dt[Kt],bt=f[mt*2],vt=f[mt*2+1];bt>=B&&bt<=I&&vt>=R&&vt<=F&&st.push(mt)}let Tt=S[ut],wt=Tt[J*4+0],It=Tt[J*4+1],Ct=Tt[J*4+2],Nt=Tt[J*4+3],ee=K(Tt,J+1),Jt=Q*.5,te=ut+1;et(ot,X,Jt,te,wt,It||Ct||Nt||ee),et(ot,X+Jt,Jt,te,It,Ct||Nt||ee),et(ot+Jt,X,Jt,te,Ct,Nt||ee),et(ot+Jt,X+Jt,Jt,te,Nt,ee)}function K(ot,X){let Q=null,ut=0;for(;Q===null;)if(Q=ot[X*4+ut],ut++,ut>ot.length)return null;return Q}return st}function b(P,L,D,B,R){let I=[];for(let F=0;F<R;F++){let N=k[F],j=M[F][0],G=_(P,L,F),rt=_(D,B,F),ct=u.ge(N,G),st=u.gt(N,rt,ct,N.length-1);I[F]=[ct+j,st+j]}return I}function _(P,L,D){let B=1,R=.5,I=.5,F=.5;for(let N=0;N<D;N++)B<<=2,B+=P<R?L<I?0:1:L<I?2:3,F*=.5,R+=P<R?-F:F,I+=L<I?-F:F;return B}};function s(f,v){let[g,m,w,l]=v,x=1/(w-g),y=1/(l-m),S=new Array(f.length);for(let k=0,M=f.length/2;k<M;k++)S[2*k]=d((f[2*k]-g)*x,0,1),S[2*k+1]=d((f[2*k+1]-m)*y,0,1);return S}}),Dx=Vt((Z,V)=>{V.exports=RE()}),F3=Vt((Z,V)=>{V.exports=u;function u(d){var E=0,A=0,t=0,e=0;return d.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})}}),NE=Vt((Z,V)=>{Object.defineProperty(Z,"__esModule",{value:!0});var u=function(){function i(n,o){var a=[],s=!0,f=!1,v=void 0;try{for(var g=n[Symbol.iterator](),m;!(s=(m=g.next()).done)&&(a.push(m.value),!(o&&a.length===o));s=!0);}catch(w){f=!0,v=w}finally{try{!s&&g.return&&g.return()}finally{if(f)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")}}(),d=Math.PI*2,E=function(i,n,o,a,s,f,v){var g=i.x,m=i.y;g*=n,m*=o;var w=a*g-s*m,l=s*g+a*m;return{x:w+f,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),f=Math.cos(i+n),v=Math.sin(i+n);return[{x:a-s*o,y:s+a*o},{x:f+v*o,y:v-f*o},{x:f,y:v}]},t=function(i,n,o,a){var s=i*a-n*o<0?-1:1,f=i*o+n*a;return f>1&&(f=1),f<-1&&(f=-1),s*Math.acos(f)},e=function(i,n,o,a,s,f,v,g,m,w,l,x){var y=Math.pow(s,2),S=Math.pow(f,2),k=Math.pow(l,2),M=Math.pow(x,2),T=y*S-y*M-S*k;T<0&&(T=0),T/=y*M+S*k,T=Math.sqrt(T)*(v===g?-1:1);var c=T*s/f*x,h=T*-f/s*l,b=w*c-m*h+(i+o)/2,_=m*c+w*h+(n+a)/2,P=(l-c)/s,L=(x-h)/f,D=(-l-c)/s,B=(-x-h)/f,R=t(1,0,P,L),I=t(P,L,D,B);return g===0&&I>0&&(I-=d),g===1&&I<0&&(I+=d),[b,_,R,I]},r=function(i){var n=i.px,o=i.py,a=i.cx,s=i.cy,f=i.rx,v=i.ry,g=i.xAxisRotation,m=g===void 0?0:g,w=i.largeArcFlag,l=w===void 0?0:w,x=i.sweepFlag,y=x===void 0?0:x,S=[];if(f===0||v===0)return[];var k=Math.sin(m*d/360),M=Math.cos(m*d/360),T=M*(n-a)/2+k*(o-s)/2,c=-k*(n-a)/2+M*(o-s)/2;if(T===0&&c===0)return[];f=Math.abs(f),v=Math.abs(v);var h=Math.pow(T,2)/Math.pow(f,2)+Math.pow(c,2)/Math.pow(v,2);h>1&&(f*=Math.sqrt(h),v*=Math.sqrt(h));var b=e(n,o,a,s,f,v,l,y,k,M,T,c),_=u(b,4),P=_[0],L=_[1],D=_[2],B=_[3],R=Math.abs(B)/(d/4);Math.abs(1-R)<1e-7&&(R=1);var I=Math.max(Math.ceil(R),1);B/=I;for(var F=0;F<I;F++)S.push(A(D,B)),D+=B;return S.map(function(N){var j=E(N[0],f,v,M,k,P,L),G=j.x,rt=j.y,ct=E(N[1],f,v,M,k,P,L),st=ct.x,et=ct.y,K=E(N[2],f,v,M,k,P,L),ot=K.x,X=K.y;return{x1:G,y1:rt,x2:st,y2:et,x:ot,y:X}})};Z.default=r,V.exports=Z.default}),jE=Vt((Z,V)=>{V.exports=d;var u=NE();function d(t){for(var e,r=[],i=0,n=0,o=0,a=0,s=null,f=null,v=0,g=0,m=0,w=t.length;m<w;m++){var l=t[m],x=l[0];switch(x){case"M":o=l[1],a=l[2];break;case"A":var y=u({px:v,py:g,cx:l[6],cy:l[7],rx:l[1],ry:l[2],xAxisRotation:l[3],largeArcFlag:l[4],sweepFlag:l[5]});if(!y.length)continue;for(var S=0,k;S<y.length;S++)k=y[S],l=["C",k.x1,k.y1,k.x2,k.y2,k.x,k.y],S<y.length-1&&r.push(l);break;case"S":var M=v,T=g;(e=="C"||e=="S")&&(M+=M-i,T+=T-n),l=["C",M,T,l[1],l[2],l[3],l[4]];break;case"T":e=="Q"||e=="T"?(s=v*2-s,f=g*2-f):(s=v,f=g),l=A(v,g,s,f,l[1],l[2]);break;case"Q":s=l[1],f=l[2],l=A(v,g,l[1],l[2],l[3],l[4]);break;case"L":l=E(v,g,l[1],l[2]);break;case"H":l=E(v,g,l[1],g);break;case"V":l=E(v,g,v,l[1]);break;case"Z":l=E(v,g,o,a);break}e=x,v=l[l.length-2],g=l[l.length-1],l.length>4?(i=l[l.length-4],n=l[l.length-3]):(i=v,n=g),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]}}),B3=Vt((Z,V)=>{V.exports=function(u){return typeof u!="string"?!1:(u=u.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(u)&&/[\dz]$/i.test(u)&&u.length>4))}}),UE=Vt((Z,V)=>{var u=Pg(),d=F3(),E=jE(),A=B3(),t=rv();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=u(r)),t(Array.isArray(r),"Argument should be a string or an array of path segments."),r=d(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}}),VE=Vt((Z,V)=>{var u=Math.PI,d=i(120);V.exports=E;function E(n){for(var o,a=[],s=0,f=0,v=0,g=0,m=null,w=null,l=0,x=0,y=0,S=n.length;y<S;y++){var k=n[y],M=k[0];switch(M){case"M":v=k[1],g=k[2];break;case"A":k=e(l,x,k[1],k[2],i(k[3]),k[4],k[5],k[6],k[7]),k.unshift("C"),k.length>7&&(a.push(k.splice(0,7)),k.unshift("C"));break;case"S":var T=l,c=x;(o=="C"||o=="S")&&(T+=T-s,c+=c-f),k=["C",T,c,k[1],k[2],k[3],k[4]];break;case"T":o=="Q"||o=="T"?(m=l*2-m,w=x*2-w):(m=l,w=x),k=t(l,x,m,w,k[1],k[2]);break;case"Q":m=k[1],w=k[2],k=t(l,x,k[1],k[2],k[3],k[4]);break;case"L":k=A(l,x,k[1],k[2]);break;case"H":k=A(l,x,k[1],x);break;case"V":k=A(l,x,l,k[1]);break;case"Z":k=A(l,x,v,g);break}o=M,l=k[k.length-2],x=k[k.length-1],k.length>4?(s=k[k.length-4],f=k[k.length-3]):(s=l,f=x),a.push(k)}return a}function A(n,o,a,s){return["C",n,o,a,s,a,s]}function t(n,o,a,s,f,v){return["C",n/3+2/3*a,o/3+2/3*s,f/3+2/3*a,v/3+2/3*s,f,v]}function e(n,o,a,s,f,v,g,m,w,l){if(l)_=l[0],P=l[1],h=l[2],b=l[3];else{var x=r(n,o,-f);n=x.x,o=x.y,x=r(m,w,-f),m=x.x,w=x.y;var y=(n-m)/2,S=(o-w)/2,k=y*y/(a*a)+S*S/(s*s);k>1&&(k=Math.sqrt(k),a=k*a,s=k*s);var M=a*a,T=s*s,c=(v==g?-1:1)*Math.sqrt(Math.abs((M*T-M*S*S-T*y*y)/(M*S*S+T*y*y)));c==1/0&&(c=1);var h=c*a*S/s+(n+m)/2,b=c*-s*y/a+(o+w)/2,_=Math.asin(((o-b)/s).toFixed(9)),P=Math.asin(((w-b)/s).toFixed(9));_=n<h?u-_:_,P=m<h?u-P:P,_<0&&(_=u*2+_),P<0&&(P=u*2+P),g&&_>P&&(_=_-u*2),!g&&P>_&&(P=P-u*2)}if(Math.abs(P-_)>d){var L=P,D=m,B=w;P=_+d*(g&&P>_?1:-1),m=h+a*Math.cos(P),w=b+s*Math.sin(P);var R=e(m,w,a,s,f,0,g,D,B,[P,L,h,b])}var I=Math.tan((P-_)/4),F=4/3*a*I,N=4/3*s*I,j=[2*n-(n+F*Math.sin(_)),2*o-(o-N*Math.cos(_)),m+F*Math.sin(P),w-N*Math.cos(P),m,w];if(l)return j;R&&(j=j.concat(R));for(var G=0;G<j.length;){var rt=r(j[G],j[G+1],f);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*(u/180)}}),HE=Vt((Z,V)=>{var u=F3(),d=VE(),E={M:"moveTo",C:"bezierCurveTo"};V.exports=function(A,t){A.beginPath(),d(u(t)).forEach(function(e){var r=e[0],i=e.slice(1);A[E[r]].apply(A,i)}),A.closePath()}}),qE=Vt((Z,V)=>{var u=wv();V.exports=E;var d=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,f,v,g,m,w,l,x,y,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?m=r.stride:m=Math.floor(e.length/a/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(l=e,w=l.getContext("2d"),a=l.width,s=l.height,x=w.getImageData(0,0,a,s),v=x.data,m=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(l=e.canvas,w=e,a=l.width,s=l.height,x=w.getImageData(0,0,a,s),v=x.data,m=4):window.ImageData&&e instanceof window.ImageData&&(x=e,a=e.width,s=e.height,v=x.data,m=4);if(f=Math.max(a,s),window.Uint8ClampedArray&&v instanceof window.Uint8ClampedArray||window.Uint8Array&&v instanceof window.Uint8Array)for(g=v,v=Array(a*s),y=0,S=g.length;y<S;y++)v[y]=g[y*m+o]/255;else if(m!==1)throw Error("Raw data can have only 1 value per pixel");var k=Array(a*s),M=Array(a*s),T=Array(f),c=Array(f),h=Array(f+1),b=Array(f);for(y=0,S=a*s;y<S;y++){var _=v[y];k[y]=_===1?0:_===0?d:Math.pow(Math.max(0,.5-_),2),M[y]=_===1?d:_===0?0:Math.pow(Math.max(0,_-.5),2)}A(k,a,s,T,c,b,h),A(M,a,s,T,c,b,h);var P=window.Float32Array?new Float32Array(a*s):new Array(a*s);for(y=0,S=a*s;y<S;y++)P[y]=u(1-((k[y]-M[y])/n+i),0,1);return P}function A(e,r,i,n,o,a,s){for(var f=0;f<r;f++){for(var v=0;v<i;v++)n[v]=e[v*r+f];for(t(n,o,a,s,i),v=0;v<i;v++)e[v*r+f]=o[v]}for(v=0;v<i;v++){for(f=0;f<r;f++)n[f]=e[v*r+f];for(t(n,o,a,s,r),f=0;f<r;f++)e[v*r+f]=Math.sqrt(o[f])}}function t(e,r,i,n,o){i[0]=0,n[0]=-d,n[1]=+d;for(var a=1,s=0;a<o;a++){for(var f=(e[a]+a*a-(e[i[s]]+i[s]*i[s]))/(2*a-2*i[s]);f<=n[s];)s--,f=(e[a]+a*a-(e[i[s]]+i[s]*i[s]))/(2*a-2*i[s]);s++,i[s]=a,n[s]=f,n[s+1]=+d}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]]}}}),WE=Vt((Z,V)=>{var u=UE(),d=Pg(),E=HE(),A=B3(),t=qE(),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 f,v;s.shape?(f=s.shape[0],v=s.shape[1]):(f=e.width=s.w||s.width||200,v=e.height=s.h||s.height||200);var g=Math.min(f,v),m=s.stroke||0,w=s.viewbox||s.viewBox||u(a),l=[f/(w[2]-w[0]),v/(w[3]-w[1])],x=Math.min(l[0]||0,l[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,f,v),r.fillStyle="white",m&&(typeof m!="number"&&(m=1),m>0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(m)),r.translate(f*.5,v*.5),r.scale(x,x),o()){var y=new Path2D(a);r.fill(y),m&&r.stroke(y)}else{var S=d(a);E(r,S),r.fill(),m&&r.stroke()}r.setTransform(1,0,0,1,0,0);var k=t(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:g*.5});return k}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 f=a.getImageData(0,0,1,1);return n=f&&f.data&&f.data[3]===255}}),z0=Vt((Z,V)=>{var u=Lo(),d=WE(),E=Bd(),A=ji(),t=Xr(),e=t.isArrayOrTypedArray,r=Eo(),i=cc(),n=Hp().formatColor,o=nu(),a=ym(),s=Ox(),f=Ud(),v=xd().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=dh().appendArrayPointValue;function w(R,I){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(I.visible!==!0)return N;if(o.hasText(I)&&(N.text=l(R,I),N.textSel=k(R,I,I.selected),N.textUnsel=k(R,I,I.unselected)),o.hasMarkers(I)&&(N.marker=y(R,I),N.markerSel=S(R,I,I.selected),N.markerUnsel=S(R,I,I.unselected),!I.unselected&&e(I.marker.opacity))){var G=I.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(I)){N.line={overlay:!0,thickness:I.line.width*j,color:I.line.color,opacity:I.opacity};var rt=(f.DASHES[I.line.dash]||[1]).slice();for(F=0;F<rt.length;++F)rt[F]*=I.line.width*j;N.line.dashes=rt}return I.error_x&&I.error_x.visible&&(N.errorX=M(I,I.error_x,j)),I.error_y&&I.error_y.visible&&(N.errorY=M(I,I.error_y,j)),I.fill&&I.fill!=="none"&&(N.fill={closed:!0,fill:I.fillcolor,thickness:0}),N}function l(R,I){var F=R._fullLayout,N=I._length,j=I.textfont,G=I.textposition,rt=e(G)?G:[G],ct=j.color,st=j.size,et=j.family,K=j.weight,ot=j.style,X=j.variant,Q={},ut,J=R._context.plotGlPixelRatio,q=I.texttemplate;if(q){Q.text=[];var it=F._d3locale,nt=Array.isArray(q),dt=nt?Math.min(q.length,N):N,Tt=nt?function(Jt){return q[Jt]}:function(){return q};for(ut=0;ut<dt;ut++){var wt={i:ut},It=I._module.formatLabels(wt,I,F),Ct={};m(Ct,I,ut),Q.text.push(t.texttemplateString({data:[Ct,wt,I._meta],fallback:I.texttemplatefallback,labels:It,locale:it,template:Tt(ut)}))}}else e(I.text)&&I.text.length<N?Q.text=I.text.slice():Q.text=I.text;if(e(Q.text))for(ut=Q.text.length;ut<N;ut++)Q.text[ut]="";for(Q.opacity=I.opacity,Q.font={},Q.align=[],Q.baseline=[],ut=0;ut<rt.length;ut++){var Nt=rt[ut].split(/\s+/);switch(Nt[1]){case"left":Q.align.push("right");break;case"right":Q.align.push("left");break;default:Q.align.push(Nt[1])}switch(Nt[0]){case"top":Q.baseline.push("bottom");break;case"bottom":Q.baseline.push("top");break;default:Q.baseline.push(Nt[0])}}if(e(ct))for(Q.color=new Array(N),ut=0;ut<N;ut++)Q.color[ut]=ct[ut];else Q.color=ct;if(e(st)||Array.isArray(et)||e(K)||Array.isArray(ot)||Array.isArray(X))for(Q.font=new Array(N),ut=0;ut<N;ut++){var ee=Q.font[ut]={};ee.size=(t.isTypedArray(st)?st[ut]:e(st)?u(st[ut])?st[ut]:0:st)*J,ee.family=Array.isArray(et)?et[ut]:et,ee.weight=x(e(K)?K[ut]:K),ee.style=Array.isArray(ot)?ot[ut]:ot,ee.variant=Array.isArray(X)?X[ut]:X}else Q.font={size:st*J,family:et,weight:x(K),style:ot,variant:X};return Q}function x(R){return R<=1e3?R>500?"bold":"normal":R}function y(R,I){var F=I._length,N=I.marker,j={},G,rt=e(N.symbol),ct=e(N.angle),st=e(N.color),et=e(N.line.color),K=e(N.opacity),ot=e(N.size),X=e(N.line.width),Q;if(rt||(Q=s.isOpenSymbol(N.symbol)),rt||st||et||K||ct){j.symbols=new Array(F),j.angles=new Array(F),j.colors=new Array(F),j.borderColors=new Array(F);var ut=N.symbol,J=N.angle,q=n(N,N.opacity,F),it=n(N.line,N.opacity,F);if(!e(it[0])){var nt=it;for(it=Array(F),G=0;G<F;G++)it[G]=nt}if(!e(q[0])){var dt=q;for(q=Array(F),G=0;G<F;G++)q[G]=dt}if(!e(ut)){var Tt=ut;for(ut=Array(F),G=0;G<F;G++)ut[G]=Tt}if(!e(J)){var wt=J;for(J=Array(F),G=0;G<F;G++)J[G]=wt}for(j.symbols=ut,j.angles=J,j.colors=q,j.borderColors=it,G=0;G<F;G++)rt&&(Q=s.isOpenSymbol(N.symbol[G])),Q&&(it[G]=q[G].slice(),q[G]=q[G].slice(),q[G][3]=0);for(j.opacity=I.opacity,j.markers=new Array(F),G=0;G<F;G++)j.markers[G]=P({mx:j.symbols[G],ma:j.angles[G]},I)}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=I.opacity*N.opacity,j.marker=P({mx:N.symbol,ma:N.angle},I);var It=1,Ct=a(I,It),Nt;if(ot||X){var ee=j.sizes=new Array(F),Jt=j.borderSizes=new Array(F),te=0,Kt;if(ot){for(G=0;G<F;G++)ee[G]=Ct(N.size[G]),te+=ee[G];Kt=te/F}else for(Nt=Ct(N.size),G=0;G<F;G++)ee[G]=Nt;if(X)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=Kt}else j.size=Ct(N&&N.size||10),j.borderSizes=Ct(N.line.width);return j}function S(R,I,F){var N=I.marker,j={};return F&&(F.marker&&F.marker.symbol?j=y(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 k(R,I,F){var N={};if(!F)return N;if(F.textfont){var j={opacity:1,text:I.text,texttemplate:I.texttemplate,textposition:I.textposition,textfont:t.extendFlat({},I.textfont)};F.textfont&&t.extendFlat(j.textfont,F.textfont),N=l(R,j)}return N}function M(R,I,F){var N={capSize:I.width*2*F,lineWidth:I.thickness*F,color:I.color};return I.copy_ystyle&&(N=R.error_y),N}var T=f.SYMBOL_SDF_SIZE,c=f.SYMBOL_SIZE,h=f.SYMBOL_STROKE,b={},_=r.symbolFuncs[0](c*.05);function P(R,I){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],st=!!r.symbolNoFill[G%100],et=s.isDotSymbol(F);if(R.ma&&(F+="_"+R.ma),b[F])return b[F];var K=r.getMarkerAngle(R,I);return et&&!ct?N=rt(c*1.1,K)+_:N=rt(c,K),j=d(N,{w:T,h:T,viewBox:[-c,-c,c,c],stroke:st?h:-h}),b[F]=j,j||null}function L(R,I,F){var N=F.length,j=N/2,G,rt;if(o.hasLines(I)&&j)if(I.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(I.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(I.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 st=(F[rt*2+1]+F[rt*2+3])/2;G.push(F[rt*2],F[rt*2+1],F[rt*2],st,F[rt*2+2],st)}G.push(F[N-2],F[N-1])}else if(I.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 et=!1;for(rt=0;rt<G.length;rt++)if(isNaN(G[rt])){et=!0;break}var K=et||G.length>f.TOO_MANY_POINTS||o.hasMarkers(I)?"rect":"round";if(et&&I.connectgaps){var ot=G[0],X=G[1];for(rt=0;rt<G.length;rt+=2)isNaN(G[rt])||isNaN(G[rt+1])?(G[rt]=ot,G[rt+1]=X):(ot=G[rt],X=G[rt+1])}return{join:K,positions:G}}function D(R,I,F,N,j){var G=A.getComponentMethod("errorbars","makeComputeError"),rt=i.getFromId(R,I.xaxis,"x"),ct=i.getFromId(R,I.yaxis,"y"),st=F.length/2,et={};function K(ot,X){var Q=X._id.charAt(0),ut=I["error_"+Q];if(ut&&ut.visible&&(X.type==="linear"||X.type==="log")){for(var J=G(ut),q={x:0,y:1}[Q],it={x:[0,1,2,3],y:[2,3,0,1]}[Q],nt=new Float64Array(4*st),dt=1/0,Tt=-1/0,wt=0,It=0;wt<st;wt++,It+=4){var Ct=ot[wt];if(u(Ct)){var Nt=F[wt*2+q],ee=J(Ct,wt),Jt=ee[0],te=ee[1];if(u(Jt)&&u(te)){var Kt=Ct-Jt,mt=Ct+te;nt[It+it[0]]=Nt-X.c2l(Kt),nt[It+it[1]]=X.c2l(mt)-Nt,nt[It+it[2]]=0,nt[It+it[3]]=0,dt=Math.min(dt,Ct-Jt),Tt=Math.max(Tt,Ct+te)}}}et[Q]={positions:F,errors:nt,_bnds:[dt,Tt]}}}return K(N,rt),K(j,ct),et}function B(R,I,F,N){var j=I._length,G={},rt;if(o.hasMarkers(I)){var ct=F.font,st=F.align,et=F.baseline;for(G.offset=new Array(j),rt=0;rt<j;rt++){var K=N.sizes?N.sizes[rt]:N.size,ot=e(ct)?ct[rt].size:ct.size,X=e(st)?st.length>1?st[rt]:st[0]:st,Q=e(et)?et.length>1?et[rt]:et[0]:et,ut=g[X],J=g[Q],q=K?K/.8+1:0,it=-J*q-J*.5;G.offset[rt]=[ut*q/ot,it/ot]}}return G}V.exports={style:w,markerStyle:y,markerSelection:S,linePositions:L,errorBarPositions:D,textPosition:B}}),R3=Vt((Z,V)=>{var u=Xr();V.exports=function(d,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(){u.extendFlat(A,e,t)},A.init(),A.update=function(r){var i=u.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,f=A.select2d,v=A.selectBatch,g=A.unselectBatch,m=0;m<r;m++){if(i&&A.fillOrder[m]&&i.draw(A.fillOrder[m]),o&&A.lineOptions[m]&&o.draw(m),n&&(A.errorXOptions[m]&&n.draw(m),A.errorYOptions[m]&&n.draw(m+r)),a&&A.markerOptions[m])if(g[m].length){var w=u.repeat([],A.count);w[m]=g[m],a.draw(w)}else v[m].length||a.draw(m);s[m]&&A.textOptions[m]&&s[m].render()}f&&f.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||u.extendFlat(A,t),A}}),GE=Vt((Z,V)=>{var u=Dx(),d=Xr(),E=cc(),A=Xh().findExtremes,t=rp(),e=Uh(),r=e.calcMarkerSize,i=e.calcAxisExpansion,n=e.setFirstScatter,o=Nh(),a=z0(),s=R3(),f=ks().BADNUM,v=Ud().TOO_MANY_POINTS;V.exports=function(w,l){var x=w._fullLayout,y=l._xA=E.getFromId(w,l.xaxis,"x"),S=l._yA=E.getFromId(w,l.yaxis,"y"),k=x._plots[l.xaxis+l.yaxis],M=l._length,T=M>=v,c=M*2,h={},b,_=y.makeCalcdata(l,"x"),P=S.makeCalcdata(l,"y"),L=t(l,y,"x",_),D=t(l,S,"y",P),B=L.vals,R=D.vals;l._x=B,l._y=R,l.xperiodalignment&&(l._origX=_,l._xStarts=L.starts,l._xEnds=L.ends),l.yperiodalignment&&(l._origY=P,l._yStarts=D.starts,l._yEnds=D.ends);var I=new Array(c),F=new Array(M);for(b=0;b<M;b++)I[b*2]=B[b]===f?NaN:B[b],I[b*2+1]=R[b]===f?NaN:R[b],F[b]=b;if(y.type==="log")for(b=0;b<c;b+=2)I[b]=y.c2l(I[b]);if(S.type==="log")for(b=1;b<c;b+=2)I[b]=S.c2l(I[b]);T&&y.type!=="log"&&S.type!=="log"?h.tree=u(I):h.ids=F,o(w,l);var N=m(w,k,l,I,B,R),j=s(w,k);n(x,l);var G;return T?N.marker&&(G=N.marker.sizeAvg||Math.max(N.marker.size,3)):G=r(l,M),i(w,l,y,S,B,R,G),N.errorX&&g(l,y,N.errorX),N.errorY&&g(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([]),h._scene=j,h.index=j.count,h.x=B,h.y=R,h.positions=I,j.count++,[{x:!1,y:!1,t:h,trace:l}]};function g(w,l,x){var y=w._extremes[l._id],S=A(l,x._bnds,{padded:!0});y.min=y.min.concat(S.min),y.max=y.max.concat(S.max)}function m(w,l,x,y,S,k){var M=a.style(w,x);if(M.marker&&(M.marker.positions=y),M.line&&y.length>1&&d.extendFlat(M.line,a.linePositions(w,x,y)),M.errorX||M.errorY){var T=a.errorBarPositions(w,x,y,S,k);M.errorX&&d.extendFlat(M.errorX,T.x),M.errorY&&d.extendFlat(M.errorY,T.y)}return M.text&&(d.extendFlat(M.text,{positions:y},a.textPosition(w,x,M.text,M.marker)),d.extendFlat(M.textSel,{positions:y},a.textPosition(w,x,M.text,M.markerSel)),d.extendFlat(M.textUnsel,{positions:y},a.textPosition(w,x,M.text,M.markerUnsel))),M}}),N3=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=xd().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],f=n.textOptions[o],v=n.textSelectedOptions[o]||{},g=n.textUnselectedOptions[o]||{},m=u.extendFlat({},f),w,l;if(a.length||s.length){var x=v.color,y=g.color,S=f.color,k=u.isArrayOrTypedArray(S);for(m.color=new Array(r._length),w=0;w<a.length;w++)l=a[w],m.color[l]=x||(k?S[l]:S);for(w=0;w<s.length;w++){l=s[w];var M=k?S[l]:S;m.color[l]=y||(x?M:d.addOpacity(M,E))}}n.glText[o].update(m)}V.exports={styleTextSelection:A}}),j3=Vt((Z,V)=>{var u=nu(),d=N3().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,f=o.y,v=o._scene,g=o.index;if(!v)return i;var m=u.hasText(n),w=u.hasMarkers(n),l=!w&&!m;if(n.visible!==!0||l)return i;var x=[],y=[];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(f[S])})):y.push(S);if(w){var k=v.scatter2d;if(!x.length&&!y.length){var M=new Array(v.count);M[g]=v.markerOptions[g],k.update.apply(k,M)}else if(!v.selectBatch[g].length&&!v.unselectBatch[g].length){var T=new Array(v.count);T[g]=v.markerUnselectedOptions[g],k.update.apply(k,T)}}return v.selectBatch[g]=x,v.unselectBatch[g]=y,m&&d(t),i}}),ZE=Vt((Z,V)=>{var u=Px();V.exports={moduleType:"trace",name:"scattergl",basePlotModule:Kc(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Mv(),supplyDefaults:IE(),crossTraceDefaults:Ib(),colorbar:Gf(),formatLabels:PE(),calc:GE(),hoverPoints:u.hoverPoints,selectPoints:j3(),meta:{}}}),KE=Vt((Z,V)=>{var u=wv();V.exports=d,V.exports.to=d,V.exports.from=E;function d(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=u(e,0,255)&255,r=u(r,0,255)&255,i=u(i,0,255)&255,n=u(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]}}),af=Vt((Z,V)=>{var u=Object.getOwnPropertySymbols,d=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)d.call(i,s)&&(n[s]=i[s]);if(u){o=u(i);for(var f=0;f<o.length;f++)E.call(i,o[f])&&(n[o[f]]=i[o[f]])}}return n}}),YE=Vt((Z,V)=>{V.exports=function(u){typeof u=="string"&&(u=[u]);for(var d=[].slice.call(arguments,1),E=[],A=0;A<u.length-1;A++)E.push(u[A],d[A]||"");return E.push(u[A]),E.join("")}}),U3=Vt((Z,V)=>{V.exports=function(u,d,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(!(d[r]!==void 0&&!Array.isArray(d[r])&&u[r]===d[r])&&r in d){var i;if(e[r]===!0)i=d[r];else if(e[r]===!1||typeof e[r]=="function"&&(i=e[r](d[r],u,d),i===void 0))continue;u[r]=i}}return u}}),XE=Vt((Z,V)=>{V.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),Fx=Vt((Z,V)=>{V.exports=E,V.exports.float32=V.exports.float=E,V.exports.fract32=V.exports.fract=d;var u=new Float32Array(1);function d(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):(u[0]=A,u[0])}}),V3=Vt((Z,V)=>{function u(b,_){var P=b==null?null:typeof Symbol<"u"&&b[Symbol.iterator]||b["@@iterator"];if(P!=null){var L,D,B,R,I=[],F=!0,N=!1;try{if(B=(P=P.call(b)).next,_!==0)for(;!(F=(L=B.call(P)).done)&&(I.push(L.value),I.length!==_);F=!0);}catch(j){N=!0,D=j}finally{try{if(!F&&P.return!=null&&(R=P.return(),Object(R)!==R))return}finally{if(N)throw D}}return I}}function d(b,_){return t(b)||u(b,_)||r(b,_)||o()}function E(b){return A(b)||e(b)||r(b)||n()}function A(b){if(Array.isArray(b))return i(b)}function t(b){if(Array.isArray(b))return b}function e(b){if(typeof Symbol<"u"&&b[Symbol.iterator]!=null||b["@@iterator"]!=null)return Array.from(b)}function r(b,_){if(b){if(typeof b=="string")return i(b,_);var P=Object.prototype.toString.call(b).slice(8,-1);if(P==="Object"&&b.constructor&&(P=b.constructor.name),P==="Map"||P==="Set")return Array.from(b);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return i(b,_)}}function i(b,_){(_==null||_>b.length)&&(_=b.length);for(var P=0,L=new Array(_);P<_;P++)L[P]=b[P];return L}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=Bd(),s=S0(),f=KE(),v=Dx(),g=af(),m=YE(),w=_p(),l=U3(),x=E0(),y=XE(),S=Fx(),k=Wm(),M=T;function T(b,_){var P=this;if(!(this instanceof T))return new T(b,_);typeof b=="function"?(_||(_={}),_.regl=b):(_=b,b=null),_&&_.length&&(_.positions=_),b=_.regl;var L=b._gl,D,B=[],R={},I=[],F=[null],N=[null],j=255,G=100;this.tooManyColors=y,D=b.texture({data:new Uint8Array(j*4),width:j,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),g(this,{regl:b,gl:L,groups:I,markerCache:N,markerTextures:F,palette:B,paletteIds:R,paletteTexture:D,maxColors:j,maxSize:G,canvas:L.canvas}),this.update(_);var rt={uniforms:{constPointSize:!!_.constPointSize,opacity:b.prop("opacity"),paletteSize:function(et,K){return[P.tooManyColors?0:j,D.height]},pixelRatio:b.context("pixelRatio"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translate:b.prop("translate"),translateFract:b.prop("translateFract"),markerTexture:b.prop("markerTexture"),paletteTexture:D},attributes:{x:function(et,K){return K.xAttr||{buffer:K.positionBuffer,stride:8,offset:0}},y:function(et,K){return K.yAttr||{buffer:K.positionBuffer,stride:8,offset:4}},xFract:function(et,K){return K.xAttr?{constant:[0,0]}:{buffer:K.positionFractBuffer,stride:8,offset:0}},yFract:function(et,K){return K.yAttr?{constant:[0,0]}:{buffer:K.positionFractBuffer,stride:8,offset:4}},size:function(et,K){return K.size.length?{buffer:K.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(K.size*255/P.maxSize)]}},borderSize:function(et,K){return K.borderSize.length?{buffer:K.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(K.borderSize*255/P.maxSize)]}},colorId:function(et,K){return K.color.length?{buffer:K.colorBuffer,stride:P.tooManyColors?8:4,offset:0}:{constant:P.tooManyColors?B.slice(K.color*4,K.color*4+4):[K.color]}},borderColorId:function(et,K){return K.borderColor.length?{buffer:K.colorBuffer,stride:P.tooManyColors?8:4,offset:P.tooManyColors?4:2}:{constant:P.tooManyColors?B.slice(K.borderColor*4,K.borderColor*4+4):[K.borderColor]}},isActive:function(et,K){return K.activation===!0?{constant:[1]}:K.activation?K.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:b.prop("viewport")},viewport:b.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:b.prop("elements"),count:b.prop("count"),offset:b.prop("offset"),primitive:"points"},ct=g({},rt);ct.frag=m([`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=m([`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=b(ct);var st=g({},rt);st.frag=m([`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;
}
`]),st.vert=m([`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;
}
`]),y&&(st.frag=st.frag.replace("smoothstep","smoothStep"),ct.frag=ct.frag.replace("smoothstep","smoothStep")),this.drawCircle=b(st)}T.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},T.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},T.prototype.draw=function(){for(var b=this,_=arguments.length,P=new Array(_),L=0;L<_;L++)P[L]=arguments[L];var D=this.groups;if(P.length===1&&Array.isArray(P[0])&&(P[0][0]===null||Array.isArray(P[0][0]))&&(P=P[0]),this.regl._refresh(),P.length)for(var B=0;B<P.length;B++)this.drawItem(B,P[B]);else D.forEach(function(R,I){b.drawItem(I)});return this},T.prototype.drawItem=function(b,_){var P=this.groups,L=P[b];if(typeof _=="number"&&(b=_,L=P[_],_=null),!!(L&&L.count&&L.opacity)){L.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,L,_));for(var D=[],B=1;B<L.activation.length;B++)!L.activation[B]||L.activation[B]!==!0&&!L.activation[B].data.length||D.push.apply(D,E(this.getMarkerDrawOptions(B,L,_)));D.length&&this.drawMarker(D)}},T.prototype.getMarkerDrawOptions=function(b,_,P){var L=_.range,D=_.tree,B=_.viewport,R=_.activation,I=_.selectionBuffer,F=_.count;if(this.regl,!D)return P?[g({},_,{markerTexture:this.markerTextures[b],activation:R[b],count:P.length,elements:P,offset:0})]:[g({},_,{markerTexture:this.markerTextures[b],activation:R[b],offset:0})];var N=[],j=D.range(L,{lod:!0,px:[(L[2]-L[0])/B.width,(L[3]-L[1])/B.height]});if(P){for(var G=R[b],rt=G.data,ct=new Uint8Array(F),st=0;st<P.length;st++){var et=P[st];ct[et]=rt?rt[et]:1}I.subdata(ct)}for(var K=j.length;K--;){var ot=d(j[K],2),X=ot[0],Q=ot[1];N.push(g({},_,{markerTexture:this.markerTextures[b],activation:P?I:R[b],offset:X,count:Q-X}))}return N},T.prototype.update=function(){for(var b=this,_=arguments.length,P=new Array(_),L=0;L<_;L++)P[L]=arguments[L];if(P.length){P.length===1&&Array.isArray(P[0])&&(P=P[0]);var D=this.groups,B=this.gl,R=this.regl,I=this.maxSize,F=this.maxColors,N=this.palette;this.groups=D=P.map(function(j,G){var rt=D[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=w(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&&(b.tooManyColors=j.tooManyColors),rt||(D[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=g({},T.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,st=0;if(l(rt,j,[{snap:!0,size:function(Jt,te){return Jt==null&&(Jt=T.defaults.size),ct+=Jt&&Jt.length?1:0,Jt},borderSize:function(Jt,te){return Jt==null&&(Jt=T.defaults.borderSize),ct+=Jt&&Jt.length?1:0,Jt},opacity:parseFloat,color:function(Jt,te){return Jt==null&&(Jt=T.defaults.color),Jt=b.updateColor(Jt),st++,Jt},borderColor:function(Jt,te){return Jt==null&&(Jt=T.defaults.borderColor),Jt=b.updateColor(Jt),st++,Jt},bounds:function(Jt,te,Kt){return"range"in Kt||(Kt.range=null),Jt},positions:function(Jt,te,Kt){var mt=te.snap,bt=te.positionBuffer,vt=te.positionFractBuffer,Ut=te.selectionBuffer;if(Jt.x||Jt.y)return Jt.x.length?te.xAttr={buffer:R.buffer(Jt.x),offset:0,stride:4,count:Jt.x.length}:te.xAttr={buffer:Jt.x.buffer,offset:Jt.x.offset*4||0,stride:(Jt.x.stride||1)*4,count:Jt.x.count},Jt.y.length?te.yAttr={buffer:R.buffer(Jt.y),offset:0,stride:4,count:Jt.y.length}:te.yAttr={buffer:Jt.y.buffer,offset:Jt.y.offset*4||0,stride:(Jt.y.stride||1)*4,count:Jt.y.count},te.count=Math.max(te.xAttr.count,te.yAttr.count),Jt;Jt=x(Jt,"float64");var re=te.count=Math.floor(Jt.length/2),Zt=te.bounds=re?s(Jt,2):null;if(!Kt.range&&!te.range&&(delete te.range,Kt.range=Zt),!Kt.marker&&!te.marker&&(delete te.marker,Kt.marker=null),mt&&(mt===!0||re>mt)?te.tree=v(Jt,{bounds:Zt}):mt&&mt.length&&(te.tree=mt),te.tree){var ue={primitive:"points",usage:"static",data:te.tree,type:"uint32"};te.elements?te.elements(ue):te.elements=R.elements(ue)}var Me=S.float32(Jt);bt({data:Me,usage:"dynamic"});var Ce=S.fract32(Jt,Me);return vt({data:Ce,usage:"dynamic"}),Ut({data:new Uint8Array(re),type:"uint8",usage:"stream"}),Jt}},{marker:function(Jt,te,Kt){var mt=te.activation;if(mt.forEach(function(Ce){return Ce&&Ce.destroy&&Ce.destroy()}),mt.length=0,!Jt||typeof Jt[0]=="number"){var bt=b.addMarker(Jt);mt[bt]=!0}else{for(var vt=[],Ut=0,re=Math.min(Jt.length,te.count);Ut<re;Ut++){var Zt=b.addMarker(Jt[Ut]);vt[Zt]||(vt[Zt]=new Uint8Array(te.count)),vt[Zt][Ut]=1}for(var ue=0;ue<vt.length;ue++)if(vt[ue]){var Me={data:vt[ue],type:"uint8",usage:"static"};mt[ue]?mt[ue](Me):mt[ue]=R.buffer(Me),mt[ue].data=vt[ue]}}return Jt},range:function(Jt,te,Kt){var mt=te.bounds;if(mt)return Jt||(Jt=mt),te.scale=[1/(Jt[2]-Jt[0]),1/(Jt[3]-Jt[1])],te.translate=[-Jt[0],-Jt[1]],te.scaleFract=S.fract(te.scale),te.translateFract=S.fract(te.translate),Jt},viewport:function(Jt){var te=k(Jt||[B.drawingBufferWidth,B.drawingBufferHeight]);return te}}]),ct){var et=rt,K=et.count,ot=et.size,X=et.borderSize,Q=et.sizeBuffer,ut=new Uint8Array(K*2);if(ot.length||X.length)for(var J=0;J<K;J++)ut[J*2]=Math.round((ot[J]==null?ot:ot[J])*255/I),ut[J*2+1]=Math.round((X[J]==null?X:X[J])*255/I);Q({data:ut,usage:"dynamic"})}if(st){var q=rt,it=q.count,nt=q.color,dt=q.borderColor,Tt=q.colorBuffer,wt;if(b.tooManyColors){if(nt.length||dt.length){wt=new Uint8Array(it*8);for(var It=0;It<it;It++){var Ct=nt[It];wt[It*8]=N[Ct*4],wt[It*8+1]=N[Ct*4+1],wt[It*8+2]=N[Ct*4+2],wt[It*8+3]=N[Ct*4+3];var Nt=dt[It];wt[It*8+4]=N[Nt*4],wt[It*8+5]=N[Nt*4+1],wt[It*8+6]=N[Nt*4+2],wt[It*8+7]=N[Nt*4+3]}}}else if(nt.length||dt.length){wt=new Uint8Array(it*4+2);for(var ee=0;ee<it;ee++)nt[ee]!=null&&(wt[ee*4]=nt[ee]%F,wt[ee*4+1]=Math.floor(nt[ee]/F)),dt[ee]!=null&&(wt[ee*4+2]=dt[ee]%F,wt[ee*4+3]=Math.floor(dt[ee]/F))}Tt({data:wt||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return rt})}},T.prototype.addMarker=function(b){var _=this.markerTextures,P=this.regl,L=this.markerCache,D=b==null?0:L.indexOf(b);if(D>=0)return D;var B;if(b instanceof Uint8Array||b instanceof Uint8ClampedArray)B=b;else{B=new Uint8Array(b.length);for(var R=0,I=b.length;R<I;R++)B[R]=b[R]*255}var F=Math.floor(Math.sqrt(B.length));return D=_.length,L.push(b),_.push(P.texture({channels:1,data:B,radius:F,mag:"linear",min:"linear"})),D},T.prototype.updateColor=function(b){var _=this.paletteIds,P=this.palette,L=this.maxColors;Array.isArray(b)||(b=[b]);var D=[];if(typeof b[0]=="number"){var B=[];if(Array.isArray(b))for(var R=0;R<b.length;R+=4)B.push(b.slice(R,R+4));else for(var I=0;I<b.length;I+=4)B.push(b.subarray(I,I+4));b=B}for(var F=0;F<b.length;F++){var N=b[F];N=a(N,"uint8");var j=f(N,!1);if(_[j]==null){var G=P.length;_[j]=Math.floor(G/4),P[G]=N[0],P[G+1]=N[1],P[G+2]=N[2],P[G+3]=N[3]}D[F]=_[j]}return!this.tooManyColors&&P.length>L*4&&(this.tooManyColors=!0),this.updatePalette(P),D.length===1?D[0]:D},T.prototype.updatePalette=function(b){if(!this.tooManyColors){var _=this.maxColors,P=this.paletteTexture,L=Math.ceil(b.length*.25/_);if(L>1){b=b.slice();for(var D=b.length*.25%_;D<L*_;D++)b.push(0,0,0,0)}P.height<L&&P.resize(_,L),P.subimage({width:Math.min(b.length*.25,_),height:L,data:b},0,0)}},T.prototype.destroy=function(){return this.groups.forEach(function(b){b.sizeBuffer.destroy(),b.positionBuffer.destroy(),b.positionFractBuffer.destroy(),b.colorBuffer.destroy(),b.activation.forEach(function(_){return _&&_.destroy&&_.destroy()}),b.selectionBuffer.destroy(),b.elements&&b.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(function(b){return b&&b.destroy&&b.destroy()}),this};var c=af(),h=function(b,_){var P=new M(b,_),L=P.render.bind(P);return c(L,{render:L,update:P.update.bind(P),draw:P.draw.bind(P),destroy:P.destroy.bind(P),regl:P.regl,gl:P.gl,canvas:P.gl.canvas,groups:P.groups,markers:P.markerCache,palette:P.palette}),L};V.exports=h}),$E=Vt((Z,V)=>{V.exports=u,V.exports.default=u;function u(R,I,F){F=F||2;var N=I&&I.length,j=N?I[0]*F:R.length,G=d(R,0,j,F,!0),rt=[];if(!G||G.next===G.prev)return rt;var ct,st,et,K,ot,X,Q;if(N&&(G=n(R,I,G,F)),R.length>80*F){ct=et=R[0],st=K=R[1];for(var ut=F;ut<j;ut+=F)ot=R[ut],X=R[ut+1],ot<ct&&(ct=ot),X<st&&(st=X),ot>et&&(et=ot),X>K&&(K=X);Q=Math.max(et-ct,K-st),Q=Q!==0?32767/Q:0}return A(G,rt,F,ct,st,Q,0),rt}function d(R,I,F,N,j){var G,rt;if(j===B(R,I,F,N)>0)for(G=I;G<F;G+=N)rt=P(G,R[G],R[G+1],rt);else for(G=F-N;G>=I;G-=N)rt=P(G,R[G],R[G+1],rt);return rt&&S(rt,rt.next)&&(L(rt),rt=rt.next),rt}function E(R,I){if(!R)return R;I||(I=R);var F=R,N;do if(N=!1,!F.steiner&&(S(F,F.next)||y(F.prev,F,F.next)===0)){if(L(F),F=I=F.prev,F===F.next)break;N=!0}else F=F.next;while(N||F!==I);return I}function A(R,I,F,N,j,G,rt){if(R){!rt&&G&&v(R,N,j,G);for(var ct=R,st,et;R.prev!==R.next;){if(st=R.prev,et=R.next,G?e(R,N,j,G):t(R)){I.push(st.i/F|0),I.push(R.i/F|0),I.push(et.i/F|0),L(R),R=et.next,ct=et.next;continue}if(R=et,R===ct){rt?rt===1?(R=r(E(R),I,F),A(R,I,F,N,j,G,2)):rt===2&&i(R,I,F,N,j,G):A(E(R),I,F,N,j,G,1);break}}}}function t(R){var I=R.prev,F=R,N=R.next;if(y(I,F,N)>=0)return!1;for(var j=I.x,G=F.x,rt=N.x,ct=I.y,st=F.y,et=N.y,K=j<G?j<rt?j:rt:G<rt?G:rt,ot=ct<st?ct<et?ct:et:st<et?st:et,X=j>G?j>rt?j:rt:G>rt?G:rt,Q=ct>st?ct>et?ct:et:st>et?st:et,ut=N.next;ut!==I;){if(ut.x>=K&&ut.x<=X&&ut.y>=ot&&ut.y<=Q&&l(j,ct,G,st,rt,et,ut.x,ut.y)&&y(ut.prev,ut,ut.next)>=0)return!1;ut=ut.next}return!0}function e(R,I,F,N){var j=R.prev,G=R,rt=R.next;if(y(j,G,rt)>=0)return!1;for(var ct=j.x,st=G.x,et=rt.x,K=j.y,ot=G.y,X=rt.y,Q=ct<st?ct<et?ct:et:st<et?st:et,ut=K<ot?K<X?K:X:ot<X?ot:X,J=ct>st?ct>et?ct:et:st>et?st:et,q=K>ot?K>X?K:X:ot>X?ot:X,it=m(Q,ut,I,F,N),nt=m(J,q,I,F,N),dt=R.prevZ,Tt=R.nextZ;dt&&dt.z>=it&&Tt&&Tt.z<=nt;){if(dt.x>=Q&&dt.x<=J&&dt.y>=ut&&dt.y<=q&&dt!==j&&dt!==rt&&l(ct,K,st,ot,et,X,dt.x,dt.y)&&y(dt.prev,dt,dt.next)>=0||(dt=dt.prevZ,Tt.x>=Q&&Tt.x<=J&&Tt.y>=ut&&Tt.y<=q&&Tt!==j&&Tt!==rt&&l(ct,K,st,ot,et,X,Tt.x,Tt.y)&&y(Tt.prev,Tt,Tt.next)>=0))return!1;Tt=Tt.nextZ}for(;dt&&dt.z>=it;){if(dt.x>=Q&&dt.x<=J&&dt.y>=ut&&dt.y<=q&&dt!==j&&dt!==rt&&l(ct,K,st,ot,et,X,dt.x,dt.y)&&y(dt.prev,dt,dt.next)>=0)return!1;dt=dt.prevZ}for(;Tt&&Tt.z<=nt;){if(Tt.x>=Q&&Tt.x<=J&&Tt.y>=ut&&Tt.y<=q&&Tt!==j&&Tt!==rt&&l(ct,K,st,ot,et,X,Tt.x,Tt.y)&&y(Tt.prev,Tt,Tt.next)>=0)return!1;Tt=Tt.nextZ}return!0}function r(R,I,F){var N=R;do{var j=N.prev,G=N.next.next;!S(j,G)&&k(j,N,N.next,G)&&h(j,G)&&h(G,j)&&(I.push(j.i/F|0),I.push(N.i/F|0),I.push(G.i/F|0),L(N),L(N.next),N=R=G),N=N.next}while(N!==R);return E(N)}function i(R,I,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 st=_(rt,ct);rt=E(rt,rt.next),st=E(st,st.next),A(rt,I,F,N,j,G,0),A(st,I,F,N,j,G,0);return}ct=ct.next}rt=rt.next}while(rt!==R)}function n(R,I,F,N){var j=[],G,rt,ct,st,et;for(G=0,rt=I.length;G<rt;G++)ct=I[G]*N,st=G<rt-1?I[G+1]*N:R.length,et=d(R,ct,st,N,!1),et===et.next&&(et.steiner=!0),j.push(w(et));for(j.sort(o),G=0;G<j.length;G++)F=a(j[G],F);return F}function o(R,I){return R.x-I.x}function a(R,I){var F=s(R,I);if(!F)return I;var N=_(F,R);return E(N,N.next),E(F,F.next)}function s(R,I){var F=I,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!==I);if(!rt)return null;var st=rt,et=rt.x,K=rt.y,ot=1/0,X;F=rt;do N>=F.x&&F.x>=et&&N!==F.x&&l(j<K?N:G,j,et,K,j<K?G:N,j,F.x,F.y)&&(X=Math.abs(j-F.y)/(N-F.x),h(F,R)&&(X<ot||X===ot&&(F.x>rt.x||F.x===rt.x&&f(rt,F)))&&(rt=F,ot=X)),F=F.next;while(F!==st);return rt}function f(R,I){return y(R.prev,R,I.prev)<0&&y(I.next,R,R.next)<0}function v(R,I,F,N){var j=R;do j.z===0&&(j.z=m(j.x,j.y,I,F,N)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==R);j.prevZ.nextZ=null,j.prevZ=null,g(j)}function g(R){var I,F,N,j,G,rt,ct,st,et=1;do{for(F=R,R=null,G=null,rt=0;F;){for(rt++,N=F,ct=0,I=0;I<et&&(ct++,N=N.nextZ,!!N);I++);for(st=et;ct>0||st>0&&N;)ct!==0&&(st===0||!N||F.z<=N.z)?(j=F,F=F.nextZ,ct--):(j=N,N=N.nextZ,st--),G?G.nextZ=j:R=j,j.prevZ=G,G=j;F=N}G.nextZ=null,et*=2}while(rt>1);return R}function m(R,I,F,N,j){return R=(R-F)*j|0,I=(I-N)*j|0,R=(R|R<<8)&16711935,R=(R|R<<4)&252645135,R=(R|R<<2)&858993459,R=(R|R<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,R|I<<1}function w(R){var I=R,F=R;do(I.x<F.x||I.x===F.x&&I.y<F.y)&&(F=I),I=I.next;while(I!==R);return F}function l(R,I,F,N,j,G,rt,ct){return(j-rt)*(I-ct)>=(R-rt)*(G-ct)&&(R-rt)*(N-ct)>=(F-rt)*(I-ct)&&(F-rt)*(G-ct)>=(j-rt)*(N-ct)}function x(R,I){return R.next.i!==I.i&&R.prev.i!==I.i&&!c(R,I)&&(h(R,I)&&h(I,R)&&b(R,I)&&(y(R.prev,R,I.prev)||y(R,I.prev,I))||S(R,I)&&y(R.prev,R,R.next)>0&&y(I.prev,I,I.next)>0)}function y(R,I,F){return(I.y-R.y)*(F.x-I.x)-(I.x-R.x)*(F.y-I.y)}function S(R,I){return R.x===I.x&&R.y===I.y}function k(R,I,F,N){var j=T(y(R,I,F)),G=T(y(R,I,N)),rt=T(y(F,N,R)),ct=T(y(F,N,I));return!!(j!==G&&rt!==ct||j===0&&M(R,F,I)||G===0&&M(R,N,I)||rt===0&&M(F,R,N)||ct===0&&M(F,I,N))}function M(R,I,F){return I.x<=Math.max(R.x,F.x)&&I.x>=Math.min(R.x,F.x)&&I.y<=Math.max(R.y,F.y)&&I.y>=Math.min(R.y,F.y)}function T(R){return R>0?1:R<0?-1:0}function c(R,I){var F=R;do{if(F.i!==R.i&&F.next.i!==R.i&&F.i!==I.i&&F.next.i!==I.i&&k(F,F.next,R,I))return!0;F=F.next}while(F!==R);return!1}function h(R,I){return y(R.prev,R,R.next)<0?y(R,I,R.next)>=0&&y(R,R.prev,I)>=0:y(R,I,R.prev)<0||y(R,R.next,I)<0}function b(R,I){var F=R,N=!1,j=(R.x+I.x)/2,G=(R.y+I.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,I){var F=new D(R.i,R.x,R.y),N=new D(I.i,I.x,I.y),j=R.next,G=I.prev;return R.next=I,I.prev=R,F.next=j,j.prev=F,N.next=F,F.prev=N,G.next=N,N.prev=G,N}function P(R,I,F,N){var j=new D(R,I,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 L(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 D(R,I,F){this.i=R,this.x=I,this.y=F,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}u.deviation=function(R,I,F,N){var j=I&&I.length,G=j?I[0]*F:R.length,rt=Math.abs(B(R,0,G,F));if(j)for(var ct=0,st=I.length;ct<st;ct++){var et=I[ct]*F,K=ct<st-1?I[ct+1]*F:R.length;rt-=Math.abs(B(R,et,K,F))}var ot=0;for(ct=0;ct<N.length;ct+=3){var X=N[ct]*F,Q=N[ct+1]*F,ut=N[ct+2]*F;ot+=Math.abs((R[X]-R[ut])*(R[Q+1]-R[X+1])-(R[X]-R[Q])*(R[ut+1]-R[X+1]))}return rt===0&&ot===0?0:Math.abs((ot-rt)/rt)};function B(R,I,F,N){for(var j=0,G=I,rt=F-N;G<F;G+=N)j+=(R[rt]-R[G])*(R[G+1]+R[rt+1]),rt=G;return j}u.flatten=function(R){for(var I=R[0][0].length,F={vertices:[],holes:[],dimensions:I},N=0,j=0;j<R.length;j++){for(var G=0;G<R[j].length;G++)for(var rt=0;rt<I;rt++)F.vertices.push(R[j][G][rt]);j>0&&(N+=R[j-1].length,F.holes.push(N))}return F}}),JE=Vt((Z,V)=>{var u=S0();V.exports=d;function d(E,A,t){if(!E||E.length==null)throw Error("Argument should be an array");A==null&&(A=1),t==null&&(t=u(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}}),QE=Vt((Z,V)=>{V.exports=function(){var u,d;if(typeof WeakMap!="function")return!1;try{u=new WeakMap([[d={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(u)!=="[object WeakMap]"||typeof u.set!="function"||u.set({},1)!==u||typeof u.delete!="function"||typeof u.has!="function"||u.get(d)!=="one")}}),t7=Vt((Z,V)=>{V.exports=function(){}}),Vd=Vt((Z,V)=>{var u=t7()();V.exports=function(d){return d!==u&&d!==null}}),H3=Vt((Z,V)=>{var u=Object.create,d=Object.getPrototypeOf,E={};V.exports=function(){var A=Object.setPrototypeOf,t=arguments[0]||u;return typeof A!="function"?!1:d(A(t(null),E))===E}}),q3=Vt((Z,V)=>{var u=Vd(),d={function:!0,object:!0};V.exports=function(E){return u(E)&&d[typeof E]||!1}}),qp=Vt((Z,V)=>{var u=Vd();V.exports=function(d){if(!u(d))throw new TypeError("Cannot use null or undefined");return d}}),e7=Vt((Z,V)=>{var u=Object.create,d;H3()()||(d=W3()),V.exports=function(){var E,A,t;return!d||d.level!==1?u:(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(d,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:E}),function(e,r){return u(e===null?E:e,r)})}()}),W3=Vt((Z,V)=>{var u=q3(),d=qp(),E=Object.prototype.isPrototypeOf,A=Object.defineProperty,t={configurable:!0,enumerable:!1,writable:!0,value:void 0},e;e=function(r,i){if(d(r),i===null||u(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 f;return e(a,s),f=E.call(o.nullPolyfill,a),f&&delete o.nullPolyfill.__proto__,s===null&&(s=o.nullPolyfill),a.__proto__=s,f&&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)}()),e7()}),Bx=Vt((Z,V)=>{V.exports=H3()()?Object.setPrototypeOf:W3()}),r7=Vt((Z,V)=>{var u=q3();V.exports=function(d){if(!u(d))throw new TypeError(d+" is not an Object");return d}}),n7=Vt((Z,V)=>{var u=Object.create(null),d=Math.random;V.exports=function(){var E;do E=d().toString(36).slice(2);while(u[E]);return E}}),L0=Vt((Z,V)=>{var u=void 0;V.exports=function(d){return d!==u&&d!==null}}),Rx=Vt((Z,V)=>{var u=L0(),d={object:!0,function:!0,undefined:!0};V.exports=function(E){return u(E)?hasOwnProperty.call(d,typeof E):!1}}),a7=Vt((Z,V)=>{var u=Rx();V.exports=function(d){if(!u(d))return!1;try{return d.constructor?d.constructor.prototype===d:!1}catch{return!1}}}),i7=Vt((Z,V)=>{var u=a7();V.exports=function(d){if(typeof d!="function"||!hasOwnProperty.call(d,"length"))return!1;try{if(typeof d.length!="number"||typeof d.call!="function"||typeof d.apply!="function")return!1}catch{return!1}return!u(d)}}),G3=Vt((Z,V)=>{var u=i7(),d=/^\s*class[\s{/}]/,E=Function.prototype.toString;V.exports=function(A){return!(!u(A)||d.test(E.call(A)))}}),o7=Vt((Z,V)=>{V.exports=function(){var u=Object.assign,d;return typeof u!="function"?!1:(d={foo:"raz"},u(d,{bar:"dwa"},{trzy:"trzy"}),d.foo+d.bar+d.trzy==="razdwatrzy")}}),s7=Vt((Z,V)=>{V.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),l7=Vt((Z,V)=>{var u=Vd(),d=Object.keys;V.exports=function(E){return d(u(E)?Object(E):E)}}),u7=Vt((Z,V)=>{V.exports=s7()()?Object.keys:l7()}),c7=Vt((Z,V)=>{var u=u7(),d=qp(),E=Math.max;V.exports=function(A,t){var e,r,i=E(arguments.length,2),n;for(A=Object(d(A)),n=function(o){try{A[o]=t[o]}catch(a){e||(e=a)}},r=1;r<i;++r)t=arguments[r],u(t).forEach(n);if(e!==void 0)throw e;return A}}),Nx=Vt((Z,V)=>{V.exports=o7()()?Object.assign:c7()}),Z3=Vt((Z,V)=>{var u=Vd(),d=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 d.call(arguments,function(r){u(r)&&A(Object(r),e)}),e}}),f7=Vt((Z,V)=>{var u="razdwatrzy";V.exports=function(){return typeof u.contains!="function"?!1:u.contains("dwa")===!0&&u.contains("foo")===!1}}),h7=Vt((Z,V)=>{var u=String.prototype.indexOf;V.exports=function(d){return u.call(this,d,arguments[1])>-1}}),K3=Vt((Z,V)=>{V.exports=f7()()?String.prototype.contains:h7()}),Wp=Vt((Z,V)=>{var u=L0(),d=G3(),E=Nx(),A=Z3(),t=K3(),e=V.exports=function(r,i){var n,o,a,s,f;return arguments.length<2||typeof r!="string"?(s=i,i=r,r=null):s=arguments[2],u(r)?(n=t.call(r,"c"),o=t.call(r,"e"),a=t.call(r,"w")):(n=a=!0,o=!1),f={value:i,configurable:n,enumerable:o,writable:a},s?E(A(s),f):f};e.gs=function(r,i,n){var o,a,s,f;return typeof r!="string"?(s=n,n=i,i=r,r=null):s=arguments[3],u(i)?d(i)?u(n)?d(n)||(s=n,n=void 0):n=void 0:(s=i,i=n=void 0):i=void 0,u(r)?(o=t.call(r,"c"),a=t.call(r,"e")):(o=!0,a=!1),f={get:i,set:n,configurable:o,enumerable:a},s?E(A(s),f):f}}),Sv=Vt((Z,V)=>{var u=Object.prototype.toString,d=u.call(function(){return arguments}());V.exports=function(E){return u.call(E)===d}}),Ev=Vt((Z,V)=>{var u=Object.prototype.toString,d=u.call("");V.exports=function(E){return typeof E=="string"||E&&typeof E=="object"&&(E instanceof String||u.call(E)===d)||!1}}),p7=Vt((Z,V)=>{V.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),d7=Vt((Z,V)=>{var u=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 u()}try{return __global__||u()}finally{delete Object.prototype.__global__}}()}),zv=Vt((Z,V)=>{V.exports=p7()()?globalThis:d7()}),m7=Vt((Z,V)=>{var u=zv(),d={object:!0,symbol:!0};V.exports=function(){var E=u.Symbol,A;if(typeof E!="function")return!1;A=E("test symbol");try{String(A)}catch{return!1}return!(!d[typeof E.iterator]||!d[typeof E.toPrimitive]||!d[typeof E.toStringTag])}}),g7=Vt((Z,V)=>{V.exports=function(u){return u?typeof u=="symbol"?!0:!u.constructor||u.constructor.name!=="Symbol"?!1:u[u.constructor.toStringTag]==="Symbol":!1}}),Y3=Vt((Z,V)=>{var u=g7();V.exports=function(d){if(!u(d))throw new TypeError(d+" is not a symbol");return d}}),v7=Vt((Z,V)=>{var u=Wp(),d=Object.create,E=Object.defineProperty,A=Object.prototype,t=d(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,u.gs(null,function(o){n||(n=!0,E(this,i,u(o)),n=!1)})),i}}),y7=Vt((Z,V)=>{var u=Wp(),d=zv().Symbol;V.exports=function(E){return Object.defineProperties(E,{hasInstance:u("",d&&d.hasInstance||E("hasInstance")),isConcatSpreadable:u("",d&&d.isConcatSpreadable||E("isConcatSpreadable")),iterator:u("",d&&d.iterator||E("iterator")),match:u("",d&&d.match||E("match")),replace:u("",d&&d.replace||E("replace")),search:u("",d&&d.search||E("search")),species:u("",d&&d.species||E("species")),split:u("",d&&d.split||E("split")),toPrimitive:u("",d&&d.toPrimitive||E("toPrimitive")),toStringTag:u("",d&&d.toStringTag||E("toStringTag")),unscopables:u("",d&&d.unscopables||E("unscopables"))})}}),x7=Vt((Z,V)=>{var u=Wp(),d=Y3(),E=Object.create(null);V.exports=function(A){return Object.defineProperties(A,{for:u(function(t){return E[t]?E[t]:E[t]=A(String(t))}),keyFor:u(function(t){var e;d(t);for(e in E)if(E[e]===t)return e})})}}),_7=Vt((Z,V)=>{var u=Wp(),d=Y3(),E=zv().Symbol,A=v7(),t=y7(),e=x7(),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(f){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return o(f)},V.exports=o=function f(v){var g;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?E(v):(g=r(a.prototype),v=v===void 0?"":String(v),i(g,{__description__:u("",v),__name__:u("",A(v))}))},t(o),e(o),i(a.prototype,{constructor:u(o),toString:u("",function(){return this.__name__})}),i(o.prototype,{toString:u(function(){return"Symbol ("+d(this).__description__+")"}),valueOf:u(function(){return d(this)})}),n(o.prototype,o.toPrimitive,u("",function(){var f=d(this);return typeof f=="symbol"?f:f.toString()})),n(o.prototype,o.toStringTag,u("c","Symbol")),n(a.prototype,o.toStringTag,u("c",o.prototype[o.toStringTag])),n(a.prototype,o.toPrimitive,u("c",o.prototype[o.toPrimitive]))}),Hd=Vt((Z,V)=>{V.exports=m7()()?zv().Symbol:_7()}),b7=Vt((Z,V)=>{var u=qp();V.exports=function(){return u(this).length=0,this}}),Gm=Vt((Z,V)=>{V.exports=function(u){if(typeof u!="function")throw new TypeError(u+" is not a function");return u}}),w7=Vt((Z,V)=>{var u=L0(),d=Rx(),E=Object.prototype.toString;V.exports=function(A){if(!u(A))return null;if(d(A)){var t=A.toString;if(typeof t!="function"||t===E)return null}try{return""+A}catch{return null}}}),T7=Vt((Z,V)=>{V.exports=function(u){try{return u.toString()}catch{try{return String(u)}catch{return null}}}}),k7=Vt((Z,V)=>{var u=T7(),d=/[\n\r\u2028\u2029]/g;V.exports=function(E){var A=u(E);return A===null?"<Non-coercible to string value>":(A.length>100&&(A=A.slice(0,99)+"…"),A=A.replace(d,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)}}),X3=Vt((Z,V)=>{var u=L0(),d=Rx(),E=w7(),A=k7(),t=function(e,r){return e.replace("%v",A(r))};V.exports=function(e,r,i){if(!d(i))throw new TypeError(t(r,e));if(!u(e)){if("default"in i)return i.default;if(i.isOptional)return null}var n=E(i.errorMessage);throw u(n)||(n=r),new TypeError(t(n,e))}}),A7=Vt((Z,V)=>{var u=X3(),d=L0();V.exports=function(E){return d(E)?E:u(E,"Cannot use %v",arguments[1])}}),M7=Vt((Z,V)=>{var u=X3(),d=G3();V.exports=function(E){return d(E)?E:u(E,"%v is not a plain function",arguments[1])}}),S7=Vt((Z,V)=>{V.exports=function(){var u=Array.from,d,E;return typeof u!="function"?!1:(d=["raz","dwa"],E=u(d),!!(E&&E!==d&&E[1]==="dwa"))}}),E7=Vt((Z,V)=>{var u=Object.prototype.toString,d=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);V.exports=function(E){return typeof E=="function"&&d(u.call(E))}}),z7=Vt((Z,V)=>{V.exports=function(){var u=Math.sign;return typeof u!="function"?!1:u(10)===1&&u(-20)===-1}}),L7=Vt((Z,V)=>{V.exports=function(u){return u=Number(u),isNaN(u)||u===0?u:u>0?1:-1}}),C7=Vt((Z,V)=>{V.exports=z7()()?Math.sign:L7()}),I7=Vt((Z,V)=>{var u=C7(),d=Math.abs,E=Math.floor;V.exports=function(A){return isNaN(A)?0:(A=Number(A),A===0||!isFinite(A)?A:u(A)*E(d(A)))}}),P7=Vt((Z,V)=>{var u=I7(),d=Math.max;V.exports=function(E){return d(0,u(E))}}),O7=Vt((Z,V)=>{var u=Hd().iterator,d=Sv(),E=E7(),A=P7(),t=Gm(),e=qp(),r=Vd(),i=Ev(),n=Array.isArray,o=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;V.exports=function(f){var v=arguments[1],g=arguments[2],m,w,l,x,y,S,k,M,T,c;if(f=Object(e(f)),r(v)&&t(v),!this||this===Array||!E(this)){if(!v){if(d(f))return y=f.length,y!==1?Array.apply(null,f):(x=new Array(1),x[0]=f[0],x);if(n(f)){for(x=new Array(y=f.length),w=0;w<y;++w)x[w]=f[w];return x}}x=[]}else m=this;if(!n(f)){if((T=f[u])!==void 0){for(k=t(T).call(f),m&&(x=new m),M=k.next(),w=0;!M.done;)c=v?o.call(v,g,M.value,w):M.value,m?(a.value=c,s(x,w,a)):x[w]=c,M=k.next(),++w;y=w}else if(i(f)){for(y=f.length,m&&(x=new m),w=0,l=0;w<y;++w)c=f[w],w+1<y&&(S=c.charCodeAt(0),S>=55296&&S<=56319&&(c+=f[++w])),c=v?o.call(v,g,c,l):c,m?(a.value=c,s(x,l,a)):x[l]=c,++l;y=l}}if(y===void 0)for(y=A(f.length),m&&(x=new m(y)),w=0;w<y;++w)c=v?o.call(v,g,f[w],w):f[w],m?(a.value=c,s(x,w,a)):x[w]=c;return m&&(a.value=null,x.length=y),x}}),D7=Vt((Z,V)=>{V.exports=S7()()?Array.from:O7()}),F7=Vt((Z,V)=>{var u=D7(),d=Nx(),E=qp();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?u(e,function(n){(r.ensure||n in A)&&(i[n]=A[n])}):d(i,A),i}}),B7=Vt((Z,V)=>{var u=Gm(),d=qp(),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],f=arguments[3];return n=Object(d(n)),u(o),a=t(n),f&&a.sort(typeof f=="function"?E.call(f,n):void 0),typeof r!="function"&&(r=a[r]),A.call(r,a,function(v,g){return e.call(n,v)?A.call(o,s,n[v],v,n,g):i})}}}),R7=Vt((Z,V)=>{V.exports=B7()("forEach")}),N7=Vt((Z,V)=>{var u=Gm(),d=R7(),E=Function.prototype.call;V.exports=function(A,t){var e={},r=arguments[2];return u(t),d(A,function(i,n,o,a){e[n]=E.call(t,r,i,n,o,a)}),e}}),j7=Vt((Z,V)=>{var u=L0(),d=A7(),E=M7(),A=F7(),t=Z3(),e=N7(),r=Function.prototype.bind,i=Object.defineProperty,n=Object.prototype.hasOwnProperty,o;o=function(a,s,f){var v=d(s)&&E(s.value),g;return g=A(s),delete g.writable,delete g.value,g.get=function(){return!f.overwriteDefinition&&n.call(this,a)?v:(s.value=r.call(v,f.resolveContext?f.resolveContext(this):this),i(this,a,s),this[a])},g},V.exports=function(a){var s=t(arguments[1]);return u(s.resolveContext)&&E(s.resolveContext),e(a,function(f,v){return o(v,f,s)})}}),$3=Vt((Z,V)=>{var u=b7(),d=Nx(),E=Gm(),A=qp(),t=Wp(),e=j7(),r=Hd(),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,d({_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,f){s>=a&&(this.__redo__[f]=++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(f,v){f>a&&(this.__redo__[v]=--f)},this)))}),_onClear:t(function(){this.__redo__&&u.call(this.__redo__),this.__nextIndex__=0})}))),i(o.prototype,r.iterator,t(function(){return this}))}),U7=Vt((Z,V)=>{var u=Bx(),d=K3(),E=Wp(),A=Hd(),t=$3(),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?d.call(n,"key+value")?n="key+value":d.call(n,"key")?n="key":n="value":n="value",e(this,"__kind__",E("",n))},u&&u(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"))}),V7=Vt((Z,V)=>{var u=Bx(),d=Wp(),E=Hd(),A=$3(),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__",d("",r.length))},u&&u(e,A),delete e.prototype.constructor,e.prototype=Object.create(A.prototype,{_next:d(function(){if(this.__list__){if(this.__nextIndex__<this.__length__)return this.__nextIndex__++;this._unBind()}}),_resolve:d(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,d("c","String Iterator"))}),H7=Vt((Z,V)=>{var u=Sv(),d=Vd(),E=Ev(),A=Hd().iterator,t=Array.isArray;V.exports=function(e){return d(e)?t(e)||E(e)||u(e)?!0:typeof e[A]=="function":!1}}),q7=Vt((Z,V)=>{var u=H7();V.exports=function(d){if(!u(d))throw new TypeError(d+" is not iterable");return d}}),J3=Vt((Z,V)=>{var u=Sv(),d=Ev(),E=U7(),A=V7(),t=q7(),e=Hd().iterator;V.exports=function(r){return typeof t(r)[e]=="function"?r[e]():u(r)?new E(r):d(r)?new A(r):new E(r)}}),W7=Vt((Z,V)=>{var u=Sv(),d=Gm(),E=Ev(),A=J3(),t=Array.isArray,e=Function.prototype.call,r=Array.prototype.some;V.exports=function(i,n){var o,a=arguments[2],s,f,v,g,m,w,l;if(t(i)||u(i)?o="array":E(i)?o="string":i=A(i),d(n),f=function(){v=!0},o==="array"){r.call(i,function(x){return e.call(n,a,x,f),v});return}if(o==="string"){for(m=i.length,g=0;g<m&&(w=i[g],g+1<m&&(l=w.charCodeAt(0),l>=55296&&l<=56319&&(w+=i[++g])),e.call(n,a,w,f),!v);++g);return}for(s=i.next();!s.done;){if(e.call(n,a,s.value,f),v)return;s=i.next()}}}),G7=Vt((Z,V)=>{V.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),Z7=Vt((Z,V)=>{var u=Vd(),d=Bx(),E=r7(),A=qp(),t=n7(),e=Wp(),r=J3(),i=W7(),n=Hd().toStringTag,o=G7(),a=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf,g;V.exports=g=function(){var m=arguments[0],w;if(!(this instanceof g))throw new TypeError("Constructor requires 'new'");return w=o&&d&&WeakMap!==g?d(new WeakMap,v(this)):this,u(m)&&(a(m)||(m=r(m))),s(w,"__weakMapData__",e("c","$weakMap$"+t())),m&&i(m,function(l){A(l),w.set(l[0],l[1])}),w},o&&(d&&d(g,WeakMap),g.prototype=Object.create(WeakMap.prototype,{constructor:e(g)})),Object.defineProperties(g.prototype,{delete:e(function(m){return f.call(E(m),this.__weakMapData__)?(delete m[this.__weakMapData__],!0):!1}),get:e(function(m){if(f.call(E(m),this.__weakMapData__))return m[this.__weakMapData__]}),has:e(function(m){return f.call(E(m),this.__weakMapData__)}),set:e(function(m,w){return s(E(m),this.__weakMapData__,e("c",w)),this}),toString:e(function(){return"[object WeakMap]"})}),s(g.prototype,n,e("c","WeakMap"))}),Q3=Vt((Z,V)=>{V.exports=QE()()?WeakMap:Z7()}),K7=Vt((Z,V)=>{V.exports=function(u,d,E){if(typeof Array.prototype.findIndex=="function")return u.findIndex(d,E);if(typeof d!="function")throw new TypeError("predicate must be a function");var A=Object(u),t=A.length;if(t===0)return-1;for(var e=0;e<t;e++)if(d.call(E,A[e],e,A))return e;return-1}}),t5=Vt((Z,V)=>{var u=Bd(),d=S0(),E=af(),A=_p(),t=E0(),e=$E(),r=JE(),{float32:i,fract32:n}=Fx(),o=Q3(),a=Wm(),s=K7(),f=`
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;
}
`,g=`
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;
}
`,m=`
precision highp float;
varying vec4 fragColor;
void main() {
gl_FragColor = fragColor;
}
`,w=`
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(y,S){if(!(this instanceof x))return new x(y,S);if(typeof y=="function"?(S||(S={}),S.regl=y):S=y,S.length&&(S.positions=S),y=S.regl,!y.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=y._gl,this.regl=y,this.passes=[],this.shaders=x.shaders.has(y)?x.shaders.get(y):x.shaders.set(y,x.createShaders(y)).get(y),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(y){let S=y.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),k={primitive:"triangle strip",instances:y.prop("count"),count:4,offset:0,uniforms:{miterMode:(c,h)=>h.join==="round"?2:1,miterLimit:y.prop("miterLimit"),scale:y.prop("scale"),scaleFract:y.prop("scaleFract"),translateFract:y.prop("translateFract"),translate:y.prop("translate"),thickness:y.prop("thickness"),dashTexture:y.prop("dashTexture"),opacity:y.prop("opacity"),pixelRatio:y.context("pixelRatio"),id:y.prop("id"),dashLength:y.prop("dashLength"),viewport:(c,h)=>[h.viewport.x,h.viewport.y,c.viewportWidth,c.viewportHeight],depth:y.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:(c,h)=>!h.overlay},stencil:{enable:!1},scissor:{enable:!0,box:y.prop("viewport")},viewport:y.prop("viewport")},M=y(E({vert:f,frag:v,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:y.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:y.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:y.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},k)),T;try{T=y(E({cull:{enable:!0,face:"back"},vert:w,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:y.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:y.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:y.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},k))}catch{T=M}return{fill:y({primitive:"triangle",elements:(c,h)=>h.triangles,offset:0,vert:g,frag:m,uniforms:{scale:y.prop("scale"),color:y.prop("fill"),scaleFract:y.prop("scaleFract"),translateFract:y.prop("translateFract"),translate:y.prop("translate"),opacity:y.prop("opacity"),pixelRatio:y.context("pixelRatio"),id:y.prop("id"),viewport:(c,h)=>[h.viewport.x,h.viewport.y,c.viewportWidth,c.viewportHeight]},attributes:{position:{buffer:y.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:y.prop("positionFractBuffer"),stride:8,offset:8}},blend:k.blend,depth:{enable:!1},scissor:k.scissor,stencil:k.stencil,viewport:k.viewport}),rect:M,miter:T}},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(...y){y.length&&this.update(...y),this.draw()},x.prototype.draw=function(...y){return(y.length?y:this.passes).forEach((S,k)=>{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(y){if(!y)return;y.length!=null?typeof y[0]=="number"&&(y=[{positions:y}]):Array.isArray(y)||(y=[y]);let{regl:S,gl:k}=this;if(y.forEach((T,c)=>{let h=this.passes[c];if(T!==void 0){if(T===null){this.passes[c]=null;return}if(typeof T[0]=="number"&&(T={positions:T}),T=A(T,{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"}),h||(this.passes[c]=h={id:c,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})},T=E({},x.defaults,T)),T.thickness!=null&&(h.thickness=parseFloat(T.thickness)),T.opacity!=null&&(h.opacity=parseFloat(T.opacity)),T.miterLimit!=null&&(h.miterLimit=parseFloat(T.miterLimit)),T.overlay!=null&&(h.overlay=!!T.overlay,c<x.maxLines&&(h.depth=2*(x.maxLines-1-c%x.maxLines)/x.maxLines-1)),T.join!=null&&(h.join=T.join),T.hole!=null&&(h.hole=T.hole),T.fill!=null&&(h.fill=T.fill?u(T.fill,"uint8"):null),T.viewport!=null&&(h.viewport=a(T.viewport)),h.viewport||(h.viewport=a([k.drawingBufferWidth,k.drawingBufferHeight])),T.close!=null&&(h.close=T.close),T.positions===null&&(T.positions=[]),T.positions){let P,L;if(T.positions.x&&T.positions.y){let I=T.positions.x,F=T.positions.y;L=h.count=Math.max(I.length,F.length),P=new Float64Array(L*2);for(let N=0;N<L;N++)P[N*2]=I[N],P[N*2+1]=F[N]}else P=t(T.positions,"float64"),L=h.count=Math.floor(P.length/2);let D=h.bounds=d(P,2);if(h.fill){let I=[],F={},N=0;for(let j=0,G=0,rt=h.count;j<rt;j++){let ct=P[j*2],st=P[j*2+1];isNaN(ct)||isNaN(st)||ct==null||st==null?(ct=P[N*2],st=P[N*2+1],F[j]=N):N=j,I[G++]=ct,I[G++]=st}if(T.splitNull){h.count-1 in F||(F[h.count]=h.count-1);let j=Object.keys(F).map(Number).sort((st,et)=>st-et),G=[],rt=0,ct=h.hole!=null?h.hole[0]:null;if(ct!=null){let st=s(j,et=>et>=ct);j=j.slice(0,st),j.push(ct)}for(let st=0;st<j.length;st++){let et=I.slice(rt*2,j[st]*2).concat(ct?I.slice(ct*2):[]),K=(h.hole||[]).map(X=>X-ct+(j[st]-rt)),ot=e(et,K);ot=ot.map(X=>X+rt+(X+rt<j[st]?0:ct-j[st])),G.push(...ot),rt=j[st]+1}for(let st=0,et=G.length;st<et;st++)F[G[st]]!=null&&(G[st]=F[G[st]]);h.triangles=G}else{let j=e(I,h.hole||[]);for(let G=0,rt=j.length;G<rt;G++)F[j[G]]!=null&&(j[G]=F[j[G]]);h.triangles=j}}let B=new Float64Array(P);r(B,2,D);let R=new Float64Array(L*2+6);h.close?P[0]===P[L*2-2]&&P[1]===P[L*2-1]?(R[0]=B[L*2-4],R[1]=B[L*2-3]):(R[0]=B[L*2-2],R[1]=B[L*2-1]):(R[0]=B[0],R[1]=B[1]),R.set(B,2),h.close?P[0]===P[L*2-2]&&P[1]===P[L*2-1]?(R[L*2+2]=B[2],R[L*2+3]=B[3],h.count-=1):(R[L*2+2]=B[0],R[L*2+3]=B[1],R[L*2+4]=B[2],R[L*2+5]=B[3]):(R[L*2+2]=B[L*2-2],R[L*2+3]=B[L*2-1],R[L*2+4]=B[L*2-2],R[L*2+5]=B[L*2-1]);var b=i(R);h.positionBuffer(b);var _=n(R,b);h.positionFractBuffer(_)}if(T.range?h.range=T.range:h.range||(h.range=h.bounds),(T.range||T.positions)&&h.count){let P=h.bounds,L=P[2]-P[0],D=P[3]-P[1],B=h.range[2]-h.range[0],R=h.range[3]-h.range[1];h.scale=[L/B,D/R],h.translate=[-h.range[0]/B+P[0]/B||0,-h.range[1]/R+P[1]/R||0],h.scaleFract=n(h.scale),h.translateFract=n(h.translate)}if(T.dashes){let P=0,L;if(!T.dashes||T.dashes.length<2)P=1,L=new Uint8Array([255,255,255,255,255,255,255,255]);else{P=0;for(let R=0;R<T.dashes.length;++R)P+=T.dashes[R];L=new Uint8Array(P*x.dashMult);let D=0,B=255;for(let R=0;R<2;R++)for(let I=0;I<T.dashes.length;++I){for(let F=0,N=T.dashes[I]*x.dashMult*.5;F<N;++F)L[D++]=B;B^=255}}h.dashLength=P,h.dashTexture({channels:1,data:L,width:L.length,height:1,mag:"linear",min:"linear"},0,0)}if(T.color){let P=h.count,L=T.color;L||(L="transparent");let D=new Uint8Array(P*4+4);if(!Array.isArray(L)||typeof L[0]=="number"){let B=u(L,"uint8");for(let R=0;R<P+1;R++)D.set(B,R*4)}else{for(let B=0;B<P;B++){let R=u(L[B],"uint8");D.set(R,B*4)}D.set(u(L[0],"uint8"),P*4)}h.colorBuffer({usage:"dynamic",type:"uint8",data:D})}}}),y.length<this.passes.length){for(let T=y.length;T<this.passes.length;T++){let c=this.passes[T];c&&(c.colorBuffer.destroy(),c.positionBuffer.destroy(),c.dashTexture.destroy())}this.passes.length=y.length}let M=[];for(let T=0;T<this.passes.length;T++)this.passes[T]!==null&&M.push(this.passes[T]);return this.passes=M,this},x.prototype.destroy=function(){return this.passes.forEach(y=>{y.colorBuffer.destroy(),y.positionBuffer.destroy(),y.dashTexture.destroy()}),this.passes.length=0,this}}),Y7=Vt((Z,V)=>{var u=S0(),d=Bd(),E=U3(),A=_p(),t=af(),e=E0(),{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 f=a._gl,v,g,m,w,l,x,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return w=a.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),g=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=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}),c(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:(b,_)=>[_.viewport.x,_.viewport.y,b.viewportWidth,b.viewportHeight]},attributes:{color:{buffer:w,offset:(b,_)=>_.offset*4,divisor:1},position:{buffer:g,offset:(b,_)=>_.offset*8,divisor:1},positionFract:{buffer:m,offset:(b,_)=>_.offset*8,divisor:1},error:{buffer:l,offset:(b,_)=>_.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(k,{update:c,draw:M,destroy:h,regl:a,gl:f,canvas:f.canvas,groups:S}),k;function k(b){b?c(b):b===null&&h(),M()}function M(b){if(typeof b=="number")return T(b);b&&!Array.isArray(b)&&(b=[b]),a._refresh(),S.forEach((_,P)=>{if(_){if(b&&(b[P]?_.draw=!0:_.draw=!1),!_.draw){_.draw=!0;return}T(P)}})}function T(b){typeof b=="number"&&(b=S[b]),b!=null&&b&&b.count&&b.color&&b.opacity&&b.positions&&b.positions.length>1&&(b.scaleRatio=[b.scale[0]*b.viewport.width,b.scale[1]*b.viewport.height],v(b),b.after&&b.after(b))}function c(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let _=0,P=0;if(k.groups=S=b.map((B,R)=>{let I=S[R];if(B)typeof B=="function"?B={after:B}:typeof B[0]=="number"&&(B={positions:B});else return I;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"}),I||(S[R]=I={id:R,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},B=t({},y,B)),E(I,B,[{lineWidth:F=>+F*.5,capSize:F=>+F*.5,opacity:parseFloat,errors:F=>(F=e(F),P+=F.length,F),positions:(F,N)=>(F=e(F,"float64"),N.count=Math.floor(F.length/2),N.bounds=u(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=d(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:f.drawingBufferWidth,height:f.drawingBufferHeight},N}}]),I}),_||P){let B=S.reduce((N,j,G)=>N+(j?j.count:0),0),R=new Float64Array(B*2),I=new Uint8Array(B*4),F=new Float32Array(B*4);S.forEach((N,j)=>{if(!N)return;let{positions:G,count:rt,offset:ct,color:st,errors:et}=N;rt&&(I.set(st,ct*4),F.set(et,ct*4),R.set(G,ct*2))});var L=r(R);g(L);var D=i(R,L);m(D),w(I),l(F)}}function h(){g.destroy(),m.destroy(),w.destroy(),l.destroy(),x.destroy()}}}),X7=Vt((Z,V)=>{var u=/[\'\"]/;V.exports=function(d){return d?(u.test(d.charAt(0))&&(d=d.substr(1)),u.test(d.charAt(d.length-1))&&(d=d.substr(0,d.length-1)),d):""}}),e5=Vt((Z,V)=>{V.exports=["inherit","initial","unset"]}),r5=Vt((Z,V)=>{V.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),n5=Vt((Z,V)=>{V.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),a5=Vt((Z,V)=>{V.exports=["normal","italic","oblique"]}),i5=Vt((Z,V)=>{V.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),$7=Vt((Z,V)=>{function u(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 f=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),v=[];function g(m,w,l){var x=e.push(m.slice(s[0].length,-s[1].length))-1;return v.push(x),i+x+i}e.forEach(function(m,w){for(var l,x=0;m!=l;)if(l=m,m=m.replace(f,g),x++>1e4)throw Error("References have circular dependency. Please, check them.");e[w]=m}),v=v.reverse(),e=e.map(function(m){return v.forEach(function(w){m=m.replace(new RegExp("(\\"+i+w+"\\"+i+")","g"),s[0]+"$1"+s[1])}),m})});var o=new RegExp("\\"+i+"([0-9]+)\\"+i);function a(s,f,v){for(var g=[],m,w=0;m=o.exec(s);){if(w++>1e4)throw Error("Circular references in parenthesis");g.push(s.slice(0,m.index)),g.push(a(f[m[1]],f)),s=s.slice(m.index+m[0].length)}return g.push(s),g}return n?e:a(e[0],e)}function d(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(f,v){return Array.isArray(v)&&(v=v.reduce(s,"")),f+v},"");function a(s,f){if(A[f]==null)throw Error("Reference "+f+"is undefined");return A[f]}}function E(A,t){return Array.isArray(A)?d(A,t):u(A,t)}E.parse=u,E.stringify=d,V.exports=E}),J7=Vt((Z,V)=>{var u=$7();V.exports=function(d,E,A){if(d==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=u.parse(d,{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]=u.stringify(t,{flat:!0});return r}}),Q7=Vt((Z,V)=>{V.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),o5=Vt((Z,V)=>{var u=Q7();V.exports={isSize:function(d){return/^[\d\.]/.test(d)||d.indexOf("/")!==-1||u.indexOf(d)!==-1}}}),t9=Vt((Z,V)=>{var u=X7(),d=e5(),E=r5(),A=n5(),t=a5(),e=i5(),r=J7(),i=o5().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 f={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},v=r(s,/\s+/),g;g=v.shift();){if(d.indexOf(g)!==-1)return["style","variant","weight","stretch"].forEach(function(w){f[w]=g}),n[s]=f;if(t.indexOf(g)!==-1){f.style=g;continue}if(g==="normal"||g==="small-caps"){f.variant=g;continue}if(e.indexOf(g)!==-1){f.stretch=g;continue}if(A.indexOf(g)!==-1){f.weight=g;continue}if(i(g)){var m=r(g,"/");if(f.size=m[0],m[1]!=null?f.lineHeight=a(m[1]):v[0]==="/"&&(v.shift(),f.lineHeight=a(v.shift())),!v.length)throw new Error("Missing required font-family.");return f.family=r(v.join(" "),/\s*,\s*/).map(u),n[s]=f}throw new Error("Unknown or unsupported font token: "+g)}throw new Error("Missing required font-size.")}function a(s){var f=parseFloat(s);return f.toString()===s?f:s}}),s5=Vt((Z,V)=>{var u=_p(),d=o5().isSize,E=s(e5()),A=s(r5()),t=s(n5()),e=s(a5()),r=s(i5()),i={normal:1,"small-caps":1},n={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},o={size:"1rem",family:"serif"};V.exports=function(f){if(f=u(f,{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"}),f.system)return f.system&&a(f.system,A),f.system;if(a(f.style,e),a(f.variant,i),a(f.weight,t),a(f.stretch,r),f.size==null&&(f.size=o.size),typeof f.size=="number"&&(f.size+="px"),!d)throw Error("Bad size value `"+f.size+"`");f.family||(f.family=o.family),Array.isArray(f.family)&&(f.family.length||(f.family=[o.family]),f.family=f.family.map(function(g){return n[g]?g:'"'+g+'"'}).join(", "));var v=[];return v.push(f.style),f.variant!==f.style&&v.push(f.variant),f.weight!==f.variant&&f.weight!==f.style&&v.push(f.weight),f.stretch!==f.weight&&f.stretch!==f.variant&&f.stretch!==f.style&&v.push(f.stretch),v.push(f.size+(f.lineHeight==null||f.lineHeight==="normal"||f.lineHeight+""=="1"?"":"/"+f.lineHeight)),v.push(f.family),v.filter(Boolean).join(" ")};function a(f,v){if(f&&!v[f]&&!E[f])throw Error("Unknown keyword `"+f+"`");return f}function s(f){for(var v={},g=0;g<f.length;g++)v[f[g]]=1;return v}}),e9=Vt((Z,V)=>{V.exports={parse:t9(),stringify:s5()}}),r9=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?V.exports=d():u.createREGL=d()})(Z,function(){var u=function(ie,nr){for(var cr=Object.keys(nr),sn=0;sn<cr.length;++sn)ie[cr[sn]]=nr[cr[sn]];return ie},d=0,E=0,A=5,t=6;function e(ie,nr){this.id=d++,this.type=ie,this.data=nr}function r(ie){return ie.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(ie){if(ie.length===0)return[];var nr=ie.charAt(0),cr=ie.charAt(ie.length-1);if(ie.length>1&&nr===cr&&(nr==='"'||nr==="'"))return['"'+r(ie.substr(1,ie.length-2))+'"'];var sn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(ie);if(sn)return i(ie.substr(0,sn.index)).concat(i(sn[1])).concat(i(ie.substr(sn.index+sn[0].length)));var zn=ie.split(".");if(zn.length===1)return['"'+r(ie)+'"'];for(var Tn=[],qr=0;qr<zn.length;++qr)Tn=Tn.concat(i(zn[qr]));return Tn}function n(ie){return"["+i(ie).join("][")+"]"}function o(ie,nr){return new e(ie,n(nr+""))}function a(ie){return typeof ie=="function"&&!ie._reglType||ie instanceof e}function s(ie,nr){if(typeof ie=="function")return new e(E,ie);if(typeof ie=="number"||typeof ie=="boolean")return new e(A,ie);if(Array.isArray(ie))return new e(t,ie.map(function(cr,sn){return s(cr)}));if(ie instanceof e)return ie}var f={DynamicVariable:e,define:o,isDynamic:a,unbox:s,accessor:n},v={next:typeof requestAnimationFrame=="function"?function(ie){return requestAnimationFrame(ie)}:function(ie){return setTimeout(ie,16)},cancel:typeof cancelAnimationFrame=="function"?function(ie){return cancelAnimationFrame(ie)}:clearTimeout},g=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function m(){var ie={"":0},nr=[""];return{id:function(cr){var sn=ie[cr];return sn||(sn=ie[cr]=nr.length,nr.push(cr),sn)},str:function(cr){return nr[cr]}}}function w(ie,nr,cr){var sn=document.createElement("canvas");u(sn.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),ie.appendChild(sn),ie===document.body&&(sn.style.position="absolute",u(ie.style,{margin:0,padding:0}));function zn(){var Sn=window.innerWidth,sa=window.innerHeight;if(ie!==document.body){var ea=sn.getBoundingClientRect();Sn=ea.right-ea.left,sa=ea.bottom-ea.top}sn.width=cr*Sn,sn.height=cr*sa}var Tn;ie!==document.body&&typeof ResizeObserver=="function"?(Tn=new ResizeObserver(function(){setTimeout(zn)}),Tn.observe(ie)):window.addEventListener("resize",zn,!1);function qr(){Tn?Tn.disconnect():window.removeEventListener("resize",zn),ie.removeChild(sn)}return zn(),{canvas:sn,onDestroy:qr}}function l(ie,nr){function cr(sn){try{return ie.getContext(sn,nr)}catch{return null}}return cr("webgl")||cr("experimental-webgl")||cr("webgl-experimental")}function x(ie){return typeof ie.nodeName=="string"&&typeof ie.appendChild=="function"&&typeof ie.getBoundingClientRect=="function"}function y(ie){return typeof ie.drawArrays=="function"||typeof ie.drawElements=="function"}function S(ie){return typeof ie=="string"?ie.split():ie}function k(ie){return typeof ie=="string"?document.querySelector(ie):ie}function M(ie){var nr=ie||{},cr,sn,zn,Tn,qr={},Sn=[],sa=[],ea=typeof window>"u"?1:window.devicePixelRatio,ka=!1,Ka={},Va=function(Nr){},fa=function(){};if(typeof nr=="string"?cr=document.querySelector(nr):typeof nr=="object"&&(x(nr)?cr=nr:y(nr)?(Tn=nr,zn=Tn.canvas):("gl"in nr?Tn=nr.gl:"canvas"in nr?zn=k(nr.canvas):"container"in nr&&(sn=k(nr.container)),"attributes"in nr&&(qr=nr.attributes),"extensions"in nr&&(Sn=S(nr.extensions)),"optionalExtensions"in nr&&(sa=S(nr.optionalExtensions)),"onDone"in nr&&(Va=nr.onDone),"profile"in nr&&(ka=!!nr.profile),"pixelRatio"in nr&&(ea=+nr.pixelRatio),"cachedCode"in nr&&(Ka=nr.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?zn=cr:sn=cr),!Tn){if(!zn){var Un=w(sn||document.body,Va,ea);if(!Un)return null;zn=Un.canvas,fa=Un.onDestroy}qr.premultipliedAlpha===void 0&&(qr.premultipliedAlpha=!0),Tn=l(zn,qr)}return Tn?{gl:Tn,canvas:zn,container:sn,extensions:Sn,optionalExtensions:sa,pixelRatio:ea,profile:ka,cachedCode:Ka,onDone:Va,onDestroy:fa}:(fa(),Va("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function T(ie,nr){var cr={};function sn(qr){var Sn=qr.toLowerCase(),sa;try{sa=cr[Sn]=ie.getExtension(Sn)}catch{}return!!sa}for(var zn=0;zn<nr.extensions.length;++zn){var Tn=nr.extensions[zn];if(!sn(Tn))return nr.onDestroy(),nr.onDone('"'+Tn+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return nr.optionalExtensions.forEach(sn),{extensions:cr,restore:function(){Object.keys(cr).forEach(function(qr){if(cr[qr]&&!sn(qr))throw new Error("(regl): error restoring extension "+qr)})}}}function c(ie,nr){for(var cr=Array(ie),sn=0;sn<ie;++sn)cr[sn]=nr(sn);return cr}var h=5120,b=5121,_=5122,P=5123,L=5124,D=5125,B=5126;function R(ie){for(var nr=16;nr<=1<<28;nr*=16)if(ie<=nr)return nr;return 0}function I(ie){var nr,cr;return nr=(ie>65535)<<4,ie>>>=nr,cr=(ie>255)<<3,ie>>>=cr,nr|=cr,cr=(ie>15)<<2,ie>>>=cr,nr|=cr,cr=(ie>3)<<1,ie>>>=cr,nr|=cr,nr|ie>>1}function F(){var ie=c(8,function(){return[]});function nr(Tn){var qr=R(Tn),Sn=ie[I(qr)>>2];return Sn.length>0?Sn.pop():new ArrayBuffer(qr)}function cr(Tn){ie[I(Tn.byteLength)>>2].push(Tn)}function sn(Tn,qr){var Sn=null;switch(Tn){case h:Sn=new Int8Array(nr(qr),0,qr);break;case b:Sn=new Uint8Array(nr(qr),0,qr);break;case _:Sn=new Int16Array(nr(2*qr),0,qr);break;case P:Sn=new Uint16Array(nr(2*qr),0,qr);break;case L:Sn=new Int32Array(nr(4*qr),0,qr);break;case D:Sn=new Uint32Array(nr(4*qr),0,qr);break;case B:Sn=new Float32Array(nr(4*qr),0,qr);break;default:return null}return Sn.length!==qr?Sn.subarray(0,qr):Sn}function zn(Tn){cr(Tn.buffer)}return{alloc:nr,free:cr,allocType:sn,freeType:zn}}var N=F();N.zero=F();var j=3408,G=3410,rt=3411,ct=3412,st=3413,et=3414,K=3415,ot=33901,X=33902,Q=3379,ut=3386,J=34921,q=36347,it=36348,nt=35661,dt=35660,Tt=34930,wt=36349,It=34076,Ct=34024,Nt=7936,ee=7937,Jt=7938,te=35724,Kt=34047,mt=36063,bt=34852,vt=3553,Ut=34067,re=34069,Zt=33984,ue=6408,Me=5126,Ce=5121,We=36160,qe=36053,vr=36064,_r=16384,er=function(ie,nr){var cr=1;nr.ext_texture_filter_anisotropic&&(cr=ie.getParameter(Kt));var sn=1,zn=1;nr.webgl_draw_buffers&&(sn=ie.getParameter(bt),zn=ie.getParameter(mt));var Tn=!!nr.oes_texture_float;if(Tn){var qr=ie.createTexture();ie.bindTexture(vt,qr),ie.texImage2D(vt,0,ue,1,1,0,ue,Me,null);var Sn=ie.createFramebuffer();if(ie.bindFramebuffer(We,Sn),ie.framebufferTexture2D(We,vr,vt,qr,0),ie.bindTexture(vt,null),ie.checkFramebufferStatus(We)!==qe)Tn=!1;else{ie.viewport(0,0,1,1),ie.clearColor(1,0,0,1),ie.clear(_r);var sa=N.allocType(Me,4);ie.readPixels(0,0,1,1,ue,Me,sa),ie.getError()?Tn=!1:(ie.deleteFramebuffer(Sn),ie.deleteTexture(qr),Tn=sa[0]===1),N.freeType(sa)}}var ea=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ka=!0;if(!ea){var Ka=ie.createTexture(),Va=N.allocType(Ce,36);ie.activeTexture(Zt),ie.bindTexture(Ut,Ka),ie.texImage2D(re,0,ue,3,3,0,ue,Ce,Va),N.freeType(Va),ie.bindTexture(Ut,null),ie.deleteTexture(Ka),ka=!ie.getError()}return{colorBits:[ie.getParameter(G),ie.getParameter(rt),ie.getParameter(ct),ie.getParameter(st)],depthBits:ie.getParameter(et),stencilBits:ie.getParameter(K),subpixelBits:ie.getParameter(j),extensions:Object.keys(nr).filter(function(fa){return!!nr[fa]}),maxAnisotropic:cr,maxDrawbuffers:sn,maxColorAttachments:zn,pointSizeDims:ie.getParameter(ot),lineWidthDims:ie.getParameter(X),maxViewportDims:ie.getParameter(ut),maxCombinedTextureUnits:ie.getParameter(nt),maxCubeMapSize:ie.getParameter(It),maxRenderbufferSize:ie.getParameter(Ct),maxTextureUnits:ie.getParameter(Tt),maxTextureSize:ie.getParameter(Q),maxAttributes:ie.getParameter(J),maxVertexUniforms:ie.getParameter(q),maxVertexTextureUnits:ie.getParameter(dt),maxVaryingVectors:ie.getParameter(it),maxFragmentUniforms:ie.getParameter(wt),glsl:ie.getParameter(te),renderer:ie.getParameter(ee),vendor:ie.getParameter(Nt),version:ie.getParameter(Jt),readFloat:Tn,npotTextureCube:ka}},Mr=function(ie){return ie instanceof Uint8Array||ie instanceof Uint16Array||ie instanceof Uint32Array||ie instanceof Int8Array||ie instanceof Int16Array||ie instanceof Int32Array||ie instanceof Float32Array||ie instanceof Float64Array||ie instanceof Uint8ClampedArray};function Ir(ie){return!!ie&&typeof ie=="object"&&Array.isArray(ie.shape)&&Array.isArray(ie.stride)&&typeof ie.offset=="number"&&ie.shape.length===ie.stride.length&&(Array.isArray(ie.data)||Mr(ie.data))}var de=function(ie){return Object.keys(ie).map(function(nr){return ie[nr]})},Dt={shape:Ht,flatten:St};function qt(ie,nr,cr){for(var sn=0;sn<nr;++sn)cr[sn]=ie[sn]}function _t(ie,nr,cr,sn){for(var zn=0,Tn=0;Tn<nr;++Tn)for(var qr=ie[Tn],Sn=0;Sn<cr;++Sn)sn[zn++]=qr[Sn]}function lt(ie,nr,cr,sn,zn,Tn){for(var qr=Tn,Sn=0;Sn<nr;++Sn)for(var sa=ie[Sn],ea=0;ea<cr;++ea)for(var ka=sa[ea],Ka=0;Ka<sn;++Ka)zn[qr++]=ka[Ka]}function yt(ie,nr,cr,sn,zn){for(var Tn=1,qr=cr+1;qr<nr.length;++qr)Tn*=nr[qr];var Sn=nr[cr];if(nr.length-cr===4){var sa=nr[cr+1],ea=nr[cr+2],ka=nr[cr+3];for(qr=0;qr<Sn;++qr)lt(ie[qr],sa,ea,ka,sn,zn),zn+=Tn}else for(qr=0;qr<Sn;++qr)yt(ie[qr],nr,cr+1,sn,zn),zn+=Tn}function St(ie,nr,cr,sn){var zn=1;if(nr.length)for(var Tn=0;Tn<nr.length;++Tn)zn*=nr[Tn];else zn=0;var qr=sn||N.allocType(cr,zn);switch(nr.length){case 0:break;case 1:qt(ie,nr[0],qr);break;case 2:_t(ie,nr[0],nr[1],qr);break;case 3:lt(ie,nr[0],nr[1],nr[2],qr,0);break;default:yt(ie,nr,0,qr,0)}return qr}function Ht(ie){for(var nr=[],cr=ie;cr.length;cr=cr[0])nr.push(cr.length);return nr}var Yt={"[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},se=5120,ke=5122,Ee=5124,Ue=5121,ir=5123,ar=5125,Ye=5126,Er=5126,pn={int8:se,int16:ke,int32:Ee,uint8:Ue,uint16:ir,uint32:ar,float:Ye,float32:Er},dn=35048,bn=35040,Zn={dynamic:dn,stream:bn,static:35044},En=Dt.flatten,gn=Dt.shape,da=35044,ra=35040,Se=5121,Re=5126,Ze=[];Ze[5120]=1,Ze[5122]=2,Ze[5124]=4,Ze[5121]=1,Ze[5123]=2,Ze[5125]=4,Ze[5126]=4;function tr(ie){return Yt[Object.prototype.toString.call(ie)]|0}function zr(ie,nr){for(var cr=0;cr<nr.length;++cr)ie[cr]=nr[cr]}function tn(ie,nr,cr,sn,zn,Tn,qr){for(var Sn=0,sa=0;sa<cr;++sa)for(var ea=0;ea<sn;++ea)ie[Sn++]=nr[zn*sa+Tn*ea+qr]}function Yr(ie,nr,cr,sn){var zn=0,Tn={};function qr(Nr){this.id=zn++,this.buffer=ie.createBuffer(),this.type=Nr,this.usage=da,this.byteLength=0,this.dimension=1,this.dtype=Se,this.persistentData=null,cr.profile&&(this.stats={size:0})}qr.prototype.bind=function(){ie.bindBuffer(this.type,this.buffer)},qr.prototype.destroy=function(){Va(this)};var Sn=[];function sa(Nr,fn){var Xn=Sn.pop();return Xn||(Xn=new qr(Nr)),Xn.bind(),Ka(Xn,fn,ra,0,1,!1),Xn}function ea(Nr){Sn.push(Nr)}function ka(Nr,fn,Xn){Nr.byteLength=fn.byteLength,ie.bufferData(Nr.type,fn,Xn)}function Ka(Nr,fn,Xn,jn,kn,Ia){var ya;if(Nr.usage=Xn,Array.isArray(fn)){if(Nr.dtype=jn||Re,fn.length>0){var qa;if(Array.isArray(fn[0])){ya=gn(fn);for(var Rn=1,An=1;An<ya.length;++An)Rn*=ya[An];Nr.dimension=Rn,qa=En(fn,ya,Nr.dtype),ka(Nr,qa,Xn),Ia?Nr.persistentData=qa:N.freeType(qa)}else if(typeof fn[0]=="number"){Nr.dimension=kn;var Pa=N.allocType(Nr.dtype,fn.length);zr(Pa,fn),ka(Nr,Pa,Xn),Ia?Nr.persistentData=Pa:N.freeType(Pa)}else Mr(fn[0])&&(Nr.dimension=fn[0].length,Nr.dtype=jn||tr(fn[0])||Re,qa=En(fn,[fn.length,fn[0].length],Nr.dtype),ka(Nr,qa,Xn),Ia?Nr.persistentData=qa:N.freeType(qa))}}else if(Mr(fn))Nr.dtype=jn||tr(fn),Nr.dimension=kn,ka(Nr,fn,Xn),Ia&&(Nr.persistentData=new Uint8Array(new Uint8Array(fn.buffer)));else if(Ir(fn)){ya=fn.shape;var ba=fn.stride,aa=fn.offset,oa=0,Sa=0,_i=0,pi=0;ya.length===1?(oa=ya[0],Sa=1,_i=ba[0],pi=0):ya.length===2&&(oa=ya[0],Sa=ya[1],_i=ba[0],pi=ba[1]),Nr.dtype=jn||tr(fn.data)||Re,Nr.dimension=Sa;var Ma=N.allocType(Nr.dtype,oa*Sa);tn(Ma,fn.data,oa,Sa,_i,pi,aa),ka(Nr,Ma,Xn),Ia?Nr.persistentData=Ma:N.freeType(Ma)}else fn instanceof ArrayBuffer&&(Nr.dtype=Se,Nr.dimension=kn,ka(Nr,fn,Xn),Ia&&(Nr.persistentData=new Uint8Array(new Uint8Array(fn))))}function Va(Nr){nr.bufferCount--,sn(Nr);var fn=Nr.buffer;ie.deleteBuffer(fn),Nr.buffer=null,delete Tn[Nr.id]}function fa(Nr,fn,Xn,jn){nr.bufferCount++;var kn=new qr(fn);Tn[kn.id]=kn;function Ia(Rn){var An=da,Pa=null,ba=0,aa=0,oa=1;return Array.isArray(Rn)||Mr(Rn)||Ir(Rn)||Rn instanceof ArrayBuffer?Pa=Rn:typeof Rn=="number"?ba=Rn|0:Rn&&("data"in Rn&&(Pa=Rn.data),"usage"in Rn&&(An=Zn[Rn.usage]),"type"in Rn&&(aa=pn[Rn.type]),"dimension"in Rn&&(oa=Rn.dimension|0),"length"in Rn&&(ba=Rn.length|0)),kn.bind(),Pa?Ka(kn,Pa,An,aa,oa,jn):(ba&&ie.bufferData(kn.type,ba,An),kn.dtype=aa||Se,kn.usage=An,kn.dimension=oa,kn.byteLength=ba),cr.profile&&(kn.stats.size=kn.byteLength*Ze[kn.dtype]),Ia}function ya(Rn,An){ie.bufferSubData(kn.type,An,Rn)}function qa(Rn,An){var Pa=(An||0)|0,ba;if(kn.bind(),Mr(Rn)||Rn instanceof ArrayBuffer)ya(Rn,Pa);else if(Array.isArray(Rn)){if(Rn.length>0){if(typeof Rn[0]=="number"){var aa=N.allocType(kn.dtype,Rn.length);zr(aa,Rn),ya(aa,Pa),N.freeType(aa)}else if(Array.isArray(Rn[0])||Mr(Rn[0])){ba=gn(Rn);var oa=En(Rn,ba,kn.dtype);ya(oa,Pa),N.freeType(oa)}}}else if(Ir(Rn)){ba=Rn.shape;var Sa=Rn.stride,_i=0,pi=0,Ma=0,Na=0;ba.length===1?(_i=ba[0],pi=1,Ma=Sa[0],Na=0):ba.length===2&&(_i=ba[0],pi=ba[1],Ma=Sa[0],Na=Sa[1]);var ui=Array.isArray(Rn.data)?kn.dtype:tr(Rn.data),gi=N.allocType(ui,_i*pi);tn(gi,Rn.data,_i,pi,Ma,Na,Rn.offset),ya(gi,Pa),N.freeType(gi)}return Ia}return Xn||Ia(Nr),Ia._reglType="buffer",Ia._buffer=kn,Ia.subdata=qa,cr.profile&&(Ia.stats=kn.stats),Ia.destroy=function(){Va(kn)},Ia}function Un(){de(Tn).forEach(function(Nr){Nr.buffer=ie.createBuffer(),ie.bindBuffer(Nr.type,Nr.buffer),ie.bufferData(Nr.type,Nr.persistentData||Nr.byteLength,Nr.usage)})}return cr.profile&&(nr.getTotalBufferSize=function(){var Nr=0;return Object.keys(Tn).forEach(function(fn){Nr+=Tn[fn].stats.size}),Nr}),{create:fa,createStream:sa,destroyStream:ea,clear:function(){de(Tn).forEach(Va),Sn.forEach(Va)},getBuffer:function(Nr){return Nr&&Nr._buffer instanceof qr?Nr._buffer:null},restore:Un,_initBuffer:Ka}}var $r=0,In=0,Nn=1,Kn=1,$n=4,ia=4,Cn={points:$r,point:In,lines:Nn,line:Kn,triangles:$n,triangle:ia,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Fa=0,Ga=1,ve=4,ge=5120,dr=5121,br=5122,Tr=5123,mr=5124,kr=5125,Ur=34963,Or=35040,pe=35044;function Ke(ie,nr,cr,sn){var zn={},Tn=0,qr={uint8:dr,uint16:Tr};nr.oes_element_index_uint&&(qr.uint32=kr);function Sn(Un){this.id=Tn++,zn[this.id]=this,this.buffer=Un,this.primType=ve,this.vertCount=0,this.type=0}Sn.prototype.bind=function(){this.buffer.bind()};var sa=[];function ea(Un){var Nr=sa.pop();return Nr||(Nr=new Sn(cr.create(null,Ur,!0,!1)._buffer)),Ka(Nr,Un,Or,-1,-1,0,0),Nr}function ka(Un){sa.push(Un)}function Ka(Un,Nr,fn,Xn,jn,kn,Ia){Un.buffer.bind();var ya;if(Nr){var qa=Ia;!Ia&&(!Mr(Nr)||Ir(Nr)&&!Mr(Nr.data))&&(qa=nr.oes_element_index_uint?kr:Tr),cr._initBuffer(Un.buffer,Nr,fn,qa,3)}else ie.bufferData(Ur,kn,fn),Un.buffer.dtype=ya||dr,Un.buffer.usage=fn,Un.buffer.dimension=3,Un.buffer.byteLength=kn;if(ya=Ia,!Ia){switch(Un.buffer.dtype){case dr:case ge:ya=dr;break;case Tr:case br:ya=Tr;break;case kr:case mr:ya=kr;break}Un.buffer.dtype=ya}Un.type=ya;var Rn=jn;Rn<0&&(Rn=Un.buffer.byteLength,ya===Tr?Rn>>=1:ya===kr&&(Rn>>=2)),Un.vertCount=Rn;var An=Xn;if(Xn<0){An=ve;var Pa=Un.buffer.dimension;Pa===1&&(An=Fa),Pa===2&&(An=Ga),Pa===3&&(An=ve)}Un.primType=An}function Va(Un){sn.elementsCount--,delete zn[Un.id],Un.buffer.destroy(),Un.buffer=null}function fa(Un,Nr){var fn=cr.create(null,Ur,!0),Xn=new Sn(fn._buffer);sn.elementsCount++;function jn(kn){if(!kn)fn(),Xn.primType=ve,Xn.vertCount=0,Xn.type=dr;else if(typeof kn=="number")fn(kn),Xn.primType=ve,Xn.vertCount=kn|0,Xn.type=dr;else{var Ia=null,ya=pe,qa=-1,Rn=-1,An=0,Pa=0;Array.isArray(kn)||Mr(kn)||Ir(kn)?Ia=kn:("data"in kn&&(Ia=kn.data),"usage"in kn&&(ya=Zn[kn.usage]),"primitive"in kn&&(qa=Cn[kn.primitive]),"count"in kn&&(Rn=kn.count|0),"type"in kn&&(Pa=qr[kn.type]),"length"in kn?An=kn.length|0:(An=Rn,Pa===Tr||Pa===br?An*=2:(Pa===kr||Pa===mr)&&(An*=4))),Ka(Xn,Ia,ya,qa,Rn,An,Pa)}return jn}return jn(Un),jn._reglType="elements",jn._elements=Xn,jn.subdata=function(kn,Ia){return fn.subdata(kn,Ia),jn},jn.destroy=function(){Va(Xn)},jn}return{create:fa,createStream:ea,destroyStream:ka,getElements:function(Un){return typeof Un=="function"&&Un._elements instanceof Sn?Un._elements:null},clear:function(){de(zn).forEach(Va)}}}var xr=new Float32Array(1),Gr=new Uint32Array(xr.buffer),ln=5123;function wn(ie){for(var nr=N.allocType(ln,ie.length),cr=0;cr<ie.length;++cr)if(isNaN(ie[cr]))nr[cr]=65535;else if(ie[cr]===1/0)nr[cr]=31744;else if(ie[cr]===-1/0)nr[cr]=64512;else{xr[0]=ie[cr];var sn=Gr[0],zn=sn>>>31<<15,Tn=(sn<<1>>>24)-127,qr=sn>>13&1023;if(Tn<-24)nr[cr]=zn;else if(Tn<-14){var Sn=-14-Tn;nr[cr]=zn+(qr+1024>>Sn)}else Tn>15?nr[cr]=zn+31744:nr[cr]=zn+(Tn+15<<10)+qr}return nr}function rn(ie){return Array.isArray(ie)||Mr(ie)}var Qr=34467,vn=3553,Oa=34067,Qn=34069,Qa=6408,Ja=6406,wi=6407,ci=6409,Ti=6410,Ra=32854,Qi=32855,Hi=36194,Ho=32819,Ci=32820,zo=33635,qi=34042,qo=6402,Po=34041,hs=35904,Gi=35906,uo=36193,yi=33776,ao=33777,ts=33778,vs=33779,As=35986,_o=35987,Da=34798,li=35840,wo=35841,Ms=35842,Di=35843,_s=36196,No=5121,is=5123,al=5125,ii=5126,io=10242,co=10243,Is=10497,Wo=33071,Bi=33648,$s=10240,fl=10241,Jo=9728,us=9729,Ss=9984,Ls=9985,yl=9986,bu=9987,au=33170,fu=4352,Ec=4353,xc=4354,cs=34046,Gl=3317,zc=37440,Al=37441,xl=37443,Ml=37444,hu=33984,Fs=[Ss,yl,Ls,bu],_l=[0,ci,Ti,wi,Qa],Fo={};Fo[ci]=Fo[Ja]=Fo[qo]=1,Fo[Po]=Fo[Ti]=2,Fo[wi]=Fo[hs]=3,Fo[Qa]=Fo[Gi]=4;function bs(ie){return"[object "+ie+"]"}var Iu=bs("HTMLCanvasElement"),Nl=bs("OffscreenCanvas"),Hu=bs("CanvasRenderingContext2D"),qs=bs("ImageBitmap"),of=bs("HTMLImageElement"),Oo=bs("HTMLVideoElement"),vf=Object.keys(Yt).concat([Iu,Nl,Hu,qs,of,Oo]),os=[];os[No]=1,os[ii]=4,os[uo]=2,os[is]=2,os[al]=4;var Fi=[];Fi[Ra]=2,Fi[Qi]=2,Fi[Hi]=2,Fi[Po]=4,Fi[yi]=.5,Fi[ao]=.5,Fi[ts]=1,Fi[vs]=1,Fi[As]=.5,Fi[_o]=1,Fi[Da]=1,Fi[li]=.5,Fi[wo]=.25,Fi[Ms]=.5,Fi[Di]=.25,Fi[_s]=.5;function nc(ie){return Array.isArray(ie)&&(ie.length===0||typeof ie[0]=="number")}function pu(ie){if(!Array.isArray(ie))return!1;var nr=ie.length;return!(nr===0||!rn(ie[0]))}function ml(ie){return Object.prototype.toString.call(ie)}function Lc(ie){return ml(ie)===Iu}function qu(ie){return ml(ie)===Nl}function dc(ie){return ml(ie)===Hu}function bl(ie){return ml(ie)===qs}function Yc(ie){return ml(ie)===of}function Fc(ie){return ml(ie)===Oo}function mc(ie){if(!ie)return!1;var nr=ml(ie);return vf.indexOf(nr)>=0?!0:nc(ie)||pu(ie)||Ir(ie)}function Wu(ie){return Yt[Object.prototype.toString.call(ie)]|0}function Cc(ie,nr){var cr=nr.length;switch(ie.type){case No:case is:case al:case ii:var sn=N.allocType(ie.type,cr);sn.set(nr),ie.data=sn;break;case uo:ie.data=wn(nr);break}}function Ic(ie,nr){return N.allocType(ie.type===uo?ii:ie.type,nr)}function du(ie,nr){ie.type===uo?(ie.data=wn(nr),N.freeType(nr)):ie.data=nr}function Bc(ie,nr,cr,sn,zn,Tn){for(var qr=ie.width,Sn=ie.height,sa=ie.channels,ea=qr*Sn*sa,ka=Ic(ie,ea),Ka=0,Va=0;Va<Sn;++Va)for(var fa=0;fa<qr;++fa)for(var Un=0;Un<sa;++Un)ka[Ka++]=nr[cr*fa+sn*Va+zn*Un+Tn];du(ie,ka)}function Pu(ie,nr,cr,sn,zn,Tn){var qr;if(typeof Fi[ie]<"u"?qr=Fi[ie]:qr=Fo[ie]*os[nr],Tn&&(qr*=6),zn){for(var Sn=0,sa=cr;sa>=1;)Sn+=qr*sa*sa,sa/=2;return Sn}else return qr*cr*sn}function wu(ie,nr,cr,sn,zn,Tn,qr){var Sn={"don't care":fu,"dont care":fu,nice:xc,fast:Ec},sa={repeat:Is,clamp:Wo,mirror:Bi},ea={nearest:Jo,linear:us},ka=u({mipmap:bu,"nearest mipmap nearest":Ss,"linear mipmap nearest":Ls,"nearest mipmap linear":yl,"linear mipmap linear":bu},ea),Ka={none:0,browser:Ml},Va={uint8:No,rgba4:Ho,rgb565:zo,"rgb5 a1":Ci},fa={alpha:Ja,luminance:ci,"luminance alpha":Ti,rgb:wi,rgba:Qa,rgba4:Ra,"rgb5 a1":Qi,rgb565:Hi},Un={};nr.ext_srgb&&(fa.srgb=hs,fa.srgba=Gi),nr.oes_texture_float&&(Va.float32=Va.float=ii),nr.oes_texture_half_float&&(Va.float16=Va["half float"]=uo),nr.webgl_depth_texture&&(u(fa,{depth:qo,"depth stencil":Po}),u(Va,{uint16:is,uint32:al,"depth stencil":qi})),nr.webgl_compressed_texture_s3tc&&u(Un,{"rgb s3tc dxt1":yi,"rgba s3tc dxt1":ao,"rgba s3tc dxt3":ts,"rgba s3tc dxt5":vs}),nr.webgl_compressed_texture_atc&&u(Un,{"rgb atc":As,"rgba atc explicit alpha":_o,"rgba atc interpolated alpha":Da}),nr.webgl_compressed_texture_pvrtc&&u(Un,{"rgb pvrtc 4bppv1":li,"rgb pvrtc 2bppv1":wo,"rgba pvrtc 4bppv1":Ms,"rgba pvrtc 2bppv1":Di}),nr.webgl_compressed_texture_etc1&&(Un["rgb etc1"]=_s);var Nr=Array.prototype.slice.call(ie.getParameter(Qr));Object.keys(Un).forEach(function(U){var tt=Un[U];Nr.indexOf(tt)>=0&&(fa[U]=tt)});var fn=Object.keys(fa);cr.textureFormats=fn;var Xn=[];Object.keys(fa).forEach(function(U){var tt=fa[U];Xn[tt]=U});var jn=[];Object.keys(Va).forEach(function(U){var tt=Va[U];jn[tt]=U});var kn=[];Object.keys(ea).forEach(function(U){var tt=ea[U];kn[tt]=U});var Ia=[];Object.keys(ka).forEach(function(U){var tt=ka[U];Ia[tt]=U});var ya=[];Object.keys(sa).forEach(function(U){var tt=sa[U];ya[tt]=U});var qa=fn.reduce(function(U,tt){var Y=fa[tt];return Y===ci||Y===Ja||Y===ci||Y===Ti||Y===qo||Y===Po||nr.ext_srgb&&(Y===hs||Y===Gi)?U[Y]=Y:Y===Qi||tt.indexOf("rgba")>=0?U[Y]=Qa:U[Y]=wi,U},{});function Rn(){this.internalformat=Qa,this.format=Qa,this.type=No,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Ml,this.width=0,this.height=0,this.channels=0}function An(U,tt){U.internalformat=tt.internalformat,U.format=tt.format,U.type=tt.type,U.compressed=tt.compressed,U.premultiplyAlpha=tt.premultiplyAlpha,U.flipY=tt.flipY,U.unpackAlignment=tt.unpackAlignment,U.colorSpace=tt.colorSpace,U.width=tt.width,U.height=tt.height,U.channels=tt.channels}function Pa(U,tt){if(!(typeof tt!="object"||!tt)){if("premultiplyAlpha"in tt&&(U.premultiplyAlpha=tt.premultiplyAlpha),"flipY"in tt&&(U.flipY=tt.flipY),"alignment"in tt&&(U.unpackAlignment=tt.alignment),"colorSpace"in tt&&(U.colorSpace=Ka[tt.colorSpace]),"type"in tt){var Y=tt.type;U.type=Va[Y]}var ft=U.width,zt=U.height,Qt=U.channels,ne=!1;"shape"in tt?(ft=tt.shape[0],zt=tt.shape[1],tt.shape.length===3&&(Qt=tt.shape[2],ne=!0)):("radius"in tt&&(ft=zt=tt.radius),"width"in tt&&(ft=tt.width),"height"in tt&&(zt=tt.height),"channels"in tt&&(Qt=tt.channels,ne=!0)),U.width=ft|0,U.height=zt|0,U.channels=Qt|0;var Ft=!1;if("format"in tt){var $t=tt.format,he=U.internalformat=fa[$t];U.format=qa[he],$t in Va&&("type"in tt||(U.type=Va[$t])),$t in Un&&(U.compressed=!0),Ft=!0}!ne&&Ft?U.channels=Fo[U.format]:ne&&!Ft&&U.channels!==_l[U.format]&&(U.format=U.internalformat=_l[U.channels])}}function ba(U){ie.pixelStorei(zc,U.flipY),ie.pixelStorei(Al,U.premultiplyAlpha),ie.pixelStorei(xl,U.colorSpace),ie.pixelStorei(Gl,U.unpackAlignment)}function aa(){Rn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function oa(U,tt){var Y=null;if(mc(tt)?Y=tt:tt&&(Pa(U,tt),"x"in tt&&(U.xOffset=tt.x|0),"y"in tt&&(U.yOffset=tt.y|0),mc(tt.data)&&(Y=tt.data)),tt.copy){var ft=zn.viewportWidth,zt=zn.viewportHeight;U.width=U.width||ft-U.xOffset,U.height=U.height||zt-U.yOffset,U.needsCopy=!0}else if(!Y)U.width=U.width||1,U.height=U.height||1,U.channels=U.channels||4;else if(Mr(Y))U.channels=U.channels||4,U.data=Y,!("type"in tt)&&U.type===No&&(U.type=Wu(Y));else if(nc(Y))U.channels=U.channels||4,Cc(U,Y),U.alignment=1,U.needsFree=!0;else if(Ir(Y)){var Qt=Y.data;!Array.isArray(Qt)&&U.type===No&&(U.type=Wu(Qt));var ne=Y.shape,Ft=Y.stride,$t,he,Ne,Ie,Fe,He;ne.length===3?(Ne=ne[2],He=Ft[2]):(Ne=1,He=1),$t=ne[0],he=ne[1],Ie=Ft[0],Fe=Ft[1],U.alignment=1,U.width=$t,U.height=he,U.channels=Ne,U.format=U.internalformat=_l[Ne],U.needsFree=!0,Bc(U,Qt,Ie,Fe,He,Y.offset)}else if(Lc(Y)||qu(Y)||dc(Y))Lc(Y)||qu(Y)?U.element=Y:U.element=Y.canvas,U.width=U.element.width,U.height=U.element.height,U.channels=4;else if(bl(Y))U.element=Y,U.width=Y.width,U.height=Y.height,U.channels=4;else if(Yc(Y))U.element=Y,U.width=Y.naturalWidth,U.height=Y.naturalHeight,U.channels=4;else if(Fc(Y))U.element=Y,U.width=Y.videoWidth,U.height=Y.videoHeight,U.channels=4;else if(pu(Y)){var Ge=U.width||Y[0].length,Ae=U.height||Y.length,Oe=U.channels;rn(Y[0][0])?Oe=Oe||Y[0][0].length:Oe=Oe||1;for(var Le=Dt.shape(Y),ur=1,Dr=0;Dr<Le.length;++Dr)ur*=Le[Dr];var jr=Ic(U,ur);Dt.flatten(Y,Le,"",jr),du(U,jr),U.alignment=1,U.width=Ge,U.height=Ae,U.channels=Oe,U.format=U.internalformat=_l[Oe],U.needsFree=!0}U.type===ii||U.type}function Sa(U,tt,Y){var ft=U.element,zt=U.data,Qt=U.internalformat,ne=U.format,Ft=U.type,$t=U.width,he=U.height;ba(U),ft?ie.texImage2D(tt,Y,ne,ne,Ft,ft):U.compressed?ie.compressedTexImage2D(tt,Y,Qt,$t,he,0,zt):U.needsCopy?(sn(),ie.copyTexImage2D(tt,Y,ne,U.xOffset,U.yOffset,$t,he,0)):ie.texImage2D(tt,Y,ne,$t,he,0,ne,Ft,zt||null)}function _i(U,tt,Y,ft,zt){var Qt=U.element,ne=U.data,Ft=U.internalformat,$t=U.format,he=U.type,Ne=U.width,Ie=U.height;ba(U),Qt?ie.texSubImage2D(tt,zt,Y,ft,$t,he,Qt):U.compressed?ie.compressedTexSubImage2D(tt,zt,Y,ft,Ft,Ne,Ie,ne):U.needsCopy?(sn(),ie.copyTexSubImage2D(tt,zt,Y,ft,U.xOffset,U.yOffset,Ne,Ie)):ie.texSubImage2D(tt,zt,Y,ft,Ne,Ie,$t,he,ne)}var pi=[];function Ma(){return pi.pop()||new aa}function Na(U){U.needsFree&&N.freeType(U.data),aa.call(U),pi.push(U)}function ui(){Rn.call(this),this.genMipmaps=!1,this.mipmapHint=fu,this.mipmask=0,this.images=Array(16)}function gi(U,tt,Y){var ft=U.images[0]=Ma();U.mipmask=1,ft.width=U.width=tt,ft.height=U.height=Y,ft.channels=U.channels=4}function Ri(U,tt){var Y=null;if(mc(tt))Y=U.images[0]=Ma(),An(Y,U),oa(Y,tt),U.mipmask=1;else if(Pa(U,tt),Array.isArray(tt.mipmap))for(var ft=tt.mipmap,zt=0;zt<ft.length;++zt)Y=U.images[zt]=Ma(),An(Y,U),Y.width>>=zt,Y.height>>=zt,oa(Y,ft[zt]),U.mipmask|=1<<zt;else Y=U.images[0]=Ma(),An(Y,U),oa(Y,tt),U.mipmask=1;An(U,U.images[0]),U.compressed&&(U.internalformat===yi||U.internalformat===ao||U.internalformat===ts||U.internalformat)}function ds(U,tt){for(var Y=U.images,ft=0;ft<Y.length;++ft){if(!Y[ft])return;Sa(Y[ft],tt,ft)}}var rs=[];function Zi(){var U=rs.pop()||new ui;Rn.call(U),U.mipmask=0;for(var tt=0;tt<16;++tt)U.images[tt]=null;return U}function Zs(U){for(var tt=U.images,Y=0;Y<tt.length;++Y)tt[Y]&&Na(tt[Y]),tt[Y]=null;rs.push(U)}function Zo(){this.minFilter=Jo,this.magFilter=Jo,this.wrapS=Wo,this.wrapT=Wo,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=fu}function Qs(U,tt){if("min"in tt){var Y=tt.min;U.minFilter=ka[Y],Fs.indexOf(U.minFilter)>=0&&!("faces"in tt)&&(U.genMipmaps=!0)}if("mag"in tt){var ft=tt.mag;U.magFilter=ea[ft]}var zt=U.wrapS,Qt=U.wrapT;if("wrap"in tt){var ne=tt.wrap;typeof ne=="string"?zt=Qt=sa[ne]:Array.isArray(ne)&&(zt=sa[ne[0]],Qt=sa[ne[1]])}else{if("wrapS"in tt){var Ft=tt.wrapS;zt=sa[Ft]}if("wrapT"in tt){var $t=tt.wrapT;Qt=sa[$t]}}if(U.wrapS=zt,U.wrapT=Qt,"anisotropic"in tt&&(tt.anisotropic,U.anisotropic=tt.anisotropic),"mipmap"in tt){var he=!1;switch(typeof tt.mipmap){case"string":U.mipmapHint=Sn[tt.mipmap],U.genMipmaps=!0,he=!0;break;case"boolean":he=U.genMipmaps=tt.mipmap;break;case"object":U.genMipmaps=!1,he=!0;break}he&&!("min"in tt)&&(U.minFilter=Ss)}}function El(U,tt){ie.texParameteri(tt,fl,U.minFilter),ie.texParameteri(tt,$s,U.magFilter),ie.texParameteri(tt,io,U.wrapS),ie.texParameteri(tt,co,U.wrapT),nr.ext_texture_filter_anisotropic&&ie.texParameteri(tt,cs,U.anisotropic),U.genMipmaps&&(ie.hint(au,U.mipmapHint),ie.generateMipmap(tt))}var Cl=0,Hs={},js=cr.maxTextureUnits,Ks=Array(js).map(function(){return null});function Mi(U){Rn.call(this),this.mipmask=0,this.internalformat=Qa,this.id=Cl++,this.refCount=1,this.target=U,this.texture=ie.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Zo,qr.profile&&(this.stats={size:0})}function Ys(U){ie.activeTexture(hu),ie.bindTexture(U.target,U.texture)}function Uo(){var U=Ks[0];U?ie.bindTexture(U.target,U.texture):ie.bindTexture(vn,null)}function tl(U){var tt=U.texture,Y=U.unit,ft=U.target;Y>=0&&(ie.activeTexture(hu+Y),ie.bindTexture(ft,null),Ks[Y]=null),ie.deleteTexture(tt),U.texture=null,U.params=null,U.pixels=null,U.refCount=0,delete Hs[U.id],Tn.textureCount--}u(Mi.prototype,{bind:function(){var U=this;U.bindCount+=1;var tt=U.unit;if(tt<0){for(var Y=0;Y<js;++Y){var ft=Ks[Y];if(ft){if(ft.bindCount>0)continue;ft.unit=-1}Ks[Y]=U,tt=Y;break}qr.profile&&Tn.maxTextureUnits<tt+1&&(Tn.maxTextureUnits=tt+1),U.unit=tt,ie.activeTexture(hu+tt),ie.bindTexture(U.target,U.texture)}return tt},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&tl(this)}});function Il(U,tt){var Y=new Mi(vn);Hs[Y.id]=Y,Tn.textureCount++;function ft(ne,Ft){var $t=Y.texInfo;Zo.call($t);var he=Zi();return typeof ne=="number"?typeof Ft=="number"?gi(he,ne|0,Ft|0):gi(he,ne|0,ne|0):ne?(Qs($t,ne),Ri(he,ne)):gi(he,1,1),$t.genMipmaps&&(he.mipmask=(he.width<<1)-1),Y.mipmask=he.mipmask,An(Y,he),Y.internalformat=he.internalformat,ft.width=he.width,ft.height=he.height,Ys(Y),ds(he,vn),El($t,vn),Uo(),Zs(he),qr.profile&&(Y.stats.size=Pu(Y.internalformat,Y.type,he.width,he.height,$t.genMipmaps,!1)),ft.format=Xn[Y.internalformat],ft.type=jn[Y.type],ft.mag=kn[$t.magFilter],ft.min=Ia[$t.minFilter],ft.wrapS=ya[$t.wrapS],ft.wrapT=ya[$t.wrapT],ft}function zt(ne,Ft,$t,he){var Ne=Ft|0,Ie=$t|0,Fe=he|0,He=Ma();return An(He,Y),He.width=0,He.height=0,oa(He,ne),He.width=He.width||(Y.width>>Fe)-Ne,He.height=He.height||(Y.height>>Fe)-Ie,Ys(Y),_i(He,vn,Ne,Ie,Fe),Uo(),Na(He),ft}function Qt(ne,Ft){var $t=ne|0,he=Ft|0||$t;if($t===Y.width&&he===Y.height)return ft;ft.width=Y.width=$t,ft.height=Y.height=he,Ys(Y);for(var Ne=0;Y.mipmask>>Ne;++Ne){var Ie=$t>>Ne,Fe=he>>Ne;if(!Ie||!Fe)break;ie.texImage2D(vn,Ne,Y.format,Ie,Fe,0,Y.format,Y.type,null)}return Uo(),qr.profile&&(Y.stats.size=Pu(Y.internalformat,Y.type,$t,he,!1,!1)),ft}return ft(U,tt),ft.subimage=zt,ft.resize=Qt,ft._reglType="texture2d",ft._texture=Y,qr.profile&&(ft.stats=Y.stats),ft.destroy=function(){Y.decRef()},ft}function vi(U,tt,Y,ft,zt,Qt){var ne=new Mi(Oa);Hs[ne.id]=ne,Tn.cubeCount++;var Ft=new Array(6);function $t(Ie,Fe,He,Ge,Ae,Oe){var Le,ur=ne.texInfo;for(Zo.call(ur),Le=0;Le<6;++Le)Ft[Le]=Zi();if(typeof Ie=="number"||!Ie){var Dr=Ie|0||1;for(Le=0;Le<6;++Le)gi(Ft[Le],Dr,Dr)}else if(typeof Ie=="object")if(Fe)Ri(Ft[0],Ie),Ri(Ft[1],Fe),Ri(Ft[2],He),Ri(Ft[3],Ge),Ri(Ft[4],Ae),Ri(Ft[5],Oe);else if(Qs(ur,Ie),Pa(ne,Ie),"faces"in Ie){var jr=Ie.faces;for(Le=0;Le<6;++Le)An(Ft[Le],ne),Ri(Ft[Le],jr[Le])}else for(Le=0;Le<6;++Le)Ri(Ft[Le],Ie);for(An(ne,Ft[0]),ur.genMipmaps?ne.mipmask=(Ft[0].width<<1)-1:ne.mipmask=Ft[0].mipmask,ne.internalformat=Ft[0].internalformat,$t.width=Ft[0].width,$t.height=Ft[0].height,Ys(ne),Le=0;Le<6;++Le)ds(Ft[Le],Qn+Le);for(El(ur,Oa),Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,ur.genMipmaps,!0)),$t.format=Xn[ne.internalformat],$t.type=jn[ne.type],$t.mag=kn[ur.magFilter],$t.min=Ia[ur.minFilter],$t.wrapS=ya[ur.wrapS],$t.wrapT=ya[ur.wrapT],Le=0;Le<6;++Le)Zs(Ft[Le]);return $t}function he(Ie,Fe,He,Ge,Ae){var Oe=He|0,Le=Ge|0,ur=Ae|0,Dr=Ma();return An(Dr,ne),Dr.width=0,Dr.height=0,oa(Dr,Fe),Dr.width=Dr.width||(ne.width>>ur)-Oe,Dr.height=Dr.height||(ne.height>>ur)-Le,Ys(ne),_i(Dr,Qn+Ie,Oe,Le,ur),Uo(),Na(Dr),$t}function Ne(Ie){var Fe=Ie|0;if(Fe!==ne.width){$t.width=ne.width=Fe,$t.height=ne.height=Fe,Ys(ne);for(var He=0;He<6;++He)for(var Ge=0;ne.mipmask>>Ge;++Ge)ie.texImage2D(Qn+He,Ge,ne.format,Fe>>Ge,Fe>>Ge,0,ne.format,ne.type,null);return Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,!1,!0)),$t}}return $t(U,tt,Y,ft,zt,Qt),$t.subimage=he,$t.resize=Ne,$t._reglType="textureCube",$t._texture=ne,qr.profile&&($t.stats=ne.stats),$t.destroy=function(){ne.decRef()},$t}function lo(){for(var U=0;U<js;++U)ie.activeTexture(hu+U),ie.bindTexture(vn,null),Ks[U]=null;de(Hs).forEach(tl),Tn.cubeCount=0,Tn.textureCount=0}qr.profile&&(Tn.getTotalTextureSize=function(){var U=0;return Object.keys(Hs).forEach(function(tt){U+=Hs[tt].stats.size}),U});function ns(){for(var U=0;U<js;++U){var tt=Ks[U];tt&&(tt.bindCount=0,tt.unit=-1,Ks[U]=null)}de(Hs).forEach(function(Y){Y.texture=ie.createTexture(),ie.bindTexture(Y.target,Y.texture);for(var ft=0;ft<32;++ft)if((Y.mipmask&1<<ft)!==0)if(Y.target===vn)ie.texImage2D(vn,ft,Y.internalformat,Y.width>>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);else for(var zt=0;zt<6;++zt)ie.texImage2D(Qn+zt,ft,Y.internalformat,Y.width>>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);El(Y.texInfo,Y.target)})}function $o(){for(var U=0;U<js;++U){var tt=Ks[U];tt&&(tt.bindCount=0,tt.unit=-1,Ks[U]=null),ie.activeTexture(hu+U),ie.bindTexture(vn,null),ie.bindTexture(Oa,null)}}return{create2D:Il,createCube:vi,clear:lo,getTexture:function(U){return null},restore:ns,refresh:$o}}var wl=36161,Ju=32854,Pc=32855,Es=36194,_c=33189,sf=36168,Rc=34041,gc=35907,Nc=34836,Zl=34842,jc=34843,rl=[];rl[Ju]=2,rl[Pc]=2,rl[Es]=2,rl[_c]=2,rl[sf]=1,rl[Rc]=4,rl[gc]=4,rl[Nc]=16,rl[Zl]=8,rl[jc]=6;function Kl(ie,nr,cr){return rl[ie]*nr*cr}var Gu=function(ie,nr,cr,sn,zn){var Tn={rgba4:Ju,rgb565:Es,"rgb5 a1":Pc,depth:_c,stencil:sf,"depth stencil":Rc};nr.ext_srgb&&(Tn.srgba=gc),nr.ext_color_buffer_half_float&&(Tn.rgba16f=Zl,Tn.rgb16f=jc),nr.webgl_color_buffer_float&&(Tn.rgba32f=Nc);var qr=[];Object.keys(Tn).forEach(function(fa){var Un=Tn[fa];qr[Un]=fa});var Sn=0,sa={};function ea(fa){this.id=Sn++,this.refCount=1,this.renderbuffer=fa,this.format=Ju,this.width=0,this.height=0,zn.profile&&(this.stats={size:0})}ea.prototype.decRef=function(){--this.refCount<=0&&ka(this)};function ka(fa){var Un=fa.renderbuffer;ie.bindRenderbuffer(wl,null),ie.deleteRenderbuffer(Un),fa.renderbuffer=null,fa.refCount=0,delete sa[fa.id],sn.renderbufferCount--}function Ka(fa,Un){var Nr=new ea(ie.createRenderbuffer());sa[Nr.id]=Nr,sn.renderbufferCount++;function fn(jn,kn){var Ia=0,ya=0,qa=Ju;if(typeof jn=="object"&&jn){var Rn=jn;if("shape"in Rn){var An=Rn.shape;Ia=An[0]|0,ya=An[1]|0}else"radius"in Rn&&(Ia=ya=Rn.radius|0),"width"in Rn&&(Ia=Rn.width|0),"height"in Rn&&(ya=Rn.height|0);"format"in Rn&&(qa=Tn[Rn.format])}else typeof jn=="number"?(Ia=jn|0,typeof kn=="number"?ya=kn|0:ya=Ia):jn||(Ia=ya=1);if(!(Ia===Nr.width&&ya===Nr.height&&qa===Nr.format))return fn.width=Nr.width=Ia,fn.height=Nr.height=ya,Nr.format=qa,ie.bindRenderbuffer(wl,Nr.renderbuffer),ie.renderbufferStorage(wl,qa,Ia,ya),zn.profile&&(Nr.stats.size=Kl(Nr.format,Nr.width,Nr.height)),fn.format=qr[Nr.format],fn}function Xn(jn,kn){var Ia=jn|0,ya=kn|0||Ia;return Ia===Nr.width&&ya===Nr.height||(fn.width=Nr.width=Ia,fn.height=Nr.height=ya,ie.bindRenderbuffer(wl,Nr.renderbuffer),ie.renderbufferStorage(wl,Nr.format,Ia,ya),zn.profile&&(Nr.stats.size=Kl(Nr.format,Nr.width,Nr.height))),fn}return fn(fa,Un),fn.resize=Xn,fn._reglType="renderbuffer",fn._renderbuffer=Nr,zn.profile&&(fn.stats=Nr.stats),fn.destroy=function(){Nr.decRef()},fn}zn.profile&&(sn.getTotalRenderbufferSize=function(){var fa=0;return Object.keys(sa).forEach(function(Un){fa+=sa[Un].stats.size}),fa});function Va(){de(sa).forEach(function(fa){fa.renderbuffer=ie.createRenderbuffer(),ie.bindRenderbuffer(wl,fa.renderbuffer),ie.renderbufferStorage(wl,fa.format,fa.width,fa.height)}),ie.bindRenderbuffer(wl,null)}return{create:Ka,clear:function(){de(sa).forEach(ka)},restore:Va}},Bs=36160,Ou=36161,Rl=3553,Yl=34069,Ws=36064,ac=36096,Tu=36128,Zu=33306,bc=36193,lf=5121,Mf=5126,ic=6407,wc=6408,Fl=[];Fl[wc]=4,Fl[ic]=3;var oc=[];oc[lf]=1,oc[Mf]=4,oc[bc]=2;function iu(ie,nr,cr,sn,zn,Tn){var qr={cur:null,next:null,dirty:!1,setFBO:null},Sn=["rgba"],sa=["rgba4","rgb565","rgb5 a1"];nr.ext_srgb&&sa.push("srgba"),nr.ext_color_buffer_half_float&&sa.push("rgba16f","rgb16f"),nr.webgl_color_buffer_float&&sa.push("rgba32f");var ea=["uint8"];nr.oes_texture_half_float&&ea.push("half float","float16"),nr.oes_texture_float&&ea.push("float","float32");function ka(aa,oa,Sa){this.target=aa,this.texture=oa,this.renderbuffer=Sa;var _i=0,pi=0;oa?(_i=oa.width,pi=oa.height):Sa&&(_i=Sa.width,pi=Sa.height),this.width=_i,this.height=pi}function Ka(aa){aa&&(aa.texture&&aa.texture._texture.decRef(),aa.renderbuffer&&aa.renderbuffer._renderbuffer.decRef())}function Va(aa,oa,Sa){if(aa)if(aa.texture){var _i=aa.texture._texture;Math.max(1,_i.width),Math.max(1,_i.height),_i.refCount+=1}else{var pi=aa.renderbuffer._renderbuffer;pi.refCount+=1}}function fa(aa,oa){oa&&(oa.texture?ie.framebufferTexture2D(Bs,aa,oa.target,oa.texture._texture.texture,0):ie.framebufferRenderbuffer(Bs,aa,Ou,oa.renderbuffer._renderbuffer.renderbuffer))}function Un(aa){var oa=Rl,Sa=null,_i=null,pi=aa;typeof aa=="object"&&(pi=aa.data,"target"in aa&&(oa=aa.target|0));var Ma=pi._reglType;return Ma==="texture2d"||Ma==="textureCube"?Sa=pi:Ma==="renderbuffer"&&(_i=pi,oa=Ou),new ka(oa,Sa,_i)}function Nr(aa,oa,Sa,_i,pi){if(Sa){var Ma=sn.create2D({width:aa,height:oa,format:_i,type:pi});return Ma._texture.refCount=0,new ka(Rl,Ma,null)}else{var Na=zn.create({width:aa,height:oa,format:_i});return Na._renderbuffer.refCount=0,new ka(Ou,null,Na)}}function fn(aa){return aa&&(aa.texture||aa.renderbuffer)}function Xn(aa,oa,Sa){aa&&(aa.texture?aa.texture.resize(oa,Sa):aa.renderbuffer&&aa.renderbuffer.resize(oa,Sa),aa.width=oa,aa.height=Sa)}var jn=0,kn={};function Ia(){this.id=jn++,kn[this.id]=this,this.framebuffer=ie.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function ya(aa){aa.colorAttachments.forEach(Ka),Ka(aa.depthAttachment),Ka(aa.stencilAttachment),Ka(aa.depthStencilAttachment)}function qa(aa){var oa=aa.framebuffer;ie.deleteFramebuffer(oa),aa.framebuffer=null,Tn.framebufferCount--,delete kn[aa.id]}function Rn(aa){var oa;ie.bindFramebuffer(Bs,aa.framebuffer);var Sa=aa.colorAttachments;for(oa=0;oa<Sa.length;++oa)fa(Ws+oa,Sa[oa]);for(oa=Sa.length;oa<cr.maxColorAttachments;++oa)ie.framebufferTexture2D(Bs,Ws+oa,Rl,null,0);ie.framebufferTexture2D(Bs,Zu,Rl,null,0),ie.framebufferTexture2D(Bs,ac,Rl,null,0),ie.framebufferTexture2D(Bs,Tu,Rl,null,0),fa(ac,aa.depthAttachment),fa(Tu,aa.stencilAttachment),fa(Zu,aa.depthStencilAttachment),ie.checkFramebufferStatus(Bs),ie.isContextLost(),ie.bindFramebuffer(Bs,qr.next?qr.next.framebuffer:null),qr.cur=qr.next,ie.getError()}function An(aa,oa){var Sa=new Ia;Tn.framebufferCount++;function _i(Ma,Na){var ui,gi=0,Ri=0,ds=!0,rs=!0,Zi=null,Zs=!0,Zo="rgba",Qs="uint8",El=1,Cl=null,Hs=null,js=null,Ks=!1;if(typeof Ma=="number")gi=Ma|0,Ri=Na|0||gi;else if(!Ma)gi=Ri=1;else{var Mi=Ma;if("shape"in Mi){var Ys=Mi.shape;gi=Ys[0],Ri=Ys[1]}else"radius"in Mi&&(gi=Ri=Mi.radius),"width"in Mi&&(gi=Mi.width),"height"in Mi&&(Ri=Mi.height);("color"in Mi||"colors"in Mi)&&(Zi=Mi.color||Mi.colors,Array.isArray(Zi)),Zi||("colorCount"in Mi&&(El=Mi.colorCount|0),"colorTexture"in Mi&&(Zs=!!Mi.colorTexture,Zo="rgba4"),"colorType"in Mi&&(Qs=Mi.colorType,Zs||(Qs==="half float"||Qs==="float16"?Zo="rgba16f":(Qs==="float"||Qs==="float32")&&(Zo="rgba32f"))),"colorFormat"in Mi&&(Zo=Mi.colorFormat,Sn.indexOf(Zo)>=0?Zs=!0:sa.indexOf(Zo)>=0&&(Zs=!1))),("depthTexture"in Mi||"depthStencilTexture"in Mi)&&(Ks=!!(Mi.depthTexture||Mi.depthStencilTexture)),"depth"in Mi&&(typeof Mi.depth=="boolean"?ds=Mi.depth:(Cl=Mi.depth,rs=!1)),"stencil"in Mi&&(typeof Mi.stencil=="boolean"?rs=Mi.stencil:(Hs=Mi.stencil,ds=!1)),"depthStencil"in Mi&&(typeof Mi.depthStencil=="boolean"?ds=rs=Mi.depthStencil:(js=Mi.depthStencil,ds=!1,rs=!1))}var Uo=null,tl=null,Il=null,vi=null;if(Array.isArray(Zi))Uo=Zi.map(Un);else if(Zi)Uo=[Un(Zi)];else for(Uo=new Array(El),ui=0;ui<El;++ui)Uo[ui]=Nr(gi,Ri,Zs,Zo,Qs);for(gi=gi||Uo[0].width,Ri=Ri||Uo[0].height,Cl?tl=Un(Cl):ds&&!rs&&(tl=Nr(gi,Ri,Ks,"depth","uint32")),Hs?Il=Un(Hs):rs&&!ds&&(Il=Nr(gi,Ri,!1,"stencil","uint8")),js?vi=Un(js):!Cl&&!Hs&&rs&&ds&&(vi=Nr(gi,Ri,Ks,"depth stencil","depth stencil")),ui=0;ui<Uo.length;++ui)Va(Uo[ui]),Uo[ui]&&Uo[ui].texture&&Fl[Uo[ui].texture._texture.format]*oc[Uo[ui].texture._texture.type];return Va(tl),Va(Il),Va(vi),ya(Sa),Sa.width=gi,Sa.height=Ri,Sa.colorAttachments=Uo,Sa.depthAttachment=tl,Sa.stencilAttachment=Il,Sa.depthStencilAttachment=vi,_i.color=Uo.map(fn),_i.depth=fn(tl),_i.stencil=fn(Il),_i.depthStencil=fn(vi),_i.width=Sa.width,_i.height=Sa.height,Rn(Sa),_i}function pi(Ma,Na){var ui=Math.max(Ma|0,1),gi=Math.max(Na|0||ui,1);if(ui===Sa.width&&gi===Sa.height)return _i;for(var Ri=Sa.colorAttachments,ds=0;ds<Ri.length;++ds)Xn(Ri[ds],ui,gi);return Xn(Sa.depthAttachment,ui,gi),Xn(Sa.stencilAttachment,ui,gi),Xn(Sa.depthStencilAttachment,ui,gi),Sa.width=_i.width=ui,Sa.height=_i.height=gi,Rn(Sa),_i}return _i(aa,oa),u(_i,{resize:pi,_reglType:"framebuffer",_framebuffer:Sa,destroy:function(){qa(Sa),ya(Sa)},use:function(Ma){qr.setFBO({framebuffer:_i},Ma)}})}function Pa(aa){var oa=Array(6);function Sa(pi){var Ma,Na={color:null},ui=0,gi=null,Ri="rgba",ds="uint8",rs=1;if(typeof pi=="number")ui=pi|0;else if(!pi)ui=1;else{var Zi=pi;if("shape"in Zi){var Zs=Zi.shape;ui=Zs[0]}else"radius"in Zi&&(ui=Zi.radius|0),"width"in Zi?(ui=Zi.width|0,"height"in Zi):"height"in Zi&&(ui=Zi.height|0);("color"in Zi||"colors"in Zi)&&(gi=Zi.color||Zi.colors,Array.isArray(gi)),gi||("colorCount"in Zi&&(rs=Zi.colorCount|0),"colorType"in Zi&&(ds=Zi.colorType),"colorFormat"in Zi&&(Ri=Zi.colorFormat)),"depth"in Zi&&(Na.depth=Zi.depth),"stencil"in Zi&&(Na.stencil=Zi.stencil),"depthStencil"in Zi&&(Na.depthStencil=Zi.depthStencil)}var Zo;if(gi)if(Array.isArray(gi))for(Zo=[],Ma=0;Ma<gi.length;++Ma)Zo[Ma]=gi[Ma];else Zo=[gi];else{Zo=Array(rs);var Qs={radius:ui,format:Ri,type:ds};for(Ma=0;Ma<rs;++Ma)Zo[Ma]=sn.createCube(Qs)}for(Na.color=Array(Zo.length),Ma=0;Ma<Zo.length;++Ma){var El=Zo[Ma];ui=ui||El.width,Na.color[Ma]={target:Yl,data:Zo[Ma]}}for(Ma=0;Ma<6;++Ma){for(var Cl=0;Cl<Zo.length;++Cl)Na.color[Cl].target=Yl+Ma;Ma>0&&(Na.depth=oa[0].depth,Na.stencil=oa[0].stencil,Na.depthStencil=oa[0].depthStencil),oa[Ma]?oa[Ma](Na):oa[Ma]=An(Na)}return u(Sa,{width:ui,height:ui,color:Zo})}function _i(pi){var Ma,Na=pi|0;if(Na===Sa.width)return Sa;var ui=Sa.color;for(Ma=0;Ma<ui.length;++Ma)ui[Ma].resize(Na);for(Ma=0;Ma<6;++Ma)oa[Ma].resize(Na);return Sa.width=Sa.height=Na,Sa}return Sa(aa),u(Sa,{faces:oa,resize:_i,_reglType:"framebufferCube",destroy:function(){oa.forEach(function(pi){pi.destroy()})}})}function ba(){qr.cur=null,qr.next=null,qr.dirty=!0,de(kn).forEach(function(aa){aa.framebuffer=ie.createFramebuffer(),Rn(aa)})}return u(qr,{getFramebuffer:function(aa){if(typeof aa=="function"&&aa._reglType==="framebuffer"){var oa=aa._framebuffer;if(oa instanceof Ia)return oa}return null},create:An,createCube:Pa,clear:function(){de(kn).forEach(qa)},restore:ba})}var sc=5126,Tc=34962,ku=34963;function Gs(){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=sc,this.offset=0,this.stride=0,this.divisor=0}function Du(ie,nr,cr,sn,zn,Tn,qr){for(var Sn=cr.maxAttributes,sa=new Array(Sn),ea=0;ea<Sn;++ea)sa[ea]=new Gs;var ka=0,Ka={},Va={Record:Gs,scope:{},state:sa,currentVAO:null,targetVAO:null,restore:Un()?ya:function(){},createVAO:qa,getVAO:fn,destroyBuffer:fa,setVAO:Un()?Xn:jn,clear:Un()?kn:function(){}};function fa(Rn){for(var An=0;An<sa.length;++An){var Pa=sa[An];Pa.buffer===Rn&&(ie.disableVertexAttribArray(An),Pa.buffer=null)}}function Un(){return nr.oes_vertex_array_object}function Nr(){return nr.angle_instanced_arrays}function fn(Rn){return typeof Rn=="function"&&Rn._vao?Rn._vao:null}function Xn(Rn){if(Rn!==Va.currentVAO){var An=Un();Rn?An.bindVertexArrayOES(Rn.vao):An.bindVertexArrayOES(null),Va.currentVAO=Rn}}function jn(Rn){if(Rn!==Va.currentVAO){if(Rn)Rn.bindAttrs();else{for(var An=Nr(),Pa=0;Pa<sa.length;++Pa){var ba=sa[Pa];ba.buffer?(ie.enableVertexAttribArray(Pa),ba.buffer.bind(),ie.vertexAttribPointer(Pa,ba.size,ba.type,ba.normalized,ba.stride,ba.offfset),An&&ba.divisor&&An.vertexAttribDivisorANGLE(Pa,ba.divisor)):(ie.disableVertexAttribArray(Pa),ie.vertexAttrib4f(Pa,ba.x,ba.y,ba.z,ba.w))}qr.elements?ie.bindBuffer(ku,qr.elements.buffer.buffer):ie.bindBuffer(ku,null)}Va.currentVAO=Rn}}function kn(){de(Ka).forEach(function(Rn){Rn.destroy()})}function Ia(){this.id=++ka,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var Rn=Un();Rn?this.vao=Rn.createVertexArrayOES():this.vao=null,Ka[this.id]=this,this.buffers=[]}Ia.prototype.bindAttrs=function(){for(var Rn=Nr(),An=this.attributes,Pa=0;Pa<An.length;++Pa){var ba=An[Pa];ba.buffer?(ie.enableVertexAttribArray(Pa),ie.bindBuffer(Tc,ba.buffer.buffer),ie.vertexAttribPointer(Pa,ba.size,ba.type,ba.normalized,ba.stride,ba.offset),Rn&&ba.divisor&&Rn.vertexAttribDivisorANGLE(Pa,ba.divisor)):(ie.disableVertexAttribArray(Pa),ie.vertexAttrib4f(Pa,ba.x,ba.y,ba.z,ba.w))}for(var aa=An.length;aa<Sn;++aa)ie.disableVertexAttribArray(aa);var oa=Tn.getElements(this.elements);oa?ie.bindBuffer(ku,oa.buffer.buffer):ie.bindBuffer(ku,null)},Ia.prototype.refresh=function(){var Rn=Un();Rn&&(Rn.bindVertexArrayOES(this.vao),this.bindAttrs(),Va.currentVAO=null,Rn.bindVertexArrayOES(null))},Ia.prototype.destroy=function(){if(this.vao){var Rn=Un();this===Va.currentVAO&&(Va.currentVAO=null,Rn.bindVertexArrayOES(null)),Rn.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Ka[this.id]&&(delete Ka[this.id],sn.vaoCount-=1)};function ya(){var Rn=Un();Rn&&de(Ka).forEach(function(An){An.refresh()})}function qa(Rn){var An=new Ia;sn.vaoCount+=1;function Pa(ba){var aa;if(Array.isArray(ba))aa=ba,An.elements&&An.ownsElements&&An.elements.destroy(),An.elements=null,An.ownsElements=!1,An.offset=0,An.count=0,An.instances=-1,An.primitive=4;else{if(ba.elements){var oa=ba.elements;An.ownsElements?typeof oa=="function"&&oa._reglType==="elements"?(An.elements.destroy(),An.ownsElements=!1):(An.elements(oa),An.ownsElements=!1):Tn.getElements(ba.elements)?(An.elements=ba.elements,An.ownsElements=!1):(An.elements=Tn.create(ba.elements),An.ownsElements=!0)}else An.elements=null,An.ownsElements=!1;aa=ba.attributes,An.offset=0,An.count=-1,An.instances=-1,An.primitive=4,An.elements&&(An.count=An.elements._elements.vertCount,An.primitive=An.elements._elements.primType),"offset"in ba&&(An.offset=ba.offset|0),"count"in ba&&(An.count=ba.count|0),"instances"in ba&&(An.instances=ba.instances|0),"primitive"in ba&&(An.primitive=Cn[ba.primitive])}var Sa={},_i=An.attributes;_i.length=aa.length;for(var pi=0;pi<aa.length;++pi){var Ma=aa[pi],Na=_i[pi]=new Gs,ui=Ma.data||Ma;if(Array.isArray(ui)||Mr(ui)||Ir(ui)){var gi;An.buffers[pi]&&(gi=An.buffers[pi],Mr(ui)&&gi._buffer.byteLength>=ui.byteLength?gi.subdata(ui):(gi.destroy(),An.buffers[pi]=null)),An.buffers[pi]||(gi=An.buffers[pi]=zn.create(Ma,Tc,!1,!0)),Na.buffer=zn.getBuffer(gi),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1,Sa[pi]=1}else zn.getBuffer(Ma)?(Na.buffer=zn.getBuffer(Ma),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1):zn.getBuffer(Ma.buffer)?(Na.buffer=zn.getBuffer(Ma.buffer),Na.size=(+Ma.size||Na.buffer.dimension)|0,Na.normalized=!!Ma.normalized||!1,"type"in Ma?Na.type=pn[Ma.type]:Na.type=Na.buffer.dtype,Na.offset=(Ma.offset||0)|0,Na.stride=(Ma.stride||0)|0,Na.divisor=(Ma.divisor||0)|0,Na.state=1):"x"in Ma&&(Na.x=+Ma.x||0,Na.y=+Ma.y||0,Na.z=+Ma.z||0,Na.w=+Ma.w||0,Na.state=2)}for(var Ri=0;Ri<An.buffers.length;++Ri)!Sa[Ri]&&An.buffers[Ri]&&(An.buffers[Ri].destroy(),An.buffers[Ri]=null);return An.refresh(),Pa}return Pa.destroy=function(){for(var ba=0;ba<An.buffers.length;++ba)An.buffers[ba]&&An.buffers[ba].destroy();An.buffers.length=0,An.ownsElements&&(An.elements.destroy(),An.elements=null,An.ownsElements=!1),An.destroy()},Pa._vao=An,Pa._reglType="vao",Pa(Rn)}return Va}var Xl=35632,Xc=35633,Vs=35718,vc=35721;function Ku(ie,nr,cr,sn){var zn={},Tn={};function qr(Nr,fn,Xn,jn){this.name=Nr,this.id=fn,this.location=Xn,this.info=jn}function Sn(Nr,fn){for(var Xn=0;Xn<Nr.length;++Xn)if(Nr[Xn].id===fn.id){Nr[Xn].location=fn.location;return}Nr.push(fn)}function sa(Nr,fn,Xn){var jn=Nr===Xl?zn:Tn,kn=jn[fn];if(!kn){var Ia=nr.str(fn);kn=ie.createShader(Nr),ie.shaderSource(kn,Ia),ie.compileShader(kn),jn[fn]=kn}return kn}var ea={},ka=[],Ka=0;function Va(Nr,fn){this.id=Ka++,this.fragId=Nr,this.vertId=fn,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,sn.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function fa(Nr,fn,Xn){var jn,kn,Ia=sa(Xl,Nr.fragId),ya=sa(Xc,Nr.vertId),qa=Nr.program=ie.createProgram();if(ie.attachShader(qa,Ia),ie.attachShader(qa,ya),Xn)for(jn=0;jn<Xn.length;++jn){var Rn=Xn[jn];ie.bindAttribLocation(qa,Rn[0],Rn[1])}ie.linkProgram(qa);var An=ie.getProgramParameter(qa,Vs);sn.profile&&(Nr.stats.uniformsCount=An);var Pa=Nr.uniforms;for(jn=0;jn<An;++jn)if(kn=ie.getActiveUniform(qa,jn),kn)if(kn.size>1)for(var ba=0;ba<kn.size;++ba){var aa=kn.name.replace("[0]","["+ba+"]");Sn(Pa,new qr(aa,nr.id(aa),ie.getUniformLocation(qa,aa),kn))}else Sn(Pa,new qr(kn.name,nr.id(kn.name),ie.getUniformLocation(qa,kn.name),kn));var oa=ie.getProgramParameter(qa,vc);sn.profile&&(Nr.stats.attributesCount=oa);var Sa=Nr.attributes;for(jn=0;jn<oa;++jn)kn=ie.getActiveAttrib(qa,jn),kn&&Sn(Sa,new qr(kn.name,nr.id(kn.name),ie.getAttribLocation(qa,kn.name),kn))}sn.profile&&(cr.getMaxUniformsCount=function(){var Nr=0;return ka.forEach(function(fn){fn.stats.uniformsCount>Nr&&(Nr=fn.stats.uniformsCount)}),Nr},cr.getMaxAttributesCount=function(){var Nr=0;return ka.forEach(function(fn){fn.stats.attributesCount>Nr&&(Nr=fn.stats.attributesCount)}),Nr});function Un(){zn={},Tn={};for(var Nr=0;Nr<ka.length;++Nr)fa(ka[Nr],null,ka[Nr].attributes.map(function(fn){return[fn.location,fn.name]}))}return{clear:function(){var Nr=ie.deleteShader.bind(ie);de(zn).forEach(Nr),zn={},de(Tn).forEach(Nr),Tn={},ka.forEach(function(fn){ie.deleteProgram(fn.program)}),ka.length=0,ea={},cr.shaderCount=0},program:function(Nr,fn,Xn,jn){var kn=ea[fn];kn||(kn=ea[fn]={});var Ia=kn[Nr];if(Ia&&(Ia.refCount++,!jn))return Ia;var ya=new Va(fn,Nr);return cr.shaderCount++,fa(ya,Xn,jn),Ia||(kn[Nr]=ya),ka.push(ya),u(ya,{destroy:function(){if(ya.refCount--,ya.refCount<=0){ie.deleteProgram(ya.program);var qa=ka.indexOf(ya);ka.splice(qa,1),cr.shaderCount--}kn[ya.vertId].refCount<=0&&(ie.deleteShader(Tn[ya.vertId]),delete Tn[ya.vertId],delete ea[ya.fragId][ya.vertId]),Object.keys(ea[ya.fragId]).length||(ie.deleteShader(zn[ya.fragId]),delete zn[ya.fragId],delete ea[ya.fragId])}})},restore:Un,shader:sa,frag:-1,vert:-1}}var ou=6408,Qu=5121,Yu=3333,yc=5126;function uf(ie,nr,cr,sn,zn,Tn,qr){function Sn(ka){var Ka;nr.next===null?Ka=Qu:Ka=nr.next.colorAttachments[0].texture._texture.type;var Va=0,fa=0,Un=sn.framebufferWidth,Nr=sn.framebufferHeight,fn=null;Mr(ka)?fn=ka:ka&&(Va=ka.x|0,fa=ka.y|0,Un=(ka.width||sn.framebufferWidth-Va)|0,Nr=(ka.height||sn.framebufferHeight-fa)|0,fn=ka.data||null),cr();var Xn=Un*Nr*4;return fn||(Ka===Qu?fn=new Uint8Array(Xn):Ka===yc&&(fn=fn||new Float32Array(Xn))),ie.pixelStorei(Yu,4),ie.readPixels(Va,fa,Un,Nr,ou,Ka,fn),fn}function sa(ka){var Ka;return nr.setFBO({framebuffer:ka.framebuffer},function(){Ka=Sn(ka)}),Ka}function ea(ka){return!ka||!("framebuffer"in ka)?Sn(ka):sa(ka)}return ea}function zl(ie){return su(Uc(Fu(ie)))}function Uc(ie){return il(mn(Au(ie),ie.length*8))}function su(ie){for(var nr="0123456789abcdef",cr="",sn,zn=0;zn<ie.length;zn++)sn=ie.charCodeAt(zn),cr+=nr.charAt(sn>>>4&15)+nr.charAt(sn&15);return cr}function Fu(ie){for(var nr="",cr=-1,sn,zn;++cr<ie.length;)sn=ie.charCodeAt(cr),zn=cr+1<ie.length?ie.charCodeAt(cr+1):0,55296<=sn&&sn<=56319&&56320<=zn&&zn<=57343&&(sn=65536+((sn&1023)<<10)+(zn&1023),cr++),sn<=127?nr+=String.fromCharCode(sn):sn<=2047?nr+=String.fromCharCode(192|sn>>>6&31,128|sn&63):sn<=65535?nr+=String.fromCharCode(224|sn>>>12&15,128|sn>>>6&63,128|sn&63):sn<=2097151&&(nr+=String.fromCharCode(240|sn>>>18&7,128|sn>>>12&63,128|sn>>>6&63,128|sn&63));return nr}function Au(ie){for(var nr=Array(ie.length>>2),cr=0;cr<nr.length;cr++)nr[cr]=0;for(var cr=0;cr<ie.length*8;cr+=8)nr[cr>>5]|=(ie.charCodeAt(cr/8)&255)<<24-cr%32;return nr}function il(ie){for(var nr="",cr=0;cr<ie.length*32;cr+=8)nr+=String.fromCharCode(ie[cr>>5]>>>24-cr%32&255);return nr}function Cs(ie,nr){return ie>>>nr|ie<<32-nr}function Mu(ie,nr){return ie>>>nr}function lc(ie,nr,cr){return ie&nr^~ie&cr}function Su(ie,nr,cr){return ie&nr^ie&cr^nr&cr}function Oc(ie){return Cs(ie,2)^Cs(ie,13)^Cs(ie,22)}function Xe(ie){return Cs(ie,6)^Cs(ie,11)^Cs(ie,25)}function yr(ie){return Cs(ie,7)^Cs(ie,18)^Mu(ie,3)}function Kr(ie){return Cs(ie,17)^Cs(ie,19)^Mu(ie,10)}var Rr=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 mn(ie,nr){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),sn=new Array(64),zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr;for(ie[nr>>5]|=128<<24-nr%32,ie[(nr+64>>9<<4)+15]=nr,Va=0;Va<ie.length;Va+=16){for(zn=cr[0],Tn=cr[1],qr=cr[2],Sn=cr[3],sa=cr[4],ea=cr[5],ka=cr[6],Ka=cr[7],fa=0;fa<64;fa++)fa<16?sn[fa]=ie[fa+Va]:sn[fa]=Pn(Pn(Pn(Kr(sn[fa-2]),sn[fa-7]),yr(sn[fa-15])),sn[fa-16]),Un=Pn(Pn(Pn(Pn(Ka,Xe(sa)),lc(sa,ea,ka)),Rr[fa]),sn[fa]),Nr=Pn(Oc(zn),Su(zn,Tn,qr)),Ka=ka,ka=ea,ea=sa,sa=Pn(Sn,Un),Sn=qr,qr=Tn,Tn=zn,zn=Pn(Un,Nr);cr[0]=Pn(zn,cr[0]),cr[1]=Pn(Tn,cr[1]),cr[2]=Pn(qr,cr[2]),cr[3]=Pn(Sn,cr[3]),cr[4]=Pn(sa,cr[4]),cr[5]=Pn(ea,cr[5]),cr[6]=Pn(ka,cr[6]),cr[7]=Pn(Ka,cr[7])}return cr}function Pn(ie,nr){var cr=(ie&65535)+(nr&65535),sn=(ie>>16)+(nr>>16)+(cr>>16);return sn<<16|cr&65535}function ha(ie){return Array.prototype.slice.call(ie)}function Ta(ie){return ha(ie).join("")}function Ua(ie){var nr=ie&&ie.cache,cr=0,sn=[],zn=[],Tn=[];function qr(Un,Nr){var fn=Nr&&Nr.stable;if(!fn){for(var Xn=0;Xn<zn.length;++Xn)if(zn[Xn]===Un&&!Tn[Xn])return sn[Xn]}var jn="g"+cr++;return sn.push(jn),zn.push(Un),Tn.push(fn),jn}function Sn(){var Un=[];function Nr(){Un.push.apply(Un,ha(arguments))}var fn=[];function Xn(){var jn="v"+cr++;return fn.push(jn),arguments.length>0&&(Un.push(jn,"="),Un.push.apply(Un,ha(arguments)),Un.push(";")),jn}return u(Nr,{def:Xn,toString:function(){return Ta([fn.length>0?"var "+fn.join(",")+";":"",Ta(Un)])}})}function sa(){var Un=Sn(),Nr=Sn(),fn=Un.toString,Xn=Nr.toString;function jn(kn,Ia){Nr(kn,Ia,"=",Un.def(kn,Ia),";")}return u(function(){Un.apply(Un,ha(arguments))},{def:Un.def,entry:Un,exit:Nr,save:jn,set:function(kn,Ia,ya){jn(kn,Ia),Un(kn,Ia,"=",ya,";")},toString:function(){return fn()+Xn()}})}function ea(){var Un=Ta(arguments),Nr=sa(),fn=sa(),Xn=Nr.toString,jn=fn.toString;return u(Nr,{then:function(){return Nr.apply(Nr,ha(arguments)),this},else:function(){return fn.apply(fn,ha(arguments)),this},toString:function(){var kn=jn();return kn&&(kn="else{"+kn+"}"),Ta(["if(",Un,"){",Xn(),"}",kn])}})}var ka=Sn(),Ka={};function Va(Un,Nr){var fn=[];function Xn(){var qa="a"+fn.length;return fn.push(qa),qa}Nr=Nr||0;for(var jn=0;jn<Nr;++jn)Xn();var kn=sa(),Ia=kn.toString,ya=Ka[Un]=u(kn,{arg:Xn,toString:function(){return Ta(["function(",fn.join(),"){",Ia(),"}"])}});return ya}function fa(){var Un=['"use strict";',ka,"return {"];Object.keys(Ka).forEach(function(jn){Un.push('"',jn,'":',Ka[jn].toString(),",")}),Un.push("}");var Nr=Ta(Un).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),fn;if(nr&&(fn=zl(Nr),nr[fn]))return nr[fn].apply(null,zn);var Xn=Function.apply(null,sn.concat(Nr));return nr&&(nr[fn]=Xn),Xn.apply(null,zn)}return{global:ka,link:qr,block:Sn,proc:Va,scope:sa,cond:ea,compile:fa}}var Ya="xyzw".split(""),va=5121,Ba=1,za=2,ca=0,ei=1,Vi=2,Oi=3,Wi=4,Xi=5,ni=6,Za="dither",$i="blend.enable",Do="blend.color",ss="blend.equation",Ps="blend.func",ys="depth.enable",Os="depth.func",Yo="depth.range",ll="depth.mask",el="colorMask",Rs="cull.enable",bi="cull.face",so="frontFace",ws="lineWidth",fs="polygonOffset.enable",Ll="polygonOffset.offset",$l="sample.alpha",jl="sample.enable",Bu="sample.coverage",Jl="stencil.enable",Ru="stencil.mask",nl="stencil.func",Nu="stencil.opFront",Ui="stencil.opBack",fo="scissor.enable",Ql="scissor.box",ul="viewport",Dc="profile",Pt="framebuffer",z="vert",at="frag",xt="elements",kt="primitive",Lt="count",le="offset",xe="instances",Pe="vao",$e="Width",hr="Height",pr=Pt+$e,Br=Pt+hr,Jr=ul+$e,Rt=ul+hr,Gt="drawingBuffer",ae=Gt+$e,ce=Gt+hr,Te=[Ps,ss,nl,Nu,Ui,Bu,ul,Ql,Ll],ye=34962,ze=34963,rr=2884,fr=3042,gr=3024,Lr=2960,Hr=2929,nn=3089,cn=32823,Mn=32926,Jn=32928,_a=5126,xa=35664,La=35665,ai=35666,Ai=5124,mi=35667,Yi=35668,Go=35669,Xo=35670,po=35671,Qo=35672,Js=35673,Us=35674,To=35675,ko=35676,hl=35678,Sl=35680,tu=4,gt=1028,Et=1029,Xt=2304,fe=2305,me=32775,we=32776,Ve=519,je=7680,or=0,Cr=1,Sr=32774,Wr=513,an=36160,on=36064,ta={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},hn={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},Bn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Hn={cw:Xt,ccw:fe};function Yn(ie){return Array.isArray(ie)||Mr(ie)||Ir(ie)}function na(ie){return ie.sort(function(nr,cr){return nr===ul?-1:cr===ul?1:nr<cr?-1:1})}function _n(ie,nr,cr,sn){this.thisDep=ie,this.contextDep=nr,this.propDep=cr,this.append=sn}function Ha(ie){return ie&&!(ie.thisDep||ie.contextDep||ie.propDep)}function Wa(ie){return new _n(!1,!1,!1,ie)}function ri(ie,nr){var cr=ie.type;if(cr===ca){var sn=ie.data.length;return new _n(!0,sn>=1,sn>=2,nr)}else if(cr===Wi){var zn=ie.data;return new _n(zn.thisDep,zn.contextDep,zn.propDep,nr)}else{if(cr===Xi)return new _n(!1,!1,!1,nr);if(cr===ni){for(var Tn=!1,qr=!1,Sn=!1,sa=0;sa<ie.data.length;++sa){var ea=ie.data[sa];if(ea.type===ei)Sn=!0;else if(ea.type===Vi)qr=!0;else if(ea.type===Oi)Tn=!0;else if(ea.type===ca){Tn=!0;var ka=ea.data;ka>=1&&(qr=!0),ka>=2&&(Sn=!0)}else ea.type===Wi&&(Tn=Tn||ea.data.thisDep,qr=qr||ea.data.contextDep,Sn=Sn||ea.data.propDep)}return new _n(Tn,qr,Sn,nr)}else return new _n(cr===Oi,cr===Vi,cr===ei,nr)}}var xi=new _n(!1,!1,!1,function(){});function ki(ie,nr,cr,sn,zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr){var fn=ea.Record,Xn={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(Xn.min=me,Xn.max=we);var jn=cr.angle_instanced_arrays,kn=cr.webgl_draw_buffers,Ia=cr.oes_vertex_array_object,ya={dirty:!0,profile:Nr.profile},qa={},Rn=[],An={},Pa={};function ba(Ft){return Ft.replace(".","_")}function aa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),qa[Ne]=ya[Ne]=!!he,An[Ne]=$t}function oa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),Array.isArray(he)?(ya[Ne]=he.slice(),qa[Ne]=he.slice()):ya[Ne]=qa[Ne]=he,Pa[Ne]=$t}function Sa(Ft){return!!isNaN(Ft)}aa(Za,gr),aa($i,fr),oa(Do,"blendColor",[0,0,0,0]),oa(ss,"blendEquationSeparate",[Sr,Sr]),oa(Ps,"blendFuncSeparate",[Cr,or,Cr,or]),aa(ys,Hr,!0),oa(Os,"depthFunc",Wr),oa(Yo,"depthRange",[0,1]),oa(ll,"depthMask",!0),oa(el,el,[!0,!0,!0,!0]),aa(Rs,rr),oa(bi,"cullFace",Et),oa(so,so,fe),oa(ws,ws,1),aa(fs,cn),oa(Ll,"polygonOffset",[0,0]),aa($l,Mn),aa(jl,Jn),oa(Bu,"sampleCoverage",[1,!1]),aa(Jl,Lr),oa(Ru,"stencilMask",-1),oa(nl,"stencilFunc",[Ve,0,-1]),oa(Nu,"stencilOpSeparate",[gt,je,je,je]),oa(Ui,"stencilOpSeparate",[Et,je,je,je]),aa(fo,nn),oa(Ql,"scissor",[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]),oa(ul,ul,[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]);var _i={gl:ie,context:Va,strings:nr,next:qa,current:ya,draw:Ka,elements:Tn,buffer:zn,shader:ka,attributes:ea.state,vao:ea,uniforms:sa,framebuffer:Sn,extensions:cr,timer:fa,isBufferArgs:Yn},pi={primTypes:Cn,compareFuncs:hn,blendFuncs:ta,blendEquations:Xn,stencilOps:Bn,glTypes:pn,orientationType:Hn};kn&&(pi.backBuffer=[Et],pi.drawBuffer=c(sn.maxDrawbuffers,function(Ft){return Ft===0?[0]:c(Ft,function($t){return on+$t})}));var Ma=0;function Na(){var Ft=Ua({cache:Un}),$t=Ft.link,he=Ft.global;Ft.id=Ma++,Ft.batchId="0";var Ne=$t(_i),Ie=Ft.shared={props:"a0"};Object.keys(_i).forEach(function(Oe){Ie[Oe]=he.def(Ne,".",Oe)});var Fe=Ft.next={},He=Ft.current={};Object.keys(Pa).forEach(function(Oe){Array.isArray(ya[Oe])&&(Fe[Oe]=he.def(Ie.next,".",Oe),He[Oe]=he.def(Ie.current,".",Oe))});var Ge=Ft.constants={};Object.keys(pi).forEach(function(Oe){Ge[Oe]=he.def(JSON.stringify(pi[Oe]))}),Ft.invoke=function(Oe,Le){switch(Le.type){case ca:var ur=["this",Ie.context,Ie.props,Ft.batchId];return Oe.def($t(Le.data),".call(",ur.slice(0,Math.max(Le.data.length+1,4)),")");case ei:return Oe.def(Ie.props,Le.data);case Vi:return Oe.def(Ie.context,Le.data);case Oi:return Oe.def("this",Le.data);case Wi:return Le.data.append(Ft,Oe),Le.data.ref;case Xi:return Le.data.toString();case ni:return Le.data.map(function(Dr){return Ft.invoke(Oe,Dr)})}},Ft.attribCache={};var Ae={};return Ft.scopeAttrib=function(Oe){var Le=nr.id(Oe);if(Le in Ae)return Ae[Le];var ur=ea.scope[Le];ur||(ur=ea.scope[Le]=new fn);var Dr=Ae[Le]=$t(ur);return Dr},Ft}function ui(Ft){var $t=Ft.static,he=Ft.dynamic,Ne;if(Dc in $t){var Ie=!!$t[Dc];Ne=Wa(function(He,Ge){return Ie}),Ne.enable=Ie}else if(Dc in he){var Fe=he[Dc];Ne=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}return Ne}function gi(Ft,$t){var he=Ft.static,Ne=Ft.dynamic;if(Pt in he){var Ie=he[Pt];return Ie?(Ie=Sn.getFramebuffer(Ie),Wa(function(He,Ge){var Ae=He.link(Ie),Oe=He.shared;Ge.set(Oe.framebuffer,".next",Ae);var Le=Oe.context;return Ge.set(Le,"."+pr,Ae+".width"),Ge.set(Le,"."+Br,Ae+".height"),Ae})):Wa(function(He,Ge){var Ae=He.shared;Ge.set(Ae.framebuffer,".next","null");var Oe=Ae.context;return Ge.set(Oe,"."+pr,Oe+"."+ae),Ge.set(Oe,"."+Br,Oe+"."+ce),"null"})}else if(Pt in Ne){var Fe=Ne[Pt];return ri(Fe,function(He,Ge){var Ae=He.invoke(Ge,Fe),Oe=He.shared,Le=Oe.framebuffer,ur=Ge.def(Le,".getFramebuffer(",Ae,")");Ge.set(Le,".next",ur);var Dr=Oe.context;return Ge.set(Dr,"."+pr,ur+"?"+ur+".width:"+Dr+"."+ae),Ge.set(Dr,"."+Br,ur+"?"+ur+".height:"+Dr+"."+ce),ur})}else return null}function Ri(Ft,$t,he){var Ne=Ft.static,Ie=Ft.dynamic;function Fe(Ae){if(Ae in Ne){var Oe=Ne[Ae],Le=!0,ur=Oe.x|0,Dr=Oe.y|0,jr,On;return"width"in Oe?jr=Oe.width|0:Le=!1,"height"in Oe?On=Oe.height|0:Le=!1,new _n(!Le&&$t&&$t.thisDep,!Le&&$t&&$t.contextDep,!Le&&$t&&$t.propDep,function(Wn,Dn){var la=Wn.shared.context,qn=jr;"width"in Oe||(qn=Dn.def(la,".",pr,"-",ur));var Gn=On;return"height"in Oe||(Gn=Dn.def(la,".",Br,"-",Dr)),[ur,Dr,qn,Gn]})}else if(Ae in Ie){var Ln=Ie[Ae],xn=ri(Ln,function(Wn,Dn){var la=Wn.invoke(Dn,Ln),qn=Wn.shared.context,Gn=Dn.def(la,".x|0"),ma=Dn.def(la,".y|0"),ti=Dn.def('"width" in ',la,"?",la,".width|0:","(",qn,".",pr,"-",Gn,")"),si=Dn.def('"height" in ',la,"?",la,".height|0:","(",qn,".",Br,"-",ma,")");return[Gn,ma,ti,si]});return $t&&(xn.thisDep=xn.thisDep||$t.thisDep,xn.contextDep=xn.contextDep||$t.contextDep,xn.propDep=xn.propDep||$t.propDep),xn}else return $t?new _n($t.thisDep,$t.contextDep,$t.propDep,function(Wn,Dn){var la=Wn.shared.context;return[0,0,Dn.def(la,".",pr),Dn.def(la,".",Br)]}):null}var He=Fe(ul);if(He){var Ge=He;He=new _n(He.thisDep,He.contextDep,He.propDep,function(Ae,Oe){var Le=Ge.append(Ae,Oe),ur=Ae.shared.context;return Oe.set(ur,"."+Jr,Le[2]),Oe.set(ur,"."+Rt,Le[3]),Le})}return{viewport:He,scissor_box:Fe(Ql)}}function ds(Ft,$t){var he=Ft.static,Ne=typeof he[at]=="string"&&typeof he[z]=="string";if(Ne){if(Object.keys($t.dynamic).length>0)return null;var Ie=$t.static,Fe=Object.keys(Ie);if(Fe.length>0&&typeof Ie[Fe[0]]=="number"){for(var He=[],Ge=0;Ge<Fe.length;++Ge)He.push([Ie[Fe[Ge]]|0,Fe[Ge]]);return He}}return null}function rs(Ft,$t,he){var Ne=Ft.static,Ie=Ft.dynamic;function Fe(Le){if(Le in Ne){var ur=nr.id(Ne[Le]),Dr=Wa(function(){return ur});return Dr.id=ur,Dr}else if(Le in Ie){var jr=Ie[Le];return ri(jr,function(On,Ln){var xn=On.invoke(Ln,jr),Wn=Ln.def(On.shared.strings,".id(",xn,")");return Wn})}return null}var He=Fe(at),Ge=Fe(z),Ae=null,Oe;return Ha(He)&&Ha(Ge)?(Ae=ka.program(Ge.id,He.id,null,he),Oe=Wa(function(Le,ur){return Le.link(Ae)})):Oe=new _n(He&&He.thisDep||Ge&&Ge.thisDep,He&&He.contextDep||Ge&&Ge.contextDep,He&&He.propDep||Ge&&Ge.propDep,function(Le,ur){var Dr=Le.shared.shader,jr;He?jr=He.append(Le,ur):jr=ur.def(Dr,".",at);var On;Ge?On=Ge.append(Le,ur):On=ur.def(Dr,".",z);var Ln=Dr+".program("+On+","+jr;return ur.def(Ln+")")}),{frag:He,vert:Ge,progVar:Oe,program:Ae}}function Zi(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={},Fe=!1;function He(){if(Pe in he){var Dn=he[Pe];return Dn!==null&&ea.getVAO(Dn)===null&&(Dn=ea.createVAO(Dn)),Fe=!0,Ie.vao=Dn,Wa(function(qn){var Gn=ea.getVAO(Dn);return Gn?qn.link(Gn):"null"})}else if(Pe in Ne){Fe=!0;var la=Ne[Pe];return ri(la,function(qn,Gn){var ma=qn.invoke(Gn,la);return Gn.def(qn.shared.vao+".getVAO("+ma+")")})}return null}var Ge=He(),Ae=!1;function Oe(){if(xt in he){var Dn=he[xt];if(Ie.elements=Dn,Yn(Dn)){var la=Ie.elements=Tn.create(Dn,!0);Dn=Tn.getElements(la),Ae=!0}else Dn&&(Dn=Tn.getElements(Dn),Ae=!0);var qn=Wa(function(ma,ti){if(Dn){var si=ma.link(Dn);return ma.ELEMENTS=si,si}return ma.ELEMENTS=null,null});return qn.value=Dn,qn}else if(xt in Ne){Ae=!0;var Gn=Ne[xt];return ri(Gn,function(ma,ti){var si=ma.shared,Li=si.isBufferArgs,to=si.elements,ls=ma.invoke(ti,Gn),ms=ti.def("null"),Ko=ti.def(Li,"(",ls,")"),gs=ma.cond(Ko).then(ms,"=",to,".createStream(",ls,");").else(ms,"=",to,".getElements(",ls,");");return ti.entry(gs),ti.exit(ma.cond(Ko).then(to,".destroyStream(",ms,");")),ma.ELEMENTS=ms,ms})}else if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ma,ti){return ti.def(ma.shared.vao+".currentVAO?"+ma.shared.elements+".getElements("+ma.shared.vao+".currentVAO.elements):null")});return null}var Le=Oe();function ur(){if(kt in he){var Dn=he[kt];return Ie.primitive=Dn,Wa(function(qn,Gn){return Cn[Dn]})}else if(kt in Ne){var la=Ne[kt];return ri(la,function(qn,Gn){var ma=qn.constants.primTypes,ti=qn.invoke(Gn,la);return Gn.def(ma,"[",ti,"]")})}else{if(Ae)return Ha(Le)?Le.value?Wa(function(qn,Gn){return Gn.def(qn.ELEMENTS,".primType")}):Wa(function(){return tu}):new _n(Le.thisDep,Le.contextDep,Le.propDep,function(qn,Gn){var ma=qn.ELEMENTS;return Gn.def(ma,"?",ma,".primType:",tu)});if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(qn,Gn){return Gn.def(qn.shared.vao+".currentVAO?"+qn.shared.vao+".currentVAO.primitive:"+tu)})}return null}function Dr(Dn,la){if(Dn in he){var qn=he[Dn]|0;return la?Ie.offset=qn:Ie.instances=qn,Wa(function(ma,ti){return la&&(ma.OFFSET=qn),qn})}else if(Dn in Ne){var Gn=Ne[Dn];return ri(Gn,function(ma,ti){var si=ma.invoke(ti,Gn);return la&&(ma.OFFSET=si),si})}else if(la){if(Ae)return Wa(function(ma,ti){return ma.OFFSET=0,0});if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ma,ti){return ti.def(ma.shared.vao+".currentVAO?"+ma.shared.vao+".currentVAO.offset:0")})}else if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ma,ti){return ti.def(ma.shared.vao+".currentVAO?"+ma.shared.vao+".currentVAO.instances:-1")});return null}var jr=Dr(le,!0);function On(){if(Lt in he){var Dn=he[Lt]|0;return Ie.count=Dn,Wa(function(){return Dn})}else if(Lt in Ne){var la=Ne[Lt];return ri(la,function(ti,si){var Li=ti.invoke(si,la);return Li})}else if(Ae)if(Ha(Le)){if(Le)return jr?new _n(jr.thisDep,jr.contextDep,jr.propDep,function(ti,si){var Li=si.def(ti.ELEMENTS,".vertCount-",ti.OFFSET);return Li}):Wa(function(ti,si){return si.def(ti.ELEMENTS,".vertCount")});var qn=Wa(function(){return-1});return qn}else{var Gn=new _n(Le.thisDep||jr.thisDep,Le.contextDep||jr.contextDep,Le.propDep||jr.propDep,function(ti,si){var Li=ti.ELEMENTS;return ti.OFFSET?si.def(Li,"?",Li,".vertCount-",ti.OFFSET,":-1"):si.def(Li,"?",Li,".vertCount:-1")});return Gn}else if(Fe){var ma=new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ti,si){return si.def(ti.shared.vao,".currentVAO?",ti.shared.vao,".currentVAO.count:-1")});return ma}return null}var Ln=ur(),xn=On(),Wn=Dr(xe,!1);return{elements:Le,primitive:Ln,count:xn,instances:Wn,offset:jr,vao:Ge,vaoActive:Fe,elementsActive:Ae,static:Ie}}function Zs(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={};return Rn.forEach(function(Fe){var He=ba(Fe);function Ge(Ae,Oe){if(Fe in he){var Le=Ae(he[Fe]);Ie[He]=Wa(function(){return Le})}else if(Fe in Ne){var ur=Ne[Fe];Ie[He]=ri(ur,function(Dr,jr){return Oe(Dr,jr,Dr.invoke(jr,ur))})}}switch(Fe){case Rs:case $i:case Za:case Jl:case ys:case fo:case fs:case $l:case jl:case ll:return Ge(function(Ae){return Ae},function(Ae,Oe,Le){return Le});case Os:return Ge(function(Ae){return hn[Ae]},function(Ae,Oe,Le){var ur=Ae.constants.compareFuncs;return Oe.def(ur,"[",Le,"]")});case Yo:return Ge(function(Ae){return Ae},function(Ae,Oe,Le){var ur=Oe.def("+",Le,"[0]"),Dr=Oe.def("+",Le,"[1]");return[ur,Dr]});case Ps:return Ge(function(Ae){var Oe="srcRGB"in Ae?Ae.srcRGB:Ae.src,Le="srcAlpha"in Ae?Ae.srcAlpha:Ae.src,ur="dstRGB"in Ae?Ae.dstRGB:Ae.dst,Dr="dstAlpha"in Ae?Ae.dstAlpha:Ae.dst;return[ta[Oe],ta[ur],ta[Le],ta[Dr]]},function(Ae,Oe,Le){var ur=Ae.constants.blendFuncs;function Dr(la,qn){var Gn=Oe.def('"',la,qn,'" in ',Le,"?",Le,".",la,qn,":",Le,".",la);return Gn}var jr=Dr("src","RGB"),On=Dr("dst","RGB"),Ln=Oe.def(ur,"[",jr,"]"),xn=Oe.def(ur,"[",Dr("src","Alpha"),"]"),Wn=Oe.def(ur,"[",On,"]"),Dn=Oe.def(ur,"[",Dr("dst","Alpha"),"]");return[Ln,Wn,xn,Dn]});case ss:return Ge(function(Ae){if(typeof Ae=="string")return[Xn[Ae],Xn[Ae]];if(typeof Ae=="object")return[Xn[Ae.rgb],Xn[Ae.alpha]]},function(Ae,Oe,Le){var ur=Ae.constants.blendEquations,Dr=Oe.def(),jr=Oe.def(),On=Ae.cond("typeof ",Le,'==="string"');return On.then(Dr,"=",jr,"=",ur,"[",Le,"];"),On.else(Dr,"=",ur,"[",Le,".rgb];",jr,"=",ur,"[",Le,".alpha];"),Oe(On),[Dr,jr]});case Do:return Ge(function(Ae){return c(4,function(Oe){return+Ae[Oe]})},function(Ae,Oe,Le){return c(4,function(ur){return Oe.def("+",Le,"[",ur,"]")})});case Ru:return Ge(function(Ae){return Ae|0},function(Ae,Oe,Le){return Oe.def(Le,"|0")});case nl:return Ge(function(Ae){var Oe=Ae.cmp||"keep",Le=Ae.ref||0,ur="mask"in Ae?Ae.mask:-1;return[hn[Oe],Le,ur]},function(Ae,Oe,Le){var ur=Ae.constants.compareFuncs,Dr=Oe.def('"cmp" in ',Le,"?",ur,"[",Le,".cmp]",":",je),jr=Oe.def(Le,".ref|0"),On=Oe.def('"mask" in ',Le,"?",Le,".mask|0:-1");return[Dr,jr,On]});case Nu:case Ui:return Ge(function(Ae){var Oe=Ae.fail||"keep",Le=Ae.zfail||"keep",ur=Ae.zpass||"keep";return[Fe===Ui?Et:gt,Bn[Oe],Bn[Le],Bn[ur]]},function(Ae,Oe,Le){var ur=Ae.constants.stencilOps;function Dr(jr){return Oe.def('"',jr,'" in ',Le,"?",ur,"[",Le,".",jr,"]:",je)}return[Fe===Ui?Et:gt,Dr("fail"),Dr("zfail"),Dr("zpass")]});case Ll:return Ge(function(Ae){var Oe=Ae.factor|0,Le=Ae.units|0;return[Oe,Le]},function(Ae,Oe,Le){var ur=Oe.def(Le,".factor|0"),Dr=Oe.def(Le,".units|0");return[ur,Dr]});case bi:return Ge(function(Ae){var Oe=0;return Ae==="front"?Oe=gt:Ae==="back"&&(Oe=Et),Oe},function(Ae,Oe,Le){return Oe.def(Le,'==="front"?',gt,":",Et)});case ws:return Ge(function(Ae){return Ae},function(Ae,Oe,Le){return Le});case so:return Ge(function(Ae){return Hn[Ae]},function(Ae,Oe,Le){return Oe.def(Le+'==="cw"?'+Xt+":"+fe)});case el:return Ge(function(Ae){return Ae.map(function(Oe){return!!Oe})},function(Ae,Oe,Le){return c(4,function(ur){return"!!"+Le+"["+ur+"]"})});case Bu:return Ge(function(Ae){var Oe="value"in Ae?Ae.value:1,Le=!!Ae.invert;return[Oe,Le]},function(Ae,Oe,Le){var ur=Oe.def('"value" in ',Le,"?+",Le,".value:1"),Dr=Oe.def("!!",Le,".invert");return[ur,Dr]})}}),Ie}function Zo(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={};return Object.keys(he).forEach(function(Fe){var He=he[Fe],Ge;if(typeof He=="number"||typeof He=="boolean")Ge=Wa(function(){return He});else if(typeof He=="function"){var Ae=He._reglType;Ae==="texture2d"||Ae==="textureCube"?Ge=Wa(function(Oe){return Oe.link(He)}):(Ae==="framebuffer"||Ae==="framebufferCube")&&(Ge=Wa(function(Oe){return Oe.link(He.color[0])}))}else rn(He)&&(Ge=Wa(function(Oe){var Le=Oe.global.def("[",c(He.length,function(ur){return He[ur]}),"]");return Le}));Ge.value=He,Ie[Fe]=Ge}),Object.keys(Ne).forEach(function(Fe){var He=Ne[Fe];Ie[Fe]=ri(He,function(Ge,Ae){return Ge.invoke(Ae,He)})}),Ie}function Qs(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={};return Object.keys(he).forEach(function(Fe){var He=he[Fe],Ge=nr.id(Fe),Ae=new fn;if(Yn(He))Ae.state=Ba,Ae.buffer=zn.getBuffer(zn.create(He,ye,!1,!0)),Ae.type=0;else{var Oe=zn.getBuffer(He);if(Oe)Ae.state=Ba,Ae.buffer=Oe,Ae.type=0;else if("constant"in He){var Le=He.constant;Ae.buffer="null",Ae.state=za,typeof Le=="number"?Ae.x=Le:Ya.forEach(function(Wn,Dn){Dn<Le.length&&(Ae[Wn]=Le[Dn])})}else{Yn(He.buffer)?Oe=zn.getBuffer(zn.create(He.buffer,ye,!1,!0)):Oe=zn.getBuffer(He.buffer);var ur=He.offset|0,Dr=He.stride|0,jr=He.size|0,On=!!He.normalized,Ln=0;"type"in He&&(Ln=pn[He.type]);var xn=He.divisor|0;Ae.buffer=Oe,Ae.state=Ba,Ae.size=jr,Ae.normalized=On,Ae.type=Ln||Oe.dtype,Ae.offset=ur,Ae.stride=Dr,Ae.divisor=xn}}Ie[Fe]=Wa(function(Wn,Dn){var la=Wn.attribCache;if(Ge in la)return la[Ge];var qn={isStream:!1};return Object.keys(Ae).forEach(function(Gn){qn[Gn]=Ae[Gn]}),Ae.buffer&&(qn.buffer=Wn.link(Ae.buffer),qn.type=qn.type||qn.buffer+".dtype"),la[Ge]=qn,qn})}),Object.keys(Ne).forEach(function(Fe){var He=Ne[Fe];function Ge(Ae,Oe){var Le=Ae.invoke(Oe,He),ur=Ae.shared,Dr=Ae.constants,jr=ur.isBufferArgs,On=ur.buffer,Ln={isStream:Oe.def(!1)},xn=new fn;xn.state=Ba,Object.keys(xn).forEach(function(qn){Ln[qn]=Oe.def(""+xn[qn])});var Wn=Ln.buffer,Dn=Ln.type;Oe("if(",jr,"(",Le,")){",Ln.isStream,"=true;",Wn,"=",On,".createStream(",ye,",",Le,");",Dn,"=",Wn,".dtype;","}else{",Wn,"=",On,".getBuffer(",Le,");","if(",Wn,"){",Dn,"=",Wn,".dtype;",'}else if("constant" in ',Le,"){",Ln.state,"=",za,";","if(typeof "+Le+'.constant === "number"){',Ln[Ya[0]],"=",Le,".constant;",Ya.slice(1).map(function(qn){return Ln[qn]}).join("="),"=0;","}else{",Ya.map(function(qn,Gn){return Ln[qn]+"="+Le+".constant.length>"+Gn+"?"+Le+".constant["+Gn+"]:0;"}).join(""),"}}else{","if(",jr,"(",Le,".buffer)){",Wn,"=",On,".createStream(",ye,",",Le,".buffer);","}else{",Wn,"=",On,".getBuffer(",Le,".buffer);","}",Dn,'="type" in ',Le,"?",Dr.glTypes,"[",Le,".type]:",Wn,".dtype;",Ln.normalized,"=!!",Le,".normalized;");function la(qn){Oe(Ln[qn],"=",Le,".",qn,"|0;")}return la("size"),la("offset"),la("stride"),la("divisor"),Oe("}}"),Oe.exit("if(",Ln.isStream,"){",On,".destroyStream(",Wn,");","}"),Ln}Ie[Fe]=ri(He,Ge)}),Ie}function El(Ft){var $t=Ft.static,he=Ft.dynamic,Ne={};return Object.keys($t).forEach(function(Ie){var Fe=$t[Ie];Ne[Ie]=Wa(function(He,Ge){return typeof Fe=="number"||typeof Fe=="boolean"?""+Fe:He.link(Fe)})}),Object.keys(he).forEach(function(Ie){var Fe=he[Ie];Ne[Ie]=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}),Ne}function Cl(Ft,$t,he,Ne,Ie){Ft.static,Ft.dynamic;var Fe=ds(Ft,$t),He=gi(Ft),Ge=Ri(Ft,He),Ae=Zi(Ft),Oe=Zs(Ft),Le=rs(Ft,Ie,Fe);function ur(Wn){var Dn=Ge[Wn];Dn&&(Oe[Wn]=Dn)}ur(ul),ur(ba(Ql));var Dr=Object.keys(Oe).length>0,jr={framebuffer:He,draw:Ae,shader:Le,state:Oe,dirty:Dr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(jr.profile=ui(Ft),jr.uniforms=Zo(he),jr.drawVAO=jr.scopeVAO=Ae.vao,!jr.drawVAO&&Le.program&&!Fe&&cr.angle_instanced_arrays&&Ae.static.elements){var On=!0,Ln=Le.program.attributes.map(function(Wn){var Dn=$t.static[Wn];return On=On&&!!Dn,Dn});if(On&&Ln.length>0){var xn=ea.getVAO(ea.createVAO({attributes:Ln,elements:Ae.static.elements}));jr.drawVAO=new _n(null,null,null,function(Wn,Dn){return Wn.link(xn)}),jr.useVAO=!0}}return Fe?jr.useVAO=!0:jr.attributes=Qs($t),jr.context=El(Ne),jr}function Hs(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.context,Fe=Ft.scope();Object.keys(he).forEach(function(He){$t.save(Ie,"."+He);var Ge=he[He],Ae=Ge.append(Ft,$t);Array.isArray(Ae)?Fe(Ie,".",He,"=[",Ae.join(),"];"):Fe(Ie,".",He,"=",Ae,";")}),$t(Fe)}function js(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ie.gl,He=Ie.framebuffer,Ge;kn&&(Ge=$t.def(Ie.extensions,".webgl_draw_buffers"));var Ae=Ft.constants,Oe=Ae.drawBuffer,Le=Ae.backBuffer,ur;he?ur=he.append(Ft,$t):ur=$t.def(He,".next"),Ne||$t("if(",ur,"!==",He,".cur){"),$t("if(",ur,"){",Fe,".bindFramebuffer(",an,",",ur,".framebuffer);"),kn&&$t(Ge,".drawBuffersWEBGL(",Oe,"[",ur,".colorAttachments.length]);"),$t("}else{",Fe,".bindFramebuffer(",an,",null);"),kn&&$t(Ge,".drawBuffersWEBGL(",Le,");"),$t("}",He,".cur=",ur,";"),Ne||$t("}")}function Ks(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.gl,Fe=Ft.current,He=Ft.next,Ge=Ne.current,Ae=Ne.next,Oe=Ft.cond(Ge,".dirty");Rn.forEach(function(Le){var ur=ba(Le);if(!(ur in he.state)){var Dr,jr;if(ur in He){Dr=He[ur],jr=Fe[ur];var On=c(ya[ur].length,function(xn){return Oe.def(Dr,"[",xn,"]")});Oe(Ft.cond(On.map(function(xn,Wn){return xn+"!=="+jr+"["+Wn+"]"}).join("||")).then(Ie,".",Pa[ur],"(",On,");",On.map(function(xn,Wn){return jr+"["+Wn+"]="+xn}).join(";"),";"))}else{Dr=Oe.def(Ae,".",ur);var Ln=Ft.cond(Dr,"!==",Ge,".",ur);Oe(Ln),ur in An?Ln(Ft.cond(Dr).then(Ie,".enable(",An[ur],");").else(Ie,".disable(",An[ur],");"),Ge,".",ur,"=",Dr,";"):Ln(Ie,".",Pa[ur],"(",Dr,");",Ge,".",ur,"=",Dr,";")}}}),Object.keys(he.state).length===0&&Oe(Ge,".dirty=false;"),$t(Oe)}function Mi(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ft.current,He=Ie.current,Ge=Ie.gl,Ae;na(Object.keys(he)).forEach(function(Oe){var Le=he[Oe];if(!(Ne&&!Ne(Le))){var ur=Le.append(Ft,$t);if(An[Oe]){var Dr=An[Oe];Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ft.cond(Ae).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",Ae,";")):($t(Ft.cond(ur).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",ur,";"))}else if(rn(ur)){var jr=Fe[Oe];$t(Ge,".",Pa[Oe],"(",ur,");",ur.map(function(On,Ln){return jr+"["+Ln+"]="+On}).join(";"),";")}else Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ge,".",Pa[Oe],"(",Ae,");",He,".",Oe,"=",Ae,";")):$t(Ge,".",Pa[Oe],"(",ur,");",He,".",Oe,"=",ur,";")}})}function Ys(Ft,$t){jn&&(Ft.instancing=$t.def(Ft.shared.extensions,".angle_instanced_arrays"))}function Uo(Ft,$t,he,Ne,Ie){var Fe=Ft.shared,He=Ft.stats,Ge=Fe.current,Ae=Fe.timer,Oe=he.profile;function Le(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ur,Dr;function jr(la){ur=$t.def(),la(ur,"=",Le(),";"),typeof Ie=="string"?la(He,".count+=",Ie,";"):la(He,".count++;"),fa&&(Ne?(Dr=$t.def(),la(Dr,"=",Ae,".getNumPendingQueries();")):la(Ae,".beginQuery(",He,");"))}function On(la){la(He,".cpuTime+=",Le(),"-",ur,";"),fa&&(Ne?la(Ae,".pushScopeStats(",Dr,",",Ae,".getNumPendingQueries(),",He,");"):la(Ae,".endQuery();"))}function Ln(la){var qn=$t.def(Ge,".profile");$t(Ge,".profile=",la,";"),$t.exit(Ge,".profile=",qn,";")}var xn;if(Oe){if(Ha(Oe)){Oe.enable?(jr($t),On($t.exit),Ln("true")):Ln("false");return}xn=Oe.append(Ft,$t),Ln(xn)}else xn=$t.def(Ge,".profile");var Wn=Ft.block();jr(Wn),$t("if(",xn,"){",Wn,"}");var Dn=Ft.block();On(Dn),$t.exit("if(",xn,"){",Dn,"}")}function tl(Ft,$t,he,Ne,Ie){var Fe=Ft.shared;function He(Ae){switch(Ae){case xa:case mi:case po:return 2;case La:case Yi:case Qo:return 3;case ai:case Go:case Js:return 4;default:return 1}}function Ge(Ae,Oe,Le){var ur=Fe.gl,Dr=$t.def(Ae,".location"),jr=$t.def(Fe.attributes,"[",Dr,"]"),On=Le.state,Ln=Le.buffer,xn=[Le.x,Le.y,Le.z,Le.w],Wn=["buffer","normalized","offset","stride"];function Dn(){$t("if(!",jr,".buffer){",ur,".enableVertexAttribArray(",Dr,");}");var qn=Le.type,Gn;if(Le.size?Gn=$t.def(Le.size,"||",Oe):Gn=Oe,$t("if(",jr,".type!==",qn,"||",jr,".size!==",Gn,"||",Wn.map(function(ti){return jr+"."+ti+"!=="+Le[ti]}).join("||"),"){",ur,".bindBuffer(",ye,",",Ln,".buffer);",ur,".vertexAttribPointer(",[Dr,Gn,qn,Le.normalized,Le.stride,Le.offset],");",jr,".type=",qn,";",jr,".size=",Gn,";",Wn.map(function(ti){return jr+"."+ti+"="+Le[ti]+";"}).join(""),"}"),jn){var ma=Le.divisor;$t("if(",jr,".divisor!==",ma,"){",Ft.instancing,".vertexAttribDivisorANGLE(",[Dr,ma],");",jr,".divisor=",ma,";}")}}function la(){$t("if(",jr,".buffer){",ur,".disableVertexAttribArray(",Dr,");",jr,".buffer=null;","}if(",Ya.map(function(qn,Gn){return jr+"."+qn+"!=="+xn[Gn]}).join("||"),"){",ur,".vertexAttrib4f(",Dr,",",xn,");",Ya.map(function(qn,Gn){return jr+"."+qn+"="+xn[Gn]+";"}).join(""),"}")}On===Ba?Dn():On===za?la():($t("if(",On,"===",Ba,"){"),Dn(),$t("}else{"),la(),$t("}"))}Ne.forEach(function(Ae){var Oe=Ae.name,Le=he.attributes[Oe],ur;if(Le){if(!Ie(Le))return;ur=Le.append(Ft,$t)}else{if(!Ie(xi))return;var Dr=Ft.scopeAttrib(Oe);ur={},Object.keys(new fn).forEach(function(jr){ur[jr]=$t.def(Dr,".",jr)})}Ge(Ft.link(Ae),He(Ae.info.type),ur)})}function Il(Ft,$t,he,Ne,Ie,Fe){for(var He=Ft.shared,Ge=He.gl,Ae,Oe=0;Oe<Ne.length;++Oe){var Le=Ne[Oe],ur=Le.name,Dr=Le.info.type,jr=he.uniforms[ur],On=Ft.link(Le),Ln=On+".location",xn;if(jr){if(!Ie(jr))continue;if(Ha(jr)){var Wn=jr.value;if(Dr===hl||Dr===Sl){var Dn=Ft.link(Wn._texture||Wn.color[0]._texture);$t(Ge,".uniform1i(",Ln,",",Dn+".bind());"),$t.exit(Dn,".unbind();")}else if(Dr===Us||Dr===To||Dr===ko){var la=Ft.global.def("new Float32Array(["+Array.prototype.slice.call(Wn)+"])"),qn=2;Dr===To?qn=3:Dr===ko&&(qn=4),$t(Ge,".uniformMatrix",qn,"fv(",Ln,",false,",la,");")}else{switch(Dr){case _a:Ae="1f";break;case xa:Ae="2f";break;case La:Ae="3f";break;case ai:Ae="4f";break;case Xo:Ae="1i";break;case Ai:Ae="1i";break;case po:Ae="2i";break;case mi:Ae="2i";break;case Qo:Ae="3i";break;case Yi:Ae="3i";break;case Js:Ae="4i";break;case Go:Ae="4i";break}$t(Ge,".uniform",Ae,"(",Ln,",",rn(Wn)?Array.prototype.slice.call(Wn):Wn,");")}continue}else xn=jr.append(Ft,$t)}else{if(!Ie(xi))continue;xn=$t.def(He.uniforms,"[",nr.id(ur),"]")}Dr===hl?$t("if(",xn,"&&",xn,'._reglType==="framebuffer"){',xn,"=",xn,".color[0];","}"):Dr===Sl&&$t("if(",xn,"&&",xn,'._reglType==="framebufferCube"){',xn,"=",xn,".color[0];","}");var Gn=1;switch(Dr){case hl:case Sl:var ma=$t.def(xn,"._texture");$t(Ge,".uniform1i(",Ln,",",ma,".bind());"),$t.exit(ma,".unbind();");continue;case Ai:case Xo:Ae="1i";break;case mi:case po:Ae="2i",Gn=2;break;case Yi:case Qo:Ae="3i",Gn=3;break;case Go:case Js:Ae="4i",Gn=4;break;case _a:Ae="1f";break;case xa:Ae="2f",Gn=2;break;case La:Ae="3f",Gn=3;break;case ai:Ae="4f",Gn=4;break;case Us:Ae="Matrix2fv";break;case To:Ae="Matrix3fv";break;case ko:Ae="Matrix4fv";break}if(Ae.charAt(0)==="M"){$t(Ge,".uniform",Ae,"(",Ln,",");var ti=Math.pow(Dr-Us+2,2),si=Ft.global.def("new Float32Array(",ti,")");Array.isArray(xn)?$t("false,(",c(ti,function(Ko){return si+"["+Ko+"]="+xn[Ko]}),",",si,")"):$t("false,(Array.isArray(",xn,")||",xn," instanceof Float32Array)?",xn,":(",c(ti,function(Ko){return si+"["+Ko+"]="+xn+"["+Ko+"]"}),",",si,")"),$t(");")}else if(Gn>1){for(var Li=[],to=[],ls=0;ls<Gn;++ls)Array.isArray(xn)?to.push(xn[ls]):to.push($t.def(xn+"["+ls+"]")),Fe&&Li.push($t.def());Fe&&$t("if(!",Ft.batchId,"||",Li.map(function(Ko,gs){return Ko+"!=="+to[gs]}).join("||"),"){",Li.map(function(Ko,gs){return Ko+"="+to[gs]+";"}).join("")),$t(Ge,".uniform",Ae,"(",Ln,",",to.join(","),");"),Fe&&$t("}")}else{if(Fe){var ms=$t.def();$t("if(!",Ft.batchId,"||",ms,"!==",xn,"){",ms,"=",xn,";")}$t(Ge,".uniform",Ae,"(",Ln,",",xn,");"),Fe&&$t("}")}}}function vi(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ie.gl,He=Ie.draw,Ge=Ne.draw;function Ae(){var Gn=Ge.elements,ma,ti=$t;return Gn?((Gn.contextDep&&Ne.contextDynamic||Gn.propDep)&&(ti=he),ma=Gn.append(Ft,ti),Ge.elementsActive&&ti("if("+ma+")"+Fe+".bindBuffer("+ze+","+ma+".buffer.buffer);")):(ma=ti.def(),ti(ma,"=",He,".",xt,";","if(",ma,"){",Fe,".bindBuffer(",ze,",",ma,".buffer.buffer);}","else if(",Ie.vao,".currentVAO){",ma,"=",Ft.shared.elements+".getElements("+Ie.vao,".currentVAO.elements);",Ia?"":"if("+ma+")"+Fe+".bindBuffer("+ze+","+ma+".buffer.buffer);","}")),ma}function Oe(){var Gn=Ge.count,ma,ti=$t;return Gn?((Gn.contextDep&&Ne.contextDynamic||Gn.propDep)&&(ti=he),ma=Gn.append(Ft,ti)):ma=ti.def(He,".",Lt),ma}var Le=Ae();function ur(Gn){var ma=Ge[Gn];return ma?ma.contextDep&&Ne.contextDynamic||ma.propDep?ma.append(Ft,he):ma.append(Ft,$t):$t.def(He,".",Gn)}var Dr=ur(kt),jr=ur(le),On=Oe();if(typeof On=="number"){if(On===0)return}else he("if(",On,"){"),he.exit("}");var Ln,xn;jn&&(Ln=ur(xe),xn=Ft.instancing);var Wn=Le+".type",Dn=Ge.elements&&Ha(Ge.elements)&&!Ge.vaoActive;function la(){function Gn(){he(xn,".drawElementsInstancedANGLE(",[Dr,On,Wn,jr+"<<(("+Wn+"-"+va+")>>1)",Ln],");")}function ma(){he(xn,".drawArraysInstancedANGLE(",[Dr,jr,On,Ln],");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}function qn(){function Gn(){he(Fe+".drawElements("+[Dr,On,Wn,jr+"<<(("+Wn+"-"+va+")>>1)"]+");")}function ma(){he(Fe+".drawArrays("+[Dr,jr,On]+");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}jn&&(typeof Ln!="number"||Ln>=0)?typeof Ln=="string"?(he("if(",Ln,">0){"),la(),he("}else if(",Ln,"<0){"),qn(),he("}")):la():qn()}function lo(Ft,$t,he,Ne,Ie){var Fe=Na(),He=Fe.proc("body",Ie);return jn&&(Fe.instancing=He.def(Fe.shared.extensions,".angle_instanced_arrays")),Ft(Fe,He,he,Ne),Fe.compile().body}function ns(Ft,$t,he,Ne){Ys(Ft,$t),he.useVAO?he.drawVAO?$t(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,$t),");"):$t(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):($t(Ft.shared.vao,".setVAO(null);"),tl(Ft,$t,he,Ne.attributes,function(){return!0})),Il(Ft,$t,he,Ne.uniforms,function(){return!0},!1),vi(Ft,$t,$t,he)}function $o(Ft,$t){var he=Ft.proc("draw",1);Ys(Ft,he),Hs(Ft,he,$t.context),js(Ft,he,$t.framebuffer),Ks(Ft,he,$t),Mi(Ft,he,$t.state),Uo(Ft,he,$t,!1,!0);var Ne=$t.shader.progVar.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Ne,".program);"),$t.shader.program)ns(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Ie=Ft.global.def("{}"),Fe=he.def(Ne,".id"),He=he.def(Ie,"[",Fe,"]");he(Ft.cond(He).then(He,".call(this,a0);").else(He,"=",Ie,"[",Fe,"]=",Ft.link(function(Ge){return lo(ns,Ft,$t,Ge,1)}),"(",Ne,");",He,".call(this,a0);"))}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function U(Ft,$t,he,Ne){Ft.batchId="a1",Ys(Ft,$t);function Ie(){return!0}tl(Ft,$t,he,Ne.attributes,Ie),Il(Ft,$t,he,Ne.uniforms,Ie,!1),vi(Ft,$t,$t,he)}function tt(Ft,$t,he,Ne){Ys(Ft,$t);var Ie=he.contextDep,Fe=$t.def(),He="a0",Ge="a1",Ae=$t.def();Ft.shared.props=Ae,Ft.batchId=Fe;var Oe=Ft.scope(),Le=Ft.scope();$t(Oe.entry,"for(",Fe,"=0;",Fe,"<",Ge,";++",Fe,"){",Ae,"=",He,"[",Fe,"];",Le,"}",Oe.exit);function ur(Wn){return Wn.contextDep&&Ie||Wn.propDep}function Dr(Wn){return!ur(Wn)}if(he.needsContext&&Hs(Ft,Le,he.context),he.needsFramebuffer&&js(Ft,Le,he.framebuffer),Mi(Ft,Le,he.state,ur),he.profile&&ur(he.profile)&&Uo(Ft,Le,he,!1,!0),Ne)he.useVAO?he.drawVAO?ur(he.drawVAO)?Le(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Le),");"):Oe(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Oe),");"):Oe(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):(Oe(Ft.shared.vao,".setVAO(null);"),tl(Ft,Oe,he,Ne.attributes,Dr),tl(Ft,Le,he,Ne.attributes,ur)),Il(Ft,Oe,he,Ne.uniforms,Dr,!1),Il(Ft,Le,he,Ne.uniforms,ur,!0),vi(Ft,Oe,Le,he);else{var jr=Ft.global.def("{}"),On=he.shader.progVar.append(Ft,Le),Ln=Le.def(On,".id"),xn=Le.def(jr,"[",Ln,"]");Le(Ft.shared.gl,".useProgram(",On,".program);","if(!",xn,"){",xn,"=",jr,"[",Ln,"]=",Ft.link(function(Wn){return lo(U,Ft,he,Wn,2)}),"(",On,");}",xn,".call(this,a0[",Fe,"],",Fe,");")}}function Y(Ft,$t){var he=Ft.proc("batch",2);Ft.batchId="0",Ys(Ft,he);var Ne=!1,Ie=!0;Object.keys($t.context).forEach(function(jr){Ne=Ne||$t.context[jr].propDep}),Ne||(Hs(Ft,he,$t.context),Ie=!1);var Fe=$t.framebuffer,He=!1;Fe?(Fe.propDep?Ne=He=!0:Fe.contextDep&&Ne&&(He=!0),He||js(Ft,he,Fe)):js(Ft,he,null),$t.state.viewport&&$t.state.viewport.propDep&&(Ne=!0);function Ge(jr){return jr.contextDep&&Ne||jr.propDep}Ks(Ft,he,$t),Mi(Ft,he,$t.state,function(jr){return!Ge(jr)}),(!$t.profile||!Ge($t.profile))&&Uo(Ft,he,$t,!1,"a1"),$t.contextDep=Ne,$t.needsContext=Ie,$t.needsFramebuffer=He;var Ae=$t.shader.progVar;if(Ae.contextDep&&Ne||Ae.propDep)tt(Ft,he,$t,null);else{var Oe=Ae.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Oe,".program);"),$t.shader.program)tt(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Le=Ft.global.def("{}"),ur=he.def(Oe,".id"),Dr=he.def(Le,"[",ur,"]");he(Ft.cond(Dr).then(Dr,".call(this,a0,a1);").else(Dr,"=",Le,"[",ur,"]=",Ft.link(function(jr){return lo(tt,Ft,$t,jr,2)}),"(",Oe,");",Dr,".call(this,a0,a1);"))}}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function ft(Ft,$t){var he=Ft.proc("scope",3);Ft.batchId="a2";var Ne=Ft.shared,Ie=Ne.current;if(Hs(Ft,he,$t.context),$t.framebuffer&&$t.framebuffer.append(Ft,he),na(Object.keys($t.state)).forEach(function(Ge){var Ae=$t.state[Ge],Oe=Ae.append(Ft,he);rn(Oe)?Oe.forEach(function(Le,ur){Sa(Le)?he.set(Ft.next[Ge],"["+ur+"]",Le):he.set(Ft.next[Ge],"["+ur+"]",Ft.link(Le,{stable:!0}))}):Ha(Ae)?he.set(Ne.next,"."+Ge,Ft.link(Oe,{stable:!0})):he.set(Ne.next,"."+Ge,Oe)}),Uo(Ft,he,$t,!0,!0),[xt,le,Lt,xe,kt].forEach(function(Ge){var Ae=$t.draw[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.draw,"."+Ge,Oe):he.set(Ne.draw,"."+Ge,Ft.link(Oe),{stable:!0})}}),Object.keys($t.uniforms).forEach(function(Ge){var Ae=$t.uniforms[Ge].append(Ft,he);Array.isArray(Ae)&&(Ae="["+Ae.map(function(Oe){return Sa(Oe)?Oe:Ft.link(Oe,{stable:!0})})+"]"),he.set(Ne.uniforms,"["+Ft.link(nr.id(Ge),{stable:!0})+"]",Ae)}),Object.keys($t.attributes).forEach(function(Ge){var Ae=$t.attributes[Ge].append(Ft,he),Oe=Ft.scopeAttrib(Ge);Object.keys(new fn).forEach(function(Le){he.set(Oe,"."+Le,Ae[Le])})}),$t.scopeVAO){var Fe=$t.scopeVAO.append(Ft,he);Sa(Fe)?he.set(Ne.vao,".targetVAO",Fe):he.set(Ne.vao,".targetVAO",Ft.link(Fe,{stable:!0}))}function He(Ge){var Ae=$t.shader[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.shader,"."+Ge,Oe):he.set(Ne.shader,"."+Ge,Ft.link(Oe,{stable:!0}))}}He(z),He(at),Object.keys($t.state).length>0&&(he(Ie,".dirty=true;"),he.exit(Ie,".dirty=true;")),he("a1(",Ft.shared.context,",a0,",Ft.batchId,");")}function zt(Ft){if(!(typeof Ft!="object"||rn(Ft))){for(var $t=Object.keys(Ft),he=0;he<$t.length;++he)if(f.isDynamic(Ft[$t[he]]))return!0;return!1}}function Qt(Ft,$t,he){var Ne=$t.static[he];if(!Ne||!zt(Ne))return;var Ie=Ft.global,Fe=Object.keys(Ne),He=!1,Ge=!1,Ae=!1,Oe=Ft.global.def("{}");Fe.forEach(function(ur){var Dr=Ne[ur];if(f.isDynamic(Dr)){typeof Dr=="function"&&(Dr=Ne[ur]=f.unbox(Dr));var jr=ri(Dr,null);He=He||jr.thisDep,Ae=Ae||jr.propDep,Ge=Ge||jr.contextDep}else{switch(Ie(Oe,".",ur,"="),typeof Dr){case"number":Ie(Dr);break;case"string":Ie('"',Dr,'"');break;case"object":Array.isArray(Dr)&&Ie("[",Dr.join(),"]");break;default:Ie(Ft.link(Dr));break}Ie(";")}});function Le(ur,Dr){Fe.forEach(function(jr){var On=Ne[jr];if(f.isDynamic(On)){var Ln=ur.invoke(Dr,On);Dr(Oe,".",jr,"=",Ln,";")}})}$t.dynamic[he]=new f.DynamicVariable(Wi,{thisDep:He,contextDep:Ge,propDep:Ae,ref:Oe,append:Le}),delete $t.static[he]}function ne(Ft,$t,he,Ne,Ie){var Fe=Na();Fe.stats=Fe.link(Ie),Object.keys($t.static).forEach(function(Ge){Qt(Fe,$t,Ge)}),Te.forEach(function(Ge){Qt(Fe,Ft,Ge)});var He=Cl(Ft,$t,he,Ne,Fe);return He.shader.program&&(He.shader.program.attributes.sort(function(Ge,Ae){return Ge.name<Ae.name?-1:1}),He.shader.program.uniforms.sort(function(Ge,Ae){return Ge.name<Ae.name?-1:1})),$o(Fe,He),ft(Fe,He),Y(Fe,He),u(Fe.compile(),{destroy:function(){He.shader.program.destroy()}})}return{next:qa,current:ya,procs:function(){var Ft=Na(),$t=Ft.proc("poll"),he=Ft.proc("refresh"),Ne=Ft.block();$t(Ne),he(Ne);var Ie=Ft.shared,Fe=Ie.gl,He=Ie.next,Ge=Ie.current;Ne(Ge,".dirty=false;"),js(Ft,$t),js(Ft,he,null,!0);var Ae;jn&&(Ae=Ft.link(jn)),cr.oes_vertex_array_object&&he(Ft.link(cr.oes_vertex_array_object),".bindVertexArrayOES(null);");var Oe=he.def(Ie.attributes),Le=he.def(0),ur=Ft.cond(Le,".buffer");ur.then(Fe,".enableVertexAttribArray(i);",Fe,".bindBuffer(",ye,",",Le,".buffer.buffer);",Fe,".vertexAttribPointer(i,",Le,".size,",Le,".type,",Le,".normalized,",Le,".stride,",Le,".offset);").else(Fe,".disableVertexAttribArray(i);",Fe,".vertexAttrib4f(i,",Le,".x,",Le,".y,",Le,".z,",Le,".w);",Le,".buffer=null;");var Dr=Ft.link(sn.maxAttributes,{stable:!0});return he("for(var i=0;i<",Dr,";++i){",Le,"=",Oe,"[i];",ur,"}"),jn&&he("for(var i=0;i<",Dr,";++i){",Ae,".vertexAttribDivisorANGLE(i,",Oe,"[i].divisor);","}"),he(Ft.shared.vao,".currentVAO=null;",Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"),Object.keys(An).forEach(function(jr){var On=An[jr],Ln=Ne.def(He,".",jr),xn=Ft.block();xn("if(",Ln,"){",Fe,".enable(",On,")}else{",Fe,".disable(",On,")}",Ge,".",jr,"=",Ln,";"),he(xn),$t("if(",Ln,"!==",Ge,".",jr,"){",xn,"}")}),Object.keys(Pa).forEach(function(jr){var On=Pa[jr],Ln=ya[jr],xn,Wn,Dn=Ft.block();if(Dn(Fe,".",On,"("),rn(Ln)){var la=Ln.length;xn=Ft.global.def(He,".",jr),Wn=Ft.global.def(Ge,".",jr),Dn(c(la,function(qn){return xn+"["+qn+"]"}),");",c(la,function(qn){return Wn+"["+qn+"]="+xn+"["+qn+"];"}).join("")),$t("if(",c(la,function(qn){return xn+"["+qn+"]!=="+Wn+"["+qn+"]"}).join("||"),"){",Dn,"}")}else xn=Ne.def(He,".",jr),Wn=Ne.def(Ge,".",jr),Dn(xn,");",Ge,".",jr,"=",xn,";"),$t("if(",xn,"!==",Wn,"){",Dn,"}");he(Dn)}),Ft.compile()}(),compile:ne}}function zi(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var jo=34918,Ii=34919,Ji=35007,es=function(ie,nr){if(!nr.ext_disjoint_timer_query)return null;var cr=[];function sn(){return cr.pop()||nr.ext_disjoint_timer_query.createQueryEXT()}function zn(Xn){cr.push(Xn)}var Tn=[];function qr(Xn){var jn=sn();nr.ext_disjoint_timer_query.beginQueryEXT(Ji,jn),Tn.push(jn),fa(Tn.length-1,Tn.length,Xn)}function Sn(){nr.ext_disjoint_timer_query.endQueryEXT(Ji)}function sa(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var ea=[];function ka(){return ea.pop()||new sa}function Ka(Xn){ea.push(Xn)}var Va=[];function fa(Xn,jn,kn){var Ia=ka();Ia.startQueryIndex=Xn,Ia.endQueryIndex=jn,Ia.sum=0,Ia.stats=kn,Va.push(Ia)}var Un=[],Nr=[];function fn(){var Xn,jn,kn=Tn.length;if(kn!==0){Nr.length=Math.max(Nr.length,kn+1),Un.length=Math.max(Un.length,kn+1),Un[0]=0,Nr[0]=0;var Ia=0;for(Xn=0,jn=0;jn<Tn.length;++jn){var ya=Tn[jn];nr.ext_disjoint_timer_query.getQueryObjectEXT(ya,Ii)?(Ia+=nr.ext_disjoint_timer_query.getQueryObjectEXT(ya,jo),zn(ya)):Tn[Xn++]=ya,Un[jn+1]=Ia,Nr[jn+1]=Xn}for(Tn.length=Xn,Xn=0,jn=0;jn<Va.length;++jn){var qa=Va[jn],Rn=qa.startQueryIndex,An=qa.endQueryIndex;qa.sum+=Un[An]-Un[Rn];var Pa=Nr[Rn],ba=Nr[An];ba===Pa?(qa.stats.gpuTime+=qa.sum/1e6,Ka(qa)):(qa.startQueryIndex=Pa,qa.endQueryIndex=ba,Va[Xn++]=qa)}Va.length=Xn}}return{beginQuery:qr,endQuery:Sn,pushScopeStats:fa,update:fn,getNumPendingQueries:function(){return Tn.length},clear:function(){cr.push.apply(cr,Tn);for(var Xn=0;Xn<cr.length;Xn++)nr.ext_disjoint_timer_query.deleteQueryEXT(cr[Xn]);Tn.length=0,cr.length=0},restore:function(){Tn.length=0,cr.length=0}}},pl=16384,Ns=256,fi=1024,Ao=34962,Bo="webglcontextlost",Ds="webglcontextrestored",Ts=1,lu=2,ps=3;function zs(ie,nr){for(var cr=0;cr<ie.length;++cr)if(ie[cr]===nr)return cr;return-1}function Eu(ie){var nr=M(ie);if(!nr)return null;var cr=nr.gl,sn=cr.getContextAttributes();cr.isContextLost();var zn=T(cr,nr);if(!zn)return null;var Tn=m(),qr=zi(),Sn=nr.cachedCode||{},sa=zn.extensions,ea=es(cr,sa),ka=g(),Ka=cr.drawingBufferWidth,Va=cr.drawingBufferHeight,fa={tick:0,time:0,viewportWidth:Ka,viewportHeight:Va,framebufferWidth:Ka,framebufferHeight:Va,drawingBufferWidth:Ka,drawingBufferHeight:Va,pixelRatio:nr.pixelRatio},Un={},Nr={elements:null,primitive:4,count:-1,offset:0,instances:-1},fn=er(cr,sa),Xn=Yr(cr,qr,nr,Ia),jn=Ke(cr,sa,Xn,qr),kn=Du(cr,sa,fn,qr,Xn,jn,Nr);function Ia(vi){return kn.destroyBuffer(vi)}var ya=Ku(cr,Tn,qr,nr),qa=wu(cr,sa,fn,function(){Pa.procs.poll()},fa,qr,nr),Rn=Gu(cr,sa,fn,qr,nr),An=iu(cr,sa,fn,qa,Rn,qr),Pa=ki(cr,Tn,sa,fn,Xn,jn,qa,An,Un,kn,ya,Nr,fa,ea,Sn,nr),ba=uf(cr,An,Pa.procs.poll,fa),aa=Pa.next,oa=cr.canvas,Sa=[],_i=[],pi=[],Ma=[nr.onDestroy],Na=null;function ui(){if(Sa.length===0){ea&&ea.update(),Na=null;return}Na=v.next(ui),js();for(var vi=Sa.length-1;vi>=0;--vi){var lo=Sa[vi];lo&&lo(fa,null,0)}cr.flush(),ea&&ea.update()}function gi(){!Na&&Sa.length>0&&(Na=v.next(ui))}function Ri(){Na&&(v.cancel(ui),Na=null)}function ds(vi){vi.preventDefault(),Ri(),_i.forEach(function(lo){lo()})}function rs(vi){cr.getError(),zn.restore(),ya.restore(),Xn.restore(),qa.restore(),Rn.restore(),An.restore(),kn.restore(),ea&&ea.restore(),Pa.procs.refresh(),gi(),pi.forEach(function(lo){lo()})}oa&&(oa.addEventListener(Bo,ds,!1),oa.addEventListener(Ds,rs,!1));function Zi(){Sa.length=0,Ri(),oa&&(oa.removeEventListener(Bo,ds),oa.removeEventListener(Ds,rs)),ya.clear(),An.clear(),Rn.clear(),kn.clear(),qa.clear(),jn.clear(),Xn.clear(),ea&&ea.clear(),Ma.forEach(function(vi){vi()})}function Zs(vi){function lo(Ie){var Fe=u({},Ie);delete Fe.uniforms,delete Fe.attributes,delete Fe.context,delete Fe.vao,"stencil"in Fe&&Fe.stencil.op&&(Fe.stencil.opBack=Fe.stencil.opFront=Fe.stencil.op,delete Fe.stencil.op);function He(Ge){if(Ge in Fe){var Ae=Fe[Ge];delete Fe[Ge],Object.keys(Ae).forEach(function(Oe){Fe[Ge+"."+Oe]=Ae[Oe]})}}return He("blend"),He("depth"),He("cull"),He("stencil"),He("polygonOffset"),He("scissor"),He("sample"),"vao"in Ie&&(Fe.vao=Ie.vao),Fe}function ns(Ie,Fe){var He={},Ge={};return Object.keys(Ie).forEach(function(Ae){var Oe=Ie[Ae];if(f.isDynamic(Oe)){Ge[Ae]=f.unbox(Oe,Ae);return}else if(Fe&&Array.isArray(Oe)){for(var Le=0;Le<Oe.length;++Le)if(f.isDynamic(Oe[Le])){Ge[Ae]=f.unbox(Oe,Ae);return}}He[Ae]=Oe}),{dynamic:Ge,static:He}}var $o=ns(vi.context||{},!0),U=ns(vi.uniforms||{},!0),tt=ns(vi.attributes||{},!1),Y=ns(lo(vi),!1),ft={gpuTime:0,cpuTime:0,count:0},zt=Pa.compile(Y,tt,U,$o,ft),Qt=zt.draw,ne=zt.batch,Ft=zt.scope,$t=[];function he(Ie){for(;$t.length<Ie;)$t.push(null);return $t}function Ne(Ie,Fe){var He;if(typeof Ie=="function")return Ft.call(this,null,Ie,0);if(typeof Fe=="function")if(typeof Ie=="number")for(He=0;He<Ie;++He)Ft.call(this,null,Fe,He);else if(Array.isArray(Ie))for(He=0;He<Ie.length;++He)Ft.call(this,Ie[He],Fe,He);else return Ft.call(this,Ie,Fe,0);else if(typeof Ie=="number"){if(Ie>0)return ne.call(this,he(Ie|0),Ie|0)}else if(Array.isArray(Ie)){if(Ie.length)return ne.call(this,Ie,Ie.length)}else return Qt.call(this,Ie)}return u(Ne,{stats:ft,destroy:function(){zt.destroy()}})}var Zo=An.setFBO=Zs({framebuffer:f.define.call(null,Ts,"framebuffer")});function Qs(vi,lo){var ns=0;Pa.procs.poll();var $o=lo.color;$o&&(cr.clearColor(+$o[0]||0,+$o[1]||0,+$o[2]||0,+$o[3]||0),ns|=pl),"depth"in lo&&(cr.clearDepth(+lo.depth),ns|=Ns),"stencil"in lo&&(cr.clearStencil(lo.stencil|0),ns|=fi),cr.clear(ns)}function El(vi){if("framebuffer"in vi)if(vi.framebuffer&&vi.framebuffer_reglType==="framebufferCube")for(var lo=0;lo<6;++lo)Zo(u({framebuffer:vi.framebuffer.faces[lo]},vi),Qs);else Zo(vi,Qs);else Qs(null,vi)}function Cl(vi){Sa.push(vi);function lo(){var ns=zs(Sa,vi);function $o(){var U=zs(Sa,$o);Sa[U]=Sa[Sa.length-1],Sa.length-=1,Sa.length<=0&&Ri()}Sa[ns]=$o}return gi(),{cancel:lo}}function Hs(){var vi=aa.viewport,lo=aa.scissor_box;vi[0]=vi[1]=lo[0]=lo[1]=0,fa.viewportWidth=fa.framebufferWidth=fa.drawingBufferWidth=vi[2]=lo[2]=cr.drawingBufferWidth,fa.viewportHeight=fa.framebufferHeight=fa.drawingBufferHeight=vi[3]=lo[3]=cr.drawingBufferHeight}function js(){fa.tick+=1,fa.time=Mi(),Hs(),Pa.procs.poll()}function Ks(){qa.refresh(),Hs(),Pa.procs.refresh(),ea&&ea.update()}function Mi(){return(g()-ka)/1e3}Ks();function Ys(vi,lo){var ns;switch(vi){case"frame":return Cl(lo);case"lost":ns=_i;break;case"restore":ns=pi;break;case"destroy":ns=Ma;break}return ns.push(lo),{cancel:function(){for(var $o=0;$o<ns.length;++$o)if(ns[$o]===lo){ns[$o]=ns[ns.length-1],ns.pop();return}}}}function Uo(){return Sn}function tl(vi){Object.entries(vi).forEach(function(lo){Sn[lo[0]]=lo[1]})}var Il=u(Zs,{clear:El,prop:f.define.bind(null,Ts),context:f.define.bind(null,lu),this:f.define.bind(null,ps),draw:Zs({}),buffer:function(vi){return Xn.create(vi,Ao,!1,!1)},elements:function(vi){return jn.create(vi,!1)},texture:qa.create2D,cube:qa.createCube,renderbuffer:Rn.create,framebuffer:An.create,framebufferCube:An.createCube,vao:kn.createVAO,attributes:sn,frame:Cl,on:Ys,limits:fn,hasExtension:function(vi){return fn.extensions.indexOf(vi.toLowerCase())>=0},read:ba,destroy:Zi,_gl:cr,_refresh:Ks,poll:function(){js(),ea&&ea.update()},now:Mi,stats:qr,getCachedCode:Uo,preloadCachedCode:tl});return nr.onDone(null,Il),Il}return Eu})}),n9=Vt((Z,V)=>{var u=_p();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=u(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),d(r))}else if(!r.canvas)if(typeof document<"u")r.container=document.body||document.documentElement,r.canvas=e(),r.container.appendChild(r.canvas),d(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 d(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}}),a9=Vt((Z,V)=>{var u=s5(),d=[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||d;if(r&&typeof r!="string"&&(r=u(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 f=e.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,e.width,e.height),f.font=r,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";for(var v=i[0]/2,g=i[1]/2,a=0;a<n.length;a++)f.fillText(n[a],v,g),(v+=i[0])>t[0]-i[0]/2&&(v=i[0]/2,g+=i[1]);return e}}),l5=Vt(Z=>{"use restrict";var V=32;Z.INT_BITS=V,Z.INT_MAX=2147483647,Z.INT_MIN=-1<<V-1,Z.sign=function(E){return(E>0)-(E<0)},Z.abs=function(E){var A=E>>V-1;return(E^A)-A},Z.min=function(E,A){return A^(E^A)&-(E<A)},Z.max=function(E,A){return E^(E^A)&-(E<A)},Z.isPow2=function(E){return!(E&E-1)&&!!E},Z.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},Z.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},Z.popCount=function(E){return E=E-(E>>>1&1431655765),E=(E&858993459)+(E>>>2&858993459),(E+(E>>>4)&252645135)*16843009>>>24};function u(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}Z.countTrailingZeros=u,Z.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},Z.prevPow2=function(E){return E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E-(E>>>1)},Z.parity=function(E){return E^=E>>>16,E^=E>>>8,E^=E>>>4,E&=15,27030>>>E&1};var d=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}})(d),Z.reverse=function(E){return d[E&255]<<24|d[E>>>8&255]<<16|d[E>>>16&255]<<8|d[E>>>24&255]},Z.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},Z.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},Z.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},Z.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},Z.nextCombination=function(E){var A=E|E-1;return A+1|(~A&-~A)-1>>>u(E)+1}}),i9=Vt((Z,V)=>{function u(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]=u(A,t,e+1);return i}function d(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 d(A|0,t);break;case"object":if(typeof A.length=="number")return u(A,t,0);break}return[]}V.exports=E}),o9=Vt(Z=>{var V=l5(),u=i9(),d=p0().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:u([32,0]),UINT16:u([32,0]),UINT32:u([32,0]),BIGUINT64:u([32,0]),INT8:u([32,0]),INT16:u([32,0]),INT32:u([32,0]),BIGINT64:u([32,0]),FLOAT:u([32,0]),DOUBLE:u([32,0]),DATA:u([32,0]),UINT8C:u([32,0]),BUFFER:u([32,0])});var E=typeof Uint8ClampedArray<"u",A=typeof BigUint64Array<"u",t=typeof BigInt64Array<"u",e=window.__TYPEDARRAY_POOL;e.UINT8C||(e.UINT8C=u([32,0])),e.BIGUINT64||(e.BIGUINT64=u([32,0])),e.BIGINT64||(e.BIGINT64=u([32,0])),e.BUFFER||(e.BUFFER=u([32,0]));var r=e.DATA,i=e.BUFFER;Z.free=function(c){if(d.isBuffer(c))i[V.log2(c.length)].push(c);else{if(Object.prototype.toString.call(c)!=="[object ArrayBuffer]"&&(c=c.buffer),!c)return;var h=c.length||c.byteLength,b=V.log2(h)|0;r[b].push(c)}};function n(c){if(c){var h=c.length||c.byteLength,b=V.log2(h);r[b].push(c)}}function o(c){n(c.buffer)}Z.freeUint8=Z.freeUint16=Z.freeUint32=Z.freeBigUint64=Z.freeInt8=Z.freeInt16=Z.freeInt32=Z.freeBigInt64=Z.freeFloat32=Z.freeFloat=Z.freeFloat64=Z.freeDouble=Z.freeUint8Clamped=Z.freeDataView=o,Z.freeArrayBuffer=n,Z.freeBuffer=function(c){i[V.log2(c.length)].push(c)},Z.malloc=function(c,h){if(h===void 0||h==="arraybuffer")return a(c);switch(h){case"uint8":return s(c);case"uint16":return f(c);case"uint32":return v(c);case"int8":return g(c);case"int16":return m(c);case"int32":return w(c);case"float":case"float32":return l(c);case"double":case"float64":return x(c);case"uint8_clamped":return y(c);case"bigint64":return k(c);case"biguint64":return S(c);case"buffer":return T(c);case"data":case"dataview":return M(c);default:return null}return null};function a(h){var h=V.nextPow2(h),b=V.log2(h),_=r[b];return _.length>0?_.pop():new ArrayBuffer(h)}Z.mallocArrayBuffer=a;function s(c){return new Uint8Array(a(c),0,c)}Z.mallocUint8=s;function f(c){return new Uint16Array(a(2*c),0,c)}Z.mallocUint16=f;function v(c){return new Uint32Array(a(4*c),0,c)}Z.mallocUint32=v;function g(c){return new Int8Array(a(c),0,c)}Z.mallocInt8=g;function m(c){return new Int16Array(a(2*c),0,c)}Z.mallocInt16=m;function w(c){return new Int32Array(a(4*c),0,c)}Z.mallocInt32=w;function l(c){return new Float32Array(a(4*c),0,c)}Z.mallocFloat32=Z.mallocFloat=l;function x(c){return new Float64Array(a(8*c),0,c)}Z.mallocFloat64=Z.mallocDouble=x;function y(c){return E?new Uint8ClampedArray(a(c),0,c):s(c)}Z.mallocUint8Clamped=y;function S(c){return A?new BigUint64Array(a(8*c),0,c):null}Z.mallocBigUint64=S;function k(c){return t?new BigInt64Array(a(8*c),0,c):null}Z.mallocBigInt64=k;function M(c){return new DataView(a(c),0,c)}Z.mallocDataView=M;function T(c){c=V.nextPow2(c);var h=V.log2(c),b=i[h];return b.length>0?b.pop():new d(c)}Z.mallocBuffer=T,Z.clearCache=function(){for(var c=0;c<32;++c)e.UINT8[c].length=0,e.UINT16[c].length=0,e.UINT32[c].length=0,e.INT8[c].length=0,e.INT16[c].length=0,e.INT32[c].length=0,e.FLOAT[c].length=0,e.DOUBLE[c].length=0,e.BIGUINT64[c].length=0,e.BIGINT64[c].length=0,e.UINT8C[c].length=0,r[c].length=0,i[c].length=0}}),s9=Vt((Z,V)=>{var u=Object.prototype.toString;V.exports=function(d){var E;return u.call(d)==="[object Object]"&&(E=Object.getPrototypeOf(d),E===null||E===Object.getPrototypeOf({}))}}),u5=Vt((Z,V)=>{V.exports=function(u,d){d||(d=[0,""]),u=String(u);var E=parseFloat(u,10);return d[0]=E,d[1]=u.match(/[\d.\-\+]*\s*(.*)/)[1]||"",d}}),l9=Vt((Z,V)=>{var u=u5();V.exports=t;var d=96;function E(e,r){var i=u(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 d;case"cm":return d/2.54;case"mm":return d/25.4;case"pt":return d/72;case"pc":return d/6}return 1}}),u9=Vt((Z,V)=>{V.exports=A;var u=A.canvas=document.createElement("canvas"),d=u.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),d.font=o+"px "+e;for(var s=0;s<n.length;s++){var f=n[s],v=d.measureText(f[0]).width+d.measureText(f[1]).width,g=d.measureText(f).width;if(Math.abs(v-g)>o*a){var m=(g-v)/o;i[f]=m*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}}),c9=Vt((Z,V)=>{V.exports=u,u.canvas=document.createElement("canvas"),u.cache={};function u(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(u.cache[r]&&i<=u.cache[r].em)return d(u.cache[r],s);var f=e.canvas||u.canvas,v=f.getContext("2d"),g={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"},m=Math.ceil(i*1.5);f.height=m,f.width=m*.5,v.font=a;var w="H",l={top:0};v.clearRect(0,0,m,m),v.textBaseline="top",v.fillStyle="black",v.fillText(w,0,0);var x=E(v.getImageData(0,0,m,m));v.clearRect(0,0,m,m),v.textBaseline="bottom",v.fillText(w,0,m);var y=E(v.getImageData(0,0,m,m));l.lineHeight=l.bottom=m-y+x,v.clearRect(0,0,m,m),v.textBaseline="alphabetic",v.fillText(w,0,m);var S=E(v.getImageData(0,0,m,m)),k=m-S-1+x;l.baseline=l.alphabetic=k,v.clearRect(0,0,m,m),v.textBaseline="middle",v.fillText(w,0,m*.5);var M=E(v.getImageData(0,0,m,m));l.median=l.middle=m-M-1+x-m*.5,v.clearRect(0,0,m,m),v.textBaseline="hanging",v.fillText(w,0,m*.5);var T=E(v.getImageData(0,0,m,m));l.hanging=m-T-1+x-m*.5,v.clearRect(0,0,m,m),v.textBaseline="ideographic",v.fillText(w,0,m);var c=E(v.getImageData(0,0,m,m));if(l.ideographic=m-c-1+x,g.upper&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.upper,0,0),l.upper=E(v.getImageData(0,0,m,m)),l.capHeight=l.baseline-l.upper),g.lower&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.lower,0,0),l.lower=E(v.getImageData(0,0,m,m)),l.xHeight=l.baseline-l.lower),g.tittle&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.tittle,0,0),l.tittle=E(v.getImageData(0,0,m,m))),g.ascent&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.ascent,0,0),l.ascent=E(v.getImageData(0,0,m,m))),g.descent&&(v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.descent,0,0),l.descent=A(v.getImageData(0,0,m,m))),g.overshoot){v.clearRect(0,0,m,m),v.textBaseline="top",v.fillText(g.overshoot,0,0);var h=A(v.getImageData(0,0,m,m));l.overshoot=h-k}for(var b in l)l[b]/=i;return l.em=i,u.cache[r]=l,d(l,s)}function d(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)}}),f9=Vt((Z,V)=>{var u=e9(),d=_p(),E=r9(),A=n9(),t=Q3(),e=Bd(),r=a9(),i=o9(),n=Wm(),o=s9(),a=u5(),s=l9(),f=u9(),v=af(),g=c9(),m=E0(),w=l5(),l=w.nextPow2,x=new t,y=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(y=!0),document.body.removeChild(S));var S,k=function(T){M(T)?(T={regl:T},this.gl=T.regl._gl):this.gl=A(T),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=T.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(T)?T:{})};k.prototype.createShader=function(){var T=this.regl,c=T({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:T.prop("count"),offset:T.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:T.this("sizeBuffer")},width:{offset:0,stride:8,buffer:T.this("sizeBuffer")},char:T.this("charBuffer"),position:T.this("position")},uniforms:{atlasSize:function(b,_){return[_.atlas.width,_.atlas.height]},atlasDim:function(b,_){return[_.atlas.cols,_.atlas.rows]},atlas:function(b,_){return _.atlas.texture},charStep:function(b,_){return _.atlas.step},em:function(b,_){return _.atlas.em},color:T.prop("color"),opacity:T.prop("opacity"),viewport:T.this("viewportArray"),scale:T.this("scale"),align:T.prop("align"),baseline:T.prop("baseline"),translate:T.this("translate"),positionOffset:T.prop("positionOffset")},primitive:"points",viewport:T.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;
}`}),h={};return{regl:T,draw:c,atlas:h}},k.prototype.update=function(T){var c=this;if(typeof T=="string")T={text:T};else if(!T)return;T=d(T,{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),T.opacity!=null&&(Array.isArray(T.opacity)?this.opacity=T.opacity.map(function(bt){return parseFloat(bt)}):this.opacity=parseFloat(T.opacity)),T.viewport!=null&&(this.viewport=n(T.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]),T.kerning!=null&&(this.kerning=T.kerning),T.offset!=null&&(typeof T.offset=="number"&&(T.offset=[T.offset,0]),this.positionOffset=m(T.offset)),T.direction&&(this.direction=T.direction),T.range&&(this.range=T.range,this.scale=[1/(T.range[2]-T.range[0]),1/(T.range[3]-T.range[1])],this.translate=[-T.range[0],-T.range[1]]),T.scale&&(this.scale=T.scale),T.translate&&(this.translate=T.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!T.font&&(T.font=k.baseFontSize+"px sans-serif");var h=!1,b=!1;if(T.font&&(Array.isArray(T.font)?T.font:[T.font]).forEach(function(bt,vt){if(typeof bt=="string")try{bt=u.parse(bt)}catch{bt=u.parse(k.baseFontSize+"px "+bt)}else{var Ut=bt.style,re=bt.weight,Zt=bt.stretch,ue=bt.variant;bt=u.parse(u.stringify(bt)),Ut&&(bt.style=Ut),re&&(bt.weight=re),Zt&&(bt.stretch=Zt),ue&&(bt.variant=ue)}var Me=u.stringify({size:k.baseFontSize,family:bt.family,stretch:y?bt.stretch:void 0,variant:bt.variant,weight:bt.weight,style:bt.style}),Ce=a(bt.size),We=Math.round(Ce[0]*s(Ce[1]));if(We!==c.fontSize[vt]&&(b=!0,c.fontSize[vt]=We),(!c.font[vt]||Me!=c.font[vt].baseString)&&(h=!0,c.font[vt]=k.fonts[Me],!c.font[vt])){var qe=bt.family.join(", "),vr=[bt.style];bt.style!=bt.variant&&vr.push(bt.variant),bt.variant!=bt.weight&&vr.push(bt.weight),y&&bt.weight!=bt.stretch&&vr.push(bt.stretch),c.font[vt]={baseString:Me,family:qe,weight:bt.weight,stretch:bt.stretch,style:bt.style,variant:bt.variant,width:{},kerning:{},metrics:g(qe,{origin:"top",fontSize:k.baseFontSize,fontStyle:vr.join(" ")})},k.fonts[Me]=c.font[vt]}}),(h||b)&&this.font.forEach(function(bt,vt){var Ut=u.stringify({size:c.fontSize[vt],family:bt.family,stretch:y?bt.stretch:void 0,variant:bt.variant,weight:bt.weight,style:bt.style});if(c.fontAtlas[vt]=c.shader.atlas[Ut],!c.fontAtlas[vt]){var re=bt.metrics;c.shader.atlas[Ut]=c.fontAtlas[vt]={fontString:Ut,step:Math.ceil(c.fontSize[vt]*re.bottom*.5)*2,em:c.fontSize[vt],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:c.regl.texture()}}T.text==null&&(T.text=c.text)}),typeof T.text=="string"&&T.position&&T.position.length>2){for(var _=Array(T.position.length*.5),P=0;P<_.length;P++)_[P]=T.text;T.text=_}var L;if(T.text!=null||h){if(this.textOffsets=[0],Array.isArray(T.text)){this.count=T.text[0].length,this.counts=[this.count];for(var D=1;D<T.text.length;D++)this.textOffsets[D]=this.textOffsets[D-1]+T.text[D-1].length,this.count+=T.text[D].length,this.counts.push(T.text[D].length);this.text=T.text.join("")}else this.text=T.text,this.count=this.text.length,this.counts=[this.count];L=[],this.font.forEach(function(bt,vt){k.atlasContext.font=bt.baseString;for(var Ut=c.fontAtlas[vt],re=0;re<c.text.length;re++){var Zt=c.text.charAt(re);if(Ut.ids[Zt]==null&&(Ut.ids[Zt]=Ut.chars.length,Ut.chars.push(Zt),L.push(Zt)),bt.width[Zt]==null&&(bt.width[Zt]=k.atlasContext.measureText(Zt).width/k.baseFontSize,c.kerning)){var ue=[];for(var Me in bt.width)ue.push(Me+Zt,Zt+Me);v(bt.kerning,f(bt.family,{pairs:ue}))}}})}if(T.position)if(T.position.length>2){for(var B=!T.position[0].length,R=i.mallocFloat(this.count*2),I=0,F=0;I<this.counts.length;I++){var N=this.counts[I];if(B)for(var j=0;j<N;j++)R[F++]=T.position[I*2],R[F++]=T.position[I*2+1];else for(var G=0;G<N;G++)R[F++]=T.position[I][0],R[F++]=T.position[I][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:T.position};if(T.text||h){var rt=i.mallocUint8(this.count),ct=i.mallocFloat(this.count*2);this.textWidth=[];for(var st=0,et=0;st<this.counts.length;st++){for(var K=this.counts[st],ot=this.font[st]||this.font[0],X=this.fontAtlas[st]||this.fontAtlas[0],Q=0;Q<K;Q++){var ut=this.text.charAt(et),J=this.text.charAt(et-1);if(rt[et]=X.ids[ut],ct[et*2]=ot.width[ut],Q){var q=ct[et*2-2],it=ct[et*2],nt=ct[et*2-1],dt=nt+q*.5+it*.5;if(this.kerning){var Tt=ot.kerning[J+ut];Tt&&(dt+=Tt*.001)}ct[et*2+1]=dt}else ct[et*2+1]=ct[et*2]*.5;et++}this.textWidth.push(ct.length?ct[et*2-2]*.5+ct[et*2-1]:0)}T.align||(T.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),L.length&&this.font.forEach(function(bt,vt){var Ut=c.fontAtlas[vt],re=Ut.step,Zt=Math.floor(k.maxAtlasSize/re),ue=Math.min(Zt,Ut.chars.length),Me=Math.ceil(Ut.chars.length/ue),Ce=l(ue*re),We=l(Me*re);Ut.width=Ce,Ut.height=We,Ut.rows=Me,Ut.cols=ue,Ut.em&&Ut.texture({data:r({canvas:k.atlasCanvas,font:Ut.fontString,chars:Ut.chars,shape:[Ce,We],step:[re,re]})})})}if(T.align&&(this.align=T.align,this.alignOffset=this.textWidth.map(function(bt,vt){var Ut=Array.isArray(c.align)?c.align.length>1?c.align[vt]:c.align[0]:c.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&&T.baseline==null&&(T.baseline=0),T.baseline!=null&&(this.baseline=T.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(bt,vt){var Ut=(c.font[vt]||c.font[0]).metrics,re=0;return re+=Ut.bottom*.5,typeof bt=="number"?re+=bt-Ut.baseline:re+=-Ut[bt],re*=-1,re})),T.color!=null)if(T.color||(T.color="transparent"),typeof T.color=="string"||!isNaN(T.color))this.color=e(T.color,"uint8");else{var wt;if(typeof T.color[0]=="number"&&T.color.length>this.counts.length){var It=T.color.length;wt=i.mallocUint8(It);for(var Ct=(T.color.subarray||T.color.slice).bind(T.color),Nt=0;Nt<It;Nt+=4)wt.set(e(Ct(Nt,Nt+4),"uint8"),Nt)}else{var ee=T.color.length;wt=i.mallocUint8(ee*4);for(var Jt=0;Jt<ee;Jt++)wt.set(e(T.color[Jt]||0,"uint8"),Jt*4)}this.color=wt}if(T.position||T.text||T.color||T.baseline||T.align||T.font||T.offset||T.opacity){var te=this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(te){var Kt=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(Kt);for(var mt=0;mt<this.batch.length;mt++)this.batch[mt]={count:this.counts.length>1?this.counts[mt]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[mt]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(mt*4,mt*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[mt]:this.opacity,baseline:this.baselineOffset[mt]!=null?this.baselineOffset[mt]:this.baselineOffset[0],align:this.align?this.alignOffset[mt]!=null?this.alignOffset[mt]:this.alignOffset[0]:0,atlas:this.fontAtlas[mt]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(mt*2,mt*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=[]}},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={};function M(T){return typeof T=="function"&&T._gl&&T.prop&&T.texture&&T.buffer}V.exports=k}),h9=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?V.exports=d():u.createREGL=d()})(Z,function(){var u=function(ie,nr){for(var cr=Object.keys(nr),sn=0;sn<cr.length;++sn)ie[cr[sn]]=nr[cr[sn]];return ie},d=0,E=0,A=5,t=6;function e(ie,nr){this.id=d++,this.type=ie,this.data=nr}function r(ie){return ie.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(ie){if(ie.length===0)return[];var nr=ie.charAt(0),cr=ie.charAt(ie.length-1);if(ie.length>1&&nr===cr&&(nr==='"'||nr==="'"))return['"'+r(ie.substr(1,ie.length-2))+'"'];var sn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(ie);if(sn)return i(ie.substr(0,sn.index)).concat(i(sn[1])).concat(i(ie.substr(sn.index+sn[0].length)));var zn=ie.split(".");if(zn.length===1)return['"'+r(ie)+'"'];for(var Tn=[],qr=0;qr<zn.length;++qr)Tn=Tn.concat(i(zn[qr]));return Tn}function n(ie){return"["+i(ie).join("][")+"]"}function o(ie,nr){return new e(ie,n(nr+""))}function a(ie){return typeof ie=="function"&&!ie._reglType||ie instanceof e}function s(ie,nr){if(typeof ie=="function")return new e(E,ie);if(typeof ie=="number"||typeof ie=="boolean")return new e(A,ie);if(Array.isArray(ie))return new e(t,ie.map(function(cr,sn){return s(cr)}));if(ie instanceof e)return ie}var f={DynamicVariable:e,define:o,isDynamic:a,unbox:s,accessor:n},v={next:typeof requestAnimationFrame=="function"?function(ie){return requestAnimationFrame(ie)}:function(ie){return setTimeout(ie,16)},cancel:typeof cancelAnimationFrame=="function"?function(ie){return cancelAnimationFrame(ie)}:clearTimeout},g=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function m(){var ie={"":0},nr=[""];return{id:function(cr){var sn=ie[cr];return sn||(sn=ie[cr]=nr.length,nr.push(cr),sn)},str:function(cr){return nr[cr]}}}function w(ie,nr,cr){var sn=document.createElement("canvas");u(sn.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),ie.appendChild(sn),ie===document.body&&(sn.style.position="absolute",u(ie.style,{margin:0,padding:0}));function zn(){var Sn=window.innerWidth,sa=window.innerHeight;if(ie!==document.body){var ea=sn.getBoundingClientRect();Sn=ea.right-ea.left,sa=ea.bottom-ea.top}sn.width=cr*Sn,sn.height=cr*sa}var Tn;ie!==document.body&&typeof ResizeObserver=="function"?(Tn=new ResizeObserver(function(){setTimeout(zn)}),Tn.observe(ie)):window.addEventListener("resize",zn,!1);function qr(){Tn?Tn.disconnect():window.removeEventListener("resize",zn),ie.removeChild(sn)}return zn(),{canvas:sn,onDestroy:qr}}function l(ie,nr){function cr(sn){try{return ie.getContext(sn,nr)}catch{return null}}return cr("webgl")||cr("experimental-webgl")||cr("webgl-experimental")}function x(ie){return typeof ie.nodeName=="string"&&typeof ie.appendChild=="function"&&typeof ie.getBoundingClientRect=="function"}function y(ie){return typeof ie.drawArrays=="function"||typeof ie.drawElements=="function"}function S(ie){return typeof ie=="string"?ie.split():ie}function k(ie){return typeof ie=="string"?document.querySelector(ie):ie}function M(ie){var nr=ie||{},cr,sn,zn,Tn,qr={},Sn=[],sa=[],ea=typeof window>"u"?1:window.devicePixelRatio,ka=!1,Ka={},Va=function(Nr){},fa=function(){};if(typeof nr=="string"?cr=document.querySelector(nr):typeof nr=="object"&&(x(nr)?cr=nr:y(nr)?(Tn=nr,zn=Tn.canvas):("gl"in nr?Tn=nr.gl:"canvas"in nr?zn=k(nr.canvas):"container"in nr&&(sn=k(nr.container)),"attributes"in nr&&(qr=nr.attributes),"extensions"in nr&&(Sn=S(nr.extensions)),"optionalExtensions"in nr&&(sa=S(nr.optionalExtensions)),"onDone"in nr&&(Va=nr.onDone),"profile"in nr&&(ka=!!nr.profile),"pixelRatio"in nr&&(ea=+nr.pixelRatio),"cachedCode"in nr&&(Ka=nr.cachedCode))),cr&&(cr.nodeName.toLowerCase()==="canvas"?zn=cr:sn=cr),!Tn){if(!zn){var Un=w(sn||document.body,Va,ea);if(!Un)return null;zn=Un.canvas,fa=Un.onDestroy}qr.premultipliedAlpha===void 0&&(qr.premultipliedAlpha=!0),Tn=l(zn,qr)}return Tn?{gl:Tn,canvas:zn,container:sn,extensions:Sn,optionalExtensions:sa,pixelRatio:ea,profile:ka,cachedCode:Ka,onDone:Va,onDestroy:fa}:(fa(),Va("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function T(ie,nr){var cr={};function sn(qr){var Sn=qr.toLowerCase(),sa;try{sa=cr[Sn]=ie.getExtension(Sn)}catch{}return!!sa}for(var zn=0;zn<nr.extensions.length;++zn){var Tn=nr.extensions[zn];if(!sn(Tn))return nr.onDestroy(),nr.onDone('"'+Tn+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return nr.optionalExtensions.forEach(sn),{extensions:cr,restore:function(){Object.keys(cr).forEach(function(qr){if(cr[qr]&&!sn(qr))throw new Error("(regl): error restoring extension "+qr)})}}}function c(ie,nr){for(var cr=Array(ie),sn=0;sn<ie;++sn)cr[sn]=nr(sn);return cr}var h=5120,b=5121,_=5122,P=5123,L=5124,D=5125,B=5126;function R(ie){for(var nr=16;nr<=1<<28;nr*=16)if(ie<=nr)return nr;return 0}function I(ie){var nr,cr;return nr=(ie>65535)<<4,ie>>>=nr,cr=(ie>255)<<3,ie>>>=cr,nr|=cr,cr=(ie>15)<<2,ie>>>=cr,nr|=cr,cr=(ie>3)<<1,ie>>>=cr,nr|=cr,nr|ie>>1}function F(){var ie=c(8,function(){return[]});function nr(Tn){var qr=R(Tn),Sn=ie[I(qr)>>2];return Sn.length>0?Sn.pop():new ArrayBuffer(qr)}function cr(Tn){ie[I(Tn.byteLength)>>2].push(Tn)}function sn(Tn,qr){var Sn=null;switch(Tn){case h:Sn=new Int8Array(nr(qr),0,qr);break;case b:Sn=new Uint8Array(nr(qr),0,qr);break;case _:Sn=new Int16Array(nr(2*qr),0,qr);break;case P:Sn=new Uint16Array(nr(2*qr),0,qr);break;case L:Sn=new Int32Array(nr(4*qr),0,qr);break;case D:Sn=new Uint32Array(nr(4*qr),0,qr);break;case B:Sn=new Float32Array(nr(4*qr),0,qr);break;default:return null}return Sn.length!==qr?Sn.subarray(0,qr):Sn}function zn(Tn){cr(Tn.buffer)}return{alloc:nr,free:cr,allocType:sn,freeType:zn}}var N=F();N.zero=F();var j=3408,G=3410,rt=3411,ct=3412,st=3413,et=3414,K=3415,ot=33901,X=33902,Q=3379,ut=3386,J=34921,q=36347,it=36348,nt=35661,dt=35660,Tt=34930,wt=36349,It=34076,Ct=34024,Nt=7936,ee=7937,Jt=7938,te=35724,Kt=34047,mt=36063,bt=34852,vt=3553,Ut=34067,re=34069,Zt=33984,ue=6408,Me=5126,Ce=5121,We=36160,qe=36053,vr=36064,_r=16384,er=function(ie,nr){var cr=1;nr.ext_texture_filter_anisotropic&&(cr=ie.getParameter(Kt));var sn=1,zn=1;nr.webgl_draw_buffers&&(sn=ie.getParameter(bt),zn=ie.getParameter(mt));var Tn=!!nr.oes_texture_float;if(Tn){var qr=ie.createTexture();ie.bindTexture(vt,qr),ie.texImage2D(vt,0,ue,1,1,0,ue,Me,null);var Sn=ie.createFramebuffer();if(ie.bindFramebuffer(We,Sn),ie.framebufferTexture2D(We,vr,vt,qr,0),ie.bindTexture(vt,null),ie.checkFramebufferStatus(We)!==qe)Tn=!1;else{ie.viewport(0,0,1,1),ie.clearColor(1,0,0,1),ie.clear(_r);var sa=N.allocType(Me,4);ie.readPixels(0,0,1,1,ue,Me,sa),ie.getError()?Tn=!1:(ie.deleteFramebuffer(Sn),ie.deleteTexture(qr),Tn=sa[0]===1),N.freeType(sa)}}var ea=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ka=!0;if(!ea){var Ka=ie.createTexture(),Va=N.allocType(Ce,36);ie.activeTexture(Zt),ie.bindTexture(Ut,Ka),ie.texImage2D(re,0,ue,3,3,0,ue,Ce,Va),N.freeType(Va),ie.bindTexture(Ut,null),ie.deleteTexture(Ka),ka=!ie.getError()}return{colorBits:[ie.getParameter(G),ie.getParameter(rt),ie.getParameter(ct),ie.getParameter(st)],depthBits:ie.getParameter(et),stencilBits:ie.getParameter(K),subpixelBits:ie.getParameter(j),extensions:Object.keys(nr).filter(function(fa){return!!nr[fa]}),maxAnisotropic:cr,maxDrawbuffers:sn,maxColorAttachments:zn,pointSizeDims:ie.getParameter(ot),lineWidthDims:ie.getParameter(X),maxViewportDims:ie.getParameter(ut),maxCombinedTextureUnits:ie.getParameter(nt),maxCubeMapSize:ie.getParameter(It),maxRenderbufferSize:ie.getParameter(Ct),maxTextureUnits:ie.getParameter(Tt),maxTextureSize:ie.getParameter(Q),maxAttributes:ie.getParameter(J),maxVertexUniforms:ie.getParameter(q),maxVertexTextureUnits:ie.getParameter(dt),maxVaryingVectors:ie.getParameter(it),maxFragmentUniforms:ie.getParameter(wt),glsl:ie.getParameter(te),renderer:ie.getParameter(ee),vendor:ie.getParameter(Nt),version:ie.getParameter(Jt),readFloat:Tn,npotTextureCube:ka}},Mr=function(ie){return ie instanceof Uint8Array||ie instanceof Uint16Array||ie instanceof Uint32Array||ie instanceof Int8Array||ie instanceof Int16Array||ie instanceof Int32Array||ie instanceof Float32Array||ie instanceof Float64Array||ie instanceof Uint8ClampedArray};function Ir(ie){return!!ie&&typeof ie=="object"&&Array.isArray(ie.shape)&&Array.isArray(ie.stride)&&typeof ie.offset=="number"&&ie.shape.length===ie.stride.length&&(Array.isArray(ie.data)||Mr(ie.data))}var de=function(ie){return Object.keys(ie).map(function(nr){return ie[nr]})},Dt={shape:Ht,flatten:St};function qt(ie,nr,cr){for(var sn=0;sn<nr;++sn)cr[sn]=ie[sn]}function _t(ie,nr,cr,sn){for(var zn=0,Tn=0;Tn<nr;++Tn)for(var qr=ie[Tn],Sn=0;Sn<cr;++Sn)sn[zn++]=qr[Sn]}function lt(ie,nr,cr,sn,zn,Tn){for(var qr=Tn,Sn=0;Sn<nr;++Sn)for(var sa=ie[Sn],ea=0;ea<cr;++ea)for(var ka=sa[ea],Ka=0;Ka<sn;++Ka)zn[qr++]=ka[Ka]}function yt(ie,nr,cr,sn,zn){for(var Tn=1,qr=cr+1;qr<nr.length;++qr)Tn*=nr[qr];var Sn=nr[cr];if(nr.length-cr===4){var sa=nr[cr+1],ea=nr[cr+2],ka=nr[cr+3];for(qr=0;qr<Sn;++qr)lt(ie[qr],sa,ea,ka,sn,zn),zn+=Tn}else for(qr=0;qr<Sn;++qr)yt(ie[qr],nr,cr+1,sn,zn),zn+=Tn}function St(ie,nr,cr,sn){var zn=1;if(nr.length)for(var Tn=0;Tn<nr.length;++Tn)zn*=nr[Tn];else zn=0;var qr=sn||N.allocType(cr,zn);switch(nr.length){case 0:break;case 1:qt(ie,nr[0],qr);break;case 2:_t(ie,nr[0],nr[1],qr);break;case 3:lt(ie,nr[0],nr[1],nr[2],qr,0);break;default:yt(ie,nr,0,qr,0)}return qr}function Ht(ie){for(var nr=[],cr=ie;cr.length;cr=cr[0])nr.push(cr.length);return nr}var Yt={"[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},se=5120,ke=5122,Ee=5124,Ue=5121,ir=5123,ar=5125,Ye=5126,Er=5126,pn={int8:se,int16:ke,int32:Ee,uint8:Ue,uint16:ir,uint32:ar,float:Ye,float32:Er},dn=35048,bn=35040,Zn={dynamic:dn,stream:bn,static:35044},En=Dt.flatten,gn=Dt.shape,da=35044,ra=35040,Se=5121,Re=5126,Ze=[];Ze[5120]=1,Ze[5122]=2,Ze[5124]=4,Ze[5121]=1,Ze[5123]=2,Ze[5125]=4,Ze[5126]=4;function tr(ie){return Yt[Object.prototype.toString.call(ie)]|0}function zr(ie,nr){for(var cr=0;cr<nr.length;++cr)ie[cr]=nr[cr]}function tn(ie,nr,cr,sn,zn,Tn,qr){for(var Sn=0,sa=0;sa<cr;++sa)for(var ea=0;ea<sn;++ea)ie[Sn++]=nr[zn*sa+Tn*ea+qr]}function Yr(ie,nr,cr,sn){var zn=0,Tn={};function qr(Nr){this.id=zn++,this.buffer=ie.createBuffer(),this.type=Nr,this.usage=da,this.byteLength=0,this.dimension=1,this.dtype=Se,this.persistentData=null,cr.profile&&(this.stats={size:0})}qr.prototype.bind=function(){ie.bindBuffer(this.type,this.buffer)},qr.prototype.destroy=function(){Va(this)};var Sn=[];function sa(Nr,fn){var Xn=Sn.pop();return Xn||(Xn=new qr(Nr)),Xn.bind(),Ka(Xn,fn,ra,0,1,!1),Xn}function ea(Nr){Sn.push(Nr)}function ka(Nr,fn,Xn){Nr.byteLength=fn.byteLength,ie.bufferData(Nr.type,fn,Xn)}function Ka(Nr,fn,Xn,jn,kn,Ia){var ya;if(Nr.usage=Xn,Array.isArray(fn)){if(Nr.dtype=jn||Re,fn.length>0){var qa;if(Array.isArray(fn[0])){ya=gn(fn);for(var Rn=1,An=1;An<ya.length;++An)Rn*=ya[An];Nr.dimension=Rn,qa=En(fn,ya,Nr.dtype),ka(Nr,qa,Xn),Ia?Nr.persistentData=qa:N.freeType(qa)}else if(typeof fn[0]=="number"){Nr.dimension=kn;var Pa=N.allocType(Nr.dtype,fn.length);zr(Pa,fn),ka(Nr,Pa,Xn),Ia?Nr.persistentData=Pa:N.freeType(Pa)}else Mr(fn[0])&&(Nr.dimension=fn[0].length,Nr.dtype=jn||tr(fn[0])||Re,qa=En(fn,[fn.length,fn[0].length],Nr.dtype),ka(Nr,qa,Xn),Ia?Nr.persistentData=qa:N.freeType(qa))}}else if(Mr(fn))Nr.dtype=jn||tr(fn),Nr.dimension=kn,ka(Nr,fn,Xn),Ia&&(Nr.persistentData=new Uint8Array(new Uint8Array(fn.buffer)));else if(Ir(fn)){ya=fn.shape;var ba=fn.stride,aa=fn.offset,oa=0,Sa=0,_i=0,pi=0;ya.length===1?(oa=ya[0],Sa=1,_i=ba[0],pi=0):ya.length===2&&(oa=ya[0],Sa=ya[1],_i=ba[0],pi=ba[1]),Nr.dtype=jn||tr(fn.data)||Re,Nr.dimension=Sa;var Ma=N.allocType(Nr.dtype,oa*Sa);tn(Ma,fn.data,oa,Sa,_i,pi,aa),ka(Nr,Ma,Xn),Ia?Nr.persistentData=Ma:N.freeType(Ma)}else fn instanceof ArrayBuffer&&(Nr.dtype=Se,Nr.dimension=kn,ka(Nr,fn,Xn),Ia&&(Nr.persistentData=new Uint8Array(new Uint8Array(fn))))}function Va(Nr){nr.bufferCount--,sn(Nr);var fn=Nr.buffer;ie.deleteBuffer(fn),Nr.buffer=null,delete Tn[Nr.id]}function fa(Nr,fn,Xn,jn){nr.bufferCount++;var kn=new qr(fn);Tn[kn.id]=kn;function Ia(Rn){var An=da,Pa=null,ba=0,aa=0,oa=1;return Array.isArray(Rn)||Mr(Rn)||Ir(Rn)||Rn instanceof ArrayBuffer?Pa=Rn:typeof Rn=="number"?ba=Rn|0:Rn&&("data"in Rn&&(Pa=Rn.data),"usage"in Rn&&(An=Zn[Rn.usage]),"type"in Rn&&(aa=pn[Rn.type]),"dimension"in Rn&&(oa=Rn.dimension|0),"length"in Rn&&(ba=Rn.length|0)),kn.bind(),Pa?Ka(kn,Pa,An,aa,oa,jn):(ba&&ie.bufferData(kn.type,ba,An),kn.dtype=aa||Se,kn.usage=An,kn.dimension=oa,kn.byteLength=ba),cr.profile&&(kn.stats.size=kn.byteLength*Ze[kn.dtype]),Ia}function ya(Rn,An){ie.bufferSubData(kn.type,An,Rn)}function qa(Rn,An){var Pa=(An||0)|0,ba;if(kn.bind(),Mr(Rn)||Rn instanceof ArrayBuffer)ya(Rn,Pa);else if(Array.isArray(Rn)){if(Rn.length>0){if(typeof Rn[0]=="number"){var aa=N.allocType(kn.dtype,Rn.length);zr(aa,Rn),ya(aa,Pa),N.freeType(aa)}else if(Array.isArray(Rn[0])||Mr(Rn[0])){ba=gn(Rn);var oa=En(Rn,ba,kn.dtype);ya(oa,Pa),N.freeType(oa)}}}else if(Ir(Rn)){ba=Rn.shape;var Sa=Rn.stride,_i=0,pi=0,Ma=0,Na=0;ba.length===1?(_i=ba[0],pi=1,Ma=Sa[0],Na=0):ba.length===2&&(_i=ba[0],pi=ba[1],Ma=Sa[0],Na=Sa[1]);var ui=Array.isArray(Rn.data)?kn.dtype:tr(Rn.data),gi=N.allocType(ui,_i*pi);tn(gi,Rn.data,_i,pi,Ma,Na,Rn.offset),ya(gi,Pa),N.freeType(gi)}return Ia}return Xn||Ia(Nr),Ia._reglType="buffer",Ia._buffer=kn,Ia.subdata=qa,cr.profile&&(Ia.stats=kn.stats),Ia.destroy=function(){Va(kn)},Ia}function Un(){de(Tn).forEach(function(Nr){Nr.buffer=ie.createBuffer(),ie.bindBuffer(Nr.type,Nr.buffer),ie.bufferData(Nr.type,Nr.persistentData||Nr.byteLength,Nr.usage)})}return cr.profile&&(nr.getTotalBufferSize=function(){var Nr=0;return Object.keys(Tn).forEach(function(fn){Nr+=Tn[fn].stats.size}),Nr}),{create:fa,createStream:sa,destroyStream:ea,clear:function(){de(Tn).forEach(Va),Sn.forEach(Va)},getBuffer:function(Nr){return Nr&&Nr._buffer instanceof qr?Nr._buffer:null},restore:Un,_initBuffer:Ka}}var $r=0,In=0,Nn=1,Kn=1,$n=4,ia=4,Cn={points:$r,point:In,lines:Nn,line:Kn,triangles:$n,triangle:ia,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Fa=0,Ga=1,ve=4,ge=5120,dr=5121,br=5122,Tr=5123,mr=5124,kr=5125,Ur=34963,Or=35040,pe=35044;function Ke(ie,nr,cr,sn){var zn={},Tn=0,qr={uint8:dr,uint16:Tr};nr.oes_element_index_uint&&(qr.uint32=kr);function Sn(Un){this.id=Tn++,zn[this.id]=this,this.buffer=Un,this.primType=ve,this.vertCount=0,this.type=0}Sn.prototype.bind=function(){this.buffer.bind()};var sa=[];function ea(Un){var Nr=sa.pop();return Nr||(Nr=new Sn(cr.create(null,Ur,!0,!1)._buffer)),Ka(Nr,Un,Or,-1,-1,0,0),Nr}function ka(Un){sa.push(Un)}function Ka(Un,Nr,fn,Xn,jn,kn,Ia){Un.buffer.bind();var ya;if(Nr){var qa=Ia;!Ia&&(!Mr(Nr)||Ir(Nr)&&!Mr(Nr.data))&&(qa=nr.oes_element_index_uint?kr:Tr),cr._initBuffer(Un.buffer,Nr,fn,qa,3)}else ie.bufferData(Ur,kn,fn),Un.buffer.dtype=ya||dr,Un.buffer.usage=fn,Un.buffer.dimension=3,Un.buffer.byteLength=kn;if(ya=Ia,!Ia){switch(Un.buffer.dtype){case dr:case ge:ya=dr;break;case Tr:case br:ya=Tr;break;case kr:case mr:ya=kr;break}Un.buffer.dtype=ya}Un.type=ya;var Rn=jn;Rn<0&&(Rn=Un.buffer.byteLength,ya===Tr?Rn>>=1:ya===kr&&(Rn>>=2)),Un.vertCount=Rn;var An=Xn;if(Xn<0){An=ve;var Pa=Un.buffer.dimension;Pa===1&&(An=Fa),Pa===2&&(An=Ga),Pa===3&&(An=ve)}Un.primType=An}function Va(Un){sn.elementsCount--,delete zn[Un.id],Un.buffer.destroy(),Un.buffer=null}function fa(Un,Nr){var fn=cr.create(null,Ur,!0),Xn=new Sn(fn._buffer);sn.elementsCount++;function jn(kn){if(!kn)fn(),Xn.primType=ve,Xn.vertCount=0,Xn.type=dr;else if(typeof kn=="number")fn(kn),Xn.primType=ve,Xn.vertCount=kn|0,Xn.type=dr;else{var Ia=null,ya=pe,qa=-1,Rn=-1,An=0,Pa=0;Array.isArray(kn)||Mr(kn)||Ir(kn)?Ia=kn:("data"in kn&&(Ia=kn.data),"usage"in kn&&(ya=Zn[kn.usage]),"primitive"in kn&&(qa=Cn[kn.primitive]),"count"in kn&&(Rn=kn.count|0),"type"in kn&&(Pa=qr[kn.type]),"length"in kn?An=kn.length|0:(An=Rn,Pa===Tr||Pa===br?An*=2:(Pa===kr||Pa===mr)&&(An*=4))),Ka(Xn,Ia,ya,qa,Rn,An,Pa)}return jn}return jn(Un),jn._reglType="elements",jn._elements=Xn,jn.subdata=function(kn,Ia){return fn.subdata(kn,Ia),jn},jn.destroy=function(){Va(Xn)},jn}return{create:fa,createStream:ea,destroyStream:ka,getElements:function(Un){return typeof Un=="function"&&Un._elements instanceof Sn?Un._elements:null},clear:function(){de(zn).forEach(Va)}}}var xr=new Float32Array(1),Gr=new Uint32Array(xr.buffer),ln=5123;function wn(ie){for(var nr=N.allocType(ln,ie.length),cr=0;cr<ie.length;++cr)if(isNaN(ie[cr]))nr[cr]=65535;else if(ie[cr]===1/0)nr[cr]=31744;else if(ie[cr]===-1/0)nr[cr]=64512;else{xr[0]=ie[cr];var sn=Gr[0],zn=sn>>>31<<15,Tn=(sn<<1>>>24)-127,qr=sn>>13&1023;if(Tn<-24)nr[cr]=zn;else if(Tn<-14){var Sn=-14-Tn;nr[cr]=zn+(qr+1024>>Sn)}else Tn>15?nr[cr]=zn+31744:nr[cr]=zn+(Tn+15<<10)+qr}return nr}function rn(ie){return Array.isArray(ie)||Mr(ie)}var Qr=34467,vn=3553,Oa=34067,Qn=34069,Qa=6408,Ja=6406,wi=6407,ci=6409,Ti=6410,Ra=32854,Qi=32855,Hi=36194,Ho=32819,Ci=32820,zo=33635,qi=34042,qo=6402,Po=34041,hs=35904,Gi=35906,uo=36193,yi=33776,ao=33777,ts=33778,vs=33779,As=35986,_o=35987,Da=34798,li=35840,wo=35841,Ms=35842,Di=35843,_s=36196,No=5121,is=5123,al=5125,ii=5126,io=10242,co=10243,Is=10497,Wo=33071,Bi=33648,$s=10240,fl=10241,Jo=9728,us=9729,Ss=9984,Ls=9985,yl=9986,bu=9987,au=33170,fu=4352,Ec=4353,xc=4354,cs=34046,Gl=3317,zc=37440,Al=37441,xl=37443,Ml=37444,hu=33984,Fs=[Ss,yl,Ls,bu],_l=[0,ci,Ti,wi,Qa],Fo={};Fo[ci]=Fo[Ja]=Fo[qo]=1,Fo[Po]=Fo[Ti]=2,Fo[wi]=Fo[hs]=3,Fo[Qa]=Fo[Gi]=4;function bs(ie){return"[object "+ie+"]"}var Iu=bs("HTMLCanvasElement"),Nl=bs("OffscreenCanvas"),Hu=bs("CanvasRenderingContext2D"),qs=bs("ImageBitmap"),of=bs("HTMLImageElement"),Oo=bs("HTMLVideoElement"),vf=Object.keys(Yt).concat([Iu,Nl,Hu,qs,of,Oo]),os=[];os[No]=1,os[ii]=4,os[uo]=2,os[is]=2,os[al]=4;var Fi=[];Fi[Ra]=2,Fi[Qi]=2,Fi[Hi]=2,Fi[Po]=4,Fi[yi]=.5,Fi[ao]=.5,Fi[ts]=1,Fi[vs]=1,Fi[As]=.5,Fi[_o]=1,Fi[Da]=1,Fi[li]=.5,Fi[wo]=.25,Fi[Ms]=.5,Fi[Di]=.25,Fi[_s]=.5;function nc(ie){return Array.isArray(ie)&&(ie.length===0||typeof ie[0]=="number")}function pu(ie){if(!Array.isArray(ie))return!1;var nr=ie.length;return!(nr===0||!rn(ie[0]))}function ml(ie){return Object.prototype.toString.call(ie)}function Lc(ie){return ml(ie)===Iu}function qu(ie){return ml(ie)===Nl}function dc(ie){return ml(ie)===Hu}function bl(ie){return ml(ie)===qs}function Yc(ie){return ml(ie)===of}function Fc(ie){return ml(ie)===Oo}function mc(ie){if(!ie)return!1;var nr=ml(ie);return vf.indexOf(nr)>=0?!0:nc(ie)||pu(ie)||Ir(ie)}function Wu(ie){return Yt[Object.prototype.toString.call(ie)]|0}function Cc(ie,nr){var cr=nr.length;switch(ie.type){case No:case is:case al:case ii:var sn=N.allocType(ie.type,cr);sn.set(nr),ie.data=sn;break;case uo:ie.data=wn(nr);break}}function Ic(ie,nr){return N.allocType(ie.type===uo?ii:ie.type,nr)}function du(ie,nr){ie.type===uo?(ie.data=wn(nr),N.freeType(nr)):ie.data=nr}function Bc(ie,nr,cr,sn,zn,Tn){for(var qr=ie.width,Sn=ie.height,sa=ie.channels,ea=qr*Sn*sa,ka=Ic(ie,ea),Ka=0,Va=0;Va<Sn;++Va)for(var fa=0;fa<qr;++fa)for(var Un=0;Un<sa;++Un)ka[Ka++]=nr[cr*fa+sn*Va+zn*Un+Tn];du(ie,ka)}function Pu(ie,nr,cr,sn,zn,Tn){var qr;if(typeof Fi[ie]<"u"?qr=Fi[ie]:qr=Fo[ie]*os[nr],Tn&&(qr*=6),zn){for(var Sn=0,sa=cr;sa>=1;)Sn+=qr*sa*sa,sa/=2;return Sn}else return qr*cr*sn}function wu(ie,nr,cr,sn,zn,Tn,qr){var Sn={"don't care":fu,"dont care":fu,nice:xc,fast:Ec},sa={repeat:Is,clamp:Wo,mirror:Bi},ea={nearest:Jo,linear:us},ka=u({mipmap:bu,"nearest mipmap nearest":Ss,"linear mipmap nearest":Ls,"nearest mipmap linear":yl,"linear mipmap linear":bu},ea),Ka={none:0,browser:Ml},Va={uint8:No,rgba4:Ho,rgb565:zo,"rgb5 a1":Ci},fa={alpha:Ja,luminance:ci,"luminance alpha":Ti,rgb:wi,rgba:Qa,rgba4:Ra,"rgb5 a1":Qi,rgb565:Hi},Un={};nr.ext_srgb&&(fa.srgb=hs,fa.srgba=Gi),nr.oes_texture_float&&(Va.float32=Va.float=ii),nr.oes_texture_half_float&&(Va.float16=Va["half float"]=uo),nr.webgl_depth_texture&&(u(fa,{depth:qo,"depth stencil":Po}),u(Va,{uint16:is,uint32:al,"depth stencil":qi})),nr.webgl_compressed_texture_s3tc&&u(Un,{"rgb s3tc dxt1":yi,"rgba s3tc dxt1":ao,"rgba s3tc dxt3":ts,"rgba s3tc dxt5":vs}),nr.webgl_compressed_texture_atc&&u(Un,{"rgb atc":As,"rgba atc explicit alpha":_o,"rgba atc interpolated alpha":Da}),nr.webgl_compressed_texture_pvrtc&&u(Un,{"rgb pvrtc 4bppv1":li,"rgb pvrtc 2bppv1":wo,"rgba pvrtc 4bppv1":Ms,"rgba pvrtc 2bppv1":Di}),nr.webgl_compressed_texture_etc1&&(Un["rgb etc1"]=_s);var Nr=Array.prototype.slice.call(ie.getParameter(Qr));Object.keys(Un).forEach(function(U){var tt=Un[U];Nr.indexOf(tt)>=0&&(fa[U]=tt)});var fn=Object.keys(fa);cr.textureFormats=fn;var Xn=[];Object.keys(fa).forEach(function(U){var tt=fa[U];Xn[tt]=U});var jn=[];Object.keys(Va).forEach(function(U){var tt=Va[U];jn[tt]=U});var kn=[];Object.keys(ea).forEach(function(U){var tt=ea[U];kn[tt]=U});var Ia=[];Object.keys(ka).forEach(function(U){var tt=ka[U];Ia[tt]=U});var ya=[];Object.keys(sa).forEach(function(U){var tt=sa[U];ya[tt]=U});var qa=fn.reduce(function(U,tt){var Y=fa[tt];return Y===ci||Y===Ja||Y===ci||Y===Ti||Y===qo||Y===Po||nr.ext_srgb&&(Y===hs||Y===Gi)?U[Y]=Y:Y===Qi||tt.indexOf("rgba")>=0?U[Y]=Qa:U[Y]=wi,U},{});function Rn(){this.internalformat=Qa,this.format=Qa,this.type=No,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Ml,this.width=0,this.height=0,this.channels=0}function An(U,tt){U.internalformat=tt.internalformat,U.format=tt.format,U.type=tt.type,U.compressed=tt.compressed,U.premultiplyAlpha=tt.premultiplyAlpha,U.flipY=tt.flipY,U.unpackAlignment=tt.unpackAlignment,U.colorSpace=tt.colorSpace,U.width=tt.width,U.height=tt.height,U.channels=tt.channels}function Pa(U,tt){if(!(typeof tt!="object"||!tt)){if("premultiplyAlpha"in tt&&(U.premultiplyAlpha=tt.premultiplyAlpha),"flipY"in tt&&(U.flipY=tt.flipY),"alignment"in tt&&(U.unpackAlignment=tt.alignment),"colorSpace"in tt&&(U.colorSpace=Ka[tt.colorSpace]),"type"in tt){var Y=tt.type;U.type=Va[Y]}var ft=U.width,zt=U.height,Qt=U.channels,ne=!1;"shape"in tt?(ft=tt.shape[0],zt=tt.shape[1],tt.shape.length===3&&(Qt=tt.shape[2],ne=!0)):("radius"in tt&&(ft=zt=tt.radius),"width"in tt&&(ft=tt.width),"height"in tt&&(zt=tt.height),"channels"in tt&&(Qt=tt.channels,ne=!0)),U.width=ft|0,U.height=zt|0,U.channels=Qt|0;var Ft=!1;if("format"in tt){var $t=tt.format,he=U.internalformat=fa[$t];U.format=qa[he],$t in Va&&("type"in tt||(U.type=Va[$t])),$t in Un&&(U.compressed=!0),Ft=!0}!ne&&Ft?U.channels=Fo[U.format]:ne&&!Ft&&U.channels!==_l[U.format]&&(U.format=U.internalformat=_l[U.channels])}}function ba(U){ie.pixelStorei(zc,U.flipY),ie.pixelStorei(Al,U.premultiplyAlpha),ie.pixelStorei(xl,U.colorSpace),ie.pixelStorei(Gl,U.unpackAlignment)}function aa(){Rn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function oa(U,tt){var Y=null;if(mc(tt)?Y=tt:tt&&(Pa(U,tt),"x"in tt&&(U.xOffset=tt.x|0),"y"in tt&&(U.yOffset=tt.y|0),mc(tt.data)&&(Y=tt.data)),tt.copy){var ft=zn.viewportWidth,zt=zn.viewportHeight;U.width=U.width||ft-U.xOffset,U.height=U.height||zt-U.yOffset,U.needsCopy=!0}else if(!Y)U.width=U.width||1,U.height=U.height||1,U.channels=U.channels||4;else if(Mr(Y))U.channels=U.channels||4,U.data=Y,!("type"in tt)&&U.type===No&&(U.type=Wu(Y));else if(nc(Y))U.channels=U.channels||4,Cc(U,Y),U.alignment=1,U.needsFree=!0;else if(Ir(Y)){var Qt=Y.data;!Array.isArray(Qt)&&U.type===No&&(U.type=Wu(Qt));var ne=Y.shape,Ft=Y.stride,$t,he,Ne,Ie,Fe,He;ne.length===3?(Ne=ne[2],He=Ft[2]):(Ne=1,He=1),$t=ne[0],he=ne[1],Ie=Ft[0],Fe=Ft[1],U.alignment=1,U.width=$t,U.height=he,U.channels=Ne,U.format=U.internalformat=_l[Ne],U.needsFree=!0,Bc(U,Qt,Ie,Fe,He,Y.offset)}else if(Lc(Y)||qu(Y)||dc(Y))Lc(Y)||qu(Y)?U.element=Y:U.element=Y.canvas,U.width=U.element.width,U.height=U.element.height,U.channels=4;else if(bl(Y))U.element=Y,U.width=Y.width,U.height=Y.height,U.channels=4;else if(Yc(Y))U.element=Y,U.width=Y.naturalWidth,U.height=Y.naturalHeight,U.channels=4;else if(Fc(Y))U.element=Y,U.width=Y.videoWidth,U.height=Y.videoHeight,U.channels=4;else if(pu(Y)){var Ge=U.width||Y[0].length,Ae=U.height||Y.length,Oe=U.channels;rn(Y[0][0])?Oe=Oe||Y[0][0].length:Oe=Oe||1;for(var Le=Dt.shape(Y),ur=1,Dr=0;Dr<Le.length;++Dr)ur*=Le[Dr];var jr=Ic(U,ur);Dt.flatten(Y,Le,"",jr),du(U,jr),U.alignment=1,U.width=Ge,U.height=Ae,U.channels=Oe,U.format=U.internalformat=_l[Oe],U.needsFree=!0}U.type===ii||U.type}function Sa(U,tt,Y){var ft=U.element,zt=U.data,Qt=U.internalformat,ne=U.format,Ft=U.type,$t=U.width,he=U.height;ba(U),ft?ie.texImage2D(tt,Y,ne,ne,Ft,ft):U.compressed?ie.compressedTexImage2D(tt,Y,Qt,$t,he,0,zt):U.needsCopy?(sn(),ie.copyTexImage2D(tt,Y,ne,U.xOffset,U.yOffset,$t,he,0)):ie.texImage2D(tt,Y,ne,$t,he,0,ne,Ft,zt||null)}function _i(U,tt,Y,ft,zt){var Qt=U.element,ne=U.data,Ft=U.internalformat,$t=U.format,he=U.type,Ne=U.width,Ie=U.height;ba(U),Qt?ie.texSubImage2D(tt,zt,Y,ft,$t,he,Qt):U.compressed?ie.compressedTexSubImage2D(tt,zt,Y,ft,Ft,Ne,Ie,ne):U.needsCopy?(sn(),ie.copyTexSubImage2D(tt,zt,Y,ft,U.xOffset,U.yOffset,Ne,Ie)):ie.texSubImage2D(tt,zt,Y,ft,Ne,Ie,$t,he,ne)}var pi=[];function Ma(){return pi.pop()||new aa}function Na(U){U.needsFree&&N.freeType(U.data),aa.call(U),pi.push(U)}function ui(){Rn.call(this),this.genMipmaps=!1,this.mipmapHint=fu,this.mipmask=0,this.images=Array(16)}function gi(U,tt,Y){var ft=U.images[0]=Ma();U.mipmask=1,ft.width=U.width=tt,ft.height=U.height=Y,ft.channels=U.channels=4}function Ri(U,tt){var Y=null;if(mc(tt))Y=U.images[0]=Ma(),An(Y,U),oa(Y,tt),U.mipmask=1;else if(Pa(U,tt),Array.isArray(tt.mipmap))for(var ft=tt.mipmap,zt=0;zt<ft.length;++zt)Y=U.images[zt]=Ma(),An(Y,U),Y.width>>=zt,Y.height>>=zt,oa(Y,ft[zt]),U.mipmask|=1<<zt;else Y=U.images[0]=Ma(),An(Y,U),oa(Y,tt),U.mipmask=1;An(U,U.images[0]),U.compressed&&(U.internalformat===yi||U.internalformat===ao||U.internalformat===ts||U.internalformat)}function ds(U,tt){for(var Y=U.images,ft=0;ft<Y.length;++ft){if(!Y[ft])return;Sa(Y[ft],tt,ft)}}var rs=[];function Zi(){var U=rs.pop()||new ui;Rn.call(U),U.mipmask=0;for(var tt=0;tt<16;++tt)U.images[tt]=null;return U}function Zs(U){for(var tt=U.images,Y=0;Y<tt.length;++Y)tt[Y]&&Na(tt[Y]),tt[Y]=null;rs.push(U)}function Zo(){this.minFilter=Jo,this.magFilter=Jo,this.wrapS=Wo,this.wrapT=Wo,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=fu}function Qs(U,tt){if("min"in tt){var Y=tt.min;U.minFilter=ka[Y],Fs.indexOf(U.minFilter)>=0&&!("faces"in tt)&&(U.genMipmaps=!0)}if("mag"in tt){var ft=tt.mag;U.magFilter=ea[ft]}var zt=U.wrapS,Qt=U.wrapT;if("wrap"in tt){var ne=tt.wrap;typeof ne=="string"?zt=Qt=sa[ne]:Array.isArray(ne)&&(zt=sa[ne[0]],Qt=sa[ne[1]])}else{if("wrapS"in tt){var Ft=tt.wrapS;zt=sa[Ft]}if("wrapT"in tt){var $t=tt.wrapT;Qt=sa[$t]}}if(U.wrapS=zt,U.wrapT=Qt,"anisotropic"in tt&&(tt.anisotropic,U.anisotropic=tt.anisotropic),"mipmap"in tt){var he=!1;switch(typeof tt.mipmap){case"string":U.mipmapHint=Sn[tt.mipmap],U.genMipmaps=!0,he=!0;break;case"boolean":he=U.genMipmaps=tt.mipmap;break;case"object":U.genMipmaps=!1,he=!0;break}he&&!("min"in tt)&&(U.minFilter=Ss)}}function El(U,tt){ie.texParameteri(tt,fl,U.minFilter),ie.texParameteri(tt,$s,U.magFilter),ie.texParameteri(tt,io,U.wrapS),ie.texParameteri(tt,co,U.wrapT),nr.ext_texture_filter_anisotropic&&ie.texParameteri(tt,cs,U.anisotropic),U.genMipmaps&&(ie.hint(au,U.mipmapHint),ie.generateMipmap(tt))}var Cl=0,Hs={},js=cr.maxTextureUnits,Ks=Array(js).map(function(){return null});function Mi(U){Rn.call(this),this.mipmask=0,this.internalformat=Qa,this.id=Cl++,this.refCount=1,this.target=U,this.texture=ie.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Zo,qr.profile&&(this.stats={size:0})}function Ys(U){ie.activeTexture(hu),ie.bindTexture(U.target,U.texture)}function Uo(){var U=Ks[0];U?ie.bindTexture(U.target,U.texture):ie.bindTexture(vn,null)}function tl(U){var tt=U.texture,Y=U.unit,ft=U.target;Y>=0&&(ie.activeTexture(hu+Y),ie.bindTexture(ft,null),Ks[Y]=null),ie.deleteTexture(tt),U.texture=null,U.params=null,U.pixels=null,U.refCount=0,delete Hs[U.id],Tn.textureCount--}u(Mi.prototype,{bind:function(){var U=this;U.bindCount+=1;var tt=U.unit;if(tt<0){for(var Y=0;Y<js;++Y){var ft=Ks[Y];if(ft){if(ft.bindCount>0)continue;ft.unit=-1}Ks[Y]=U,tt=Y;break}qr.profile&&Tn.maxTextureUnits<tt+1&&(Tn.maxTextureUnits=tt+1),U.unit=tt,ie.activeTexture(hu+tt),ie.bindTexture(U.target,U.texture)}return tt},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&tl(this)}});function Il(U,tt){var Y=new Mi(vn);Hs[Y.id]=Y,Tn.textureCount++;function ft(ne,Ft){var $t=Y.texInfo;Zo.call($t);var he=Zi();return typeof ne=="number"?typeof Ft=="number"?gi(he,ne|0,Ft|0):gi(he,ne|0,ne|0):ne?(Qs($t,ne),Ri(he,ne)):gi(he,1,1),$t.genMipmaps&&(he.mipmask=(he.width<<1)-1),Y.mipmask=he.mipmask,An(Y,he),Y.internalformat=he.internalformat,ft.width=he.width,ft.height=he.height,Ys(Y),ds(he,vn),El($t,vn),Uo(),Zs(he),qr.profile&&(Y.stats.size=Pu(Y.internalformat,Y.type,he.width,he.height,$t.genMipmaps,!1)),ft.format=Xn[Y.internalformat],ft.type=jn[Y.type],ft.mag=kn[$t.magFilter],ft.min=Ia[$t.minFilter],ft.wrapS=ya[$t.wrapS],ft.wrapT=ya[$t.wrapT],ft}function zt(ne,Ft,$t,he){var Ne=Ft|0,Ie=$t|0,Fe=he|0,He=Ma();return An(He,Y),He.width=0,He.height=0,oa(He,ne),He.width=He.width||(Y.width>>Fe)-Ne,He.height=He.height||(Y.height>>Fe)-Ie,Ys(Y),_i(He,vn,Ne,Ie,Fe),Uo(),Na(He),ft}function Qt(ne,Ft){var $t=ne|0,he=Ft|0||$t;if($t===Y.width&&he===Y.height)return ft;ft.width=Y.width=$t,ft.height=Y.height=he,Ys(Y);for(var Ne=0;Y.mipmask>>Ne;++Ne){var Ie=$t>>Ne,Fe=he>>Ne;if(!Ie||!Fe)break;ie.texImage2D(vn,Ne,Y.format,Ie,Fe,0,Y.format,Y.type,null)}return Uo(),qr.profile&&(Y.stats.size=Pu(Y.internalformat,Y.type,$t,he,!1,!1)),ft}return ft(U,tt),ft.subimage=zt,ft.resize=Qt,ft._reglType="texture2d",ft._texture=Y,qr.profile&&(ft.stats=Y.stats),ft.destroy=function(){Y.decRef()},ft}function vi(U,tt,Y,ft,zt,Qt){var ne=new Mi(Oa);Hs[ne.id]=ne,Tn.cubeCount++;var Ft=new Array(6);function $t(Ie,Fe,He,Ge,Ae,Oe){var Le,ur=ne.texInfo;for(Zo.call(ur),Le=0;Le<6;++Le)Ft[Le]=Zi();if(typeof Ie=="number"||!Ie){var Dr=Ie|0||1;for(Le=0;Le<6;++Le)gi(Ft[Le],Dr,Dr)}else if(typeof Ie=="object")if(Fe)Ri(Ft[0],Ie),Ri(Ft[1],Fe),Ri(Ft[2],He),Ri(Ft[3],Ge),Ri(Ft[4],Ae),Ri(Ft[5],Oe);else if(Qs(ur,Ie),Pa(ne,Ie),"faces"in Ie){var jr=Ie.faces;for(Le=0;Le<6;++Le)An(Ft[Le],ne),Ri(Ft[Le],jr[Le])}else for(Le=0;Le<6;++Le)Ri(Ft[Le],Ie);for(An(ne,Ft[0]),ur.genMipmaps?ne.mipmask=(Ft[0].width<<1)-1:ne.mipmask=Ft[0].mipmask,ne.internalformat=Ft[0].internalformat,$t.width=Ft[0].width,$t.height=Ft[0].height,Ys(ne),Le=0;Le<6;++Le)ds(Ft[Le],Qn+Le);for(El(ur,Oa),Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,ur.genMipmaps,!0)),$t.format=Xn[ne.internalformat],$t.type=jn[ne.type],$t.mag=kn[ur.magFilter],$t.min=Ia[ur.minFilter],$t.wrapS=ya[ur.wrapS],$t.wrapT=ya[ur.wrapT],Le=0;Le<6;++Le)Zs(Ft[Le]);return $t}function he(Ie,Fe,He,Ge,Ae){var Oe=He|0,Le=Ge|0,ur=Ae|0,Dr=Ma();return An(Dr,ne),Dr.width=0,Dr.height=0,oa(Dr,Fe),Dr.width=Dr.width||(ne.width>>ur)-Oe,Dr.height=Dr.height||(ne.height>>ur)-Le,Ys(ne),_i(Dr,Qn+Ie,Oe,Le,ur),Uo(),Na(Dr),$t}function Ne(Ie){var Fe=Ie|0;if(Fe!==ne.width){$t.width=ne.width=Fe,$t.height=ne.height=Fe,Ys(ne);for(var He=0;He<6;++He)for(var Ge=0;ne.mipmask>>Ge;++Ge)ie.texImage2D(Qn+He,Ge,ne.format,Fe>>Ge,Fe>>Ge,0,ne.format,ne.type,null);return Uo(),qr.profile&&(ne.stats.size=Pu(ne.internalformat,ne.type,$t.width,$t.height,!1,!0)),$t}}return $t(U,tt,Y,ft,zt,Qt),$t.subimage=he,$t.resize=Ne,$t._reglType="textureCube",$t._texture=ne,qr.profile&&($t.stats=ne.stats),$t.destroy=function(){ne.decRef()},$t}function lo(){for(var U=0;U<js;++U)ie.activeTexture(hu+U),ie.bindTexture(vn,null),Ks[U]=null;de(Hs).forEach(tl),Tn.cubeCount=0,Tn.textureCount=0}qr.profile&&(Tn.getTotalTextureSize=function(){var U=0;return Object.keys(Hs).forEach(function(tt){U+=Hs[tt].stats.size}),U});function ns(){for(var U=0;U<js;++U){var tt=Ks[U];tt&&(tt.bindCount=0,tt.unit=-1,Ks[U]=null)}de(Hs).forEach(function(Y){Y.texture=ie.createTexture(),ie.bindTexture(Y.target,Y.texture);for(var ft=0;ft<32;++ft)if((Y.mipmask&1<<ft)!==0)if(Y.target===vn)ie.texImage2D(vn,ft,Y.internalformat,Y.width>>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);else for(var zt=0;zt<6;++zt)ie.texImage2D(Qn+zt,ft,Y.internalformat,Y.width>>ft,Y.height>>ft,0,Y.internalformat,Y.type,null);El(Y.texInfo,Y.target)})}function $o(){for(var U=0;U<js;++U){var tt=Ks[U];tt&&(tt.bindCount=0,tt.unit=-1,Ks[U]=null),ie.activeTexture(hu+U),ie.bindTexture(vn,null),ie.bindTexture(Oa,null)}}return{create2D:Il,createCube:vi,clear:lo,getTexture:function(U){return null},restore:ns,refresh:$o}}var wl=36161,Ju=32854,Pc=32855,Es=36194,_c=33189,sf=36168,Rc=34041,gc=35907,Nc=34836,Zl=34842,jc=34843,rl=[];rl[Ju]=2,rl[Pc]=2,rl[Es]=2,rl[_c]=2,rl[sf]=1,rl[Rc]=4,rl[gc]=4,rl[Nc]=16,rl[Zl]=8,rl[jc]=6;function Kl(ie,nr,cr){return rl[ie]*nr*cr}var Gu=function(ie,nr,cr,sn,zn){var Tn={rgba4:Ju,rgb565:Es,"rgb5 a1":Pc,depth:_c,stencil:sf,"depth stencil":Rc};nr.ext_srgb&&(Tn.srgba=gc),nr.ext_color_buffer_half_float&&(Tn.rgba16f=Zl,Tn.rgb16f=jc),nr.webgl_color_buffer_float&&(Tn.rgba32f=Nc);var qr=[];Object.keys(Tn).forEach(function(fa){var Un=Tn[fa];qr[Un]=fa});var Sn=0,sa={};function ea(fa){this.id=Sn++,this.refCount=1,this.renderbuffer=fa,this.format=Ju,this.width=0,this.height=0,zn.profile&&(this.stats={size:0})}ea.prototype.decRef=function(){--this.refCount<=0&&ka(this)};function ka(fa){var Un=fa.renderbuffer;ie.bindRenderbuffer(wl,null),ie.deleteRenderbuffer(Un),fa.renderbuffer=null,fa.refCount=0,delete sa[fa.id],sn.renderbufferCount--}function Ka(fa,Un){var Nr=new ea(ie.createRenderbuffer());sa[Nr.id]=Nr,sn.renderbufferCount++;function fn(jn,kn){var Ia=0,ya=0,qa=Ju;if(typeof jn=="object"&&jn){var Rn=jn;if("shape"in Rn){var An=Rn.shape;Ia=An[0]|0,ya=An[1]|0}else"radius"in Rn&&(Ia=ya=Rn.radius|0),"width"in Rn&&(Ia=Rn.width|0),"height"in Rn&&(ya=Rn.height|0);"format"in Rn&&(qa=Tn[Rn.format])}else typeof jn=="number"?(Ia=jn|0,typeof kn=="number"?ya=kn|0:ya=Ia):jn||(Ia=ya=1);if(!(Ia===Nr.width&&ya===Nr.height&&qa===Nr.format))return fn.width=Nr.width=Ia,fn.height=Nr.height=ya,Nr.format=qa,ie.bindRenderbuffer(wl,Nr.renderbuffer),ie.renderbufferStorage(wl,qa,Ia,ya),zn.profile&&(Nr.stats.size=Kl(Nr.format,Nr.width,Nr.height)),fn.format=qr[Nr.format],fn}function Xn(jn,kn){var Ia=jn|0,ya=kn|0||Ia;return Ia===Nr.width&&ya===Nr.height||(fn.width=Nr.width=Ia,fn.height=Nr.height=ya,ie.bindRenderbuffer(wl,Nr.renderbuffer),ie.renderbufferStorage(wl,Nr.format,Ia,ya),zn.profile&&(Nr.stats.size=Kl(Nr.format,Nr.width,Nr.height))),fn}return fn(fa,Un),fn.resize=Xn,fn._reglType="renderbuffer",fn._renderbuffer=Nr,zn.profile&&(fn.stats=Nr.stats),fn.destroy=function(){Nr.decRef()},fn}zn.profile&&(sn.getTotalRenderbufferSize=function(){var fa=0;return Object.keys(sa).forEach(function(Un){fa+=sa[Un].stats.size}),fa});function Va(){de(sa).forEach(function(fa){fa.renderbuffer=ie.createRenderbuffer(),ie.bindRenderbuffer(wl,fa.renderbuffer),ie.renderbufferStorage(wl,fa.format,fa.width,fa.height)}),ie.bindRenderbuffer(wl,null)}return{create:Ka,clear:function(){de(sa).forEach(ka)},restore:Va}},Bs=36160,Ou=36161,Rl=3553,Yl=34069,Ws=36064,ac=36096,Tu=36128,Zu=33306,bc=36193,lf=5121,Mf=5126,ic=6407,wc=6408,Fl=[];Fl[wc]=4,Fl[ic]=3;var oc=[];oc[lf]=1,oc[Mf]=4,oc[bc]=2;function iu(ie,nr,cr,sn,zn,Tn){var qr={cur:null,next:null,dirty:!1,setFBO:null},Sn=["rgba"],sa=["rgba4","rgb565","rgb5 a1"];nr.ext_srgb&&sa.push("srgba"),nr.ext_color_buffer_half_float&&sa.push("rgba16f","rgb16f"),nr.webgl_color_buffer_float&&sa.push("rgba32f");var ea=["uint8"];nr.oes_texture_half_float&&ea.push("half float","float16"),nr.oes_texture_float&&ea.push("float","float32");function ka(aa,oa,Sa){this.target=aa,this.texture=oa,this.renderbuffer=Sa;var _i=0,pi=0;oa?(_i=oa.width,pi=oa.height):Sa&&(_i=Sa.width,pi=Sa.height),this.width=_i,this.height=pi}function Ka(aa){aa&&(aa.texture&&aa.texture._texture.decRef(),aa.renderbuffer&&aa.renderbuffer._renderbuffer.decRef())}function Va(aa,oa,Sa){if(aa)if(aa.texture){var _i=aa.texture._texture;Math.max(1,_i.width),Math.max(1,_i.height),_i.refCount+=1}else{var pi=aa.renderbuffer._renderbuffer;pi.refCount+=1}}function fa(aa,oa){oa&&(oa.texture?ie.framebufferTexture2D(Bs,aa,oa.target,oa.texture._texture.texture,0):ie.framebufferRenderbuffer(Bs,aa,Ou,oa.renderbuffer._renderbuffer.renderbuffer))}function Un(aa){var oa=Rl,Sa=null,_i=null,pi=aa;typeof aa=="object"&&(pi=aa.data,"target"in aa&&(oa=aa.target|0));var Ma=pi._reglType;return Ma==="texture2d"||Ma==="textureCube"?Sa=pi:Ma==="renderbuffer"&&(_i=pi,oa=Ou),new ka(oa,Sa,_i)}function Nr(aa,oa,Sa,_i,pi){if(Sa){var Ma=sn.create2D({width:aa,height:oa,format:_i,type:pi});return Ma._texture.refCount=0,new ka(Rl,Ma,null)}else{var Na=zn.create({width:aa,height:oa,format:_i});return Na._renderbuffer.refCount=0,new ka(Ou,null,Na)}}function fn(aa){return aa&&(aa.texture||aa.renderbuffer)}function Xn(aa,oa,Sa){aa&&(aa.texture?aa.texture.resize(oa,Sa):aa.renderbuffer&&aa.renderbuffer.resize(oa,Sa),aa.width=oa,aa.height=Sa)}var jn=0,kn={};function Ia(){this.id=jn++,kn[this.id]=this,this.framebuffer=ie.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function ya(aa){aa.colorAttachments.forEach(Ka),Ka(aa.depthAttachment),Ka(aa.stencilAttachment),Ka(aa.depthStencilAttachment)}function qa(aa){var oa=aa.framebuffer;ie.deleteFramebuffer(oa),aa.framebuffer=null,Tn.framebufferCount--,delete kn[aa.id]}function Rn(aa){var oa;ie.bindFramebuffer(Bs,aa.framebuffer);var Sa=aa.colorAttachments;for(oa=0;oa<Sa.length;++oa)fa(Ws+oa,Sa[oa]);for(oa=Sa.length;oa<cr.maxColorAttachments;++oa)ie.framebufferTexture2D(Bs,Ws+oa,Rl,null,0);ie.framebufferTexture2D(Bs,Zu,Rl,null,0),ie.framebufferTexture2D(Bs,ac,Rl,null,0),ie.framebufferTexture2D(Bs,Tu,Rl,null,0),fa(ac,aa.depthAttachment),fa(Tu,aa.stencilAttachment),fa(Zu,aa.depthStencilAttachment),ie.checkFramebufferStatus(Bs),ie.isContextLost(),ie.bindFramebuffer(Bs,qr.next?qr.next.framebuffer:null),qr.cur=qr.next,ie.getError()}function An(aa,oa){var Sa=new Ia;Tn.framebufferCount++;function _i(Ma,Na){var ui,gi=0,Ri=0,ds=!0,rs=!0,Zi=null,Zs=!0,Zo="rgba",Qs="uint8",El=1,Cl=null,Hs=null,js=null,Ks=!1;if(typeof Ma=="number")gi=Ma|0,Ri=Na|0||gi;else if(!Ma)gi=Ri=1;else{var Mi=Ma;if("shape"in Mi){var Ys=Mi.shape;gi=Ys[0],Ri=Ys[1]}else"radius"in Mi&&(gi=Ri=Mi.radius),"width"in Mi&&(gi=Mi.width),"height"in Mi&&(Ri=Mi.height);("color"in Mi||"colors"in Mi)&&(Zi=Mi.color||Mi.colors,Array.isArray(Zi)),Zi||("colorCount"in Mi&&(El=Mi.colorCount|0),"colorTexture"in Mi&&(Zs=!!Mi.colorTexture,Zo="rgba4"),"colorType"in Mi&&(Qs=Mi.colorType,Zs||(Qs==="half float"||Qs==="float16"?Zo="rgba16f":(Qs==="float"||Qs==="float32")&&(Zo="rgba32f"))),"colorFormat"in Mi&&(Zo=Mi.colorFormat,Sn.indexOf(Zo)>=0?Zs=!0:sa.indexOf(Zo)>=0&&(Zs=!1))),("depthTexture"in Mi||"depthStencilTexture"in Mi)&&(Ks=!!(Mi.depthTexture||Mi.depthStencilTexture)),"depth"in Mi&&(typeof Mi.depth=="boolean"?ds=Mi.depth:(Cl=Mi.depth,rs=!1)),"stencil"in Mi&&(typeof Mi.stencil=="boolean"?rs=Mi.stencil:(Hs=Mi.stencil,ds=!1)),"depthStencil"in Mi&&(typeof Mi.depthStencil=="boolean"?ds=rs=Mi.depthStencil:(js=Mi.depthStencil,ds=!1,rs=!1))}var Uo=null,tl=null,Il=null,vi=null;if(Array.isArray(Zi))Uo=Zi.map(Un);else if(Zi)Uo=[Un(Zi)];else for(Uo=new Array(El),ui=0;ui<El;++ui)Uo[ui]=Nr(gi,Ri,Zs,Zo,Qs);for(gi=gi||Uo[0].width,Ri=Ri||Uo[0].height,Cl?tl=Un(Cl):ds&&!rs&&(tl=Nr(gi,Ri,Ks,"depth","uint32")),Hs?Il=Un(Hs):rs&&!ds&&(Il=Nr(gi,Ri,!1,"stencil","uint8")),js?vi=Un(js):!Cl&&!Hs&&rs&&ds&&(vi=Nr(gi,Ri,Ks,"depth stencil","depth stencil")),ui=0;ui<Uo.length;++ui)Va(Uo[ui]),Uo[ui]&&Uo[ui].texture&&Fl[Uo[ui].texture._texture.format]*oc[Uo[ui].texture._texture.type];return Va(tl),Va(Il),Va(vi),ya(Sa),Sa.width=gi,Sa.height=Ri,Sa.colorAttachments=Uo,Sa.depthAttachment=tl,Sa.stencilAttachment=Il,Sa.depthStencilAttachment=vi,_i.color=Uo.map(fn),_i.depth=fn(tl),_i.stencil=fn(Il),_i.depthStencil=fn(vi),_i.width=Sa.width,_i.height=Sa.height,Rn(Sa),_i}function pi(Ma,Na){var ui=Math.max(Ma|0,1),gi=Math.max(Na|0||ui,1);if(ui===Sa.width&&gi===Sa.height)return _i;for(var Ri=Sa.colorAttachments,ds=0;ds<Ri.length;++ds)Xn(Ri[ds],ui,gi);return Xn(Sa.depthAttachment,ui,gi),Xn(Sa.stencilAttachment,ui,gi),Xn(Sa.depthStencilAttachment,ui,gi),Sa.width=_i.width=ui,Sa.height=_i.height=gi,Rn(Sa),_i}return _i(aa,oa),u(_i,{resize:pi,_reglType:"framebuffer",_framebuffer:Sa,destroy:function(){qa(Sa),ya(Sa)},use:function(Ma){qr.setFBO({framebuffer:_i},Ma)}})}function Pa(aa){var oa=Array(6);function Sa(pi){var Ma,Na={color:null},ui=0,gi=null,Ri="rgba",ds="uint8",rs=1;if(typeof pi=="number")ui=pi|0;else if(!pi)ui=1;else{var Zi=pi;if("shape"in Zi){var Zs=Zi.shape;ui=Zs[0]}else"radius"in Zi&&(ui=Zi.radius|0),"width"in Zi?(ui=Zi.width|0,"height"in Zi):"height"in Zi&&(ui=Zi.height|0);("color"in Zi||"colors"in Zi)&&(gi=Zi.color||Zi.colors,Array.isArray(gi)),gi||("colorCount"in Zi&&(rs=Zi.colorCount|0),"colorType"in Zi&&(ds=Zi.colorType),"colorFormat"in Zi&&(Ri=Zi.colorFormat)),"depth"in Zi&&(Na.depth=Zi.depth),"stencil"in Zi&&(Na.stencil=Zi.stencil),"depthStencil"in Zi&&(Na.depthStencil=Zi.depthStencil)}var Zo;if(gi)if(Array.isArray(gi))for(Zo=[],Ma=0;Ma<gi.length;++Ma)Zo[Ma]=gi[Ma];else Zo=[gi];else{Zo=Array(rs);var Qs={radius:ui,format:Ri,type:ds};for(Ma=0;Ma<rs;++Ma)Zo[Ma]=sn.createCube(Qs)}for(Na.color=Array(Zo.length),Ma=0;Ma<Zo.length;++Ma){var El=Zo[Ma];ui=ui||El.width,Na.color[Ma]={target:Yl,data:Zo[Ma]}}for(Ma=0;Ma<6;++Ma){for(var Cl=0;Cl<Zo.length;++Cl)Na.color[Cl].target=Yl+Ma;Ma>0&&(Na.depth=oa[0].depth,Na.stencil=oa[0].stencil,Na.depthStencil=oa[0].depthStencil),oa[Ma]?oa[Ma](Na):oa[Ma]=An(Na)}return u(Sa,{width:ui,height:ui,color:Zo})}function _i(pi){var Ma,Na=pi|0;if(Na===Sa.width)return Sa;var ui=Sa.color;for(Ma=0;Ma<ui.length;++Ma)ui[Ma].resize(Na);for(Ma=0;Ma<6;++Ma)oa[Ma].resize(Na);return Sa.width=Sa.height=Na,Sa}return Sa(aa),u(Sa,{faces:oa,resize:_i,_reglType:"framebufferCube",destroy:function(){oa.forEach(function(pi){pi.destroy()})}})}function ba(){qr.cur=null,qr.next=null,qr.dirty=!0,de(kn).forEach(function(aa){aa.framebuffer=ie.createFramebuffer(),Rn(aa)})}return u(qr,{getFramebuffer:function(aa){if(typeof aa=="function"&&aa._reglType==="framebuffer"){var oa=aa._framebuffer;if(oa instanceof Ia)return oa}return null},create:An,createCube:Pa,clear:function(){de(kn).forEach(qa)},restore:ba})}var sc=5126,Tc=34962,ku=34963;function Gs(){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=sc,this.offset=0,this.stride=0,this.divisor=0}function Du(ie,nr,cr,sn,zn,Tn,qr){for(var Sn=cr.maxAttributes,sa=new Array(Sn),ea=0;ea<Sn;++ea)sa[ea]=new Gs;var ka=0,Ka={},Va={Record:Gs,scope:{},state:sa,currentVAO:null,targetVAO:null,restore:Un()?ya:function(){},createVAO:qa,getVAO:fn,destroyBuffer:fa,setVAO:Un()?Xn:jn,clear:Un()?kn:function(){}};function fa(Rn){for(var An=0;An<sa.length;++An){var Pa=sa[An];Pa.buffer===Rn&&(ie.disableVertexAttribArray(An),Pa.buffer=null)}}function Un(){return nr.oes_vertex_array_object}function Nr(){return nr.angle_instanced_arrays}function fn(Rn){return typeof Rn=="function"&&Rn._vao?Rn._vao:null}function Xn(Rn){if(Rn!==Va.currentVAO){var An=Un();Rn?An.bindVertexArrayOES(Rn.vao):An.bindVertexArrayOES(null),Va.currentVAO=Rn}}function jn(Rn){if(Rn!==Va.currentVAO){if(Rn)Rn.bindAttrs();else{for(var An=Nr(),Pa=0;Pa<sa.length;++Pa){var ba=sa[Pa];ba.buffer?(ie.enableVertexAttribArray(Pa),ba.buffer.bind(),ie.vertexAttribPointer(Pa,ba.size,ba.type,ba.normalized,ba.stride,ba.offfset),An&&ba.divisor&&An.vertexAttribDivisorANGLE(Pa,ba.divisor)):(ie.disableVertexAttribArray(Pa),ie.vertexAttrib4f(Pa,ba.x,ba.y,ba.z,ba.w))}qr.elements?ie.bindBuffer(ku,qr.elements.buffer.buffer):ie.bindBuffer(ku,null)}Va.currentVAO=Rn}}function kn(){de(Ka).forEach(function(Rn){Rn.destroy()})}function Ia(){this.id=++ka,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var Rn=Un();Rn?this.vao=Rn.createVertexArrayOES():this.vao=null,Ka[this.id]=this,this.buffers=[]}Ia.prototype.bindAttrs=function(){for(var Rn=Nr(),An=this.attributes,Pa=0;Pa<An.length;++Pa){var ba=An[Pa];ba.buffer?(ie.enableVertexAttribArray(Pa),ie.bindBuffer(Tc,ba.buffer.buffer),ie.vertexAttribPointer(Pa,ba.size,ba.type,ba.normalized,ba.stride,ba.offset),Rn&&ba.divisor&&Rn.vertexAttribDivisorANGLE(Pa,ba.divisor)):(ie.disableVertexAttribArray(Pa),ie.vertexAttrib4f(Pa,ba.x,ba.y,ba.z,ba.w))}for(var aa=An.length;aa<Sn;++aa)ie.disableVertexAttribArray(aa);var oa=Tn.getElements(this.elements);oa?ie.bindBuffer(ku,oa.buffer.buffer):ie.bindBuffer(ku,null)},Ia.prototype.refresh=function(){var Rn=Un();Rn&&(Rn.bindVertexArrayOES(this.vao),this.bindAttrs(),Va.currentVAO=null,Rn.bindVertexArrayOES(null))},Ia.prototype.destroy=function(){if(this.vao){var Rn=Un();this===Va.currentVAO&&(Va.currentVAO=null,Rn.bindVertexArrayOES(null)),Rn.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Ka[this.id]&&(delete Ka[this.id],sn.vaoCount-=1)};function ya(){var Rn=Un();Rn&&de(Ka).forEach(function(An){An.refresh()})}function qa(Rn){var An=new Ia;sn.vaoCount+=1;function Pa(ba){var aa;if(Array.isArray(ba))aa=ba,An.elements&&An.ownsElements&&An.elements.destroy(),An.elements=null,An.ownsElements=!1,An.offset=0,An.count=0,An.instances=-1,An.primitive=4;else{if(ba.elements){var oa=ba.elements;An.ownsElements?typeof oa=="function"&&oa._reglType==="elements"?(An.elements.destroy(),An.ownsElements=!1):(An.elements(oa),An.ownsElements=!1):Tn.getElements(ba.elements)?(An.elements=ba.elements,An.ownsElements=!1):(An.elements=Tn.create(ba.elements),An.ownsElements=!0)}else An.elements=null,An.ownsElements=!1;aa=ba.attributes,An.offset=0,An.count=-1,An.instances=-1,An.primitive=4,An.elements&&(An.count=An.elements._elements.vertCount,An.primitive=An.elements._elements.primType),"offset"in ba&&(An.offset=ba.offset|0),"count"in ba&&(An.count=ba.count|0),"instances"in ba&&(An.instances=ba.instances|0),"primitive"in ba&&(An.primitive=Cn[ba.primitive])}var Sa={},_i=An.attributes;_i.length=aa.length;for(var pi=0;pi<aa.length;++pi){var Ma=aa[pi],Na=_i[pi]=new Gs,ui=Ma.data||Ma;if(Array.isArray(ui)||Mr(ui)||Ir(ui)){var gi;An.buffers[pi]&&(gi=An.buffers[pi],Mr(ui)&&gi._buffer.byteLength>=ui.byteLength?gi.subdata(ui):(gi.destroy(),An.buffers[pi]=null)),An.buffers[pi]||(gi=An.buffers[pi]=zn.create(Ma,Tc,!1,!0)),Na.buffer=zn.getBuffer(gi),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1,Sa[pi]=1}else zn.getBuffer(Ma)?(Na.buffer=zn.getBuffer(Ma),Na.size=Na.buffer.dimension|0,Na.normalized=!1,Na.type=Na.buffer.dtype,Na.offset=0,Na.stride=0,Na.divisor=0,Na.state=1):zn.getBuffer(Ma.buffer)?(Na.buffer=zn.getBuffer(Ma.buffer),Na.size=(+Ma.size||Na.buffer.dimension)|0,Na.normalized=!!Ma.normalized||!1,"type"in Ma?Na.type=pn[Ma.type]:Na.type=Na.buffer.dtype,Na.offset=(Ma.offset||0)|0,Na.stride=(Ma.stride||0)|0,Na.divisor=(Ma.divisor||0)|0,Na.state=1):"x"in Ma&&(Na.x=+Ma.x||0,Na.y=+Ma.y||0,Na.z=+Ma.z||0,Na.w=+Ma.w||0,Na.state=2)}for(var Ri=0;Ri<An.buffers.length;++Ri)!Sa[Ri]&&An.buffers[Ri]&&(An.buffers[Ri].destroy(),An.buffers[Ri]=null);return An.refresh(),Pa}return Pa.destroy=function(){for(var ba=0;ba<An.buffers.length;++ba)An.buffers[ba]&&An.buffers[ba].destroy();An.buffers.length=0,An.ownsElements&&(An.elements.destroy(),An.elements=null,An.ownsElements=!1),An.destroy()},Pa._vao=An,Pa._reglType="vao",Pa(Rn)}return Va}var Xl=35632,Xc=35633,Vs=35718,vc=35721;function Ku(ie,nr,cr,sn){var zn={},Tn={};function qr(Nr,fn,Xn,jn){this.name=Nr,this.id=fn,this.location=Xn,this.info=jn}function Sn(Nr,fn){for(var Xn=0;Xn<Nr.length;++Xn)if(Nr[Xn].id===fn.id){Nr[Xn].location=fn.location;return}Nr.push(fn)}function sa(Nr,fn,Xn){var jn=Nr===Xl?zn:Tn,kn=jn[fn];if(!kn){var Ia=nr.str(fn);kn=ie.createShader(Nr),ie.shaderSource(kn,Ia),ie.compileShader(kn),jn[fn]=kn}return kn}var ea={},ka=[],Ka=0;function Va(Nr,fn){this.id=Ka++,this.fragId=Nr,this.vertId=fn,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,sn.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function fa(Nr,fn,Xn){var jn,kn,Ia=sa(Xl,Nr.fragId),ya=sa(Xc,Nr.vertId),qa=Nr.program=ie.createProgram();if(ie.attachShader(qa,Ia),ie.attachShader(qa,ya),Xn)for(jn=0;jn<Xn.length;++jn){var Rn=Xn[jn];ie.bindAttribLocation(qa,Rn[0],Rn[1])}ie.linkProgram(qa);var An=ie.getProgramParameter(qa,Vs);sn.profile&&(Nr.stats.uniformsCount=An);var Pa=Nr.uniforms;for(jn=0;jn<An;++jn)if(kn=ie.getActiveUniform(qa,jn),kn)if(kn.size>1)for(var ba=0;ba<kn.size;++ba){var aa=kn.name.replace("[0]","["+ba+"]");Sn(Pa,new qr(aa,nr.id(aa),ie.getUniformLocation(qa,aa),kn))}else Sn(Pa,new qr(kn.name,nr.id(kn.name),ie.getUniformLocation(qa,kn.name),kn));var oa=ie.getProgramParameter(qa,vc);sn.profile&&(Nr.stats.attributesCount=oa);var Sa=Nr.attributes;for(jn=0;jn<oa;++jn)kn=ie.getActiveAttrib(qa,jn),kn&&Sn(Sa,new qr(kn.name,nr.id(kn.name),ie.getAttribLocation(qa,kn.name),kn))}sn.profile&&(cr.getMaxUniformsCount=function(){var Nr=0;return ka.forEach(function(fn){fn.stats.uniformsCount>Nr&&(Nr=fn.stats.uniformsCount)}),Nr},cr.getMaxAttributesCount=function(){var Nr=0;return ka.forEach(function(fn){fn.stats.attributesCount>Nr&&(Nr=fn.stats.attributesCount)}),Nr});function Un(){zn={},Tn={};for(var Nr=0;Nr<ka.length;++Nr)fa(ka[Nr],null,ka[Nr].attributes.map(function(fn){return[fn.location,fn.name]}))}return{clear:function(){var Nr=ie.deleteShader.bind(ie);de(zn).forEach(Nr),zn={},de(Tn).forEach(Nr),Tn={},ka.forEach(function(fn){ie.deleteProgram(fn.program)}),ka.length=0,ea={},cr.shaderCount=0},program:function(Nr,fn,Xn,jn){var kn=ea[fn];kn||(kn=ea[fn]={});var Ia=kn[Nr];if(Ia&&(Ia.refCount++,!jn))return Ia;var ya=new Va(fn,Nr);return cr.shaderCount++,fa(ya,Xn,jn),Ia||(kn[Nr]=ya),ka.push(ya),u(ya,{destroy:function(){if(ya.refCount--,ya.refCount<=0){ie.deleteProgram(ya.program);var qa=ka.indexOf(ya);ka.splice(qa,1),cr.shaderCount--}kn[ya.vertId].refCount<=0&&(ie.deleteShader(Tn[ya.vertId]),delete Tn[ya.vertId],delete ea[ya.fragId][ya.vertId]),Object.keys(ea[ya.fragId]).length||(ie.deleteShader(zn[ya.fragId]),delete zn[ya.fragId],delete ea[ya.fragId])}})},restore:Un,shader:sa,frag:-1,vert:-1}}var ou=6408,Qu=5121,Yu=3333,yc=5126;function uf(ie,nr,cr,sn,zn,Tn,qr){function Sn(ka){var Ka;nr.next===null?Ka=Qu:Ka=nr.next.colorAttachments[0].texture._texture.type;var Va=0,fa=0,Un=sn.framebufferWidth,Nr=sn.framebufferHeight,fn=null;Mr(ka)?fn=ka:ka&&(Va=ka.x|0,fa=ka.y|0,Un=(ka.width||sn.framebufferWidth-Va)|0,Nr=(ka.height||sn.framebufferHeight-fa)|0,fn=ka.data||null),cr();var Xn=Un*Nr*4;return fn||(Ka===Qu?fn=new Uint8Array(Xn):Ka===yc&&(fn=fn||new Float32Array(Xn))),ie.pixelStorei(Yu,4),ie.readPixels(Va,fa,Un,Nr,ou,Ka,fn),fn}function sa(ka){var Ka;return nr.setFBO({framebuffer:ka.framebuffer},function(){Ka=Sn(ka)}),Ka}function ea(ka){return!ka||!("framebuffer"in ka)?Sn(ka):sa(ka)}return ea}function zl(ie){return su(Uc(Fu(ie)))}function Uc(ie){return il(mn(Au(ie),ie.length*8))}function su(ie){for(var nr="0123456789abcdef",cr="",sn,zn=0;zn<ie.length;zn++)sn=ie.charCodeAt(zn),cr+=nr.charAt(sn>>>4&15)+nr.charAt(sn&15);return cr}function Fu(ie){for(var nr="",cr=-1,sn,zn;++cr<ie.length;)sn=ie.charCodeAt(cr),zn=cr+1<ie.length?ie.charCodeAt(cr+1):0,55296<=sn&&sn<=56319&&56320<=zn&&zn<=57343&&(sn=65536+((sn&1023)<<10)+(zn&1023),cr++),sn<=127?nr+=String.fromCharCode(sn):sn<=2047?nr+=String.fromCharCode(192|sn>>>6&31,128|sn&63):sn<=65535?nr+=String.fromCharCode(224|sn>>>12&15,128|sn>>>6&63,128|sn&63):sn<=2097151&&(nr+=String.fromCharCode(240|sn>>>18&7,128|sn>>>12&63,128|sn>>>6&63,128|sn&63));return nr}function Au(ie){for(var nr=Array(ie.length>>2),cr=0;cr<nr.length;cr++)nr[cr]=0;for(var cr=0;cr<ie.length*8;cr+=8)nr[cr>>5]|=(ie.charCodeAt(cr/8)&255)<<24-cr%32;return nr}function il(ie){for(var nr="",cr=0;cr<ie.length*32;cr+=8)nr+=String.fromCharCode(ie[cr>>5]>>>24-cr%32&255);return nr}function Cs(ie,nr){return ie>>>nr|ie<<32-nr}function Mu(ie,nr){return ie>>>nr}function lc(ie,nr,cr){return ie&nr^~ie&cr}function Su(ie,nr,cr){return ie&nr^ie&cr^nr&cr}function Oc(ie){return Cs(ie,2)^Cs(ie,13)^Cs(ie,22)}function Xe(ie){return Cs(ie,6)^Cs(ie,11)^Cs(ie,25)}function yr(ie){return Cs(ie,7)^Cs(ie,18)^Mu(ie,3)}function Kr(ie){return Cs(ie,17)^Cs(ie,19)^Mu(ie,10)}var Rr=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 mn(ie,nr){var cr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),sn=new Array(64),zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr;for(ie[nr>>5]|=128<<24-nr%32,ie[(nr+64>>9<<4)+15]=nr,Va=0;Va<ie.length;Va+=16){for(zn=cr[0],Tn=cr[1],qr=cr[2],Sn=cr[3],sa=cr[4],ea=cr[5],ka=cr[6],Ka=cr[7],fa=0;fa<64;fa++)fa<16?sn[fa]=ie[fa+Va]:sn[fa]=Pn(Pn(Pn(Kr(sn[fa-2]),sn[fa-7]),yr(sn[fa-15])),sn[fa-16]),Un=Pn(Pn(Pn(Pn(Ka,Xe(sa)),lc(sa,ea,ka)),Rr[fa]),sn[fa]),Nr=Pn(Oc(zn),Su(zn,Tn,qr)),Ka=ka,ka=ea,ea=sa,sa=Pn(Sn,Un),Sn=qr,qr=Tn,Tn=zn,zn=Pn(Un,Nr);cr[0]=Pn(zn,cr[0]),cr[1]=Pn(Tn,cr[1]),cr[2]=Pn(qr,cr[2]),cr[3]=Pn(Sn,cr[3]),cr[4]=Pn(sa,cr[4]),cr[5]=Pn(ea,cr[5]),cr[6]=Pn(ka,cr[6]),cr[7]=Pn(Ka,cr[7])}return cr}function Pn(ie,nr){var cr=(ie&65535)+(nr&65535),sn=(ie>>16)+(nr>>16)+(cr>>16);return sn<<16|cr&65535}function ha(ie){return Array.prototype.slice.call(ie)}function Ta(ie){return ha(ie).join("")}function Ua(ie){var nr=ie&&ie.cache,cr=0,sn=[],zn=[],Tn=[];function qr(Un,Nr){var fn=Nr&&Nr.stable;if(!fn){for(var Xn=0;Xn<zn.length;++Xn)if(zn[Xn]===Un&&!Tn[Xn])return sn[Xn]}var jn="g"+cr++;return sn.push(jn),zn.push(Un),Tn.push(fn),jn}function Sn(){var Un=[];function Nr(){Un.push.apply(Un,ha(arguments))}var fn=[];function Xn(){var jn="v"+cr++;return fn.push(jn),arguments.length>0&&(Un.push(jn,"="),Un.push.apply(Un,ha(arguments)),Un.push(";")),jn}return u(Nr,{def:Xn,toString:function(){return Ta([fn.length>0?"var "+fn.join(",")+";":"",Ta(Un)])}})}function sa(){var Un=Sn(),Nr=Sn(),fn=Un.toString,Xn=Nr.toString;function jn(kn,Ia){Nr(kn,Ia,"=",Un.def(kn,Ia),";")}return u(function(){Un.apply(Un,ha(arguments))},{def:Un.def,entry:Un,exit:Nr,save:jn,set:function(kn,Ia,ya){jn(kn,Ia),Un(kn,Ia,"=",ya,";")},toString:function(){return fn()+Xn()}})}function ea(){var Un=Ta(arguments),Nr=sa(),fn=sa(),Xn=Nr.toString,jn=fn.toString;return u(Nr,{then:function(){return Nr.apply(Nr,ha(arguments)),this},else:function(){return fn.apply(fn,ha(arguments)),this},toString:function(){var kn=jn();return kn&&(kn="else{"+kn+"}"),Ta(["if(",Un,"){",Xn(),"}",kn])}})}var ka=Sn(),Ka={};function Va(Un,Nr){var fn=[];function Xn(){var qa="a"+fn.length;return fn.push(qa),qa}Nr=Nr||0;for(var jn=0;jn<Nr;++jn)Xn();var kn=sa(),Ia=kn.toString,ya=Ka[Un]=u(kn,{arg:Xn,toString:function(){return Ta(["function(",fn.join(),"){",Ia(),"}"])}});return ya}function fa(){var Un=['"use strict";',ka,"return {"];Object.keys(Ka).forEach(function(jn){Un.push('"',jn,'":',Ka[jn].toString(),",")}),Un.push("}");var Nr=Ta(Un).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),fn;if(nr&&(fn=zl(Nr),nr[fn]))return nr[fn].apply(null,zn);var Xn=Function.apply(null,sn.concat(Nr));return nr&&(nr[fn]=Xn),Xn.apply(null,zn)}return{global:ka,link:qr,block:Sn,proc:Va,scope:sa,cond:ea,compile:fa}}var Ya="xyzw".split(""),va=5121,Ba=1,za=2,ca=0,ei=1,Vi=2,Oi=3,Wi=4,Xi=5,ni=6,Za="dither",$i="blend.enable",Do="blend.color",ss="blend.equation",Ps="blend.func",ys="depth.enable",Os="depth.func",Yo="depth.range",ll="depth.mask",el="colorMask",Rs="cull.enable",bi="cull.face",so="frontFace",ws="lineWidth",fs="polygonOffset.enable",Ll="polygonOffset.offset",$l="sample.alpha",jl="sample.enable",Bu="sample.coverage",Jl="stencil.enable",Ru="stencil.mask",nl="stencil.func",Nu="stencil.opFront",Ui="stencil.opBack",fo="scissor.enable",Ql="scissor.box",ul="viewport",Dc="profile",Pt="framebuffer",z="vert",at="frag",xt="elements",kt="primitive",Lt="count",le="offset",xe="instances",Pe="vao",$e="Width",hr="Height",pr=Pt+$e,Br=Pt+hr,Jr=ul+$e,Rt=ul+hr,Gt="drawingBuffer",ae=Gt+$e,ce=Gt+hr,Te=[Ps,ss,nl,Nu,Ui,Bu,ul,Ql,Ll],ye=34962,ze=34963,rr=2884,fr=3042,gr=3024,Lr=2960,Hr=2929,nn=3089,cn=32823,Mn=32926,Jn=32928,_a=5126,xa=35664,La=35665,ai=35666,Ai=5124,mi=35667,Yi=35668,Go=35669,Xo=35670,po=35671,Qo=35672,Js=35673,Us=35674,To=35675,ko=35676,hl=35678,Sl=35680,tu=4,gt=1028,Et=1029,Xt=2304,fe=2305,me=32775,we=32776,Ve=519,je=7680,or=0,Cr=1,Sr=32774,Wr=513,an=36160,on=36064,ta={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},hn={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},Bn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Hn={cw:Xt,ccw:fe};function Yn(ie){return Array.isArray(ie)||Mr(ie)||Ir(ie)}function na(ie){return ie.sort(function(nr,cr){return nr===ul?-1:cr===ul?1:nr<cr?-1:1})}function _n(ie,nr,cr,sn){this.thisDep=ie,this.contextDep=nr,this.propDep=cr,this.append=sn}function Ha(ie){return ie&&!(ie.thisDep||ie.contextDep||ie.propDep)}function Wa(ie){return new _n(!1,!1,!1,ie)}function ri(ie,nr){var cr=ie.type;if(cr===ca){var sn=ie.data.length;return new _n(!0,sn>=1,sn>=2,nr)}else if(cr===Wi){var zn=ie.data;return new _n(zn.thisDep,zn.contextDep,zn.propDep,nr)}else{if(cr===Xi)return new _n(!1,!1,!1,nr);if(cr===ni){for(var Tn=!1,qr=!1,Sn=!1,sa=0;sa<ie.data.length;++sa){var ea=ie.data[sa];if(ea.type===ei)Sn=!0;else if(ea.type===Vi)qr=!0;else if(ea.type===Oi)Tn=!0;else if(ea.type===ca){Tn=!0;var ka=ea.data;ka>=1&&(qr=!0),ka>=2&&(Sn=!0)}else ea.type===Wi&&(Tn=Tn||ea.data.thisDep,qr=qr||ea.data.contextDep,Sn=Sn||ea.data.propDep)}return new _n(Tn,qr,Sn,nr)}else return new _n(cr===Oi,cr===Vi,cr===ei,nr)}}var xi=new _n(!1,!1,!1,function(){});function ki(ie,nr,cr,sn,zn,Tn,qr,Sn,sa,ea,ka,Ka,Va,fa,Un,Nr){var fn=ea.Record,Xn={add:32774,subtract:32778,"reverse subtract":32779};cr.ext_blend_minmax&&(Xn.min=me,Xn.max=we);var jn=cr.angle_instanced_arrays,kn=cr.webgl_draw_buffers,Ia=cr.oes_vertex_array_object,ya={dirty:!0,profile:Nr.profile},qa={},Rn=[],An={},Pa={};function ba(Ft){return Ft.replace(".","_")}function aa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),qa[Ne]=ya[Ne]=!!he,An[Ne]=$t}function oa(Ft,$t,he){var Ne=ba(Ft);Rn.push(Ft),Array.isArray(he)?(ya[Ne]=he.slice(),qa[Ne]=he.slice()):ya[Ne]=qa[Ne]=he,Pa[Ne]=$t}function Sa(Ft){return!!isNaN(Ft)}aa(Za,gr),aa($i,fr),oa(Do,"blendColor",[0,0,0,0]),oa(ss,"blendEquationSeparate",[Sr,Sr]),oa(Ps,"blendFuncSeparate",[Cr,or,Cr,or]),aa(ys,Hr,!0),oa(Os,"depthFunc",Wr),oa(Yo,"depthRange",[0,1]),oa(ll,"depthMask",!0),oa(el,el,[!0,!0,!0,!0]),aa(Rs,rr),oa(bi,"cullFace",Et),oa(so,so,fe),oa(ws,ws,1),aa(fs,cn),oa(Ll,"polygonOffset",[0,0]),aa($l,Mn),aa(jl,Jn),oa(Bu,"sampleCoverage",[1,!1]),aa(Jl,Lr),oa(Ru,"stencilMask",-1),oa(nl,"stencilFunc",[Ve,0,-1]),oa(Nu,"stencilOpSeparate",[gt,je,je,je]),oa(Ui,"stencilOpSeparate",[Et,je,je,je]),aa(fo,nn),oa(Ql,"scissor",[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]),oa(ul,ul,[0,0,ie.drawingBufferWidth,ie.drawingBufferHeight]);var _i={gl:ie,context:Va,strings:nr,next:qa,current:ya,draw:Ka,elements:Tn,buffer:zn,shader:ka,attributes:ea.state,vao:ea,uniforms:sa,framebuffer:Sn,extensions:cr,timer:fa,isBufferArgs:Yn},pi={primTypes:Cn,compareFuncs:hn,blendFuncs:ta,blendEquations:Xn,stencilOps:Bn,glTypes:pn,orientationType:Hn};kn&&(pi.backBuffer=[Et],pi.drawBuffer=c(sn.maxDrawbuffers,function(Ft){return Ft===0?[0]:c(Ft,function($t){return on+$t})}));var Ma=0;function Na(){var Ft=Ua({cache:Un}),$t=Ft.link,he=Ft.global;Ft.id=Ma++,Ft.batchId="0";var Ne=$t(_i),Ie=Ft.shared={props:"a0"};Object.keys(_i).forEach(function(Oe){Ie[Oe]=he.def(Ne,".",Oe)});var Fe=Ft.next={},He=Ft.current={};Object.keys(Pa).forEach(function(Oe){Array.isArray(ya[Oe])&&(Fe[Oe]=he.def(Ie.next,".",Oe),He[Oe]=he.def(Ie.current,".",Oe))});var Ge=Ft.constants={};Object.keys(pi).forEach(function(Oe){Ge[Oe]=he.def(JSON.stringify(pi[Oe]))}),Ft.invoke=function(Oe,Le){switch(Le.type){case ca:var ur=["this",Ie.context,Ie.props,Ft.batchId];return Oe.def($t(Le.data),".call(",ur.slice(0,Math.max(Le.data.length+1,4)),")");case ei:return Oe.def(Ie.props,Le.data);case Vi:return Oe.def(Ie.context,Le.data);case Oi:return Oe.def("this",Le.data);case Wi:return Le.data.append(Ft,Oe),Le.data.ref;case Xi:return Le.data.toString();case ni:return Le.data.map(function(Dr){return Ft.invoke(Oe,Dr)})}},Ft.attribCache={};var Ae={};return Ft.scopeAttrib=function(Oe){var Le=nr.id(Oe);if(Le in Ae)return Ae[Le];var ur=ea.scope[Le];ur||(ur=ea.scope[Le]=new fn);var Dr=Ae[Le]=$t(ur);return Dr},Ft}function ui(Ft){var $t=Ft.static,he=Ft.dynamic,Ne;if(Dc in $t){var Ie=!!$t[Dc];Ne=Wa(function(He,Ge){return Ie}),Ne.enable=Ie}else if(Dc in he){var Fe=he[Dc];Ne=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}return Ne}function gi(Ft,$t){var he=Ft.static,Ne=Ft.dynamic;if(Pt in he){var Ie=he[Pt];return Ie?(Ie=Sn.getFramebuffer(Ie),Wa(function(He,Ge){var Ae=He.link(Ie),Oe=He.shared;Ge.set(Oe.framebuffer,".next",Ae);var Le=Oe.context;return Ge.set(Le,"."+pr,Ae+".width"),Ge.set(Le,"."+Br,Ae+".height"),Ae})):Wa(function(He,Ge){var Ae=He.shared;Ge.set(Ae.framebuffer,".next","null");var Oe=Ae.context;return Ge.set(Oe,"."+pr,Oe+"."+ae),Ge.set(Oe,"."+Br,Oe+"."+ce),"null"})}else if(Pt in Ne){var Fe=Ne[Pt];return ri(Fe,function(He,Ge){var Ae=He.invoke(Ge,Fe),Oe=He.shared,Le=Oe.framebuffer,ur=Ge.def(Le,".getFramebuffer(",Ae,")");Ge.set(Le,".next",ur);var Dr=Oe.context;return Ge.set(Dr,"."+pr,ur+"?"+ur+".width:"+Dr+"."+ae),Ge.set(Dr,"."+Br,ur+"?"+ur+".height:"+Dr+"."+ce),ur})}else return null}function Ri(Ft,$t,he){var Ne=Ft.static,Ie=Ft.dynamic;function Fe(Ae){if(Ae in Ne){var Oe=Ne[Ae],Le=!0,ur=Oe.x|0,Dr=Oe.y|0,jr,On;return"width"in Oe?jr=Oe.width|0:Le=!1,"height"in Oe?On=Oe.height|0:Le=!1,new _n(!Le&&$t&&$t.thisDep,!Le&&$t&&$t.contextDep,!Le&&$t&&$t.propDep,function(Wn,Dn){var la=Wn.shared.context,qn=jr;"width"in Oe||(qn=Dn.def(la,".",pr,"-",ur));var Gn=On;return"height"in Oe||(Gn=Dn.def(la,".",Br,"-",Dr)),[ur,Dr,qn,Gn]})}else if(Ae in Ie){var Ln=Ie[Ae],xn=ri(Ln,function(Wn,Dn){var la=Wn.invoke(Dn,Ln),qn=Wn.shared.context,Gn=Dn.def(la,".x|0"),ma=Dn.def(la,".y|0"),ti=Dn.def('"width" in ',la,"?",la,".width|0:","(",qn,".",pr,"-",Gn,")"),si=Dn.def('"height" in ',la,"?",la,".height|0:","(",qn,".",Br,"-",ma,")");return[Gn,ma,ti,si]});return $t&&(xn.thisDep=xn.thisDep||$t.thisDep,xn.contextDep=xn.contextDep||$t.contextDep,xn.propDep=xn.propDep||$t.propDep),xn}else return $t?new _n($t.thisDep,$t.contextDep,$t.propDep,function(Wn,Dn){var la=Wn.shared.context;return[0,0,Dn.def(la,".",pr),Dn.def(la,".",Br)]}):null}var He=Fe(ul);if(He){var Ge=He;He=new _n(He.thisDep,He.contextDep,He.propDep,function(Ae,Oe){var Le=Ge.append(Ae,Oe),ur=Ae.shared.context;return Oe.set(ur,"."+Jr,Le[2]),Oe.set(ur,"."+Rt,Le[3]),Le})}return{viewport:He,scissor_box:Fe(Ql)}}function ds(Ft,$t){var he=Ft.static,Ne=typeof he[at]=="string"&&typeof he[z]=="string";if(Ne){if(Object.keys($t.dynamic).length>0)return null;var Ie=$t.static,Fe=Object.keys(Ie);if(Fe.length>0&&typeof Ie[Fe[0]]=="number"){for(var He=[],Ge=0;Ge<Fe.length;++Ge)He.push([Ie[Fe[Ge]]|0,Fe[Ge]]);return He}}return null}function rs(Ft,$t,he){var Ne=Ft.static,Ie=Ft.dynamic;function Fe(Le){if(Le in Ne){var ur=nr.id(Ne[Le]),Dr=Wa(function(){return ur});return Dr.id=ur,Dr}else if(Le in Ie){var jr=Ie[Le];return ri(jr,function(On,Ln){var xn=On.invoke(Ln,jr),Wn=Ln.def(On.shared.strings,".id(",xn,")");return Wn})}return null}var He=Fe(at),Ge=Fe(z),Ae=null,Oe;return Ha(He)&&Ha(Ge)?(Ae=ka.program(Ge.id,He.id,null,he),Oe=Wa(function(Le,ur){return Le.link(Ae)})):Oe=new _n(He&&He.thisDep||Ge&&Ge.thisDep,He&&He.contextDep||Ge&&Ge.contextDep,He&&He.propDep||Ge&&Ge.propDep,function(Le,ur){var Dr=Le.shared.shader,jr;He?jr=He.append(Le,ur):jr=ur.def(Dr,".",at);var On;Ge?On=Ge.append(Le,ur):On=ur.def(Dr,".",z);var Ln=Dr+".program("+On+","+jr;return ur.def(Ln+")")}),{frag:He,vert:Ge,progVar:Oe,program:Ae}}function Zi(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={},Fe=!1;function He(){if(Pe in he){var Dn=he[Pe];return Dn!==null&&ea.getVAO(Dn)===null&&(Dn=ea.createVAO(Dn)),Fe=!0,Ie.vao=Dn,Wa(function(qn){var Gn=ea.getVAO(Dn);return Gn?qn.link(Gn):"null"})}else if(Pe in Ne){Fe=!0;var la=Ne[Pe];return ri(la,function(qn,Gn){var ma=qn.invoke(Gn,la);return Gn.def(qn.shared.vao+".getVAO("+ma+")")})}return null}var Ge=He(),Ae=!1;function Oe(){if(xt in he){var Dn=he[xt];if(Ie.elements=Dn,Yn(Dn)){var la=Ie.elements=Tn.create(Dn,!0);Dn=Tn.getElements(la),Ae=!0}else Dn&&(Dn=Tn.getElements(Dn),Ae=!0);var qn=Wa(function(ma,ti){if(Dn){var si=ma.link(Dn);return ma.ELEMENTS=si,si}return ma.ELEMENTS=null,null});return qn.value=Dn,qn}else if(xt in Ne){Ae=!0;var Gn=Ne[xt];return ri(Gn,function(ma,ti){var si=ma.shared,Li=si.isBufferArgs,to=si.elements,ls=ma.invoke(ti,Gn),ms=ti.def("null"),Ko=ti.def(Li,"(",ls,")"),gs=ma.cond(Ko).then(ms,"=",to,".createStream(",ls,");").else(ms,"=",to,".getElements(",ls,");");return ti.entry(gs),ti.exit(ma.cond(Ko).then(to,".destroyStream(",ms,");")),ma.ELEMENTS=ms,ms})}else if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ma,ti){return ti.def(ma.shared.vao+".currentVAO?"+ma.shared.elements+".getElements("+ma.shared.vao+".currentVAO.elements):null")});return null}var Le=Oe();function ur(){if(kt in he){var Dn=he[kt];return Ie.primitive=Dn,Wa(function(qn,Gn){return Cn[Dn]})}else if(kt in Ne){var la=Ne[kt];return ri(la,function(qn,Gn){var ma=qn.constants.primTypes,ti=qn.invoke(Gn,la);return Gn.def(ma,"[",ti,"]")})}else{if(Ae)return Ha(Le)?Le.value?Wa(function(qn,Gn){return Gn.def(qn.ELEMENTS,".primType")}):Wa(function(){return tu}):new _n(Le.thisDep,Le.contextDep,Le.propDep,function(qn,Gn){var ma=qn.ELEMENTS;return Gn.def(ma,"?",ma,".primType:",tu)});if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(qn,Gn){return Gn.def(qn.shared.vao+".currentVAO?"+qn.shared.vao+".currentVAO.primitive:"+tu)})}return null}function Dr(Dn,la){if(Dn in he){var qn=he[Dn]|0;return la?Ie.offset=qn:Ie.instances=qn,Wa(function(ma,ti){return la&&(ma.OFFSET=qn),qn})}else if(Dn in Ne){var Gn=Ne[Dn];return ri(Gn,function(ma,ti){var si=ma.invoke(ti,Gn);return la&&(ma.OFFSET=si),si})}else if(la){if(Ae)return Wa(function(ma,ti){return ma.OFFSET=0,0});if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ma,ti){return ti.def(ma.shared.vao+".currentVAO?"+ma.shared.vao+".currentVAO.offset:0")})}else if(Fe)return new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ma,ti){return ti.def(ma.shared.vao+".currentVAO?"+ma.shared.vao+".currentVAO.instances:-1")});return null}var jr=Dr(le,!0);function On(){if(Lt in he){var Dn=he[Lt]|0;return Ie.count=Dn,Wa(function(){return Dn})}else if(Lt in Ne){var la=Ne[Lt];return ri(la,function(ti,si){var Li=ti.invoke(si,la);return Li})}else if(Ae)if(Ha(Le)){if(Le)return jr?new _n(jr.thisDep,jr.contextDep,jr.propDep,function(ti,si){var Li=si.def(ti.ELEMENTS,".vertCount-",ti.OFFSET);return Li}):Wa(function(ti,si){return si.def(ti.ELEMENTS,".vertCount")});var qn=Wa(function(){return-1});return qn}else{var Gn=new _n(Le.thisDep||jr.thisDep,Le.contextDep||jr.contextDep,Le.propDep||jr.propDep,function(ti,si){var Li=ti.ELEMENTS;return ti.OFFSET?si.def(Li,"?",Li,".vertCount-",ti.OFFSET,":-1"):si.def(Li,"?",Li,".vertCount:-1")});return Gn}else if(Fe){var ma=new _n(Ge.thisDep,Ge.contextDep,Ge.propDep,function(ti,si){return si.def(ti.shared.vao,".currentVAO?",ti.shared.vao,".currentVAO.count:-1")});return ma}return null}var Ln=ur(),xn=On(),Wn=Dr(xe,!1);return{elements:Le,primitive:Ln,count:xn,instances:Wn,offset:jr,vao:Ge,vaoActive:Fe,elementsActive:Ae,static:Ie}}function Zs(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={};return Rn.forEach(function(Fe){var He=ba(Fe);function Ge(Ae,Oe){if(Fe in he){var Le=Ae(he[Fe]);Ie[He]=Wa(function(){return Le})}else if(Fe in Ne){var ur=Ne[Fe];Ie[He]=ri(ur,function(Dr,jr){return Oe(Dr,jr,Dr.invoke(jr,ur))})}}switch(Fe){case Rs:case $i:case Za:case Jl:case ys:case fo:case fs:case $l:case jl:case ll:return Ge(function(Ae){return Ae},function(Ae,Oe,Le){return Le});case Os:return Ge(function(Ae){return hn[Ae]},function(Ae,Oe,Le){var ur=Ae.constants.compareFuncs;return Oe.def(ur,"[",Le,"]")});case Yo:return Ge(function(Ae){return Ae},function(Ae,Oe,Le){var ur=Oe.def("+",Le,"[0]"),Dr=Oe.def("+",Le,"[1]");return[ur,Dr]});case Ps:return Ge(function(Ae){var Oe="srcRGB"in Ae?Ae.srcRGB:Ae.src,Le="srcAlpha"in Ae?Ae.srcAlpha:Ae.src,ur="dstRGB"in Ae?Ae.dstRGB:Ae.dst,Dr="dstAlpha"in Ae?Ae.dstAlpha:Ae.dst;return[ta[Oe],ta[ur],ta[Le],ta[Dr]]},function(Ae,Oe,Le){var ur=Ae.constants.blendFuncs;function Dr(la,qn){var Gn=Oe.def('"',la,qn,'" in ',Le,"?",Le,".",la,qn,":",Le,".",la);return Gn}var jr=Dr("src","RGB"),On=Dr("dst","RGB"),Ln=Oe.def(ur,"[",jr,"]"),xn=Oe.def(ur,"[",Dr("src","Alpha"),"]"),Wn=Oe.def(ur,"[",On,"]"),Dn=Oe.def(ur,"[",Dr("dst","Alpha"),"]");return[Ln,Wn,xn,Dn]});case ss:return Ge(function(Ae){if(typeof Ae=="string")return[Xn[Ae],Xn[Ae]];if(typeof Ae=="object")return[Xn[Ae.rgb],Xn[Ae.alpha]]},function(Ae,Oe,Le){var ur=Ae.constants.blendEquations,Dr=Oe.def(),jr=Oe.def(),On=Ae.cond("typeof ",Le,'==="string"');return On.then(Dr,"=",jr,"=",ur,"[",Le,"];"),On.else(Dr,"=",ur,"[",Le,".rgb];",jr,"=",ur,"[",Le,".alpha];"),Oe(On),[Dr,jr]});case Do:return Ge(function(Ae){return c(4,function(Oe){return+Ae[Oe]})},function(Ae,Oe,Le){return c(4,function(ur){return Oe.def("+",Le,"[",ur,"]")})});case Ru:return Ge(function(Ae){return Ae|0},function(Ae,Oe,Le){return Oe.def(Le,"|0")});case nl:return Ge(function(Ae){var Oe=Ae.cmp||"keep",Le=Ae.ref||0,ur="mask"in Ae?Ae.mask:-1;return[hn[Oe],Le,ur]},function(Ae,Oe,Le){var ur=Ae.constants.compareFuncs,Dr=Oe.def('"cmp" in ',Le,"?",ur,"[",Le,".cmp]",":",je),jr=Oe.def(Le,".ref|0"),On=Oe.def('"mask" in ',Le,"?",Le,".mask|0:-1");return[Dr,jr,On]});case Nu:case Ui:return Ge(function(Ae){var Oe=Ae.fail||"keep",Le=Ae.zfail||"keep",ur=Ae.zpass||"keep";return[Fe===Ui?Et:gt,Bn[Oe],Bn[Le],Bn[ur]]},function(Ae,Oe,Le){var ur=Ae.constants.stencilOps;function Dr(jr){return Oe.def('"',jr,'" in ',Le,"?",ur,"[",Le,".",jr,"]:",je)}return[Fe===Ui?Et:gt,Dr("fail"),Dr("zfail"),Dr("zpass")]});case Ll:return Ge(function(Ae){var Oe=Ae.factor|0,Le=Ae.units|0;return[Oe,Le]},function(Ae,Oe,Le){var ur=Oe.def(Le,".factor|0"),Dr=Oe.def(Le,".units|0");return[ur,Dr]});case bi:return Ge(function(Ae){var Oe=0;return Ae==="front"?Oe=gt:Ae==="back"&&(Oe=Et),Oe},function(Ae,Oe,Le){return Oe.def(Le,'==="front"?',gt,":",Et)});case ws:return Ge(function(Ae){return Ae},function(Ae,Oe,Le){return Le});case so:return Ge(function(Ae){return Hn[Ae]},function(Ae,Oe,Le){return Oe.def(Le+'==="cw"?'+Xt+":"+fe)});case el:return Ge(function(Ae){return Ae.map(function(Oe){return!!Oe})},function(Ae,Oe,Le){return c(4,function(ur){return"!!"+Le+"["+ur+"]"})});case Bu:return Ge(function(Ae){var Oe="value"in Ae?Ae.value:1,Le=!!Ae.invert;return[Oe,Le]},function(Ae,Oe,Le){var ur=Oe.def('"value" in ',Le,"?+",Le,".value:1"),Dr=Oe.def("!!",Le,".invert");return[ur,Dr]})}}),Ie}function Zo(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={};return Object.keys(he).forEach(function(Fe){var He=he[Fe],Ge;if(typeof He=="number"||typeof He=="boolean")Ge=Wa(function(){return He});else if(typeof He=="function"){var Ae=He._reglType;Ae==="texture2d"||Ae==="textureCube"?Ge=Wa(function(Oe){return Oe.link(He)}):(Ae==="framebuffer"||Ae==="framebufferCube")&&(Ge=Wa(function(Oe){return Oe.link(He.color[0])}))}else rn(He)&&(Ge=Wa(function(Oe){var Le=Oe.global.def("[",c(He.length,function(ur){return He[ur]}),"]");return Le}));Ge.value=He,Ie[Fe]=Ge}),Object.keys(Ne).forEach(function(Fe){var He=Ne[Fe];Ie[Fe]=ri(He,function(Ge,Ae){return Ge.invoke(Ae,He)})}),Ie}function Qs(Ft,$t){var he=Ft.static,Ne=Ft.dynamic,Ie={};return Object.keys(he).forEach(function(Fe){var He=he[Fe],Ge=nr.id(Fe),Ae=new fn;if(Yn(He))Ae.state=Ba,Ae.buffer=zn.getBuffer(zn.create(He,ye,!1,!0)),Ae.type=0;else{var Oe=zn.getBuffer(He);if(Oe)Ae.state=Ba,Ae.buffer=Oe,Ae.type=0;else if("constant"in He){var Le=He.constant;Ae.buffer="null",Ae.state=za,typeof Le=="number"?Ae.x=Le:Ya.forEach(function(Wn,Dn){Dn<Le.length&&(Ae[Wn]=Le[Dn])})}else{Yn(He.buffer)?Oe=zn.getBuffer(zn.create(He.buffer,ye,!1,!0)):Oe=zn.getBuffer(He.buffer);var ur=He.offset|0,Dr=He.stride|0,jr=He.size|0,On=!!He.normalized,Ln=0;"type"in He&&(Ln=pn[He.type]);var xn=He.divisor|0;Ae.buffer=Oe,Ae.state=Ba,Ae.size=jr,Ae.normalized=On,Ae.type=Ln||Oe.dtype,Ae.offset=ur,Ae.stride=Dr,Ae.divisor=xn}}Ie[Fe]=Wa(function(Wn,Dn){var la=Wn.attribCache;if(Ge in la)return la[Ge];var qn={isStream:!1};return Object.keys(Ae).forEach(function(Gn){qn[Gn]=Ae[Gn]}),Ae.buffer&&(qn.buffer=Wn.link(Ae.buffer),qn.type=qn.type||qn.buffer+".dtype"),la[Ge]=qn,qn})}),Object.keys(Ne).forEach(function(Fe){var He=Ne[Fe];function Ge(Ae,Oe){var Le=Ae.invoke(Oe,He),ur=Ae.shared,Dr=Ae.constants,jr=ur.isBufferArgs,On=ur.buffer,Ln={isStream:Oe.def(!1)},xn=new fn;xn.state=Ba,Object.keys(xn).forEach(function(qn){Ln[qn]=Oe.def(""+xn[qn])});var Wn=Ln.buffer,Dn=Ln.type;Oe("if(",jr,"(",Le,")){",Ln.isStream,"=true;",Wn,"=",On,".createStream(",ye,",",Le,");",Dn,"=",Wn,".dtype;","}else{",Wn,"=",On,".getBuffer(",Le,");","if(",Wn,"){",Dn,"=",Wn,".dtype;",'}else if("constant" in ',Le,"){",Ln.state,"=",za,";","if(typeof "+Le+'.constant === "number"){',Ln[Ya[0]],"=",Le,".constant;",Ya.slice(1).map(function(qn){return Ln[qn]}).join("="),"=0;","}else{",Ya.map(function(qn,Gn){return Ln[qn]+"="+Le+".constant.length>"+Gn+"?"+Le+".constant["+Gn+"]:0;"}).join(""),"}}else{","if(",jr,"(",Le,".buffer)){",Wn,"=",On,".createStream(",ye,",",Le,".buffer);","}else{",Wn,"=",On,".getBuffer(",Le,".buffer);","}",Dn,'="type" in ',Le,"?",Dr.glTypes,"[",Le,".type]:",Wn,".dtype;",Ln.normalized,"=!!",Le,".normalized;");function la(qn){Oe(Ln[qn],"=",Le,".",qn,"|0;")}return la("size"),la("offset"),la("stride"),la("divisor"),Oe("}}"),Oe.exit("if(",Ln.isStream,"){",On,".destroyStream(",Wn,");","}"),Ln}Ie[Fe]=ri(He,Ge)}),Ie}function El(Ft){var $t=Ft.static,he=Ft.dynamic,Ne={};return Object.keys($t).forEach(function(Ie){var Fe=$t[Ie];Ne[Ie]=Wa(function(He,Ge){return typeof Fe=="number"||typeof Fe=="boolean"?""+Fe:He.link(Fe)})}),Object.keys(he).forEach(function(Ie){var Fe=he[Ie];Ne[Ie]=ri(Fe,function(He,Ge){return He.invoke(Ge,Fe)})}),Ne}function Cl(Ft,$t,he,Ne,Ie){Ft.static,Ft.dynamic;var Fe=ds(Ft,$t),He=gi(Ft),Ge=Ri(Ft,He),Ae=Zi(Ft),Oe=Zs(Ft),Le=rs(Ft,Ie,Fe);function ur(Wn){var Dn=Ge[Wn];Dn&&(Oe[Wn]=Dn)}ur(ul),ur(ba(Ql));var Dr=Object.keys(Oe).length>0,jr={framebuffer:He,draw:Ae,shader:Le,state:Oe,dirty:Dr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(jr.profile=ui(Ft),jr.uniforms=Zo(he),jr.drawVAO=jr.scopeVAO=Ae.vao,!jr.drawVAO&&Le.program&&!Fe&&cr.angle_instanced_arrays&&Ae.static.elements){var On=!0,Ln=Le.program.attributes.map(function(Wn){var Dn=$t.static[Wn];return On=On&&!!Dn,Dn});if(On&&Ln.length>0){var xn=ea.getVAO(ea.createVAO({attributes:Ln,elements:Ae.static.elements}));jr.drawVAO=new _n(null,null,null,function(Wn,Dn){return Wn.link(xn)}),jr.useVAO=!0}}return Fe?jr.useVAO=!0:jr.attributes=Qs($t),jr.context=El(Ne),jr}function Hs(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.context,Fe=Ft.scope();Object.keys(he).forEach(function(He){$t.save(Ie,"."+He);var Ge=he[He],Ae=Ge.append(Ft,$t);Array.isArray(Ae)?Fe(Ie,".",He,"=[",Ae.join(),"];"):Fe(Ie,".",He,"=",Ae,";")}),$t(Fe)}function js(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ie.gl,He=Ie.framebuffer,Ge;kn&&(Ge=$t.def(Ie.extensions,".webgl_draw_buffers"));var Ae=Ft.constants,Oe=Ae.drawBuffer,Le=Ae.backBuffer,ur;he?ur=he.append(Ft,$t):ur=$t.def(He,".next"),Ne||$t("if(",ur,"!==",He,".cur){"),$t("if(",ur,"){",Fe,".bindFramebuffer(",an,",",ur,".framebuffer);"),kn&&$t(Ge,".drawBuffersWEBGL(",Oe,"[",ur,".colorAttachments.length]);"),$t("}else{",Fe,".bindFramebuffer(",an,",null);"),kn&&$t(Ge,".drawBuffersWEBGL(",Le,");"),$t("}",He,".cur=",ur,";"),Ne||$t("}")}function Ks(Ft,$t,he){var Ne=Ft.shared,Ie=Ne.gl,Fe=Ft.current,He=Ft.next,Ge=Ne.current,Ae=Ne.next,Oe=Ft.cond(Ge,".dirty");Rn.forEach(function(Le){var ur=ba(Le);if(!(ur in he.state)){var Dr,jr;if(ur in He){Dr=He[ur],jr=Fe[ur];var On=c(ya[ur].length,function(xn){return Oe.def(Dr,"[",xn,"]")});Oe(Ft.cond(On.map(function(xn,Wn){return xn+"!=="+jr+"["+Wn+"]"}).join("||")).then(Ie,".",Pa[ur],"(",On,");",On.map(function(xn,Wn){return jr+"["+Wn+"]="+xn}).join(";"),";"))}else{Dr=Oe.def(Ae,".",ur);var Ln=Ft.cond(Dr,"!==",Ge,".",ur);Oe(Ln),ur in An?Ln(Ft.cond(Dr).then(Ie,".enable(",An[ur],");").else(Ie,".disable(",An[ur],");"),Ge,".",ur,"=",Dr,";"):Ln(Ie,".",Pa[ur],"(",Dr,");",Ge,".",ur,"=",Dr,";")}}}),Object.keys(he.state).length===0&&Oe(Ge,".dirty=false;"),$t(Oe)}function Mi(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ft.current,He=Ie.current,Ge=Ie.gl,Ae;na(Object.keys(he)).forEach(function(Oe){var Le=he[Oe];if(!(Ne&&!Ne(Le))){var ur=Le.append(Ft,$t);if(An[Oe]){var Dr=An[Oe];Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ft.cond(Ae).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",Ae,";")):($t(Ft.cond(ur).then(Ge,".enable(",Dr,");").else(Ge,".disable(",Dr,");")),$t(He,".",Oe,"=",ur,";"))}else if(rn(ur)){var jr=Fe[Oe];$t(Ge,".",Pa[Oe],"(",ur,");",ur.map(function(On,Ln){return jr+"["+Ln+"]="+On}).join(";"),";")}else Ha(Le)?(Ae=Ft.link(ur,{stable:!0}),$t(Ge,".",Pa[Oe],"(",Ae,");",He,".",Oe,"=",Ae,";")):$t(Ge,".",Pa[Oe],"(",ur,");",He,".",Oe,"=",ur,";")}})}function Ys(Ft,$t){jn&&(Ft.instancing=$t.def(Ft.shared.extensions,".angle_instanced_arrays"))}function Uo(Ft,$t,he,Ne,Ie){var Fe=Ft.shared,He=Ft.stats,Ge=Fe.current,Ae=Fe.timer,Oe=he.profile;function Le(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ur,Dr;function jr(la){ur=$t.def(),la(ur,"=",Le(),";"),typeof Ie=="string"?la(He,".count+=",Ie,";"):la(He,".count++;"),fa&&(Ne?(Dr=$t.def(),la(Dr,"=",Ae,".getNumPendingQueries();")):la(Ae,".beginQuery(",He,");"))}function On(la){la(He,".cpuTime+=",Le(),"-",ur,";"),fa&&(Ne?la(Ae,".pushScopeStats(",Dr,",",Ae,".getNumPendingQueries(),",He,");"):la(Ae,".endQuery();"))}function Ln(la){var qn=$t.def(Ge,".profile");$t(Ge,".profile=",la,";"),$t.exit(Ge,".profile=",qn,";")}var xn;if(Oe){if(Ha(Oe)){Oe.enable?(jr($t),On($t.exit),Ln("true")):Ln("false");return}xn=Oe.append(Ft,$t),Ln(xn)}else xn=$t.def(Ge,".profile");var Wn=Ft.block();jr(Wn),$t("if(",xn,"){",Wn,"}");var Dn=Ft.block();On(Dn),$t.exit("if(",xn,"){",Dn,"}")}function tl(Ft,$t,he,Ne,Ie){var Fe=Ft.shared;function He(Ae){switch(Ae){case xa:case mi:case po:return 2;case La:case Yi:case Qo:return 3;case ai:case Go:case Js:return 4;default:return 1}}function Ge(Ae,Oe,Le){var ur=Fe.gl,Dr=$t.def(Ae,".location"),jr=$t.def(Fe.attributes,"[",Dr,"]"),On=Le.state,Ln=Le.buffer,xn=[Le.x,Le.y,Le.z,Le.w],Wn=["buffer","normalized","offset","stride"];function Dn(){$t("if(!",jr,".buffer){",ur,".enableVertexAttribArray(",Dr,");}");var qn=Le.type,Gn;if(Le.size?Gn=$t.def(Le.size,"||",Oe):Gn=Oe,$t("if(",jr,".type!==",qn,"||",jr,".size!==",Gn,"||",Wn.map(function(ti){return jr+"."+ti+"!=="+Le[ti]}).join("||"),"){",ur,".bindBuffer(",ye,",",Ln,".buffer);",ur,".vertexAttribPointer(",[Dr,Gn,qn,Le.normalized,Le.stride,Le.offset],");",jr,".type=",qn,";",jr,".size=",Gn,";",Wn.map(function(ti){return jr+"."+ti+"="+Le[ti]+";"}).join(""),"}"),jn){var ma=Le.divisor;$t("if(",jr,".divisor!==",ma,"){",Ft.instancing,".vertexAttribDivisorANGLE(",[Dr,ma],");",jr,".divisor=",ma,";}")}}function la(){$t("if(",jr,".buffer){",ur,".disableVertexAttribArray(",Dr,");",jr,".buffer=null;","}if(",Ya.map(function(qn,Gn){return jr+"."+qn+"!=="+xn[Gn]}).join("||"),"){",ur,".vertexAttrib4f(",Dr,",",xn,");",Ya.map(function(qn,Gn){return jr+"."+qn+"="+xn[Gn]+";"}).join(""),"}")}On===Ba?Dn():On===za?la():($t("if(",On,"===",Ba,"){"),Dn(),$t("}else{"),la(),$t("}"))}Ne.forEach(function(Ae){var Oe=Ae.name,Le=he.attributes[Oe],ur;if(Le){if(!Ie(Le))return;ur=Le.append(Ft,$t)}else{if(!Ie(xi))return;var Dr=Ft.scopeAttrib(Oe);ur={},Object.keys(new fn).forEach(function(jr){ur[jr]=$t.def(Dr,".",jr)})}Ge(Ft.link(Ae),He(Ae.info.type),ur)})}function Il(Ft,$t,he,Ne,Ie,Fe){for(var He=Ft.shared,Ge=He.gl,Ae,Oe=0;Oe<Ne.length;++Oe){var Le=Ne[Oe],ur=Le.name,Dr=Le.info.type,jr=he.uniforms[ur],On=Ft.link(Le),Ln=On+".location",xn;if(jr){if(!Ie(jr))continue;if(Ha(jr)){var Wn=jr.value;if(Dr===hl||Dr===Sl){var Dn=Ft.link(Wn._texture||Wn.color[0]._texture);$t(Ge,".uniform1i(",Ln,",",Dn+".bind());"),$t.exit(Dn,".unbind();")}else if(Dr===Us||Dr===To||Dr===ko){var la=Ft.global.def("new Float32Array(["+Array.prototype.slice.call(Wn)+"])"),qn=2;Dr===To?qn=3:Dr===ko&&(qn=4),$t(Ge,".uniformMatrix",qn,"fv(",Ln,",false,",la,");")}else{switch(Dr){case _a:Ae="1f";break;case xa:Ae="2f";break;case La:Ae="3f";break;case ai:Ae="4f";break;case Xo:Ae="1i";break;case Ai:Ae="1i";break;case po:Ae="2i";break;case mi:Ae="2i";break;case Qo:Ae="3i";break;case Yi:Ae="3i";break;case Js:Ae="4i";break;case Go:Ae="4i";break}$t(Ge,".uniform",Ae,"(",Ln,",",rn(Wn)?Array.prototype.slice.call(Wn):Wn,");")}continue}else xn=jr.append(Ft,$t)}else{if(!Ie(xi))continue;xn=$t.def(He.uniforms,"[",nr.id(ur),"]")}Dr===hl?$t("if(",xn,"&&",xn,'._reglType==="framebuffer"){',xn,"=",xn,".color[0];","}"):Dr===Sl&&$t("if(",xn,"&&",xn,'._reglType==="framebufferCube"){',xn,"=",xn,".color[0];","}");var Gn=1;switch(Dr){case hl:case Sl:var ma=$t.def(xn,"._texture");$t(Ge,".uniform1i(",Ln,",",ma,".bind());"),$t.exit(ma,".unbind();");continue;case Ai:case Xo:Ae="1i";break;case mi:case po:Ae="2i",Gn=2;break;case Yi:case Qo:Ae="3i",Gn=3;break;case Go:case Js:Ae="4i",Gn=4;break;case _a:Ae="1f";break;case xa:Ae="2f",Gn=2;break;case La:Ae="3f",Gn=3;break;case ai:Ae="4f",Gn=4;break;case Us:Ae="Matrix2fv";break;case To:Ae="Matrix3fv";break;case ko:Ae="Matrix4fv";break}if(Ae.charAt(0)==="M"){$t(Ge,".uniform",Ae,"(",Ln,",");var ti=Math.pow(Dr-Us+2,2),si=Ft.global.def("new Float32Array(",ti,")");Array.isArray(xn)?$t("false,(",c(ti,function(Ko){return si+"["+Ko+"]="+xn[Ko]}),",",si,")"):$t("false,(Array.isArray(",xn,")||",xn," instanceof Float32Array)?",xn,":(",c(ti,function(Ko){return si+"["+Ko+"]="+xn+"["+Ko+"]"}),",",si,")"),$t(");")}else if(Gn>1){for(var Li=[],to=[],ls=0;ls<Gn;++ls)Array.isArray(xn)?to.push(xn[ls]):to.push($t.def(xn+"["+ls+"]")),Fe&&Li.push($t.def());Fe&&$t("if(!",Ft.batchId,"||",Li.map(function(Ko,gs){return Ko+"!=="+to[gs]}).join("||"),"){",Li.map(function(Ko,gs){return Ko+"="+to[gs]+";"}).join("")),$t(Ge,".uniform",Ae,"(",Ln,",",to.join(","),");"),Fe&&$t("}")}else{if(Fe){var ms=$t.def();$t("if(!",Ft.batchId,"||",ms,"!==",xn,"){",ms,"=",xn,";")}$t(Ge,".uniform",Ae,"(",Ln,",",xn,");"),Fe&&$t("}")}}}function vi(Ft,$t,he,Ne){var Ie=Ft.shared,Fe=Ie.gl,He=Ie.draw,Ge=Ne.draw;function Ae(){var Gn=Ge.elements,ma,ti=$t;return Gn?((Gn.contextDep&&Ne.contextDynamic||Gn.propDep)&&(ti=he),ma=Gn.append(Ft,ti),Ge.elementsActive&&ti("if("+ma+")"+Fe+".bindBuffer("+ze+","+ma+".buffer.buffer);")):(ma=ti.def(),ti(ma,"=",He,".",xt,";","if(",ma,"){",Fe,".bindBuffer(",ze,",",ma,".buffer.buffer);}","else if(",Ie.vao,".currentVAO){",ma,"=",Ft.shared.elements+".getElements("+Ie.vao,".currentVAO.elements);",Ia?"":"if("+ma+")"+Fe+".bindBuffer("+ze+","+ma+".buffer.buffer);","}")),ma}function Oe(){var Gn=Ge.count,ma,ti=$t;return Gn?((Gn.contextDep&&Ne.contextDynamic||Gn.propDep)&&(ti=he),ma=Gn.append(Ft,ti)):ma=ti.def(He,".",Lt),ma}var Le=Ae();function ur(Gn){var ma=Ge[Gn];return ma?ma.contextDep&&Ne.contextDynamic||ma.propDep?ma.append(Ft,he):ma.append(Ft,$t):$t.def(He,".",Gn)}var Dr=ur(kt),jr=ur(le),On=Oe();if(typeof On=="number"){if(On===0)return}else he("if(",On,"){"),he.exit("}");var Ln,xn;jn&&(Ln=ur(xe),xn=Ft.instancing);var Wn=Le+".type",Dn=Ge.elements&&Ha(Ge.elements)&&!Ge.vaoActive;function la(){function Gn(){he(xn,".drawElementsInstancedANGLE(",[Dr,On,Wn,jr+"<<(("+Wn+"-"+va+")>>1)",Ln],");")}function ma(){he(xn,".drawArraysInstancedANGLE(",[Dr,jr,On,Ln],");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}function qn(){function Gn(){he(Fe+".drawElements("+[Dr,On,Wn,jr+"<<(("+Wn+"-"+va+")>>1)"]+");")}function ma(){he(Fe+".drawArrays("+[Dr,jr,On]+");")}Le&&Le!=="null"?Dn?Gn():(he("if(",Le,"){"),Gn(),he("}else{"),ma(),he("}")):ma()}jn&&(typeof Ln!="number"||Ln>=0)?typeof Ln=="string"?(he("if(",Ln,">0){"),la(),he("}else if(",Ln,"<0){"),qn(),he("}")):la():qn()}function lo(Ft,$t,he,Ne,Ie){var Fe=Na(),He=Fe.proc("body",Ie);return jn&&(Fe.instancing=He.def(Fe.shared.extensions,".angle_instanced_arrays")),Ft(Fe,He,he,Ne),Fe.compile().body}function ns(Ft,$t,he,Ne){Ys(Ft,$t),he.useVAO?he.drawVAO?$t(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,$t),");"):$t(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):($t(Ft.shared.vao,".setVAO(null);"),tl(Ft,$t,he,Ne.attributes,function(){return!0})),Il(Ft,$t,he,Ne.uniforms,function(){return!0},!1),vi(Ft,$t,$t,he)}function $o(Ft,$t){var he=Ft.proc("draw",1);Ys(Ft,he),Hs(Ft,he,$t.context),js(Ft,he,$t.framebuffer),Ks(Ft,he,$t),Mi(Ft,he,$t.state),Uo(Ft,he,$t,!1,!0);var Ne=$t.shader.progVar.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Ne,".program);"),$t.shader.program)ns(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Ie=Ft.global.def("{}"),Fe=he.def(Ne,".id"),He=he.def(Ie,"[",Fe,"]");he(Ft.cond(He).then(He,".call(this,a0);").else(He,"=",Ie,"[",Fe,"]=",Ft.link(function(Ge){return lo(ns,Ft,$t,Ge,1)}),"(",Ne,");",He,".call(this,a0);"))}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function U(Ft,$t,he,Ne){Ft.batchId="a1",Ys(Ft,$t);function Ie(){return!0}tl(Ft,$t,he,Ne.attributes,Ie),Il(Ft,$t,he,Ne.uniforms,Ie,!1),vi(Ft,$t,$t,he)}function tt(Ft,$t,he,Ne){Ys(Ft,$t);var Ie=he.contextDep,Fe=$t.def(),He="a0",Ge="a1",Ae=$t.def();Ft.shared.props=Ae,Ft.batchId=Fe;var Oe=Ft.scope(),Le=Ft.scope();$t(Oe.entry,"for(",Fe,"=0;",Fe,"<",Ge,";++",Fe,"){",Ae,"=",He,"[",Fe,"];",Le,"}",Oe.exit);function ur(Wn){return Wn.contextDep&&Ie||Wn.propDep}function Dr(Wn){return!ur(Wn)}if(he.needsContext&&Hs(Ft,Le,he.context),he.needsFramebuffer&&js(Ft,Le,he.framebuffer),Mi(Ft,Le,he.state,ur),he.profile&&ur(he.profile)&&Uo(Ft,Le,he,!1,!0),Ne)he.useVAO?he.drawVAO?ur(he.drawVAO)?Le(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Le),");"):Oe(Ft.shared.vao,".setVAO(",he.drawVAO.append(Ft,Oe),");"):Oe(Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"):(Oe(Ft.shared.vao,".setVAO(null);"),tl(Ft,Oe,he,Ne.attributes,Dr),tl(Ft,Le,he,Ne.attributes,ur)),Il(Ft,Oe,he,Ne.uniforms,Dr,!1),Il(Ft,Le,he,Ne.uniforms,ur,!0),vi(Ft,Oe,Le,he);else{var jr=Ft.global.def("{}"),On=he.shader.progVar.append(Ft,Le),Ln=Le.def(On,".id"),xn=Le.def(jr,"[",Ln,"]");Le(Ft.shared.gl,".useProgram(",On,".program);","if(!",xn,"){",xn,"=",jr,"[",Ln,"]=",Ft.link(function(Wn){return lo(U,Ft,he,Wn,2)}),"(",On,");}",xn,".call(this,a0[",Fe,"],",Fe,");")}}function Y(Ft,$t){var he=Ft.proc("batch",2);Ft.batchId="0",Ys(Ft,he);var Ne=!1,Ie=!0;Object.keys($t.context).forEach(function(jr){Ne=Ne||$t.context[jr].propDep}),Ne||(Hs(Ft,he,$t.context),Ie=!1);var Fe=$t.framebuffer,He=!1;Fe?(Fe.propDep?Ne=He=!0:Fe.contextDep&&Ne&&(He=!0),He||js(Ft,he,Fe)):js(Ft,he,null),$t.state.viewport&&$t.state.viewport.propDep&&(Ne=!0);function Ge(jr){return jr.contextDep&&Ne||jr.propDep}Ks(Ft,he,$t),Mi(Ft,he,$t.state,function(jr){return!Ge(jr)}),(!$t.profile||!Ge($t.profile))&&Uo(Ft,he,$t,!1,"a1"),$t.contextDep=Ne,$t.needsContext=Ie,$t.needsFramebuffer=He;var Ae=$t.shader.progVar;if(Ae.contextDep&&Ne||Ae.propDep)tt(Ft,he,$t,null);else{var Oe=Ae.append(Ft,he);if(he(Ft.shared.gl,".useProgram(",Oe,".program);"),$t.shader.program)tt(Ft,he,$t,$t.shader.program);else{he(Ft.shared.vao,".setVAO(null);");var Le=Ft.global.def("{}"),ur=he.def(Oe,".id"),Dr=he.def(Le,"[",ur,"]");he(Ft.cond(Dr).then(Dr,".call(this,a0,a1);").else(Dr,"=",Le,"[",ur,"]=",Ft.link(function(jr){return lo(tt,Ft,$t,jr,2)}),"(",Oe,");",Dr,".call(this,a0,a1);"))}}Object.keys($t.state).length>0&&he(Ft.shared.current,".dirty=true;"),Ft.shared.vao&&he(Ft.shared.vao,".setVAO(null);")}function ft(Ft,$t){var he=Ft.proc("scope",3);Ft.batchId="a2";var Ne=Ft.shared,Ie=Ne.current;if(Hs(Ft,he,$t.context),$t.framebuffer&&$t.framebuffer.append(Ft,he),na(Object.keys($t.state)).forEach(function(Ge){var Ae=$t.state[Ge],Oe=Ae.append(Ft,he);rn(Oe)?Oe.forEach(function(Le,ur){Sa(Le)?he.set(Ft.next[Ge],"["+ur+"]",Le):he.set(Ft.next[Ge],"["+ur+"]",Ft.link(Le,{stable:!0}))}):Ha(Ae)?he.set(Ne.next,"."+Ge,Ft.link(Oe,{stable:!0})):he.set(Ne.next,"."+Ge,Oe)}),Uo(Ft,he,$t,!0,!0),[xt,le,Lt,xe,kt].forEach(function(Ge){var Ae=$t.draw[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.draw,"."+Ge,Oe):he.set(Ne.draw,"."+Ge,Ft.link(Oe),{stable:!0})}}),Object.keys($t.uniforms).forEach(function(Ge){var Ae=$t.uniforms[Ge].append(Ft,he);Array.isArray(Ae)&&(Ae="["+Ae.map(function(Oe){return Sa(Oe)?Oe:Ft.link(Oe,{stable:!0})})+"]"),he.set(Ne.uniforms,"["+Ft.link(nr.id(Ge),{stable:!0})+"]",Ae)}),Object.keys($t.attributes).forEach(function(Ge){var Ae=$t.attributes[Ge].append(Ft,he),Oe=Ft.scopeAttrib(Ge);Object.keys(new fn).forEach(function(Le){he.set(Oe,"."+Le,Ae[Le])})}),$t.scopeVAO){var Fe=$t.scopeVAO.append(Ft,he);Sa(Fe)?he.set(Ne.vao,".targetVAO",Fe):he.set(Ne.vao,".targetVAO",Ft.link(Fe,{stable:!0}))}function He(Ge){var Ae=$t.shader[Ge];if(Ae){var Oe=Ae.append(Ft,he);Sa(Oe)?he.set(Ne.shader,"."+Ge,Oe):he.set(Ne.shader,"."+Ge,Ft.link(Oe,{stable:!0}))}}He(z),He(at),Object.keys($t.state).length>0&&(he(Ie,".dirty=true;"),he.exit(Ie,".dirty=true;")),he("a1(",Ft.shared.context,",a0,",Ft.batchId,");")}function zt(Ft){if(!(typeof Ft!="object"||rn(Ft))){for(var $t=Object.keys(Ft),he=0;he<$t.length;++he)if(f.isDynamic(Ft[$t[he]]))return!0;return!1}}function Qt(Ft,$t,he){var Ne=$t.static[he];if(!Ne||!zt(Ne))return;var Ie=Ft.global,Fe=Object.keys(Ne),He=!1,Ge=!1,Ae=!1,Oe=Ft.global.def("{}");Fe.forEach(function(ur){var Dr=Ne[ur];if(f.isDynamic(Dr)){typeof Dr=="function"&&(Dr=Ne[ur]=f.unbox(Dr));var jr=ri(Dr,null);He=He||jr.thisDep,Ae=Ae||jr.propDep,Ge=Ge||jr.contextDep}else{switch(Ie(Oe,".",ur,"="),typeof Dr){case"number":Ie(Dr);break;case"string":Ie('"',Dr,'"');break;case"object":Array.isArray(Dr)&&Ie("[",Dr.join(),"]");break;default:Ie(Ft.link(Dr));break}Ie(";")}});function Le(ur,Dr){Fe.forEach(function(jr){var On=Ne[jr];if(f.isDynamic(On)){var Ln=ur.invoke(Dr,On);Dr(Oe,".",jr,"=",Ln,";")}})}$t.dynamic[he]=new f.DynamicVariable(Wi,{thisDep:He,contextDep:Ge,propDep:Ae,ref:Oe,append:Le}),delete $t.static[he]}function ne(Ft,$t,he,Ne,Ie){var Fe=Na();Fe.stats=Fe.link(Ie),Object.keys($t.static).forEach(function(Ge){Qt(Fe,$t,Ge)}),Te.forEach(function(Ge){Qt(Fe,Ft,Ge)});var He=Cl(Ft,$t,he,Ne,Fe);return He.shader.program&&(He.shader.program.attributes.sort(function(Ge,Ae){return Ge.name<Ae.name?-1:1}),He.shader.program.uniforms.sort(function(Ge,Ae){return Ge.name<Ae.name?-1:1})),$o(Fe,He),ft(Fe,He),Y(Fe,He),u(Fe.compile(),{destroy:function(){He.shader.program.destroy()}})}return{next:qa,current:ya,procs:function(){var Ft=Na(),$t=Ft.proc("poll"),he=Ft.proc("refresh"),Ne=Ft.block();$t(Ne),he(Ne);var Ie=Ft.shared,Fe=Ie.gl,He=Ie.next,Ge=Ie.current;Ne(Ge,".dirty=false;"),js(Ft,$t),js(Ft,he,null,!0);var Ae;jn&&(Ae=Ft.link(jn)),cr.oes_vertex_array_object&&he(Ft.link(cr.oes_vertex_array_object),".bindVertexArrayOES(null);");var Oe=he.def(Ie.attributes),Le=he.def(0),ur=Ft.cond(Le,".buffer");ur.then(Fe,".enableVertexAttribArray(i);",Fe,".bindBuffer(",ye,",",Le,".buffer.buffer);",Fe,".vertexAttribPointer(i,",Le,".size,",Le,".type,",Le,".normalized,",Le,".stride,",Le,".offset);").else(Fe,".disableVertexAttribArray(i);",Fe,".vertexAttrib4f(i,",Le,".x,",Le,".y,",Le,".z,",Le,".w);",Le,".buffer=null;");var Dr=Ft.link(sn.maxAttributes,{stable:!0});return he("for(var i=0;i<",Dr,";++i){",Le,"=",Oe,"[i];",ur,"}"),jn&&he("for(var i=0;i<",Dr,";++i){",Ae,".vertexAttribDivisorANGLE(i,",Oe,"[i].divisor);","}"),he(Ft.shared.vao,".currentVAO=null;",Ft.shared.vao,".setVAO(",Ft.shared.vao,".targetVAO);"),Object.keys(An).forEach(function(jr){var On=An[jr],Ln=Ne.def(He,".",jr),xn=Ft.block();xn("if(",Ln,"){",Fe,".enable(",On,")}else{",Fe,".disable(",On,")}",Ge,".",jr,"=",Ln,";"),he(xn),$t("if(",Ln,"!==",Ge,".",jr,"){",xn,"}")}),Object.keys(Pa).forEach(function(jr){var On=Pa[jr],Ln=ya[jr],xn,Wn,Dn=Ft.block();if(Dn(Fe,".",On,"("),rn(Ln)){var la=Ln.length;xn=Ft.global.def(He,".",jr),Wn=Ft.global.def(Ge,".",jr),Dn(c(la,function(qn){return xn+"["+qn+"]"}),");",c(la,function(qn){return Wn+"["+qn+"]="+xn+"["+qn+"];"}).join("")),$t("if(",c(la,function(qn){return xn+"["+qn+"]!=="+Wn+"["+qn+"]"}).join("||"),"){",Dn,"}")}else xn=Ne.def(He,".",jr),Wn=Ne.def(Ge,".",jr),Dn(xn,");",Ge,".",jr,"=",xn,";"),$t("if(",xn,"!==",Wn,"){",Dn,"}");he(Dn)}),Ft.compile()}(),compile:ne}}function zi(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var jo=34918,Ii=34919,Ji=35007,es=function(ie,nr){if(!nr.ext_disjoint_timer_query)return null;var cr=[];function sn(){return cr.pop()||nr.ext_disjoint_timer_query.createQueryEXT()}function zn(Xn){cr.push(Xn)}var Tn=[];function qr(Xn){var jn=sn();nr.ext_disjoint_timer_query.beginQueryEXT(Ji,jn),Tn.push(jn),fa(Tn.length-1,Tn.length,Xn)}function Sn(){nr.ext_disjoint_timer_query.endQueryEXT(Ji)}function sa(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var ea=[];function ka(){return ea.pop()||new sa}function Ka(Xn){ea.push(Xn)}var Va=[];function fa(Xn,jn,kn){var Ia=ka();Ia.startQueryIndex=Xn,Ia.endQueryIndex=jn,Ia.sum=0,Ia.stats=kn,Va.push(Ia)}var Un=[],Nr=[];function fn(){var Xn,jn,kn=Tn.length;if(kn!==0){Nr.length=Math.max(Nr.length,kn+1),Un.length=Math.max(Un.length,kn+1),Un[0]=0,Nr[0]=0;var Ia=0;for(Xn=0,jn=0;jn<Tn.length;++jn){var ya=Tn[jn];nr.ext_disjoint_timer_query.getQueryObjectEXT(ya,Ii)?(Ia+=nr.ext_disjoint_timer_query.getQueryObjectEXT(ya,jo),zn(ya)):Tn[Xn++]=ya,Un[jn+1]=Ia,Nr[jn+1]=Xn}for(Tn.length=Xn,Xn=0,jn=0;jn<Va.length;++jn){var qa=Va[jn],Rn=qa.startQueryIndex,An=qa.endQueryIndex;qa.sum+=Un[An]-Un[Rn];var Pa=Nr[Rn],ba=Nr[An];ba===Pa?(qa.stats.gpuTime+=qa.sum/1e6,Ka(qa)):(qa.startQueryIndex=Pa,qa.endQueryIndex=ba,Va[Xn++]=qa)}Va.length=Xn}}return{beginQuery:qr,endQuery:Sn,pushScopeStats:fa,update:fn,getNumPendingQueries:function(){return Tn.length},clear:function(){cr.push.apply(cr,Tn);for(var Xn=0;Xn<cr.length;Xn++)nr.ext_disjoint_timer_query.deleteQueryEXT(cr[Xn]);Tn.length=0,cr.length=0},restore:function(){Tn.length=0,cr.length=0}}},pl=16384,Ns=256,fi=1024,Ao=34962,Bo="webglcontextlost",Ds="webglcontextrestored",Ts=1,lu=2,ps=3;function zs(ie,nr){for(var cr=0;cr<ie.length;++cr)if(ie[cr]===nr)return cr;return-1}function Eu(ie){var nr=M(ie);if(!nr)return null;var cr=nr.gl,sn=cr.getContextAttributes();cr.isContextLost();var zn=T(cr,nr);if(!zn)return null;var Tn=m(),qr=zi(),Sn=nr.cachedCode||{},sa=zn.extensions,ea=es(cr,sa),ka=g(),Ka=cr.drawingBufferWidth,Va=cr.drawingBufferHeight,fa={tick:0,time:0,viewportWidth:Ka,viewportHeight:Va,framebufferWidth:Ka,framebufferHeight:Va,drawingBufferWidth:Ka,drawingBufferHeight:Va,pixelRatio:nr.pixelRatio},Un={},Nr={elements:null,primitive:4,count:-1,offset:0,instances:-1},fn=er(cr,sa),Xn=Yr(cr,qr,nr,Ia),jn=Ke(cr,sa,Xn,qr),kn=Du(cr,sa,fn,qr,Xn,jn,Nr);function Ia(vi){return kn.destroyBuffer(vi)}var ya=Ku(cr,Tn,qr,nr),qa=wu(cr,sa,fn,function(){Pa.procs.poll()},fa,qr,nr),Rn=Gu(cr,sa,fn,qr,nr),An=iu(cr,sa,fn,qa,Rn,qr),Pa=ki(cr,Tn,sa,fn,Xn,jn,qa,An,Un,kn,ya,Nr,fa,ea,Sn,nr),ba=uf(cr,An,Pa.procs.poll,fa),aa=Pa.next,oa=cr.canvas,Sa=[],_i=[],pi=[],Ma=[nr.onDestroy],Na=null;function ui(){if(Sa.length===0){ea&&ea.update(),Na=null;return}Na=v.next(ui),js();for(var vi=Sa.length-1;vi>=0;--vi){var lo=Sa[vi];lo&&lo(fa,null,0)}cr.flush(),ea&&ea.update()}function gi(){!Na&&Sa.length>0&&(Na=v.next(ui))}function Ri(){Na&&(v.cancel(ui),Na=null)}function ds(vi){vi.preventDefault(),Ri(),_i.forEach(function(lo){lo()})}function rs(vi){cr.getError(),zn.restore(),ya.restore(),Xn.restore(),qa.restore(),Rn.restore(),An.restore(),kn.restore(),ea&&ea.restore(),Pa.procs.refresh(),gi(),pi.forEach(function(lo){lo()})}oa&&(oa.addEventListener(Bo,ds,!1),oa.addEventListener(Ds,rs,!1));function Zi(){Sa.length=0,Ri(),oa&&(oa.removeEventListener(Bo,ds),oa.removeEventListener(Ds,rs)),ya.clear(),An.clear(),Rn.clear(),kn.clear(),qa.clear(),jn.clear(),Xn.clear(),ea&&ea.clear(),Ma.forEach(function(vi){vi()})}function Zs(vi){function lo(Ie){var Fe=u({},Ie);delete Fe.uniforms,delete Fe.attributes,delete Fe.context,delete Fe.vao,"stencil"in Fe&&Fe.stencil.op&&(Fe.stencil.opBack=Fe.stencil.opFront=Fe.stencil.op,delete Fe.stencil.op);function He(Ge){if(Ge in Fe){var Ae=Fe[Ge];delete Fe[Ge],Object.keys(Ae).forEach(function(Oe){Fe[Ge+"."+Oe]=Ae[Oe]})}}return He("blend"),He("depth"),He("cull"),He("stencil"),He("polygonOffset"),He("scissor"),He("sample"),"vao"in Ie&&(Fe.vao=Ie.vao),Fe}function ns(Ie,Fe){var He={},Ge={};return Object.keys(Ie).forEach(function(Ae){var Oe=Ie[Ae];if(f.isDynamic(Oe)){Ge[Ae]=f.unbox(Oe,Ae);return}else if(Fe&&Array.isArray(Oe)){for(var Le=0;Le<Oe.length;++Le)if(f.isDynamic(Oe[Le])){Ge[Ae]=f.unbox(Oe,Ae);return}}He[Ae]=Oe}),{dynamic:Ge,static:He}}var $o=ns(vi.context||{},!0),U=ns(vi.uniforms||{},!0),tt=ns(vi.attributes||{},!1),Y=ns(lo(vi),!1),ft={gpuTime:0,cpuTime:0,count:0},zt=Pa.compile(Y,tt,U,$o,ft),Qt=zt.draw,ne=zt.batch,Ft=zt.scope,$t=[];function he(Ie){for(;$t.length<Ie;)$t.push(null);return $t}function Ne(Ie,Fe){var He;if(typeof Ie=="function")return Ft.call(this,null,Ie,0);if(typeof Fe=="function")if(typeof Ie=="number")for(He=0;He<Ie;++He)Ft.call(this,null,Fe,He);else if(Array.isArray(Ie))for(He=0;He<Ie.length;++He)Ft.call(this,Ie[He],Fe,He);else return Ft.call(this,Ie,Fe,0);else if(typeof Ie=="number"){if(Ie>0)return ne.call(this,he(Ie|0),Ie|0)}else if(Array.isArray(Ie)){if(Ie.length)return ne.call(this,Ie,Ie.length)}else return Qt.call(this,Ie)}return u(Ne,{stats:ft,destroy:function(){zt.destroy()}})}var Zo=An.setFBO=Zs({framebuffer:f.define.call(null,Ts,"framebuffer")});function Qs(vi,lo){var ns=0;Pa.procs.poll();var $o=lo.color;$o&&(cr.clearColor(+$o[0]||0,+$o[1]||0,+$o[2]||0,+$o[3]||0),ns|=pl),"depth"in lo&&(cr.clearDepth(+lo.depth),ns|=Ns),"stencil"in lo&&(cr.clearStencil(lo.stencil|0),ns|=fi),cr.clear(ns)}function El(vi){if("framebuffer"in vi)if(vi.framebuffer&&vi.framebuffer_reglType==="framebufferCube")for(var lo=0;lo<6;++lo)Zo(u({framebuffer:vi.framebuffer.faces[lo]},vi),Qs);else Zo(vi,Qs);else Qs(null,vi)}function Cl(vi){Sa.push(vi);function lo(){var ns=zs(Sa,vi);function $o(){var U=zs(Sa,$o);Sa[U]=Sa[Sa.length-1],Sa.length-=1,Sa.length<=0&&Ri()}Sa[ns]=$o}return gi(),{cancel:lo}}function Hs(){var vi=aa.viewport,lo=aa.scissor_box;vi[0]=vi[1]=lo[0]=lo[1]=0,fa.viewportWidth=fa.framebufferWidth=fa.drawingBufferWidth=vi[2]=lo[2]=cr.drawingBufferWidth,fa.viewportHeight=fa.framebufferHeight=fa.drawingBufferHeight=vi[3]=lo[3]=cr.drawingBufferHeight}function js(){fa.tick+=1,fa.time=Mi(),Hs(),Pa.procs.poll()}function Ks(){qa.refresh(),Hs(),Pa.procs.refresh(),ea&&ea.update()}function Mi(){return(g()-ka)/1e3}Ks();function Ys(vi,lo){var ns;switch(vi){case"frame":return Cl(lo);case"lost":ns=_i;break;case"restore":ns=pi;break;case"destroy":ns=Ma;break}return ns.push(lo),{cancel:function(){for(var $o=0;$o<ns.length;++$o)if(ns[$o]===lo){ns[$o]=ns[ns.length-1],ns.pop();return}}}}function Uo(){return Sn}function tl(vi){Object.entries(vi).forEach(function(lo){Sn[lo[0]]=lo[1]})}var Il=u(Zs,{clear:El,prop:f.define.bind(null,Ts),context:f.define.bind(null,lu),this:f.define.bind(null,ps),draw:Zs({}),buffer:function(vi){return Xn.create(vi,Ao,!1,!1)},elements:function(vi){return jn.create(vi,!1)},texture:qa.create2D,cube:qa.createCube,renderbuffer:Rn.create,framebuffer:An.create,framebufferCube:An.createCube,vao:kn.createVAO,attributes:sn,frame:Cl,on:Ys,limits:fn,hasExtension:function(vi){return fn.extensions.indexOf(vi.toLowerCase())>=0},read:ba,destroy:Zi,_gl:cr,_refresh:Ks,poll:function(){js(),ea&&ea.update()},now:Mi,stats:qr,getCachedCode:Uo,preloadCachedCode:tl});return nr.onDone(null,Il),Il}return Eu})}),jx=Vt((Z,V)=>{var u=_3(),d=h9();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=d({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||u({container:e._glcontainer.node()}),r}}),c5=Vt((f,V)=>{var u=V3(),d=t5(),E=Y7(),A=f9(),t=Xr(),e=Jh().selectMode,r=jx(),i=nu(),n=Ob(),o=N3().styleTextSelection,a={};function s(v,g,m,w){var l=v._size,x=v.width*w,y=v.height*w,S=l.l*w,k=l.b*w,M=l.r*w,T=l.t*w,c=l.w*w,h=l.h*w;return[S+g.domain[0]*c,k+m.domain[0]*h,x-M-(1-g.domain[1])*c,y-T-(1-m.domain[1])*h]}var f=V.exports=function(v,g,m){if(m.length){var w=v._fullLayout,l=g._scene,x=g.xaxis,y=g.yaxis,S,k;if(l){var M=r(v,["ANGLE_instanced_arrays","OES_element_index_uint"],a);if(!M){l.init();return}var T=l.count,c=w._glcanvas.data()[0].regl;if(n(v,g,m),l.dirty){if((l.line2d||l.error2d)&&!(l.scatter2d||l.fill2d||l.glText)&&c.clear({color:!0,depth:!0}),l.error2d===!0&&(l.error2d=E(c)),l.line2d===!0&&(l.line2d=d(c)),l.scatter2d===!0&&(l.scatter2d=u(c)),l.fill2d===!0&&(l.fill2d=d(c)),l.glText===!0)for(l.glText=new Array(T),S=0;S<T;S++)l.glText[S]=new A(c);if(l.glText){if(T>l.glText.length){var h=T-l.glText.length;for(S=0;S<h;S++)l.glText.push(new A(c))}else if(T<l.glText.length){var b=l.glText.length-T,_=l.glText.splice(T,b);_.forEach(function(J){J.destroy()})}for(S=0;S<T;S++)l.glText[S].update(l.textOptions[S])}if(l.line2d&&(l.line2d.update(l.lineOptions),l.lineOptions=l.lineOptions.map(function(J){if(J&&J.positions){for(var q=J.positions,it=0;it<q.length&&(isNaN(q[it])||isNaN(q[it+1]));)it+=2;for(var nt=q.length-2;nt>it&&(isNaN(q[nt])||isNaN(q[nt+1]));)nt-=2;J.positions=q.slice(it,nt+2)}return J}),l.line2d.update(l.lineOptions)),l.error2d){var P=(l.errorXOptions||[]).concat(l.errorYOptions||[]);l.error2d.update(P)}l.scatter2d&&l.scatter2d.update(l.markerOptions),l.fillOrder=t.repeat(null,T),l.fill2d&&(l.fillOptions=l.fillOptions.map(function(J,q){var it=m[q];if(!(!J||!it||!it[0]||!it[0].trace)){var nt=it[0],dt=nt.trace,Tt=nt.t,wt=l.lineOptions[q],It,Ct,Nt=[];dt._ownfill&&Nt.push(q),dt._nexttrace&&Nt.push(q+1),Nt.length&&(l.fillOrder[q]=Nt);var ee=[],Jt=wt&&wt.positions||Tt.positions,te,Kt;if(dt.fill==="tozeroy"){for(te=0;te<Jt.length&&isNaN(Jt[te+1]);)te+=2;for(Kt=Jt.length-2;Kt>te&&isNaN(Jt[Kt+1]);)Kt-=2;Jt[te+1]!==0&&(ee=[Jt[te],0]),ee=ee.concat(Jt.slice(te,Kt+2)),Jt[Kt+1]!==0&&(ee=ee.concat([Jt[Kt],0]))}else if(dt.fill==="tozerox"){for(te=0;te<Jt.length&&isNaN(Jt[te]);)te+=2;for(Kt=Jt.length-2;Kt>te&&isNaN(Jt[Kt]);)Kt-=2;Jt[te]!==0&&(ee=[0,Jt[te+1]]),ee=ee.concat(Jt.slice(te,Kt+2)),Jt[Kt]!==0&&(ee=ee.concat([0,Jt[Kt+1]]))}else if(dt.fill==="toself"||dt.fill==="tonext"){for(ee=[],It=0,J.splitNull=!0,Ct=0;Ct<Jt.length;Ct+=2)(isNaN(Jt[Ct])||isNaN(Jt[Ct+1]))&&(ee=ee.concat(Jt.slice(It,Ct)),ee.push(Jt[It],Jt[It+1]),ee.push(null,null),It=Ct+2);ee=ee.concat(Jt.slice(It)),It&&ee.push(Jt[It],Jt[It+1])}else{var mt=dt._nexttrace;if(mt){var bt=l.lineOptions[q+1];if(bt){var vt=bt.positions;if(dt.fill==="tonexty"){for(ee=Jt.slice(),q=Math.floor(vt.length/2);q--;){var Ut=vt[q*2],re=vt[q*2+1];isNaN(Ut)||isNaN(re)||ee.push(Ut,re)}J.fill=mt.fillcolor}}}}if(dt._prevtrace&&dt._prevtrace.fill==="tonext"){var Zt=l.lineOptions[q-1].positions,ue=ee.length/2;It=ue;var Me=[It];for(Ct=0;Ct<Zt.length;Ct+=2)(isNaN(Zt[Ct])||isNaN(Zt[Ct+1]))&&(Me.push(Ct/2+ue+1),It=Ct+2);ee=ee.concat(Zt),J.hole=Me}return J.fillmode=dt.fill,J.opacity=dt.opacity,J.positions=ee,J}}),l.fill2d.update(l.fillOptions))}var L=w.dragmode,D=e(L),B=w.clickmode.indexOf("select")>-1;for(S=0;S<T;S++){var R=m[S][0],I=R.trace,F=R.t,N=F.index,j=I._length,G=F.x,rt=F.y;if(I.selectedpoints||D||B){if(D||(D=!0),I.selectedpoints){var ct=l.selectBatch[N]=t.selIndices2selPoints(I),st={};for(k=0;k<ct.length;k++)st[ct[k]]=1;var et=[];for(k=0;k<j;k++)st[k]||et.push(k);l.unselectBatch[N]=et}var K=F.xpx=new Array(j),ot=F.ypx=new Array(j);for(k=0;k<j;k++)K[k]=x.c2p(G[k]),ot[k]=y.c2p(rt[k])}else F.xpx=F.ypx=null}if(D){if(l.select2d||(l.select2d=u(w._glcanvas.data()[1].regl)),l.scatter2d){var X=new Array(T);for(S=0;S<T;S++)X[S]=l.selectBatch[S].length||l.unselectBatch[S].length?l.markerUnselectedOptions[S]:{};l.scatter2d.update(X)}l.select2d&&(l.select2d.update(l.markerOptions),l.select2d.update(l.markerSelectedOptions)),l.glText&&m.forEach(function(J){var q=((J||[])[0]||{}).trace||{};i.hasText(q)&&o(J)})}else l.scatter2d&&l.scatter2d.update(l.markerOptions);var Q={viewport:s(w,x,y,v._context.plotGlPixelRatio),range:[(x._rl||x.range)[0],(y._rl||y.range)[0],(x._rl||x.range)[1],(y._rl||y.range)[1]]},ut=t.repeat(Q,l.count);l.fill2d&&l.fill2d.update(ut),l.line2d&&l.line2d.update(ut),l.error2d&&l.error2d.update(ut.concat(ut)),l.scatter2d&&l.scatter2d.update(ut),l.select2d&&l.select2d.update(ut),l.glText&&l.glText.forEach(function(J){J.update(Q)})}}};f.reglPrecompiled=a}),p9=Vt((Z,V)=>{var u=ZE();u.plot=c5(),V.exports=u}),d9=Vt((Z,V)=>{V.exports=p9()}),f5=Vt((Z,V)=>{var u=pc(),d=Wl(),E=fc().axisHoverFormat,{hovertemplateAttrs:A,templatefallbackAttrs:t}=kl(),e=Mv(),r=Af().idRegex,i=cl().templatedArray,n=So().extendFlat,o=u.marker,a=o.line,s=n(d("marker.line",{editTypeOverride:"calc"}),{width:n({},a.width,{editType:"calc"}),editType:"calc"}),f=n(d("marker"),{symbol:o.symbol,angle:o.angle,size:n({},o.size,{editType:"markerSize"}),sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,opacity:o.opacity,colorbar:o.colorbar,line:s,editType:"calc"});f.color.editType=f.cmin.editType=f.cmax.editType="style";function v(g){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:r[g],editType:"plot"}}}V.exports={dimensions:i("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:n({},e.text,{}),hovertext:n({},e.hovertext,{}),hovertemplate:A(),hovertemplatefallback:t(),xhoverformat:E("x"),yhoverformat:E("y"),marker:f,xaxes:v("x"),yaxes:v("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:e.selected.marker,editType:"calc"},unselected:{marker:e.unselected.marker,editType:"calc"},opacity:e.opacity}}),Ux=Vt((Z,V)=>{V.exports=function(u,d,E,A){A||(A=1/0);var t,e;for(t=0;t<d.length;t++)e=d[t],e.visible&&(A=Math.min(A,e[E].length));for(A===1/0&&(A=0),u._length=A,t=0;t<d.length;t++)e=d[t],e.visible&&(e._length=A);return A}}),m9=Vt((Z,V)=>{var u=Xr(),d=Wf(),E=f5(),A=nu(),t=zh(),e=Ux(),r=Ox().isOpenSymbol;V.exports=function(o,a,s,f){function v(k,M){return u.coerce(o,a,E,k,M)}var g=d(o,a,{name:"dimensions",handleItemDefaults:i}),m=v("diagonal.visible"),w=v("showupperhalf"),l=v("showlowerhalf"),x=e(a,g,"values");if(!x||!m&&!w&&!l){a.visible=!1;return}v("text"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("xhoverformat"),v("yhoverformat"),t(o,a,s,f,v,{noAngleRef:!0,noStandOff:!0});var y=r(a.marker.symbol),S=A.isBubble(a);v("marker.line.width",y||S?1:0),n(o,a,f,v),u.coerceSelectionMarkerOpacity(a,v)};function i(o,a){function s(v,g){return u.coerce(o,a,E.dimensions,v,g)}s("label");var f=s("values");f&&f.length?s("visible"):a.visible=!1,s("axis.type"),s("axis.matches")}function n(o,a,s,f){var v=a.dimensions,g=v.length,m=a.showupperhalf,w=a.showlowerhalf,l=a.diagonal.visible,x,y,S=new Array(g),k=new Array(g);for(x=0;x<g;x++){var M=x?x+1:"";S[x]="x"+M,k[x]="y"+M}var T=f("xaxes",S),c=f("yaxes",k),h=a._diag=new Array(g);a._xaxes={},a._yaxes={};var b=[],_=[];function P(G,rt,ct,st){if(G){var et=G.charAt(0),K=s._splomAxes[et];if(a["_"+et+"axes"][G]=1,st.push(G),!(G in K)){var ot=K[G]={};ct&&(ot.label=ct.label||"",ct.visible&&ct.axis&&(ct.axis.type&&(ot.type=ct.axis.type),ct.axis.matches&&(ot.matches=rt)))}}}var L=!l&&!w,D=!l&&!m;for(a._axesDim={},x=0;x<g;x++){var B=v[x],R=x===0,I=x===g-1,F=R&&L||I&&D?void 0:T[x],N=R&&D||I&&L?void 0:c[x];P(F,N,B,b),P(N,F,B,_),h[x]=[F,N],a._axesDim[F]=x,a._axesDim[N]=x}for(x=0;x<b.length;x++)for(y=0;y<_.length;y++){var j=b[x]+_[y];(x>y&&m||x<y&&w||x===y&&(l||!w||!m))&&(s._splomSubplots[j]=1)}(!w||!l&&m&&w)&&(s._splomGridDflt.xside="bottom",s._splomGridDflt.yside="left")}}),g9=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){var A=d._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]=u.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||u.extendFlat(n,r),n}}),v9=Vt((Z,V)=>{var u=Xr(),d=cc(),E=Uh().calcMarkerSize,A=Uh().calcAxisExpansion,t=Nh(),e=z0().markerSelection,r=z0().markerStyle,i=g9(),n=ks().BADNUM,o=Ud().TOO_MANY_POINTS;V.exports=function(a,s){var f=s.dimensions,v=s._length,g={},m=g.cdata=[],w=g.data=[],l=s._visibleDims=[],x,y,S,k,M;function T(P,L){for(var D=P.makeCalcdata({v:L.values,vcalendar:s.calendar},"v"),B=0;B<D.length;B++)D[B]=D[B]===n?NaN:D[B];m.push(D),w.push(P.type==="log"?u.simpleMap(D,P.c2l):D)}for(x=0;x<f.length;x++)if(S=f[x],S.visible){if(k=d.getFromId(a,s._diag[x][0]),M=d.getFromId(a,s._diag[x][1]),k&&M&&k.type!==M.type){u.log("Skipping splom dimension "+x+" with conflicting axis types");continue}k?(T(k,S),M&&M.type==="category"&&(M._categories=k._categories.slice())):T(M,S),l.push(x)}t(a,s),u.extendFlat(g,r(a,s));var c=m.length,h=c*v>o,b;for(h?b=g.sizeAvg||Math.max(g.size,3):b=E(s,v),y=0;y<l.length;y++)x=l[y],S=f[x],k=d.getFromId(a,s._diag[x][0])||{},M=d.getFromId(a,s._diag[x][1])||{},A(a,s,k,M,m[y],m[y],b);var _=i(a,s);return _.matrix||(_.matrix=!0),_.matrixOptions=g,_.selectedOptions=e(a,s,s.selected),_.unselectedOptions=e(a,s,s.unselected),[{x:!1,y:!1,t:{},trace:s}]}}),y9=Vt((Z,V)=>{(function(){var u,d,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(u()-t)/1e6},d=process.hrtime,u=function(){var r;return r=d(),r[0]*1e9+r[1]},A=u(),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(Z)}),x9=Vt((Z,V)=>{var u=y9(),d=window,E=["moz","webkit"],A="AnimationFrame",t=d["request"+A],e=d["cancel"+A]||d["cancelRequest"+A];for(r=0;!t&&r<E.length;r++)t=d[E[r]+"Request"+A],e=d[E[r]+"Cancel"+A]||d[E[r]+"CancelRequest"+A];var r;(!t||!e)&&(i=0,n=0,o=[],a=1e3/60,t=function(s){if(o.length===0){var f=u(),v=Math.max(0,a-(f-i));i=v+f,setTimeout(function(){var g=o.slice(0);o.length=0;for(var m=0;m<g.length;m++)if(!g[m].cancelled)try{g[m].callback(i)}catch(w){setTimeout(function(){throw w},0)}},Math.round(v))}return o.push({handle:++n,callback:s,cancelled:!1}),n},e=function(s){for(var f=0;f<o.length;f++)o[f].handle===s&&(o[f].cancelled=!0)});var i,n,o,a;V.exports=function(s){return t.call(d,s)},V.exports.cancel=function(){e.apply(d,arguments)},V.exports.polyfill=function(s){s||(s=d),s.requestAnimationFrame=t,s.cancelAnimationFrame=e}}),_9=Vt((Z,V)=>{V.exports=function(u,d){var E=typeof u=="number",A=typeof d=="number";E&&!A?(d=u,u=0):!E&&!A&&(u=0,d=0),u=u|0,d=d|0;var t=d-u;if(t<0)throw new Error("array length must be positive");for(var e=new Array(t),r=0,i=u;r<t;r++,i++)e[r]=i;return e}}),b9=Vt((Z,V)=>{var u=V3(),d=_p(),E=S0(),A=x9(),t=_9(),e=Wm(),r=E0();V.exports=i;function i(s,f){if(!(this instanceof i))return new i(s);this.traces=[],this.passes={},this.regl=s,this.scatter=u(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 g=0;g<s.length;g++)this.updateItem(g,s[g]);this.traces=this.traces.filter(Boolean);let f=[],v=0;for(let g=0;g<this.traces.length;g++){let m=this.traces[g],w=this.traces[g].passes;for(let l=0;l<w.length;l++)f.push(this.passes[w[l]]);m.passOffset=v,v+=m.passes.length}return this.scatter.update(...f),this},i.prototype.updateItem=function(s,f){let{regl:v}=this;if(f===null)return this.traces[s]=null,this;if(!f)return this;let g=d(f,{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"}),m=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(g.color!=null&&(m.color=g.color),g.size!=null&&(m.size=g.size),g.marker!=null&&(m.marker=g.marker),g.borderColor!=null&&(m.borderColor=g.borderColor),g.borderSize!=null&&(m.borderSize=g.borderSize),g.opacity!=null&&(m.opacity=g.opacity),g.viewport&&(m.viewport=e(g.viewport)),g.diagonal!=null&&(m.diagonal=g.diagonal),g.upper!=null&&(m.upper=g.upper),g.lower!=null&&(m.lower=g.lower),g.data){m.buffer(r(g.data)),m.columns=g.data.length,m.count=g.data[0].length,m.bounds=[];for(let b=0;b<m.columns;b++)m.bounds[b]=E(g.data[b],1)}let w;g.range&&(m.range=g.range,w=m.range&&typeof m.range[0]!="number"),g.domain&&(m.domain=g.domain);let l=!1;g.padding!=null&&(Array.isArray(g.padding)&&g.padding.length===m.columns&&typeof g.padding[g.padding.length-1]=="number"?(m.padding=g.padding.map(a),l=!0):m.padding=a(g.padding));let x=m.columns,y=m.count,S=m.viewport.width,k=m.viewport.height,M=m.viewport.x,T=m.viewport.y,c=S/x,h=k/x;m.passes=[];for(let b=0;b<x;b++)for(let _=0;_<x;_++){if(!m.diagonal&&_===b||!m.upper&&b>_||!m.lower&&b<_)continue;let P=n(m.id,b,_),L=this.passes[P]||(this.passes[P]={});if(g.data&&(g.transpose?L.positions={x:{buffer:m.buffer,offset:_,count:y,stride:x},y:{buffer:m.buffer,offset:b,count:y,stride:x}}:L.positions={x:{buffer:m.buffer,offset:_*y,count:y},y:{buffer:m.buffer,offset:b*y,count:y}},L.bounds=o(m.bounds,b,_)),g.domain||g.viewport||g.data){let D=l?o(m.padding,b,_):m.padding;if(m.domain){let[B,R,I,F]=o(m.domain,b,_);L.viewport=[M+B*S+D[0],T+R*k+D[1],M+I*S-D[2],T+F*k-D[3]]}else L.viewport=[M+_*c+c*D[0],T+b*h+h*D[1],M+(_+1)*c-c*D[2],T+(b+1)*h-h*D[3]]}g.color&&(L.color=m.color),g.size&&(L.size=m.size),g.marker&&(L.marker=m.marker),g.borderSize&&(L.borderSize=m.borderSize),g.borderColor&&(L.borderColor=m.borderColor),g.opacity&&(L.opacity=m.opacity),g.range&&(L.range=w?o(m.range,b,_):m.range||L.bounds),m.passes.push(P)}return this},i.prototype.draw=function(...s){if(!s.length)this.scatter.draw();else{let f=[];for(let v=0;v<s.length;v++)if(typeof s[v]=="number"){let{passes:g,passOffset:m}=this.traces[s[v]];f.push(...t(m,m+g.length))}else if(s[v].length){let g=s[v],{passes:m,passOffset:w}=this.traces[v];m=m.map((l,x)=>{f[w+x]=g})}this.scatter.draw(...f)}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,f,v){let g=s.id!=null?s.id:s,m=f,w=v;return g<<16|(m&255)<<8|w&255}function o(s,f,v){let g,m,w,l,x=s[f],y=s[v];return x.length>2?(x[0],x[2],g=x[1],m=x[3]):x.length?(g=x[0],m=x[1]):(x.x,g=x.y,x.x+x.width,m=x.y+x.height),y.length>2?(w=y[0],l=y[2],y[1],y[3]):y.length?(w=y[0],l=y[1]):(w=y.x,y.y,l=y.x+y.width,y.y+y.height),[w,g,l,m]}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 f=e(s);return[f.x,f.y,f.x+f.width,f.y+f.height]}}}),w9=Vt((Z,V)=>{var u=b9(),d=Xr(),E=cc(),A=Jh().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],f=s.matrixOptions,v=f.cdata,g=i._glcanvas.data()[0].regl,m=i.dragmode,w,l,x,y,S;if(v.length!==0){f.lower=o.showupperhalf,f.upper=o.showlowerhalf,f.diagonal=o.diagonal.visible;var k=o._visibleDims,M=v.length,T=s.viewOpts={};for(T.ranges=new Array(M),T.domains=new Array(M),S=0;S<k.length;S++){x=k[S];var c=T.ranges[S]=new Array(4),h=T.domains[S]=new Array(4);w=E.getFromId(e,o._diag[x][0]),w&&(c[0]=w._rl[0],c[2]=w._rl[1],h[0]=w.domain[0],h[2]=w.domain[1]),l=E.getFromId(e,o._diag[x][1]),l&&(c[1]=l._rl[0],c[3]=l._rl[1],h[1]=l.domain[0],h[3]=l.domain[1])}var b=e._context.plotGlPixelRatio,_=n.l*b,P=n.b*b,L=n.w*b,D=n.h*b;T.viewport=[_,P,L+_,D+P],s.matrix===!0&&(s.matrix=u(g));var B=i.clickmode.indexOf("select")>-1,R=A(m)||!!o.selectedpoints||B,I=!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<k.length;S++){if(x=k[S],w=E.getFromId(e,o._diag[x][0]),w)for(rt[S]=new Array(F),y=0;y<F;y++)rt[S][y]=w.c2p(v[S][y]);if(l=E.getFromId(e,o._diag[x][1]),l)for(ct[S]=new Array(F),y=0;y<F;y++)ct[S][y]=l.c2p(v[S][y])}if(s.selectBatch.length||s.unselectBatch.length){var st=d.extendFlat({},f,s.unselectedOptions,T),et=d.extendFlat({},f,s.selectedOptions,T);s.matrix.update(st,et),I=!1}}else a.xpx=a.ypx=null;if(I){var K=d.extendFlat({},f,T);s.matrix.update(K,null)}}}}),h5=Vt(Z=>{Z.getDimIndex=function(V,u){for(var d=u._id,E=d.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]===d)return e}return!1}}),T9=Vt((Z,V)=>{var u=h5(),d=Px().calcHover,E=yo().getFromId,A=So().extendFlat;function t(r,i,n,o,a){a||(a={});var s=(o||"").charAt(0)==="x",f=(o||"").charAt(0)==="y",v=e(r,i,n);if((s||f)&&a.hoversubplots==="axis"&&v[0])for(var g=(s?r.xa:r.ya)._subplotsWith,m=a.gd,w=A({},r),l=0;l<g.length;l++){var x=g[l];if(x!==r.xa._id+r.ya._id){f?w.xa=E(m,x,"x"):w.ya=E(m,x,"y");var y=s||f,S=e(w,i,n,y);v=v.concat(S)}}return v}function e(r,i,n,o){var a=r.cd,s=a[0].trace,f=r.scene,v=f.matrixOptions.cdata,g=r.xa,m=r.ya,w=g.c2p(i),l=m.c2p(n),x=r.distance,y=u.getDimIndex(s,g),S=u.getDimIndex(s,m);if(y===!1||S===!1)return[r];for(var k=v[y],M=v[S],T,c,h=x,b=0;b<k.length;b++)if(!(o&&b!==r.index)){var _=k[b],P=M[b],L=g.c2p(_)-w,D=m.c2p(P)-l,B=Math.sqrt(L*L+D*D);(o||B<h)&&(h=c=B,T=b)}return r.index=T,r.distance=h,r.dxy=c,T===void 0?[r]:[d(r,k,M,s)]}V.exports={hoverPoints:t}}),k9=Vt((Z,V)=>{var u=Xr(),d=u.pushUnique,E=nu(),A=h5();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,f=t.yaxis,v=[];if(!o)return v;var g=!E.hasMarkers(i)&&!E.hasText(i);if(i.visible!==!0||g)return v;var m=A.getDimIndex(i,s),w=A.getDimIndex(i,f);if(m===!1||w===!1)return v;var l=n.xpx[m],x=n.ypx[w],y=a[m],S=a[w],k=(t.scene.selectBatch||[]).slice(),M=[];if(e!==!1&&!e.degenerate)for(var T=0;T<y.length;T++)e.contains([l[T],x[T]],null,T,t)?(v.push({pointNumber:T,x:y[T],y:S[T]}),d(k,T)):k.indexOf(T)!==-1?d(k,T):M.push(T);var c=o.matrixOptions;return!k.length&&!M.length?o.matrix.update(c,null):!o.selectBatch.length&&!o.unselectBatch.length&&o.matrix.update(o.unselectedOptions,u.extendFlat({},c,o.selectedOptions,o.viewOpts)),o.selectBatch=k,o.unselectBatch=M,v}}),A9=Vt((Z,V)=>{var u=Xr(),d=Nh(),E=z0().markerStyle;V.exports=function(A,t){var e=t.trace,r=A._fullLayout._splomScenes[e.uid];if(r){d(A,e),u.extendFlat(r.matrixOptions,E(A,e));var i=u.extendFlat({},r.matrixOptions,r.viewOpts);r.matrix.update(i,null)}}}),M9=Vt((Z,V)=>{var u=ji(),d=qb();V.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:f5(),supplyDefaults:m9(),colorbar:Gf(),calc:v9(),plot:w9(),hoverPoints:T9().hoverPoints,selectPoints:k9(),editStyle:A9(),meta:{}},u.register(d)}),S9=Vt((Z,V)=>{var u=t5(),d=ji(),E=jx(),A=If().getModuleCalcData,t=Kc(),e=cc().getFromId,r=yo().shouldShowZeroLine,i="splom",n={};function o(m){var w=m._fullLayout,l=d.getModule(i),x=A(m.calcdata,l)[0],y=E(m,["ANGLE_instanced_arrays","OES_element_index_uint"],n);y&&(w._hasOnlyLargeSploms&&f(m),l.plot(m,{},x))}function a(m){var w=m.calcdata,l=m._fullLayout;l._hasOnlyLargeSploms&&f(m);for(var x=0;x<w.length;x++){var y=w[x][0],S=y.trace,k=l._splomScenes[S.uid];S.type==="splom"&&k&&k.matrix&&s(m,S,k)}}function s(m,w,l){for(var x=l.matrixOptions.data.length,y=w._visibleDims,S=l.viewOpts.ranges=new Array(x),k=0;k<y.length;k++){var M=y[k],T=S[k]=new Array(4),c=e(m,w._diag[M][0]);c&&(T[0]=c.r2l(c.range[0]),T[2]=c.r2l(c.range[1]));var h=e(m,w._diag[M][1]);h&&(T[1]=h.r2l(h.range[0]),T[3]=h.r2l(h.range[1]))}l.selectBatch.length||l.unselectBatch.length?l.matrix.update({ranges:S},{ranges:S}):l.matrix.update({ranges:S})}function f(m){var w=m._fullLayout,l=w._glcanvas.data()[0].regl,x=w._splomGrid;x||(x=w._splomGrid=u(l)),x.update(v(m))}function v(m){var w=m._context.plotGlPixelRatio,l=m._fullLayout,x=l._size,y=[0,0,l.width*w,l.height*w],S={},k;function M(G,rt,ct,st,et,K){ct*=w,st*=w,et*=w,K*=w;var ot=rt[G+"color"],X=rt[G+"width"],Q=String(ot+X);Q in S?S[Q].data.push(NaN,NaN,ct,st,et,K):S[Q]={data:[ct,st,et,K],join:"rect",thickness:X*w,color:ot,viewport:y,range:y,overlay:!1}}for(k in l._splomSubplots){var T=l._plots[k],c=T.xaxis,h=T.yaxis,b=c._gridVals,_=h._gridVals,P=c._offset,L=c._length,D=h._length,B=x.b+h.domain[0]*x.h,R=-h._m,I=-R*h.r2l(h.range[0],h.calendar),F,N;if(c.showgrid)for(k=0;k<b.length;k++)F=P+c.l2p(b[k].x),M("grid",c,F,B,F,B+D);if(h.showgrid)for(k=0;k<_.length;k++)N=B+I+R*_[k].x,M("grid",h,P,N,P+L,N);r(m,c,h)&&(F=P+c.l2p(0),M("zeroline",c,F,B,F,B+D)),r(m,h,c)&&(N=B+I+0,M("zeroline",h,P,N,P+L,N))}var j=[];for(k in S)j.push(S[k]);return j}function g(m,w,l,x){var y={},S;if(x._splomScenes){for(S=0;S<m.length;S++){var k=m[S];k.type==="splom"&&(y[k.uid]=1)}for(S=0;S<l.length;S++){var M=l[S];if(!y[M.uid]){var T=x._splomScenes[M.uid];T&&T.destroy&&T.destroy(),x._splomScenes[M.uid]=null,delete x._splomScenes[M.uid]}}}Object.keys(x._splomScenes||{}).length===0&&delete x._splomScenes,x._splomGrid&&!w._hasOnlyLargeSploms&&x._hasOnlyLargeSploms&&(x._splomGrid.destroy(),x._splomGrid=null,delete x._splomGrid),t.clean(m,w,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:f,clean:g,updateFx:t.updateFx,toSVG:t.toSVG,reglPrecompiled:n}}),E9=Vt((Z,V)=>{var u=M9();u.basePlotModule=S9(),V.exports=u}),z9=Vt((Z,V)=>{V.exports=E9()}),p5=Vt((Z,V)=>{var u=Wl(),d=Pf(),E=yu(),A=Vu().attributes,t=So().extendFlat,e=cl().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({},d.tickvals,{editType:"plot"}),ticktext:t({},d.ticktext,{editType:"plot"}),tickformat:t({},d.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"},u("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"}}}),Lv=Vt((Z,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"}}}),bp=Vt((Z,V)=>{var u=Ig();function d(E){return[E]}V.exports={keyFun:function(E){return E.key},repeat:d,descend:u,wrap:d,unwrap:function(E){return E[0]}}}),d5=Vt((Z,V)=>{var u=Lv(),d=Ni(),E=bp().keyFun,A=bp().repeat,t=Xr().sorterAsc,e=Xr().strTranslate,r=u.bar.snapRatio;function i(j,G){return j*(1-r)+G*r}var n=u.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 st=j?-1:1,et=0,K=G.length-1;if(st<0){var ot=et;et=K,K=ot}for(var X=G[et],Q=X,ut=et;st*ut<st*K;ut+=st){var J=ut+st,q=G[J];if(st*rt<st*o(X,q))return i(X,Q);if(st*rt<st*q||J===K)return i(q,X);Q=X,X=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 f(j){j.attr("x",-u.bar.captureWidth/2).attr("width",u.bar.captureWidth)}function v(j){j.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function g(j){if(!j.brush.filterSpecified)return"0,"+j.height;for(var G=m(j.brush.filter.getConsolidated(),j.height),rt=[0],ct,st,et,K=G.length?G[0][0]:null,ot=0;ot<G.length;ot++)ct=G[ot],st=ct[1]-ct[0],rt.push(K),rt.push(st),et=ot+1,et<G.length&&(K=G[et][0]-ct[1]);return rt.push(j.height),rt}function m(j,G){return j.map(function(rt){return rt.map(function(ct){return Math.max(0,ct*G)}).sort(t)})}function w(j,G){var rt=u.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(){d.select(document.body).style("cursor",null)}function x(j){j.attr("stroke-dasharray",g)}function y(j,G){var rt=d.select(j).selectAll(".highlight, .highlight-shadow"),ct=G?rt.transition().duration(u.bar.snapDuration).each("end",G):rt;x(ct)}function S(j,G){var rt=j.brush,ct=rt.filterSpecified,st=NaN,et={},K;if(ct){var ot=j.height,X=rt.filter.getConsolidated(),Q=m(X,ot),ut=NaN,J=NaN,q=NaN;for(K=0;K<=Q.length;K++){var it=Q[K];if(it&&it[0]<=G&&G<=it[1]){ut=K;break}else if(J=K?K-1:NaN,it&&it[0]>G){q=K;break}}if(st=ut,isNaN(st)&&(isNaN(J)||isNaN(q)?st=isNaN(J)?q:J:st=G-Q[J][1]<Q[q][0]-G?J:q),!isNaN(st)){var nt=Q[st],dt=w(nt,G);dt&&(et.interval=X[st],et.intervalPix=nt,et.region=dt)}}if(j.ordinal&&!et.region){var Tt=j.unitTickvals,wt=j.unitToPaddedPx.invert(G);for(K=0;K<Tt.length;K++){var It=[Tt[Math.max(K-1,0)]*.25+Tt[K]*.75,Tt[Math.min(K+1,Tt.length-1)]*.25+Tt[K]*.75];if(wt>=It[0]&&wt<=It[1]){et.clickableOrdinalRange=It;break}}}return et}function k(j,G){d.event.sourceEvent.stopPropagation();var rt=G.height-d.mouse(j)[1]-2*u.verticalPadding,ct=G.unitToPaddedPx.invert(rt),st=G.brush,et=S(G,rt),K=et.interval,ot=st.svgBrush;if(ot.wasDragged=!1,ot.grabbingBar=et.region==="ns",ot.grabbingBar){var X=K.map(G.unitToPaddedPx);ot.grabPoint=rt-X[0]-u.verticalPadding,ot.barLength=X[1]-X[0]}ot.clickableOrdinalRange=et.clickableOrdinalRange,ot.stayingIntervals=G.multiselect&&st.filterSpecified?st.filter.getConsolidated():[],K&&(ot.stayingIntervals=ot.stayingIntervals.filter(function(Q){return Q[0]!==K[0]&&Q[1]!==K[1]})),ot.startExtent=et.region?K[et.region==="s"?1:0]:ct,G.parent.inBrushDrag=!0,ot.brushStartCallback()}function M(j,G){d.event.sourceEvent.stopPropagation();var rt=G.height-d.mouse(j)[1]-2*u.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),y(j.parentNode)}function T(j,G){var rt=G.brush,ct=rt.filter,st=rt.svgBrush;st._dragging||(c(j,G),M(j,G),G.brush.svgBrush.wasDragged=!1),st._dragging=!1;var et=d.event;et.sourceEvent.stopPropagation();var K=st.grabbingBar;if(st.grabbingBar=!1,st.grabLocation=void 0,G.parent.inBrushDrag=!1,l(),!st.wasDragged){st.wasDragged=void 0,st.clickableOrdinalRange?rt.filterSpecified&&G.multiselect?st.extent.push(st.clickableOrdinalRange):(st.extent=[st.clickableOrdinalRange],rt.filterSpecified=!0):K?(st.extent=st.stayingIntervals,st.extent.length===0&&D(rt)):D(rt),st.brushCallback(G),y(j.parentNode),st.brushEndCallback(rt.filterSpecified?ct.getConsolidated():[]);return}var ot=function(){ct.set(ct.getConsolidated())};if(G.ordinal){var X=G.unitTickvals;X[X.length-1]<X[0]&&X.reverse(),st.newExtent=[a(0,X,st.newExtent[0],st.stayingIntervals),a(1,X,st.newExtent[1],st.stayingIntervals)];var Q=st.newExtent[1]>st.newExtent[0];st.extent=st.stayingIntervals.concat(Q?[st.newExtent]:[]),st.extent.length||D(rt),st.brushCallback(G),Q?y(j.parentNode,ot):(ot(),y(j.parentNode))}else ot();st.brushEndCallback(rt.filterSpecified?ct.getConsolidated():[])}function c(j,G){var rt=G.height-d.mouse(j)[1]-2*u.verticalPadding,ct=S(G,rt),st="crosshair";ct.clickableOrdinalRange?st="pointer":ct.region&&(st=ct.region+"-resize"),d.select(document.body).style("cursor",st)}function h(j){j.on("mousemove",function(G){d.event.preventDefault(),G.parent.inBrushDrag||c(this,G)}).on("mouseleave",function(G){G.parent.inBrushDrag||l()}).call(d.behavior.drag().on("dragstart",function(G){k(this,G)}).on("drag",function(G){M(this,G)}).on("dragend",function(G){T(this,G)}))}function b(j,G){return j[0]-G[0]}function _(j,G,rt){var ct=rt._context.staticPlot,st=j.selectAll(".background").data(A);st.enter().append("rect").classed("background",!0).call(f).call(v).style("pointer-events",ct?"none":"auto").attr("transform",e(0,u.verticalPadding)),st.call(h).attr("height",function(ot){return ot.height-u.verticalPadding});var et=j.selectAll(".highlight-shadow").data(A);et.enter().append("line").classed("highlight-shadow",!0).attr("x",-u.bar.width/2).attr("stroke-width",u.bar.width+u.bar.strokeWidth).attr("stroke",G).attr("opacity",u.bar.strokeOpacity).attr("stroke-linecap","butt"),et.attr("y1",function(ot){return ot.height}).call(x);var K=j.selectAll(".highlight").data(A);K.enter().append("line").classed("highlight",!0).attr("x",-u.bar.width/2).attr("stroke-width",u.bar.width-u.bar.strokeWidth).attr("stroke",u.bar.fillColor).attr("opacity",u.bar.fillOpacity).attr("stroke-linecap","butt"),K.attr("y1",function(ot){return ot.height}).call(x)}function P(j,G,rt){var ct=j.selectAll("."+u.cn.axisBrush).data(A,E);ct.enter().append("g").classed(u.cn.axisBrush,!0),_(ct,G,rt)}function L(j){return j.svgBrush.extent.map(function(G){return G.slice()})}function D(j){j.filterSpecified=!1,j.svgBrush.extent=[[-1/0,1/0]]}function B(j){return function(G){var rt=G.brush,ct=L(rt),st=ct.slice();rt.filter.set(st),j()}}function R(j){for(var G=j.slice(),rt=[],ct,st=G.shift();st;){for(ct=st.slice();(st=G.shift())&&st[0]<=ct[1];)ct[1]=Math.max(ct[1],st[1]);rt.push(ct)}return rt.length===1&&rt[0][0]>rt[0][1]&&(rt=[]),rt}function I(){var j=[],G,rt;return{set:function(ct){j=ct.map(function(st){return st.slice().sort(t)}).sort(b),j.length===1&&j[0][0]===-1/0&&j[0][1]===1/0&&(j=[[0,-1]]),G=R(j),rt=j.reduce(function(st,et){return[Math.min(st[0],et[0]),Math.max(st[1],et[1])]},[1/0,-1/0])},get:function(){return j.slice()},getConsolidated:function(){return G},getBounds:function(){return rt}}}function F(j,G,rt,ct,st,et){var K=I();return K.set(rt),{filter:K,filterSpecified:G,svgBrush:{extent:[],brushStartCallback:ct,brushCallback:B(st),brushEndCallback:et}}}function N(j,G){if(Array.isArray(j[0])?(j=j.map(function(ct){return ct.sort(t)}),G.multiselect?j=R(j.sort(b)):j=[j[0]]):j=[j.sort(t)],G.tickvals){var rt=G.tickvals.slice().sort(t);if(j=j.map(function(ct){var st=[a(0,rt,ct[0],[]),a(1,rt,ct[1],[])];if(st[1]>st[0])return st}).filter(function(ct){return ct}),!j.length)return}return j.length>1?j:j[0]}V.exports={makeBrush:F,ensureAxisBrush:P,cleanRanges:N}}),L9=Vt((Z,V)=>{var u=Xr(),d=nh().hasColorscale,E=gf(),A=Vu().defaults,t=Wf(),e=yo(),r=p5(),i=d5(),n=Lv().maxDimensionCount,o=Ux();function a(f,v,g,m,w){var l=w("line.color",g);if(d(f,"line")&&u.isArrayOrTypedArray(l)){if(l.length)return w("line.colorscale"),E(f,v,m,w,{prefix:"line.",cLetter:"c"}),l.length;v.line.color=g}return 1/0}function s(f,v,g,m){function w(k,M){return u.coerce(f,v,r.dimensions,k,M)}var l=w("values"),x=w("visible");if(l&&l.length||(x=v.visible=!1),x){w("label"),w("tickvals"),w("ticktext"),w("tickformat");var y=w("range");v._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:y},e.setConvert(v._ax,m.layout),w("multiselect");var S=w("constraintrange");S&&(v.constraintrange=i.cleanRanges(S,v))}}V.exports=function(f,v,g,m){function w(k,M){return u.coerce(f,v,r,k,M)}var l=f.dimensions;Array.isArray(l)&&l.length>n&&(u.log("parcoords traces support up to "+n+" dimensions at the moment"),l.splice(n));var x=t(f,v,{name:"dimensions",layout:m,handleItemDefaults:s}),y=a(f,v,g,m,w);A(v,m,w),(!Array.isArray(x)||!x.length)&&(v.visible=!1),o(v,x,"values",y);var S=u.extendFlat({},m.font,{size:Math.round(m.font.size/1.2)});u.coerceFont(w,"labelfont",S),u.coerceFont(w,"tickfont",S,{autoShadowDflt:!0}),u.coerceFont(w,"rangefont",S),w("labelangle"),w("labelside"),w("unselected.line.color"),w("unselected.line.opacity")}}),C9=Vt((Z,V)=>{var u=Xr().isArrayOrTypedArray,d=xu(),E=bp().wrap;V.exports=function(t,e){var r,i;return d.hasColorscale(e,"line")&&u(e.line.color)?(r=e.line.color,i=d.extractOpts(e.line).colorscale,d.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}});function I9(Z){var V,u,d,E=[],A=1,t;if(typeof Z=="number")return{space:"rgb",values:[Z>>>16,(Z&65280)>>>8,Z&255],alpha:1};if(typeof Z=="number")return{space:"rgb",values:[Z>>>16,(Z&65280)>>>8,Z&255],alpha:1};if(Z=String(Z).toLowerCase(),Vx.default[Z])E=Vx.default[Z].slice(),t="rgb";else if(Z==="transparent")A=0,t="rgb",E=[0,0,0];else if(Z[0]==="#"){var e=Z.slice(1),r=e.length,i=r<=4;A=1,i?(E=[parseInt(e[0]+e[0],16),parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16)],r===4&&(A=parseInt(e[3]+e[3],16)/255)):(E=[parseInt(e[0]+e[1],16),parseInt(e[2]+e[3],16),parseInt(e[4]+e[5],16)],r===8&&(A=parseInt(e[6]+e[7],16)/255)),E[0]||(E[0]=0),E[1]||(E[1]=0),E[2]||(E[2]=0),t="rgb"}else if(d=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Z)){var n=d[1];t=n.replace(/a$/,"");var o=t==="cmyk"?4:t==="gray"?1:3;E=d[2].trim().split(/\s*[,\/]\s*|\s+/),t==="color"&&(t=E.shift()),E=E.map(function(a,s){if(a[a.length-1]==="%")return a=parseFloat(a)/100,s===3?a:t==="rgb"?a*255:t[0]==="h"||t[0]==="l"&&!s?a*100:t==="lab"?a*125:t==="lch"?s<2?a*150:a*360:t[0]==="o"&&!s?a:t==="oklab"?a*.4:t==="oklch"?s<2?a*.4:a*360:a;if(t[s]==="h"||s===2&&t[t.length-1]==="h"){if(Hx[a]!==void 0)return Hx[a];if(a.endsWith("deg"))return parseFloat(a);if(a.endsWith("turn"))return parseFloat(a)*360;if(a.endsWith("grad"))return parseFloat(a)*360/400;if(a.endsWith("rad"))return parseFloat(a)*180/Math.PI}return a==="none"?0:parseFloat(a)}),A=E.length>o?E.pop():1}else/[0-9](?:\s|\/|,)/.test(Z)&&(E=Z.match(/([0-9]+)/g).map(function(a){return parseFloat(a)}),t=((u=(V=Z.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:u.toLowerCase())||"rgb");return{space:t,values:E,alpha:A}}var Vx,m5,Hx,P9=Bl(()=>{Vx=V4(v3()),m5=I9,Hx={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),Cv,g5=Bl(()=>{Cv={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),Iv,O9=Bl(()=>{g5(),Iv={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Z){var V=Z[0]/360,u=Z[1]/100,d=Z[2]/100,E,A,t,e,r,i=0;if(u===0)return r=d*255,[r,r,r];for(A=d<.5?d*(1+u):d+u-d*u,E=2*d-A,e=[0,0,0];i<3;)t=V+1/3*-(i-1),t<0?t++:t>1&&t--,r=6*t<1?E+(A-E)*6*t:2*t<1?A:3*t<2?E+(A-E)*(2/3-t)*6:E,e[i++]=r*255;return e}},Cv.hsl=function(Z){var V=Z[0]/255,u=Z[1]/255,d=Z[2]/255,E=Math.min(V,u,d),A=Math.max(V,u,d),t=A-E,e,r,i;return A===E?e=0:V===A?e=(u-d)/t:u===A?e=2+(d-V)/t:d===A&&(e=4+(V-u)/t),e=Math.min(e*60,360),e<0&&(e+=360),i=(E+A)/2,A===E?r=0:i<=.5?r=t/(A+E):r=t/(2-A-E),[e,r*100,i*100]}}),v5={};q_(v5,{default:()=>D9});function D9(Z){Array.isArray(Z)&&Z.raw&&(Z=String.raw(...arguments)),Z instanceof Number&&(Z=+Z);var V,u=m5(Z);if(!u.space)return[];let d=u.space[0]==="h"?Iv.min:Cv.min,E=u.space[0]==="h"?Iv.max:Cv.max;return V=Array(3),V[0]=Math.min(Math.max(u.values[0],d[0]),E[0]),V[1]=Math.min(Math.max(u.values[1],d[1]),E[1]),V[2]=Math.min(Math.max(u.values[2],d[2]),E[2]),u.space[0]==="h"&&(V=Iv.rgb(V)),V.push(Math.min(Math.max(u.alpha,0),1)),V}var F9=Bl(()=>{P9(),g5(),O9()}),y5=Vt(Z=>{var V=Xr().isTypedArray;Z.convertTypedArray=function(u){return V(u)?Array.prototype.slice.call(u):u},Z.isOrdinal=function(u){return!!u.tickvals},Z.isVisible=function(u){return u.visible||!("visible"in u)}}),B9=Vt((Z,V)=>{var u=["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(`
`),d=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(`
`),E=Lv().maxDimensionCount,A=Xr(),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(T){T.read({x:0,y:0,width:1,height:1,data:r})}function a(T,c,h,b,_){var P=T._gl;P.enable(P.SCISSOR_TEST),P.scissor(c,h,b,_),T.clear({color:[0,0,0,0],depth:1})}function s(T,c,h,b,_,P){var L=P.key;function D(B){var R=Math.min(b,_-B*b);B===0&&(window.cancelAnimationFrame(h.currentRafs[L]),delete h.currentRafs[L],a(T,P.scissorX,P.scissorY,P.scissorWidth,P.viewBoxSize[1])),!h.clearOnly&&(P.count=2*R,P.offset=2*B*b,c(P),B*b+R<_&&(h.currentRafs[L]=window.requestAnimationFrame(function(){D(B+1)})),h.drawCompleted=!1)}h.drawCompleted||(o(T),h.drawCompleted=!0),D(0)}function f(T){return Math.max(t,Math.min(1-t,T))}function v(T,c){for(var h=new Array(256),b=0;b<256;b++)h[b]=T(b/255).concat(c);return h}function g(T,c){return(T>>>8*c)%256/255}function m(T,c,h){for(var b=new Array(T*(E+4)),_=0,P=0;P<T;P++){for(var L=0;L<E;L++)b[_++]=L<c.length?c[L].paddedUnitValues[P]:.5;b[_++]=g(P,2),b[_++]=g(P,1),b[_++]=g(P,0),b[_++]=f(h[P])}return b}function w(T,c,h){for(var b=new Array(c*8),_=0,P=0;P<c;P++)for(var L=0;L<2;L++)for(var D=0;D<4;D++){var B=T*4+D,R=h[P*64+B];B===63&&L===0&&(R*=-1),b[_++]=R}return b}function l(T){var c="0"+T;return c.substr(c.length-2)}function x(T){return T<E?"p"+l(T+1)+"_"+l(T+4):"colors"}function y(T,c,h){for(var b=0;b<=E;b+=4)T[x(b)](w(b/4,c,h))}function S(T){for(var c={},h=0;h<=E;h+=4)c[x(h)]=T.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return c}function k(T,c,h,b,_,P,L,D,B,R,I,F,N,j){for(var G=[[],[]],rt=0;rt<64;rt++)G[0][rt]=rt===_?1:0,G[1][rt]=rt===P?1:0;L*=j,D*=j,B*=j,R*=j;var ct=T.lines.canvasOverdrag*j,st=T.domain,et=T.canvasWidth*j,K=T.canvasHeight*j,ot=T.pad.l*j,X=T.pad.b*j,Q=T.layoutHeight*j,ut=T.layoutWidth*j,J=T.deselectedLines.color,q=T.deselectedLines.opacity,it=A.extendFlat({key:I,resolution:[et,K],viewBoxPos:[L+ct,D],viewBoxSize:[B,R],i0:_,i1:P,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:[J[0]/255,J[1]/255,J[2]/255,q!=="auto"?J[3]*q:Math.max(1/255,Math.pow(1/T.lines.color.length,1/3))],scissorX:(b===c?0:L+ct)+(ot-ct)+ut*st.x[0],scissorWidth:(b===h?et-L+ct:B+.5)+(b===c?L+ct:0),scissorY:D+X+Q*st.y[0],scissorHeight:R,viewportX:ot-ct+ut*st.x[0],viewportY:X+Q*st.y[0],viewportWidth:et,viewportHeight:K},N);return it}function M(T){var c=e-1,h=Math.max(0,Math.floor(T[0]*c),0),b=Math.min(c,Math.ceil(T[1]*c),c);return[Math.min(h,b),Math.max(h,b)]}V.exports=function(T,c){var h=c.context,b=c.pick,_=c.regl,P=_._gl,L=P.getParameter(P.ALIASED_LINE_WIDTH_RANGE),D=Math.max(L[0],Math.min(L[1],c.viewModel.plotGlPixelRatio)),B={currentRafs:{},drawCompleted:!0,clearOnly:!1},R,I,F,N,j=S(_),G,rt=_.texture(n),ct=[];et(c);var st=_({profile:!1,blend:{enable:h,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:!h,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:u,frag:d,primitive:"lines",lineWidth:D,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 et(J){R=J.model,I=J.viewModel,F=I.dimensions.slice(),N=F[0]?F[0].values.length:0;var q=R.lines,it=b?q.color.map(function(dt,Tt){return Tt/q.color.length}):q.color,nt=m(N,F,it);y(j,N,nt),!h&&!b&&(rt=_.texture(A.extendFlat({data:v(R.unitToColor,255)},n)))}function K(J){var q,it,nt,dt=[[],[]];for(nt=0;nt<64;nt++){var Tt=!J&&nt<F.length?F[nt].brush.filter.getBounds():[-1/0,1/0];dt[0][nt]=Tt[0],dt[1][nt]=Tt[1]}var wt=e*8,It=new Array(wt);for(q=0;q<wt;q++)It[q]=255;if(!J)for(q=0;q<F.length;q++){var Ct=q%8,Nt=(q-Ct)/8,ee=Math.pow(2,Ct),Jt=F[q],te=Jt.brush.filter.get();if(!(te.length<2)){var Kt=M(te[0])[1];for(it=1;it<te.length;it++){var mt=M(te[it]);for(nt=Kt+1;nt<mt[0];nt++)It[nt*8+Nt]&=~ee;Kt=Math.max(Kt,mt[1])}}}var bt={shape:[8,e],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:It};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 ot(J,q,it){var nt=J.length,dt,Tt,wt,It=1/0,Ct=-1/0;for(dt=0;dt<nt;dt++)J[dt].dim0.canvasX<It&&(It=J[dt].dim0.canvasX,Tt=dt),J[dt].dim1.canvasX>Ct&&(Ct=J[dt].dim1.canvasX,wt=dt);nt===0&&a(_,0,0,R.canvasWidth,R.canvasHeight);var Nt=K(h);for(dt=0;dt<nt;dt++){var ee=J[dt],Jt=ee.dim0.crossfilterDimensionIndex,te=ee.dim1.crossfilterDimensionIndex,Kt=ee.canvasX,mt=ee.canvasY,bt=Kt+ee.panelSizeX,vt=ee.plotGlPixelRatio;if(q||!ct[Jt]||ct[Jt][0]!==Kt||ct[Jt][1]!==bt){ct[Jt]=[Kt,bt];var Ut=k(R,Tt,wt,dt,Jt,te,Kt,mt,ee.panelSizeX,ee.panelSizeY,ee.dim0.crossfilterDimensionIndex,h?0:b?2:1,Nt,vt);B.clearOnly=it;var re=q?R.lines.blockLineCount:N;s(_,st,B,re,N,Ut)}}}function X(J,q){return _.read({x:J,y:q,width:1,height:1,data:i}),i}function Q(J,q,it,nt){var dt=new Uint8Array(4*it*nt);return _.read({x:J,y:q,width:it,height:nt,data:dt}),dt}function ut(){T.style["pointer-events"]="none",rt.destroy(),G&&G.destroy();for(var J in j)j[J].destroy()}return{render:ot,readPixel:X,readPixels:Q,destroy:ut,update:et}}}),R9=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=d.isArrayOrTypedArray,A=d.numberFormat,t=(F9(),vd(v5)).default,e=yo(),r=d.strRotate,i=d.strTranslate,n=Dl(),o=Eo(),a=xu(),s=bp(),f=s.keyFun,v=s.repeat,g=s.unwrap,m=y5(),w=Lv(),l=d5(),x=B9();function y(ct,st,et){return d.aggNums(ct,null,st,et)}function S(ct,st){return M(y(Math.min,ct,st),y(Math.max,ct,st))}function k(ct){var st=ct.range;return st?M(st[0],st[1]):S(ct.values,ct._length)}function M(ct,st){return(isNaN(ct)||!isFinite(ct))&&(ct=0),(isNaN(st)||!isFinite(st))&&(st=0),ct===st&&(ct===0?(ct-=1,st+=1):(ct*=.9,st*=1.1)),[ct,st]}function T(ct,st){return st?function(et,K){var ot=st[K];return ot??ct(et)}:ct}function c(ct,st,et,K,ot){var X=k(et);return K?u.scale.ordinal().domain(K.map(T(A(et.tickformat),ot))).range(K.map(function(Q){var ut=(Q-X[0])/(X[1]-X[0]);return ct-st+ut*(2*st-ct)})):u.scale.linear().domain(X).range([ct-st,st])}function h(ct,st){return u.scale.linear().range([st,ct-st])}function b(ct,st){return u.scale.linear().domain(k(ct)).range([st,1-st])}function _(ct){if(ct.tickvals){var st=k(ct);return u.scale.ordinal().domain(ct.tickvals).range(ct.tickvals.map(function(et){return(et-st[0])/(st[1]-st[0])}))}}function P(ct){var st=ct.map(function(X){return X[0]}),et=ct.map(function(X){var Q=t(X[1]);return u.rgb("rgb("+Q[0]+","+Q[1]+","+Q[2]+")")}),K=function(X){return function(Q){return Q[X]}},ot="rgb".split("").map(function(X){return u.scale.linear().clamp(!0).domain(st).range(et.map(K(X)))});return function(X){return ot.map(function(Q){return Q(X)})}}function L(ct){return ct.dimensions.some(function(st){return st.brush.filterSpecified})}function D(ct,st,et){var K=g(st),ot=K.trace,X=m.convertTypedArray(K.lineColor),Q=ot.line,ut={color:t(ot.unselected.line.color),opacity:ot.unselected.line.opacity},J=a.extractOpts(Q),q=J.reversescale?a.flipScale(K.cscale):K.cscale,it=ot.domain,nt=ot.dimensions,dt=ct.width,Tt=ot.labelangle,wt=ot.labelside,It=ot.labelfont,Ct=ot.tickfont,Nt=ot.rangefont,ee=d.extendDeepNoArrays({},Q,{color:X.map(u.scale.linear().domain(k({values:X,range:[J.min,J.max],_length:ot._length}))),blockLineCount:w.blockLineCount,canvasOverdrag:w.overdrag*w.canvasPixelRatio}),Jt=Math.floor(dt*(it.x[1]-it.x[0])),te=Math.floor(ct.height*(it.y[1]-it.y[0])),Kt=ct.margin||{l:80,r:80,t:100,b:80},mt=Jt,bt=te;return{key:et,colCount:nt.filter(m.isVisible).length,dimensions:nt,tickDistance:w.tickDistance,unitToColor:P(q),lines:ee,deselectedLines:ut,labelAngle:Tt,labelSide:wt,labelFont:It,tickFont:Ct,rangeFont:Nt,layoutWidth:dt,layoutHeight:ct.height,domain:it,translateX:it.x[0]*dt,translateY:ct.height-it.y[1]*ct.height,pad:Kt,canvasWidth:mt*w.canvasPixelRatio+2*ee.canvasOverdrag,canvasHeight:bt*w.canvasPixelRatio,width:mt,height:bt,canvasPixelRatio:w.canvasPixelRatio}}function B(ct,st,et){var K=et.width,ot=et.height,X=et.dimensions,Q=et.canvasPixelRatio,ut=function(dt){return K*dt/Math.max(1,et.colCount-1)},J=w.verticalPadding/ot,q=h(ot,w.verticalPadding),it={key:et.key,xScale:ut,model:et,inBrushDrag:!1},nt={};return it.dimensions=X.filter(m.isVisible).map(function(dt,Tt){var wt=b(dt,J),It=nt[dt.label];nt[dt.label]=(It||0)+1;var Ct=dt.label+(It?"__"+It:""),Nt=dt.constraintrange,ee=Nt&&Nt.length;ee&&!E(Nt[0])&&(Nt=[Nt]);var Jt=ee?Nt.map(function(Me){return Me.map(wt)}):[[-1/0,1/0]],te=function(){var Me=it;Me.focusLayer&&Me.focusLayer.render(Me.panels,!0);var Ce=L(Me);!ct.contextShown()&&Ce?(Me.contextLayer&&Me.contextLayer.render(Me.panels,!0),ct.contextShown(!0)):ct.contextShown()&&!Ce&&(Me.contextLayer&&Me.contextLayer.render(Me.panels,!0,!0),ct.contextShown(!1))},Kt=dt.values;Kt.length>dt._length&&(Kt=Kt.slice(0,dt._length));var mt=dt.tickvals,bt;function vt(Me,Ce){return{val:Me,text:bt[Ce]}}function Ut(Me,Ce){return Me.val-Ce.val}if(E(mt)&&mt.length){d.isTypedArray(mt)&&(mt=Array.from(mt)),bt=dt.ticktext,!E(bt)||!bt.length?bt=mt.map(A(dt.tickformat)):bt.length>mt.length?bt=bt.slice(0,mt.length):mt.length>bt.length&&(mt=mt.slice(0,bt.length));for(var re=1;re<mt.length;re++)if(mt[re]<mt[re-1]){for(var Zt=mt.map(vt).sort(Ut),ue=0;ue<mt.length;ue++)mt[ue]=Zt[ue].val,bt[ue]=Zt[ue].text;break}}else mt=void 0;return Kt=m.convertTypedArray(Kt),{key:Ct,label:dt.label,tickFormat:dt.tickformat,tickvals:mt,ticktext:bt,ordinal:m.isOrdinal(dt),multiselect:dt.multiselect,xIndex:Tt,crossfilterDimensionIndex:Tt,visibleIndex:dt._index,height:ot,values:Kt,paddedUnitValues:Kt.map(wt),unitTickvals:mt&&mt.map(wt),xScale:ut,x:ut(Tt),canvasX:ut(Tt)*Q,unitToPaddedPx:q,domainScale:c(ot,w.verticalPadding,dt,mt,bt),ordinalScale:_(dt),parent:it,model:et,brush:l.makeBrush(ct,ee,Jt,function(){ct.linePickActive(!1)},te,function(Me){if(it.focusLayer.render(it.panels,!0),it.pickLayer&&it.pickLayer.render(it.panels,!0),ct.linePickActive(!0),st&&st.filterChanged){var Ce=wt.invert,We=Me.map(function(qe){return qe.map(Ce).sort(d.sorterAsc)}).sort(function(qe,vr){return qe[0]-vr[0]});st.filterChanged(it.key,dt._index,We)}})}}),it}function R(ct){ct.classed(w.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function I(){var ct=!0,st=!1;return{linePickActive:function(et){return arguments.length?ct=!!et:ct},contextShown:function(et){return arguments.length?st=!!et:st}}}function F(ct,st){var et=st==="top"?1:-1,K=ct*Math.PI/180,ot=Math.sin(K),X=Math.cos(K);return{dir:et,dx:ot,dy:X,degrees:ct}}function N(ct,st,et){for(var K=st.panels||(st.panels=[]),ot=ct.data(),X=0;X<ot.length-1;X++){var Q=K[X]||(K[X]={}),ut=ot[X],J=ot[X+1];Q.dim0=ut,Q.dim1=J,Q.canvasX=ut.canvasX,Q.panelSizeX=J.canvasX-ut.canvasX,Q.panelSizeY=st.model.canvasHeight,Q.y=0,Q.canvasY=0,Q.plotGlPixelRatio=et}}function j(ct){for(var st=0;st<ct.length;st++)for(var et=0;et<ct[st].length;et++)for(var K=ct[st][et].trace,ot=K.dimensions,X=0;X<ot.length;X++){var Q=ot[X].values,ut=ot[X]._ax;ut&&(ut.range?ut.range=M(ut.range[0],ut.range[1]):ut.range=S(Q,K._length),ut.dtick||(ut.dtick=.01*(Math.abs(ut.range[1]-ut.range[0])||1)),ut.tickformat=ot[X].tickformat,e.calcTicks(ut),ut.cleanRange())}}function G(ct,st){return e.tickText(ct._ax,st,!1).text}function rt(ct,st){if(ct.ordinal)return"";var et=ct.domainScale.domain(),K=et[st?et.length-1:0];return G(ct.model.dimensions[ct.visibleIndex],K)}V.exports=function(ct,st,et,K){var ot=ct._context.staticPlot,X=ct._fullLayout,Q=X._toppaper,ut=X._glcontainer,J=ct._context.plotGlPixelRatio,q=ct._fullLayout.paper_bgcolor;j(st);var it=I(),nt=st.filter(function(Zt){return g(Zt).trace.visible}).map(D.bind(0,et)).map(B.bind(0,it,K));ut.each(function(Zt,ue){return d.extendFlat(Zt,nt[ue])});var dt=ut.selectAll(".gl-canvas").each(function(Zt){Zt.viewModel=nt[0],Zt.viewModel.plotGlPixelRatio=J,Zt.viewModel.paperColor=q,Zt.model=Zt.viewModel?Zt.viewModel.model:null}),Tt=null,wt=dt.filter(function(Zt){return Zt.pick});wt.style("pointer-events",ot?"none":"auto").on("mousemove",function(Zt){if(it.linePickActive()&&Zt.lineLayer&&K&&K.hover){var ue=u.event,Me=this.width,Ce=this.height,We=u.mouse(this),qe=We[0],vr=We[1];if(qe<0||vr<0||qe>=Me||vr>=Ce)return;var _r=Zt.lineLayer.readPixel(qe,Ce-1-vr),er=_r[3]!==0,Mr=er?_r[2]+256*(_r[1]+256*_r[0]):null,Ir={x:qe,y:vr,clientX:ue.clientX,clientY:ue.clientY,dataIndex:Zt.model.key,curveNumber:Mr};Mr!==Tt&&(er?K.hover(Ir):K.unhover&&K.unhover(Ir),Tt=Mr)}}),dt.style("opacity",function(Zt){return Zt.pick?0:1}),Q.style("background","rgba(255, 255, 255, 0)");var It=Q.selectAll("."+w.cn.parcoords).data(nt,f);It.exit().remove(),It.enter().append("g").classed(w.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),It.attr("transform",function(Zt){return i(Zt.model.translateX,Zt.model.translateY)});var Ct=It.selectAll("."+w.cn.parcoordsControlView).data(v,f);Ct.enter().append("g").classed(w.cn.parcoordsControlView,!0),Ct.attr("transform",function(Zt){return i(Zt.model.pad.l,Zt.model.pad.t)});var Nt=Ct.selectAll("."+w.cn.yAxis).data(function(Zt){return Zt.dimensions},f);Nt.enter().append("g").classed(w.cn.yAxis,!0),Ct.each(function(Zt){N(Nt,Zt,J)}),dt.each(function(Zt){if(Zt.viewModel){!Zt.lineLayer||K?Zt.lineLayer=x(this,Zt):Zt.lineLayer.update(Zt),(Zt.key||Zt.key===0)&&(Zt.viewModel[Zt.key]=Zt.lineLayer);var ue=!Zt.context||K;Zt.lineLayer.render(Zt.viewModel.panels,ue)}}),Nt.attr("transform",function(Zt){return i(Zt.xScale(Zt.xIndex),0)}),Nt.call(u.behavior.drag().origin(function(Zt){return Zt}).on("drag",function(Zt){var ue=Zt.parent;it.linePickActive(!1),Zt.x=Math.max(-w.overdrag,Math.min(Zt.model.width+w.overdrag,u.event.x)),Zt.canvasX=Zt.x*Zt.model.canvasPixelRatio,Nt.sort(function(Me,Ce){return Me.x-Ce.x}).each(function(Me,Ce){Me.xIndex=Ce,Me.x=Zt===Me?Me.x:Me.xScale(Me.xIndex),Me.canvasX=Me.x*Me.model.canvasPixelRatio}),N(Nt,ue,J),Nt.filter(function(Me){return Math.abs(Zt.xIndex-Me.xIndex)!==0}).attr("transform",function(Me){return i(Me.xScale(Me.xIndex),0)}),u.select(this).attr("transform",i(Zt.x,0)),Nt.each(function(Me,Ce,We){We===Zt.parent.key&&(ue.dimensions[Ce]=Me)}),ue.contextLayer&&ue.contextLayer.render(ue.panels,!1,!L(ue)),ue.focusLayer.render&&ue.focusLayer.render(ue.panels)}).on("dragend",function(Zt){var ue=Zt.parent;Zt.x=Zt.xScale(Zt.xIndex),Zt.canvasX=Zt.x*Zt.model.canvasPixelRatio,N(Nt,ue,J),u.select(this).attr("transform",function(Me){return i(Me.x,0)}),ue.contextLayer&&ue.contextLayer.render(ue.panels,!1,!L(ue)),ue.focusLayer&&ue.focusLayer.render(ue.panels),ue.pickLayer&&ue.pickLayer.render(ue.panels,!0),it.linePickActive(!0),K&&K.axesMoved&&K.axesMoved(ue.key,ue.dimensions.map(function(Me){return Me.crossfilterDimensionIndex}))})),Nt.exit().remove();var ee=Nt.selectAll("."+w.cn.axisOverlays).data(v,f);ee.enter().append("g").classed(w.cn.axisOverlays,!0),ee.selectAll("."+w.cn.axis).remove();var Jt=ee.selectAll("."+w.cn.axis).data(v,f);Jt.enter().append("g").classed(w.cn.axis,!0),Jt.each(function(Zt){var ue=Zt.model.height/Zt.model.tickDistance,Me=Zt.domainScale,Ce=Me.domain();u.select(this).call(u.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(ue,Zt.tickFormat).tickValues(Zt.ordinal?Ce:null).tickFormat(function(We){return m.isOrdinal(Zt)?We:G(Zt.model.dimensions[Zt.visibleIndex],We)}).scale(Me)),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 te=ee.selectAll("."+w.cn.axisHeading).data(v,f);te.enter().append("g").classed(w.cn.axisHeading,!0);var Kt=te.selectAll("."+w.cn.axisTitle).data(v,f);Kt.enter().append("text").classed(w.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ot?"none":"auto"),Kt.text(function(Zt){return Zt.label}).each(function(Zt){var ue=u.select(this);o.font(ue,Zt.model.labelFont),n.convertToTspans(ue,ct)}).attr("transform",function(Zt){var ue=F(Zt.model.labelAngle,Zt.model.labelSide),Me=w.axisTitleOffset;return(ue.dir>0?"":i(0,2*Me+Zt.model.height))+r(ue.degrees)+i(-Me*ue.dx,-Me*ue.dy)}).attr("text-anchor",function(Zt){var ue=F(Zt.model.labelAngle,Zt.model.labelSide),Me=Math.abs(ue.dx),Ce=Math.abs(ue.dy);return 2*Me>Ce?ue.dir*ue.dx<0?"start":"end":"middle"});var mt=ee.selectAll("."+w.cn.axisExtent).data(v,f);mt.enter().append("g").classed(w.cn.axisExtent,!0);var bt=mt.selectAll("."+w.cn.axisExtentTop).data(v,f);bt.enter().append("g").classed(w.cn.axisExtentTop,!0),bt.attr("transform",i(0,-w.axisExtentOffset));var vt=bt.selectAll("."+w.cn.axisExtentTopText).data(v,f);vt.enter().append("text").classed(w.cn.axisExtentTopText,!0).call(R),vt.text(function(Zt){return rt(Zt,!0)}).each(function(Zt){o.font(u.select(this),Zt.model.rangeFont)});var Ut=mt.selectAll("."+w.cn.axisExtentBottom).data(v,f);Ut.enter().append("g").classed(w.cn.axisExtentBottom,!0),Ut.attr("transform",function(Zt){return i(0,Zt.model.height+w.axisExtentOffset)});var re=Ut.selectAll("."+w.cn.axisExtentBottomText).data(v,f);re.enter().append("text").classed(w.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(R),re.text(function(Zt){return rt(Zt,!1)}).each(function(Zt){o.font(u.select(this),Zt.model.rangeFont)}),l.ensureAxisBrush(ee,q,ct)}}),x5=Vt((r,V)=>{var u=R9(),d=jx(),E=y5().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=d(i,[],A);if(a){var s={},f={},v={},g={},m=o._size;n.forEach(function(S,k){var M=S[0].trace;v[k]=M.index;var T=g[k]=M.index;s[k]=i.data[T].dimensions,f[k]=i.data[T].dimensions.slice()});var w=function(S,k,M){var T=f[S][k],c=M.map(function(D){return D.slice()}),h="dimensions["+k+"].constraintrange",b=o._tracePreGUI[i._fullData[v[S]]._fullInput.uid];if(b[h]===void 0){var _=T.constraintrange;b[h]=_||null}var P=i._fullData[v[S]].dimensions[k];c.length?(c.length===1&&(c=c[0]),T.constraintrange=c,P.constraintrange=c.slice(),c=[c]):(delete T.constraintrange,delete P.constraintrange,c=null);var L={};L[h]=c,i.emit("plotly_restyle",[L,[g[S]]])},l=function(S){i.emit("plotly_hover",S)},x=function(S){i.emit("plotly_unhover",S)},y=function(S,k){var M=e(k,f[S].filter(E));s[S].sort(M),f[S].filter(function(T){return!E(T)}).sort(function(T){return f[S].indexOf(T)}).forEach(function(T){s[S].splice(s[S].indexOf(T),1),s[S].splice(f[S].indexOf(T),0,T)}),i.emit("plotly_restyle",[{dimensions:[s[S]]},[g[S]]])};u(i,n,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{filterChanged:w,hover:l,unhover:x,axesMoved:y})}};r.reglPrecompiled=A}),N9=Vt(Z=>{var V=Ni(),u=If().getModuleCalcData,d=x5(),E=Eh();Z.name="parcoords",Z.plot=function(A){var t=u(A.calcdata,"parcoords")[0];t.length&&d(A,t)},Z.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())},Z.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)}}),j9=Vt((Z,V)=>{V.exports={attributes:p5(),supplyDefaults:L9(),calc:C9(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:N9(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),U9=Vt((Z,V)=>{var u=j9();u.plot=x5(),V.exports=u}),V9=Vt((Z,V)=>{V.exports=U9()}),_5=Vt((Z,V)=>{var u=So().extendFlat,d=Tl(),E=yu(),A=Wl(),{hovertemplateAttrs:t,templatefallbackAttrs:e}=kl(),r=Vu().attributes,i=u({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"]}),hovertemplatefallback:e({editType:"plot"})});V.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:u({},d.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"]}),hovertemplatefallback:e({editType:"plot"}),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:i,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}}),H9=Vt((Z,V)=>{var u=Xr(),d=nh().hasColorscale,E=gf(),A=Vu().defaults,t=Wf(),e=_5(),r=Ux(),i=rh().isTypedArraySpec;function n(a,s,f,v,g){g("line.shape"),g("line.hovertemplate"),g("line.hovertemplatefallback");var m=g("line.color",v.colorway[0]);if(d(a,"line")&&u.isArrayOrTypedArray(m)){if(m.length)return g("line.colorscale"),E(a,s,v,g,{prefix:"line.",cLetter:"c"}),m.length;s.line.color=f}return 1/0}function o(a,s){function f(y,S){return u.coerce(a,s,e.dimensions,y,S)}var v=f("values"),g=f("visible");if(v&&v.length||(g=s.visible=!1),g){f("label"),f("displayindex",s._index);var m=a.categoryarray,w=u.isArrayOrTypedArray(m)&&m.length>0||i(m),l;w&&(l="array");var x=f("categoryorder",l);x==="array"?(f("categoryarray"),f("ticktext")):(delete a.categoryarray,delete a.ticktext),!w&&x==="array"&&(s.categoryorder="trace")}}V.exports=function(a,s,f,v){function g(x,y){return u.coerce(a,s,e,x,y)}var m=t(a,s,{name:"dimensions",handleItemDefaults:o}),w=n(a,s,f,v,g);A(s,v,g),(!Array.isArray(m)||!m.length)&&(s.visible=!1),r(s,m,"values",w),g("hoveron"),g("hovertemplate"),g("hovertemplatefallback"),g("arrangement"),g("bundlecolors"),g("sortpaths"),g("counts");var l=v.font;u.coerceFont(g,"labelfont",l,{overrideDflt:{size:Math.round(l.size)}}),u.coerceFont(g,"tickfont",l,{autoShadowDflt:!0,overrideDflt:{size:Math.round(l.size/1.2)}})}}),q9=Vt((Z,V)=>{var u=bp().wrap,d=nh().hasColorscale,E=ah(),A=tb(),t=Eo(),e=Xr(),r=Lo();V.exports=function(l,x){var y=e.filterVisible(x.dimensions);if(y.length===0)return[];var S=y.map(function(et){var K;if(et.categoryorder==="trace")K=null;else if(et.categoryorder==="array")K=et.categoryarray;else{K=A(et.values);for(var ot=!0,X=0;X<K.length;X++)if(!r(K[X])){ot=!1;break}K.sort(ot?e.sorterAsc:void 0),et.categoryorder==="category descending"&&(K=K.reverse())}return v(et.values,K)}),k,M,T;e.isArrayOrTypedArray(x.counts)?k=x.counts:k=[x.counts],g(y),y.forEach(function(et,K){m(et,S[K])});var c=x.line,h;c?(d(x,"line")&&E(l,x,{vals:x.line.color,containerStr:"line",cLetter:"c"}),h=t.tryColorscale(c)):h=e.identity;function b(et){var K,ot;return e.isArrayOrTypedArray(c.color)?(K=c.color[et%c.color.length],ot=K):K=c.color,{color:h(K),rawColor:ot}}var _=y[0].values.length,P={},L=S.map(function(et){return et.inds});T=0;var D,B;for(D=0;D<_;D++){var R=[];for(B=0;B<L.length;B++)R.push(L[B][D]);M=k[D%k.length],T+=M;var I=b(D),F=R+"-"+I.rawColor;P[F]===void 0&&(P[F]=s(R,I.color,I.rawColor)),f(P[F],D,M)}var N=y.map(function(et,K){return n(K,et._index,et._displayindex,et.label,T)});for(D=0;D<_;D++)for(M=k[D%k.length],B=0;B<N.length;B++){var j=N[B].containerInd,G=S[B].inds[D],rt=N[B].categories;if(rt[G]===void 0){var ct=x.dimensions[j]._categoryarray[G],st=x.dimensions[j]._ticktext[G];rt[G]=o(B,G,ct,st)}a(rt[G],D,M)}return u(i(N,P,T))};function i(l,x,y){var S=l.map(function(k){return k.categories.length}).reduce(function(k,M){return Math.max(k,M)});return{dimensions:l,paths:x,trace:void 0,maxCats:S,count:y}}function n(l,x,y,S,k){return{dimensionInd:l,containerInd:x,displayInd:y,dimensionLabel:S,count:k,categories:[],dragX:null}}function o(l,x,y,S){return{dimensionInd:l,categoryInd:x,categoryValue:y,displayInd:x,categoryLabel:S,valueInds:[],count:0,dragY:null}}function a(l,x,y){l.valueInds.push(x),l.count+=y}function s(l,x,y){return{categoryInds:l,color:x,rawColor:y,valueInds:[],count:0}}function f(l,x,y){l.valueInds.push(x),l.count+=y}function v(l,x){x==null?x=[]:x=x.map(function(b){return b});var y={},S={},k=[];x.forEach(function(b,_){y[b]=0,S[b]=_});for(var M=0;M<l.length;M++){var T=l[M],c;y[T]===void 0?(y[T]=1,c=x.push(T)-1,S[T]=c):(y[T]++,c=S[T]),k.push(c)}var h=x.map(function(b){return y[b]});return{uniqueValues:x,uniqueCounts:h,inds:k}}function g(l){var x=l.map(function(S){return S.displayindex}),y;if(w(x))for(y=0;y<l.length;y++)l[y]._displayindex=l[y].displayindex;else for(y=0;y<l.length;y++)l[y]._displayindex=y}function m(l,x){l._categoryarray=x.uniqueValues,l.ticktext===null||l.ticktext===void 0?l._ticktext=[]:l._ticktext=l.ticktext.slice();for(var y=l._ticktext.length;y<x.uniqueValues.length;y++)l._ticktext.push(x.uniqueValues[y])}function w(l){for(var x=new Array(l.length),y=0;y<l.length;y++){if(l[y]<0||l[y]>=l.length||x[l[y]]!==void 0)return!1;x[l[y]]=!0}return!0}}),W9=Vt((Z,V)=>{var u=Ni(),d=(k0(),vd(Fd)).interpolateNumber,E=Ky(),A=hc(),t=Xr(),e=t.strTranslate,r=Eo(),i=kf(),n=Dl();function o(Q,ut,J,q){var it=ut._context.staticPlot,nt=Q.map(st.bind(0,ut,J)),dt=q.selectAll("g.parcatslayer").data([null]);dt.enter().append("g").attr("class","parcatslayer").style("pointer-events",it?"none":"all");var Tt=dt.selectAll("g.trace.parcats").data(nt,a),wt=Tt.enter().append("g").attr("class","trace parcats");Tt.attr("transform",function(vt){return e(vt.x,vt.y)}),wt.append("g").attr("class","paths");var It=Tt.select("g.paths"),Ct=It.selectAll("path.path").data(function(vt){return vt.paths},a);Ct.attr("fill",function(vt){return vt.model.color});var Nt=Ct.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(vt){return vt.model.color}).attr("fill-opacity",0);x(Nt),Ct.attr("d",function(vt){return vt.svgD}),Nt.empty()||Ct.sort(f),Ct.exit().remove(),Ct.on("mouseover",v).on("mouseout",g).on("click",l),wt.append("g").attr("class","dimensions");var ee=Tt.select("g.dimensions"),Jt=ee.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 te=Jt.selectAll("g.category").data(function(vt){return vt.categories},a),Kt=te.enter().append("g").attr("class","category");te.attr("transform",function(vt){return e(0,vt.y)}),Kt.append("rect").attr("class","catrect").attr("pointer-events","none"),te.select("rect.catrect").attr("fill","none").attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}),k(Kt);var mt=te.selectAll("rect.bandrect").data(function(vt){return vt.bands},a);mt.each(function(){t.raiseToTop(this)}),mt.attr("fill",function(vt){return vt.color});var bt=mt.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(vt){return vt.color}).attr("fill-opacity",0);mt.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"}),T(bt),mt.exit().remove(),Kt.append("text").attr("class","catlabel").attr("pointer-events","none"),te.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(u.select(this),vt.parcatsViewModel.categorylabelfont),n.convertToTspans(u.select(this),ut)}),Kt.append("text").attr("class","dimlabel"),te.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(u.select(this),vt.parcatsViewModel.labelfont)}),te.selectAll("rect.bandrect").on("mouseover",R).on("mouseout",I),te.exit().remove(),Jt.call(u.behavior.drag().origin(function(vt){return{x:vt.x,y:0}}).on("dragstart",F).on("drag",N).on("dragend",j)),Tt.each(function(vt){vt.traceSelection=u.select(this),vt.pathSelection=u.select(this).selectAll("g.paths").selectAll("path.path"),vt.dimensionSelection=u.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Tt.exit().remove()}V.exports=function(Q,ut,J,q){o(J,Q,q,ut)};function a(Q){return Q.key}function s(Q){var ut=Q.parcatsViewModel.dimensions.length,J=Q.parcatsViewModel.dimensions[ut-1].model.dimensionInd;return Q.model.dimensionInd===J}function f(Q,ut){return Q.model.rawColor>ut.model.rawColor?1:Q.model.rawColor<ut.model.rawColor?-1:0}function v(Q){if(!Q.parcatsViewModel.dragDimension&&Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){t.raiseToTop(this),y(u.select(this));var ut=m(Q),J=w(Q);if(Q.parcatsViewModel.graphDiv.emit("plotly_hover",{points:ut,event:u.event,constraints:J}),Q.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var q=u.mouse(this)[0],it=Q.parcatsViewModel.graphDiv,nt=Q.parcatsViewModel.trace,dt=it._fullLayout,Tt=dt._paperdiv.node().getBoundingClientRect(),wt=Q.parcatsViewModel.graphDiv.getBoundingClientRect(),It,Ct,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 ee=Q.parcatsViewModel.dimensions[Nt],Jt=Q.parcatsViewModel.dimensions[Nt+1];It=(ee.x+ee.width+Jt.x)/2,Ct=(Q.topYs[Nt]+Q.topYs[Nt+1]+Q.height)/2;break}var te=Q.parcatsViewModel.x+It,Kt=Q.parcatsViewModel.y+Ct,mt=i.mostReadable(Q.model.color,["black","white"]),bt=Q.model.count,vt=bt/Q.parcatsViewModel.model.count,Ut={countLabel:bt,probabilityLabel:vt.toFixed(3)},re=[];Q.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&re.push(["Count:",Ut.countLabel].join(" ")),Q.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&re.push(["P:",Ut.probabilityLabel].join(" "));var Zt=re.join("<br>"),ue=u.mouse(it)[0];A.loneHover({trace:nt,x:te-Tt.left+wt.left,y:Kt-Tt.top+wt.top,text:Zt,color:Q.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:mt,idealAlign:ue<te?"right":"left",hovertemplate:(nt.line||{}).hovertemplate,hovertemplateLabels:Ut,eventData:[{data:nt._input,fullData:nt,count:bt,probability:vt}]},{container:dt._hoverlayer.node(),outerContainer:dt._paper.node(),gd:it})}}}function g(Q){if(!Q.parcatsViewModel.dragDimension&&(x(u.select(this)),A.loneUnhover(Q.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),Q.parcatsViewModel.pathSelection.sort(f),Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var ut=m(Q),J=w(Q);Q.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:ut,event:u.event,constraints:J})}}function m(Q){for(var ut=[],J=G(Q.parcatsViewModel),q=0;q<Q.model.valueInds.length;q++){var it=Q.model.valueInds[q];ut.push({curveNumber:J,pointNumber:it})}return ut}function w(Q){for(var ut={},J=Q.parcatsViewModel.model.dimensions,q=0;q<J.length;q++){var it=J[q],nt=it.categories[Q.model.categoryInds[q]];ut[it.containerInd]=nt.categoryValue}return Q.model.rawColor!==void 0&&(ut.color=Q.model.rawColor),ut}function l(Q){if(Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ut=m(Q),J=w(Q);Q.parcatsViewModel.graphDiv.emit("plotly_click",{points:ut,event:u.event,constraints:J})}}function x(Q){Q.attr("fill",function(ut){return ut.model.color}).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function y(Q){Q.attr("fill-opacity",.8).attr("stroke",function(ut){return i.mostReadable(ut.model.color,["black","white"])}).attr("stroke-width",.3)}function S(Q){Q.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}function k(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 T(Q){Q.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function c(Q){var ut=Q.parcatsViewModel.pathSelection,J=Q.categoryViewModel.model.dimensionInd,q=Q.categoryViewModel.model.categoryInd;return ut.filter(function(it){return it.model.categoryInds[J]===q&&it.model.color===Q.color})}function h(Q){var ut=u.select(Q.parentNode).selectAll("rect.bandrect");ut.each(function(J){var q=c(J);y(q),q.each(function(){t.raiseToTop(this)})}),S(u.select(Q.parentNode))}function b(Q){var ut=u.select(Q).datum(),J=c(ut);y(J),J.each(function(){t.raiseToTop(this)}),u.select(Q.parentNode).selectAll("rect.bandrect").filter(function(q){return q.color===ut.color}).each(function(){t.raiseToTop(this),M(u.select(this))})}function _(Q,ut,J){var q=u.select(Q).datum(),it=q.categoryViewModel.model,nt=q.parcatsViewModel.graphDiv,dt=u.select(Q.parentNode).selectAll("rect.bandrect"),Tt=[];dt.each(function(It){var Ct=c(It);Ct.each(function(Nt){Array.prototype.push.apply(Tt,m(Nt))})});var wt={};wt[it.dimensionInd]=it.categoryValue,nt.emit(ut,{points:Tt,event:J,constraints:wt})}function P(Q,ut,J){var q=u.select(Q).datum(),it=q.categoryViewModel.model,nt=q.parcatsViewModel.graphDiv,dt=c(q),Tt=[];dt.each(function(It){Array.prototype.push.apply(Tt,m(It))});var wt={};wt[it.dimensionInd]=it.categoryValue,q.rawColor!==void 0&&(wt.color=q.rawColor),nt.emit(ut,{points:Tt,event:J,constraints:wt})}function L(Q,ut,J){Q._fullLayout._calcInverseTransform(Q);var q=Q._fullLayout._invScaleX,it=Q._fullLayout._invScaleY,nt=u.select(J.parentNode).select("rect.catrect"),dt=nt.node().getBoundingClientRect(),Tt=nt.datum(),wt=Tt.parcatsViewModel,It=wt.model.dimensions[Tt.model.dimensionInd],Ct=wt.trace,Nt=dt.top+dt.height/2,ee,Jt;wt.dimensions.length>1&&It.displayInd===wt.dimensions.length-1?(ee=dt.left,Jt="left"):(ee=dt.left+dt.width,Jt="right");var te=Tt.model.count,Kt=Tt.model.categoryLabel,mt=te/Tt.parcatsViewModel.model.count,bt={countLabel:te,categoryLabel:Kt,probabilityLabel:mt.toFixed(3)},vt=[];Tt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&vt.push(["Count:",bt.countLabel].join(" ")),Tt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&vt.push(["P("+bt.categoryLabel+"):",bt.probabilityLabel].join(" "));var Ut=vt.join("<br>");return{trace:Ct,x:q*(ee-ut.left),y:it*(Nt-ut.top),text:Ut,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:Jt,hovertemplate:Ct.hovertemplate,hovertemplateLabels:bt,eventData:[{data:Ct._input,fullData:Ct,count:te,category:Kt,probability:mt}]}}function D(Q,ut,J){var q=[];return u.select(J.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var it=this;q.push(L(Q,ut,it))}),q}function B(Q,ut,J){Q._fullLayout._calcInverseTransform(Q);var q=Q._fullLayout._invScaleX,it=Q._fullLayout._invScaleY,nt=J.getBoundingClientRect(),dt=u.select(J).datum(),Tt=dt.categoryViewModel,wt=Tt.parcatsViewModel,It=wt.model.dimensions[Tt.model.dimensionInd],Ct=wt.trace,Nt=nt.y+nt.height/2,ee,Jt;wt.dimensions.length>1&&It.displayInd===wt.dimensions.length-1?(ee=nt.left,Jt="left"):(ee=nt.left+nt.width,Jt="right");var te=Tt.model.categoryLabel,Kt=dt.parcatsViewModel.model.count,mt=0;dt.categoryViewModel.bands.forEach(function(qe){qe.color===dt.color&&(mt+=qe.count)});var bt=Tt.model.count,vt=0;wt.pathSelection.each(function(qe){qe.model.color===dt.color&&(vt+=qe.model.count)});var Ut=mt/Kt,re=mt/vt,Zt=mt/bt,ue={countLabel:mt,categoryLabel:te,probabilityLabel:Ut.toFixed(3)},Me=[];Tt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Me.push(["Count:",ue.countLabel].join(" ")),Tt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Me.push("P(color ∩ "+te+"): "+ue.probabilityLabel),Me.push("P("+te+" | color): "+re.toFixed(3)),Me.push("P(color | "+te+"): "+Zt.toFixed(3)));var Ce=Me.join("<br>"),We=i.mostReadable(dt.color,["black","white"]);return{trace:Ct,x:q*(ee-ut.left),y:it*(Nt-ut.top),text:Ce,color:dt.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:We,fontSize:10,idealAlign:Jt,hovertemplate:Ct.hovertemplate,hovertemplateLabels:ue,eventData:[{data:Ct._input,fullData:Ct,category:te,count:Kt,probability:Ut,categorycount:bt,colorcount:vt,bandcolorcount:mt}]}}function R(Q){if(!Q.parcatsViewModel.dragDimension&&Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ut=u.mouse(this)[1];if(ut<-1)return;var J=Q.parcatsViewModel.graphDiv,q=J._fullLayout,it=q._paperdiv.node().getBoundingClientRect(),nt=Q.parcatsViewModel.hoveron,dt=this;if(nt==="color"?(b(dt),P(dt,"plotly_hover",u.event)):(h(dt),_(dt,"plotly_hover",u.event)),Q.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Tt;nt==="category"?Tt=L(J,it,dt):nt==="color"?Tt=B(J,it,dt):nt==="dimension"&&(Tt=D(J,it,dt)),Tt&&A.loneHover(Tt,{container:q._hoverlayer.node(),outerContainer:q._paper.node(),gd:J})}}}function I(Q){var ut=Q.parcatsViewModel;if(!ut.dragDimension&&(x(ut.pathSelection),k(ut.dimensionSelection.selectAll("g.category")),T(ut.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),A.loneUnhover(ut.graphDiv._fullLayout._hoverlayer.node()),ut.pathSelection.sort(f),ut.hoverinfoItems.indexOf("skip")===-1)){var J=Q.parcatsViewModel.hoveron,q=this;J==="color"?P(q,"plotly_unhover",u.event):_(q,"plotly_unhover",u.event)}}function F(Q){Q.parcatsViewModel.arrangement!=="fixed"&&(Q.dragDimensionDisplayInd=Q.model.displayInd,Q.initialDragDimensionDisplayInds=Q.parcatsViewModel.model.dimensions.map(function(ut){return ut.displayInd}),Q.dragHasMoved=!1,Q.dragCategoryDisplayInd=null,u.select(this).selectAll("g.category").select("rect.catrect").each(function(ut){var J=u.mouse(this)[0],q=u.mouse(this)[1];-2<=J&&J<=ut.width+2&&-2<=q&&q<=ut.height+2&&(Q.dragCategoryDisplayInd=ut.model.displayInd,Q.initialDragCategoryDisplayInds=Q.model.categories.map(function(it){return it.displayInd}),ut.model.dragY=ut.y,t.raiseToTop(this.parentNode),u.select(this.parentNode).selectAll("rect.bandrect").each(function(it){it.y<q&&q<=it.y+it.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 ut=Q.dragDimensionDisplayInd,J=ut-1,q=ut+1,it=Q.parcatsViewModel.dimensions[ut];if(Q.dragCategoryDisplayInd!==null){var nt=it.categories[Q.dragCategoryDisplayInd];nt.model.dragY+=u.event.dy;var dt=nt.model.dragY,Tt=nt.model.displayInd,wt=it.categories,It=wt[Tt-1],Ct=wt[Tt+1];It!==void 0&&dt<It.y+It.height/2&&(nt.model.displayInd=It.model.displayInd,It.model.displayInd=Tt),Ct!==void 0&&dt+nt.height>Ct.y+Ct.height/2&&(nt.model.displayInd=Ct.model.displayInd,Ct.model.displayInd=Tt),Q.dragCategoryDisplayInd=nt.model.displayInd}if(Q.dragCategoryDisplayInd===null||Q.parcatsViewModel.arrangement==="freeform"){it.model.dragX=u.event.x;var Nt=Q.parcatsViewModel.dimensions[J],ee=Q.parcatsViewModel.dimensions[q];Nt!==void 0&&it.model.dragX<Nt.x+Nt.width&&(it.model.displayInd=Nt.model.displayInd,Nt.model.displayInd=ut),ee!==void 0&&it.model.dragX+it.width>ee.x&&(it.model.displayInd=ee.model.displayInd,ee.model.displayInd=Q.dragDimensionDisplayInd),Q.dragDimensionDisplayInd=it.model.displayInd}ot(Q.parcatsViewModel),K(Q.parcatsViewModel),ct(Q.parcatsViewModel),rt(Q.parcatsViewModel)}}function j(Q){if(Q.parcatsViewModel.arrangement!=="fixed"&&Q.dragDimensionDisplayInd!==null){u.select(this).selectAll("text").attr("font-weight","normal");var ut={},J=G(Q.parcatsViewModel),q=Q.parcatsViewModel.model.dimensions.map(function(ee){return ee.displayInd}),it=Q.initialDragDimensionDisplayInds.some(function(ee,Jt){return ee!==q[Jt]});it&&q.forEach(function(ee,Jt){var te=Q.parcatsViewModel.model.dimensions[Jt].containerInd;ut["dimensions["+te+"].displayindex"]=ee});var nt=!1;if(Q.dragCategoryDisplayInd!==null){var dt=Q.model.categories.map(function(ee){return ee.displayInd});if(nt=Q.initialDragCategoryDisplayInds.some(function(ee,Jt){return ee!==dt[Jt]}),nt){var Tt=Q.model.categories.slice().sort(function(ee,Jt){return ee.displayInd-Jt.displayInd}),wt=Tt.map(function(ee){return ee.categoryValue}),It=Tt.map(function(ee){return ee.categoryLabel});ut["dimensions["+Q.model.containerInd+"].categoryarray"]=[wt],ut["dimensions["+Q.model.containerInd+"].ticktext"]=[It],ut["dimensions["+Q.model.containerInd+"].categoryorder"]="array"}}if(Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!Q.dragHasMoved&&Q.potentialClickBand&&(Q.parcatsViewModel.hoveron==="color"?P(Q.potentialClickBand,"plotly_click",u.event.sourceEvent):_(Q.potentialClickBand,"plotly_click",u.event.sourceEvent)),Q.model.dragX=null,Q.dragCategoryDisplayInd!==null){var Ct=Q.parcatsViewModel.dimensions[Q.dragDimensionDisplayInd].categories[Q.dragCategoryDisplayInd];Ct.model.dragY=null,Q.dragCategoryDisplayInd=null}Q.dragDimensionDisplayInd=null,Q.parcatsViewModel.dragDimension=null,Q.dragHasMoved=null,Q.potentialClickBand=null,ot(Q.parcatsViewModel),K(Q.parcatsViewModel);var Nt=u.transition().duration(300).ease("cubic-in-out");Nt.each(function(){ct(Q.parcatsViewModel,!0),rt(Q.parcatsViewModel,!0)}).each("end",function(){(it||nt)&&E.restyle(Q.parcatsViewModel.graphDiv,ut,[J])})}}function G(Q){for(var ut,J=Q.graphDiv._fullData,q=0;q<J.length;q++)if(Q.key===J[q].uid){ut=q;break}return ut}function rt(Q,ut){ut===void 0&&(ut=!1);function J(q){return ut?q.transition():q}Q.pathSelection.data(function(q){return q.paths},a),J(Q.pathSelection).attr("d",function(q){return q.svgD})}function ct(Q,ut){ut===void 0&&(ut=!1);function J(wt){return ut?wt.transition():wt}Q.dimensionSelection.data(function(wt){return wt.dimensions},a);var q=Q.dimensionSelection.selectAll("g.category").data(function(wt){return wt.categories},a);J(Q.dimensionSelection).attr("transform",function(wt){return e(wt.x,0)}),J(q).attr("transform",function(wt){return e(0,wt.y)});var it=q.select(".dimlabel");it.text(function(wt,It){return It===0?wt.parcatsViewModel.model.dimensions[wt.model.dimensionInd].dimensionLabel:null});var nt=q.select(".catlabel");nt.attr("text-anchor",function(wt){return s(wt)?"start":"end"}).attr("x",function(wt){return s(wt)?wt.width+5:-5}).each(function(wt){var It,Ct;s(wt)?(It=wt.width+5,Ct="start"):(It=-5,Ct="end"),u.select(this).selectAll("tspan").attr("x",It).attr("text-anchor",Ct)});var dt=q.selectAll("rect.bandrect").data(function(wt){return wt.bands},a),Tt=dt.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",function(wt){return wt.color}).attr("fill-opacity",0);dt.attr("fill",function(wt){return wt.color}).attr("width",function(wt){return wt.width}).attr("height",function(wt){return wt.height}).attr("y",function(wt){return wt.y}),T(Tt),dt.each(function(){t.raiseToTop(this)}),dt.exit().remove()}function st(Q,ut,J){var q=J[0],it=ut.margin||{l:80,r:80,t:100,b:80},nt=q.trace,dt=nt.domain,Tt=ut.width,wt=ut.height,It=Math.floor(Tt*(dt.x[1]-dt.x[0])),Ct=Math.floor(wt*(dt.y[1]-dt.y[0])),Nt=dt.x[0]*Tt+it.l,ee=ut.height-dt.y[1]*ut.height+it.t,Jt=nt.line.shape,te;nt.hoverinfo==="all"?te=["count","probability"]:te=(nt.hoverinfo||"").split("+");var Kt={trace:nt,key:nt.uid,model:q,x:Nt,y:ee,width:It,height:Ct,hoveron:nt.hoveron,hoverinfoItems:te,arrangement:nt.arrangement,bundlecolors:nt.bundlecolors,sortpaths:nt.sortpaths,labelfont:nt.labelfont,categorylabelfont:nt.tickfont,pathShape:Jt,dragDimension:null,margin:it,paths:[],dimensions:[],graphDiv:Q,traceSelection:null,pathSelection:null,dimensionSelection:null};return q.dimensions&&(ot(Kt),K(Kt)),Kt}function et(Q,ut,J,q,it){var nt=[],dt=[],Tt,wt;for(wt=0;wt<J.length-1;wt++)Tt=d(J[wt]+Q[wt],Q[wt+1]),nt.push(Tt(it)),dt.push(Tt(1-it));var It="M "+Q[0]+","+ut[0];for(It+="l"+J[0]+",0 ",wt=1;wt<J.length;wt++)It+="C"+nt[wt-1]+","+ut[wt-1]+" "+dt[wt-1]+","+ut[wt]+" "+Q[wt]+","+ut[wt],It+="l"+J[wt]+",0 ";for(It+="l0,"+q+" ",It+="l -"+J[J.length-1]+",0 ",wt=J.length-2;wt>=0;wt--)It+="C"+dt[wt]+","+(ut[wt+1]+q)+" "+nt[wt]+","+(ut[wt]+q)+" "+(Q[wt]+J[wt])+","+(ut[wt]+q),It+="l-"+J[wt]+",0 ";return It+="Z",It}function K(Q){var ut=Q.dimensions,J=Q.model,q=ut.map(function(er){return er.categories.map(function(Mr){return Mr.y})}),it=Q.model.dimensions.map(function(er){return er.categories.map(function(Mr){return Mr.displayInd})}),nt=Q.model.dimensions.map(function(er){return er.displayInd}),dt=Q.dimensions.map(function(er){return er.model.dimensionInd}),Tt=ut.map(function(er){return er.x}),wt=ut.map(function(er){return er.width}),It=[];for(var Ct in J.paths)J.paths.hasOwnProperty(Ct)&&It.push(J.paths[Ct]);function Nt(er){var Mr=er.categoryInds.map(function(de,Dt){return it[Dt][de]}),Ir=dt.map(function(de){return Mr[de]});return Ir}It.sort(function(er,Mr){var Ir=Nt(er),de=Nt(Mr);return Q.sortpaths==="backward"&&(Ir.reverse(),de.reverse()),Ir.push(er.valueInds[0]),de.push(Mr.valueInds[0]),Q.bundlecolors&&(Ir.unshift(er.rawColor),de.unshift(Mr.rawColor)),Ir<de?-1:Ir>de?1:0});for(var ee=new Array(It.length),Jt=ut[0].model.count,te=ut[0].categories.map(function(er){return er.height}).reduce(function(er,Mr){return er+Mr}),Kt=0;Kt<It.length;Kt++){var mt=It[Kt],bt;Jt>0?bt=te*(mt.count/Jt):bt=0;for(var vt=new Array(q.length),Ut=0;Ut<mt.categoryInds.length;Ut++){var re=mt.categoryInds[Ut],Zt=it[Ut][re],ue=nt[Ut];vt[ue]=q[ue][Zt],q[ue][Zt]+=bt;var Me=Q.dimensions[ue].categories[Zt],Ce=Me.bands.length,We=Me.bands[Ce-1];if(We===void 0||mt.rawColor!==We.rawColor){var qe=We===void 0?0:We.y+We.height;Me.bands.push({key:qe,color:mt.color,rawColor:mt.rawColor,height:bt,width:Me.width,count:mt.count,y:qe,categoryViewModel:Me,parcatsViewModel:Q})}else{var vr=Me.bands[Ce-1];vr.height+=bt,vr.count+=mt.count}}var _r;Q.pathShape==="hspline"?_r=et(Tt,vt,wt,bt,.5):_r=et(Tt,vt,wt,bt,0),ee[Kt]={key:mt.valueInds[0],model:mt,height:bt,leftXs:Tt,topYs:vt,dimWidths:wt,svgD:_r,parcatsViewModel:Q}}Q.paths=ee}function ot(Q){var ut=Q.model.dimensions.map(function(dt){return{displayInd:dt.displayInd,dimensionInd:dt.dimensionInd}});ut.sort(function(dt,Tt){return dt.displayInd-Tt.displayInd});var J=[];for(var q in ut){var it=ut[q].dimensionInd,nt=Q.model.dimensions[it];J.push(X(Q,nt))}Q.dimensions=J}function X(Q,ut){var J=40,q=16,it=Q.model.dimensions.length,nt=ut.displayInd,dt,Tt,wt;it>1?dt=(Q.width-2*J-q)/(it-1):dt=0,Tt=J,wt=Tt+dt*nt;var It=[],Ct=Q.model.maxCats,Nt=ut.categories.length,ee=8,Jt=ut.count,te=Q.height-ee*(Ct-1),Kt,mt,bt,vt,Ut,re=(Ct-Nt)*ee/2,Zt=ut.categories.map(function(ue){return{displayInd:ue.displayInd,categoryInd:ue.categoryInd}});for(Zt.sort(function(ue,Me){return ue.displayInd-Me.displayInd}),Ut=0;Ut<Nt;Ut++)vt=Zt[Ut].categoryInd,mt=ut.categories[vt],Jt>0?Kt=mt.count/Jt*te:Kt=0,bt={key:mt.valueInds[0],model:mt,width:q,height:Kt,y:mt.dragY!==null?mt.dragY:re,bands:[],parcatsViewModel:Q},re=re+Kt+ee,It.push(bt);return{key:ut.dimensionInd,x:ut.dragX!==null?ut.dragX:wt,y:0,width:q,model:ut,categories:It,parcatsViewModel:Q,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),b5=Vt((Z,V)=>{var u=W9();V.exports=function(d,E,A,t){var e=d._fullLayout,r=e._paper,i=e._size;u(d,r,E,{width:i.w,height:i.h,margin:{t:i.t,r:i.r,b:i.b,l:i.l}},A,t)}}),G9=Vt(Z=>{var V=If().getModuleCalcData,u=b5(),d="parcats";Z.name=d,Z.plot=function(E,A,t,e){var r=V(E.calcdata,d);if(r.length){var i=r[0];u(E,i,t,e)}},Z.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()}}),Z9=Vt((Z,V)=>{V.exports={attributes:_5(),supplyDefaults:H9(),calc:q9(),plot:b5(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:G9(),categories:["noOpacity"],meta:{}}}),K9=Vt((Z,V)=>{V.exports=Z9()}),Gp=Vt((Z,V)=>{var u=bd(),d="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=u(r);V.exports={requiredVersion:d,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@"+d+"."].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')`}}}),Pv=Vt((Z,V)=>{var u=Xr(),d=Pi().defaultLine,E=Vu().attributes,A=yu(),t=pc().textposition,e=Cu().overrideAll,r=cl().templatedArray,i=Gp(),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:[u.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:d},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:d}},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:u.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),qx=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Qh(),t=M0(),e=pc(),r=Pv(),i=Tl(),n=Wl(),o=So().extendFlat,a=Cu().overrideAll,s=Pv(),f=t.line,v=t.marker;V.exports=a({lon:t.lon,lat:t.lat,cluster:{enabled:{valType:"boolean"},maxzoom:o({},s.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:o({},v.opacity,{dflt:1})},mode:o({},e.mode,{dflt:"markers"}),text:o({},e.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:o({},e.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:e.connectgaps,marker:o({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:v.opacity,size:v.size,sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode},n("marker")),fill:t.fill,fillcolor:A(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:u(),hovertemplatefallback:E()},"calc","nested")}),w5=Vt((Z,V)=>{var u=["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(d){return u.indexOf(d)!==-1}}}),Y9=Vt((Z,V)=>{var u=Xr(),d=nu(),E=zh(),A=Bh(),t=Rh(),e=ep(),r=qx(),i=w5().isSupportedFont;V.exports=function(o,a,s,f){function v(h,b){return u.coerce(o,a,r,h,b)}function g(h,b){return u.coerce2(o,a,r,h,b)}var m=n(o,a,v);if(!m){a.visible=!1;return}if(v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("mode"),v("below"),d.hasMarkers(a)){E(o,a,s,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var w=a.marker;w.symbol!=="circle"&&(u.isArrayOrTypedArray(w.size)&&(w.size=w.size[0]),u.isArrayOrTypedArray(w.color)&&(w.color=w.color[0]))}d.hasLines(a)&&(A(o,a,s,f,v,{noDash:!0}),v("connectgaps"));var l=g("cluster.maxzoom"),x=g("cluster.step"),y=g("cluster.color",a.marker&&a.marker.color||s),S=g("cluster.size"),k=g("cluster.opacity"),M=l!==!1||x!==!1||y!==!1||S!==!1||k!==!1,T=v("cluster.enabled",M);if(T||d.hasText(a)){var c=f.font.family;t(o,a,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(c)?c:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),a.fill!=="none"&&e(o,a,s,v),u.coerceSelectionMarkerOpacity(a,v)};function n(o,a,s){var f=s("lon")||[],v=s("lat")||[],g=Math.min(f.length,v.length);return a._length=g,g}}),T5=Vt((Z,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot,r=e.mockAxis,i=d.lonlat;return t.lonLabel=u.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=u.tickText(r,r.c2l(i[1]),!0).text,t}}),k5=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){var A=d.split(" "),t=A[0],e=A[1],r=u.isArrayOrTypedArray(E)?u.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}}}),X9=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ks().BADNUM,A=Nd(),t=xu(),e=Eo(),r=ym(),i=nu(),n=w5().isSupportedFont,o=k5(),a=dh().appendArrayPointValue,s=Dl().NEWLINES,f=Dl().BR_TAG_ALL;V.exports=function(k,M){var T=M[0].trace,c=T.visible===!0&&T._length!==0,h=T.fill!=="none",b=i.hasLines(T),_=i.hasMarkers(T),P=i.hasText(T),L=_&&T.marker.symbol==="circle",D=_&&T.marker.symbol!=="circle",B=T.cluster&&T.cluster.enabled,R=v("fill"),I=v("line"),F=v("circle"),N=v("symbol"),j={fill:R,line:I,circle:F,symbol:N};if(!c)return j;var G;if((h||b)&&(G=A.calcTraceToLineCoords(M)),h&&(R.geojson=A.makePolygon(G),R.layout.visibility="visible",d.extendFlat(R.paint,{"fill-color":T.fillcolor})),b&&(I.geojson=A.makeLine(G),I.layout.visibility="visible",d.extendFlat(I.paint,{"line-width":T.line.width,"line-color":T.line.color,"line-opacity":T.opacity})),L){var rt=g(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":y(T.cluster.color,T.cluster.step),"circle-radius":y(T.cluster.size,T.cluster.step),"circle-opacity":y(T.cluster.opacity,T.cluster.step)}},j.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(T),"text-size":12}}),d.extendFlat(F.paint,{"circle-color":rt.mcc,"circle-radius":rt.mrc,"circle-opacity":rt.mo})}if(L&&B&&(F.filter=["!",["has","point_count"]]),(D||P)&&(N.geojson=m(M,k),d.extendFlat(N.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),D&&(d.extendFlat(N.layout,{"icon-size":T.marker.size/10}),"angle"in T.marker&&T.marker.angle!=="auto"&&d.extendFlat(N.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),N.layout["icon-allow-overlap"]=T.marker.allowoverlap,d.extendFlat(N.paint,{"icon-opacity":T.opacity*T.marker.opacity,"icon-color":T.marker.color})),P)){var ct=(T.marker||{}).size,st=o(T.textposition,ct);d.extendFlat(N.layout,{"text-size":T.textfont.size,"text-anchor":st.anchor,"text-offset":st.offset,"text-font":S(T)}),d.extendFlat(N.paint,{"text-color":T.textfont.color,"text-opacity":T.opacity})}return j};function v(k){return{type:k,geojson:A.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(k){var M=k[0].trace,T=M.marker,c=M.selectedpoints,h=d.isArrayOrTypedArray(T.color),b=d.isArrayOrTypedArray(T.size),_=d.isArrayOrTypedArray(T.opacity),P;function L(st){return M.opacity*st}function D(st){return st/2}var B;h&&(t.hasColorscale(M,"marker")?B=t.makeColorScaleFuncFromTrace(T):B=d.identity);var R;b&&(R=r(M));var I;_&&(I=function(st){var et=u(st)?+d.constrain(st,0,1):0;return L(et)});var F=[];for(P=0;P<k.length;P++){var N=k[P],j=N.lonlat;if(!x(j)){var G={};B&&(G.mcc=N.mcc=B(N.mc)),R&&(G.mrc=N.mrc=R(N.ms)),I&&(G.mo=I(N.mo)),c&&(G.selected=N.selected||0),F.push({type:"Feature",id:P+1,geometry:{type:"Point",coordinates:j},properties:G})}}var rt;if(c)for(rt=e.makeSelectedPointStyleFns(M),P=0;P<F.length;P++){var ct=F[P].properties;rt.selectedOpacityFn&&(ct.mo=L(rt.selectedOpacityFn(ct))),rt.selectedColorFn&&(ct.mcc=rt.selectedColorFn(ct)),rt.selectedSizeFn&&(ct.mrc=rt.selectedSizeFn(ct))}return{geojson:{type:"FeatureCollection",features:F},mcc:h||rt&&rt.selectedColorFn?{type:"identity",property:"mcc"}:T.color,mrc:b||rt&&rt.selectedSizeFn?{type:"identity",property:"mrc"}:D(T.size),mo:_||rt&&rt.selectedOpacityFn?{type:"identity",property:"mo"}:L(T.opacity)}}function m(k,M){for(var T=M._fullLayout,c=k[0].trace,h=c.marker||{},b=h.symbol,_=h.angle,P=b!=="circle"?w(b):l,L=_!=="auto"?w(_,!0):l,D=i.hasText(c)?w(c.text):l,B=[],R=0;R<k.length;R++){var I=k[R];if(!x(I.lonlat)){var F=c.texttemplate,N;if(F){var j=Array.isArray(F)?F[R]||"":F,G=c._module.formatLabels(I,c,T),rt={};a(rt,c,I.i),N=d.texttemplateString({data:[rt,I,c._meta],fallback:c.texttemplatefallback,labels:G,locale:T._d3locale,template:j})}else N=D(R);N&&(N=N.replace(s,"").replace(f,`
`)),B.push({type:"Feature",geometry:{type:"Point",coordinates:I.lonlat},properties:{symbol:P(R),angle:L(R),text:N}})}}return{type:"FeatureCollection",features:B}}function w(k,M){return d.isArrayOrTypedArray(k)?M?function(T){return u(k[T])?+k[T]:0}:function(T){return k[T]}:k?function(){return k}:l}function l(){return""}function x(k){return k[0]===E}function y(k,M){var T;if(d.isArrayOrTypedArray(k)&&d.isArrayOrTypedArray(M)){T=["step",["get","point_count"],k[0]];for(var c=1;c<k.length;c++)T.push(M[c-1],k[c])}else T=k;return T}function S(k){var M=k.textfont,T=M.family,c=M.style,h=M.weight,b=T.split(" "),_=b[b.length-1]==="Italic";_&&b.pop(),_=_||c==="italic";var P=b.join(" ");h==="bold"&&b.indexOf("Bold")===-1?P+=" Bold":h<=1e3&&(b[0]==="Metropolis"?(P="Metropolis",h>850?P+=" Black":h>750?P+=" Extra Bold":h>650?P+=" Bold":h>550?P+=" Semi Bold":h>450?P+=" Medium":h>350?P+=" Regular":h>250?P+=" Light":h>150?P+=" Extra Light":P+=" Thin"):b.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",h>750?P+=" Extrabold":h>650?P+=" Bold":h>550?P+=" Semibold":h>350?P+=" Regular":P+=" Light"):b.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",b[3]==="CJK"&&(P+=" CJK"),P+=h>500?" Bold":" Regular")),_&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),n(P)||(P=T);var L=P.split(", ");return L}}),$9=Vt((Z,V)=>{var u=Xr(),d=X9(),E=Gp().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&&u.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,f=this.subplot.getMapLayers(),v=0;v<f.length;v++)if(f[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=d(n.gd,r),s=n.belowLookup["trace-"+this.uid],f=!!(i.cluster&&i.cluster.enabled),v=!!this.clusterEnabled,g=this;function m(c){c||g.addSource("circle",a.circle,i.cluster);for(var h=A.cluster,b=0;b<h.length;b++){var _=h[b],P=a[_];g.addLayer(_,P,s)}}function w(c){for(var h=A.cluster,b=h.length-1;b>=0;b--){var _=h[b];o.removeLayer(g.layerIds[_])}c||o.removeSource(g.sourceIds.circle)}function l(c){for(var h=A.nonCluster,b=0;b<h.length;b++){var _=h[b],P=a[_];c||g.addSource(_,P),g.addLayer(_,P,s)}}function x(c){for(var h=A.nonCluster,b=h.length-1;b>=0;b--){var _=h[b];o.removeLayer(g.layerIds[_]),c||o.removeSource(g.sourceIds[_])}}function y(c){v?w(c):x(c)}function S(c){f?m(c):l(c)}function k(){for(var c=f?A.cluster:A.nonCluster,h=0;h<c.length;h++){var b=c[h],_=a[b];_&&(n.setOptions(g.layerIds[b],"setLayoutProperty",_.layout),_.layout.visibility==="visible"&&(b!=="cluster"&&g.setSourceData(b,_),n.setOptions(g.layerIds[b],"setPaintProperty",_.paint)))}}var M=this.isHidden,T=i.visible!==!0;T?M||y():M?T||S():v!==f?(y(),S()):(this.below!==s&&(y(!0),S(!0)),k()),this.clusterEnabled=f,this.isHidden=T,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),f=d(r.gd,i),v=s.below=r.belowLookup["trace-"+n.uid],g,m,w;if(o)for(s.addSource("circle",f.circle,n.cluster),g=0;g<A.cluster.length;g++)m=A.cluster[g],w=f[m],s.addLayer(m,w,v);else for(g=0;g<A.nonCluster.length;g++)m=A.nonCluster[g],w=f[m],s.addSource(m,w,n.cluster),s.addLayer(m,w,v);return i[0].trace._glTrace=s,s}}),Wx=Vt((Z,V)=>{var u=hc(),d=Xr(),E=km(),A=d.fillText,t=ks().BADNUM,e=Gp().traceLayerPrefix;function r(n,o,a){var s=n.cd,f=s[0].trace,v=n.xa,g=n.ya,m=n.subplot,w=[],l=e+f.uid+"-circle",x=f.cluster&&f.cluster.enabled;if(x){var y=m.map.queryRenderedFeatures(null,{layers:[l]});w=y.map(function(R){return R.id})}var S=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),k=S*360,M=o-k;function T(R){var I=R.lonlat;if(I[0]===t||x&&w.indexOf(R.i+1)===-1)return 1/0;var F=d.modHalf(I[0],360),N=I[1],j=m.project([F,N]),G=j.x-v.c2p([M,N]),rt=j.y-g.c2p([F,a]),ct=Math.max(3,R.mrc||0);return Math.max(Math.sqrt(G*G+rt*rt)-ct,1-3/ct)}if(u.getClosest(s,T,n),n.index!==!1){var c=s[n.index],h=c.lonlat,b=[d.modHalf(h[0],360)+k,h[1]],_=v.c2p(b),P=g.c2p(b),L=c.mrc||1;n.x0=_-L,n.x1=_+L,n.y0=P-L,n.y1=P+L;var D={};D[f.subplot]={_subplot:m};var B=f._module.formatLabels(c,f,D);return n.lonLabel=B.lonLabel,n.latLabel=B.latLabel,n.color=E(f,c),n.extraText=i(f,c,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function i(n,o,a){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,f=s.split("+"),v=f.indexOf("all")!==-1,g=f.indexOf("lon")!==-1,m=f.indexOf("lat")!==-1,w=o.lonlat,l=[];function x(y){return y+"°"}return v||g&&m?l.push("("+x(w[1])+", "+x(w[0])+")"):g?l.push(a.lon+x(w[0])):m&&l.push(a.lat+x(w[1])),(v||f.indexOf("text")!==-1)&&A(o,n,l),l.join("<br>")}V.exports={hoverPoints:r,getExtraText:i}}),J9=Vt((Z,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u}}),Q9=Vt((Z,V)=>{var u=Xr(),d=nu(),E=ks().BADNUM;V.exports=function(A,t){var e=A.cd,r=A.xaxis,i=A.yaxis,n=[],o=e[0].trace,a;if(!d.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],f=s.lonlat;if(f[0]!==E){var v=[u.modHalf(f[0],360),f[1]],g=[r.c2p(v),i.c2p(v)];t.contains(g,null,a,A)?(n.push({pointNumber:a,lon:f[0],lat:f[1]}),s.selected=1):s.selected=0}}return n}}),A5=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?V.exports=d():(u=u||self,u.mapboxgl=d())})(Z,function(){var u,d,E;function A(t,e){if(!u)u=e;else if(!d)d=e;else{var r="var sharedChunk = {}; ("+u+")(sharedChunk); ("+d+")(sharedChunk);",i={};u(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(p,O){return O={exports:{}},p(O,O.exports),O.exports}var r="1.13.4",i=n;function n(p,O,W,pt){this.cx=3*p,this.bx=3*(W-p)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*O,this.by=3*(pt-O)-this.cy,this.ay=1-this.cy-this.by,this.p1x=p,this.p1y=pt,this.p2x=W,this.p2y=pt}n.prototype.sampleCurveX=function(p){return((this.ax*p+this.bx)*p+this.cx)*p},n.prototype.sampleCurveY=function(p){return((this.ay*p+this.by)*p+this.cy)*p},n.prototype.sampleCurveDerivativeX=function(p){return(3*this.ax*p+2*this.bx)*p+this.cx},n.prototype.solveCurveX=function(p,O){typeof O>"u"&&(O=1e-6);var W,pt,At,Ot,Wt;for(At=p,Wt=0;Wt<8;Wt++){if(Ot=this.sampleCurveX(At)-p,Math.abs(Ot)<O)return At;var _e=this.sampleCurveDerivativeX(At);if(Math.abs(_e)<1e-6)break;At=At-Ot/_e}if(W=0,pt=1,At=p,At<W)return W;if(At>pt)return pt;for(;W<pt;){if(Ot=this.sampleCurveX(At),Math.abs(Ot-p)<O)return At;p>Ot?W=At:pt=At,At=(pt-W)*.5+W}return At},n.prototype.solve=function(p,O){return this.sampleCurveY(this.solveCurveX(p,O))};var o=a;function a(p,O){this.x=p,this.y=O}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(p){return this.clone()._add(p)},sub:function(p){return this.clone()._sub(p)},multByPoint:function(p){return this.clone()._multByPoint(p)},divByPoint:function(p){return this.clone()._divByPoint(p)},mult:function(p){return this.clone()._mult(p)},div:function(p){return this.clone()._div(p)},rotate:function(p){return this.clone()._rotate(p)},rotateAround:function(p,O){return this.clone()._rotateAround(p,O)},matMult:function(p){return this.clone()._matMult(p)},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(p){return this.x===p.x&&this.y===p.y},dist:function(p){return Math.sqrt(this.distSqr(p))},distSqr:function(p){var O=p.x-this.x,W=p.y-this.y;return O*O+W*W},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(p){return Math.atan2(this.y-p.y,this.x-p.x)},angleWith:function(p){return this.angleWithSep(p.x,p.y)},angleWithSep:function(p,O){return Math.atan2(this.x*O-this.y*p,this.x*p+this.y*O)},_matMult:function(p){var O=p[0]*this.x+p[1]*this.y,W=p[2]*this.x+p[3]*this.y;return this.x=O,this.y=W,this},_add:function(p){return this.x+=p.x,this.y+=p.y,this},_sub:function(p){return this.x-=p.x,this.y-=p.y,this},_mult:function(p){return this.x*=p,this.y*=p,this},_div:function(p){return this.x/=p,this.y/=p,this},_multByPoint:function(p){return this.x*=p.x,this.y*=p.y,this},_divByPoint:function(p){return this.x/=p.x,this.y/=p.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var p=this.y;return this.y=this.x,this.x=-p,this},_rotate:function(p){var O=Math.cos(p),W=Math.sin(p),pt=O*this.x-W*this.y,At=W*this.x+O*this.y;return this.x=pt,this.y=At,this},_rotateAround:function(p,O){var W=Math.cos(p),pt=Math.sin(p),At=O.x+W*(this.x-O.x)-pt*(this.y-O.y),Ot=O.y+pt*(this.x-O.x)+W*(this.y-O.y);return this.x=At,this.y=Ot,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(p){return p instanceof a?p:Array.isArray(p)?new a(p[0],p[1]):p};var s=typeof self<"u"?self:{};function f(p,O){if(Array.isArray(p)){if(!Array.isArray(O)||p.length!==O.length)return!1;for(var W=0;W<p.length;W++)if(!f(p[W],O[W]))return!1;return!0}if(typeof p=="object"&&p!==null&&O!==null){if(typeof O!="object")return!1;var pt=Object.keys(p);if(pt.length!==Object.keys(O).length)return!1;for(var At in p)if(!f(p[At],O[At]))return!1;return!0}return p===O}var v=Math.pow(2,53)-1;function g(p){if(p<=0)return 0;if(p>=1)return 1;var O=p*p,W=O*p;return 4*(p<.5?W:3*(p-O)+W-.75)}function m(p,O,W,pt){var At=new i(p,O,W,pt);return function(Ot){return At.solve(Ot)}}var w=m(.25,.1,.25,1);function l(p,O,W){return Math.min(W,Math.max(O,p))}function x(p,O,W){var pt=W-O,At=((p-O)%pt+pt)%pt+O;return At===O?W:At}function y(p,O,W){if(!p.length)return W(null,[]);var pt=p.length,At=new Array(p.length),Ot=null;p.forEach(function(Wt,_e){O(Wt,function(De,Je){De&&(Ot=De),At[_e]=Je,--pt===0&&W(Ot,At)})})}function S(p){var O=[];for(var W in p)O.push(p[W]);return O}function k(p,O){var W=[];for(var pt in p)pt in O||W.push(pt);return W}function M(p){for(var O=[],W=arguments.length-1;W-- >0;)O[W]=arguments[W+1];for(var pt=0,At=O;pt<At.length;pt+=1){var Ot=At[pt];for(var Wt in Ot)p[Wt]=Ot[Wt]}return p}function T(p,O){for(var W={},pt=0;pt<O.length;pt++){var At=O[pt];At in p&&(W[At]=p[At])}return W}var c=1;function h(){return c++}function b(){function p(O){return O?(O^Math.random()*16>>O/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,p)}return p()}function _(p){return p<=1?1:Math.pow(2,Math.ceil(Math.log(p)/Math.LN2))}function P(p){return p?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(p):!1}function L(p,O){p.forEach(function(W){O[W]&&(O[W]=O[W].bind(O))})}function D(p,O){return p.indexOf(O,p.length-O.length)!==-1}function B(p,O,W){var pt={};for(var At in p)pt[At]=O.call(W||this,p[At],At,p);return pt}function R(p,O,W){var pt={};for(var At in p)O.call(W||this,p[At],At,p)&&(pt[At]=p[At]);return pt}function I(p){return Array.isArray(p)?p.map(I):typeof p=="object"&&p?B(p,I):p}function F(p,O){for(var W=0;W<p.length;W++)if(O.indexOf(p[W])>=0)return!0;return!1}var N={};function j(p){N[p]||(typeof console<"u"&&console.warn(p),N[p]=!0)}function G(p,O,W){return(W.y-p.y)*(O.x-p.x)>(O.y-p.y)*(W.x-p.x)}function rt(p){for(var O=0,W=0,pt=p.length,At=pt-1,Ot=void 0,Wt=void 0;W<pt;At=W++)Ot=p[W],Wt=p[At],O+=(Wt.x-Ot.x)*(Ot.y+Wt.y);return O}function ct(p){var O=p[0],W=p[1],pt=p[2];return W+=90,W*=Math.PI/180,pt*=Math.PI/180,{x:O*Math.cos(W)*Math.sin(pt),y:O*Math.sin(W)*Math.sin(pt),z:O*Math.cos(pt)}}function st(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function et(p){var O=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,W={};if(p.replace(O,function(At,Ot,Wt,_e){var De=Wt||_e;return W[Ot]=De?De.toLowerCase():!0,""}),W["max-age"]){var pt=parseInt(W["max-age"],10);isNaN(pt)?delete W["max-age"]:W["max-age"]=pt}return W}var K=null;function ot(p){if(K==null){var O=p.navigator?p.navigator.userAgent:null;K=!!p.safari||!!(O&&(/\b(iPad|iPhone|iPod)\b/.test(O)||O.match("Safari")&&!O.match("Chrome")))}return K}function X(p){try{var O=s[p];return O.setItem("_mapbox_test_",1),O.removeItem("_mapbox_test_"),!0}catch{return!1}}function Q(p){return s.btoa(encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,function(O,W){return String.fromCharCode(+("0x"+W))}))}function ut(p){return decodeURIComponent(s.atob(p).split("").map(function(O){return"%"+("00"+O.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var J=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),q=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,it=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,nt,dt,Tt={now:J,frame:function(p){var O=q(p);return{cancel:function(){return it(O)}}},getImageData:function(p,O){O===void 0&&(O=0);var W=s.document.createElement("canvas"),pt=W.getContext("2d");if(!pt)throw new Error("failed to create canvas 2d context");return W.width=p.width,W.height=p.height,pt.drawImage(p,0,0,p.width,p.height),pt.getImageData(-O,-O,p.width+2*O,p.height+2*O)},resolveURL:function(p){return nt||(nt=s.document.createElement("a")),nt.href=p,nt.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}},wt={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},It={supported:!1,testSupport:te},Ct,Nt=!1,ee,Jt=!1;s.document&&(ee=s.document.createElement("img"),ee.onload=function(){Ct&&Kt(Ct),Ct=null,Jt=!0},ee.onerror=function(){Nt=!0,Ct=null},ee.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function te(p){Nt||!ee||(Jt?Kt(p):Ct=p)}function Kt(p){var O=p.createTexture();p.bindTexture(p.TEXTURE_2D,O);try{if(p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,ee),p.isContextLost())return;It.supported=!0}catch{}p.deleteTexture(O),Nt=!0}var mt="01";function bt(){for(var p="1",O="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",W="",pt=0;pt<10;pt++)W+=O[Math.floor(Math.random()*62)];var At=720*60*1e3,Ot=[p,mt,W].join(""),Wt=Date.now()+At;return{token:Ot,tokenExpiresAt:Wt}}var vt=function(p,O){this._transformRequestFn=p,this._customAccessToken=O,this._createSkuToken()};vt.prototype._createSkuToken=function(){var p=bt();this._skuToken=p.token,this._skuTokenExpiresAt=p.tokenExpiresAt},vt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},vt.prototype.transformRequest=function(p,O){return this._transformRequestFn?this._transformRequestFn(p,O)||{url:p}:{url:p}},vt.prototype.normalizeStyleURL=function(p,O){if(!Ut(p))return p;var W=We(p);return W.path="/styles/v1"+W.path,this._makeAPIURL(W,this._customAccessToken||O)},vt.prototype.normalizeGlyphsURL=function(p,O){if(!Ut(p))return p;var W=We(p);return W.path="/fonts/v1"+W.path,this._makeAPIURL(W,this._customAccessToken||O)},vt.prototype.normalizeSourceURL=function(p,O){if(!Ut(p))return p;var W=We(p);return W.path="/v4/"+W.authority+".json",W.params.push("secure"),this._makeAPIURL(W,this._customAccessToken||O)},vt.prototype.normalizeSpriteURL=function(p,O,W,pt){var At=We(p);return Ut(p)?(At.path="/styles/v1"+At.path+"/sprite"+O+W,this._makeAPIURL(At,this._customAccessToken||pt)):(At.path+=""+O+W,qe(At))},vt.prototype.normalizeTileURL=function(p,O){if(this._isSkuTokenExpired()&&this._createSkuToken(),p&&!Ut(p))return p;var W=We(p),pt=/(\.(png|jpg)\d*)(?=$)/,At=/^.+\/v4\//,Ot=Tt.devicePixelRatio>=2||O===512?"@2x":"",Wt=It.supported?".webp":"$1";W.path=W.path.replace(pt,""+Ot+Wt),W.path=W.path.replace(At,"/"),W.path="/v4"+W.path;var _e=this._customAccessToken||Me(W.params)||wt.ACCESS_TOKEN;return wt.REQUIRE_ACCESS_TOKEN&&_e&&this._skuToken&&W.params.push("sku="+this._skuToken),this._makeAPIURL(W,_e)},vt.prototype.canonicalizeTileURL=function(p,O){var W="/v4/",pt=/\.[\w]+$/,At=We(p);if(!At.path.match(/(^\/v4\/)/)||!At.path.match(pt))return p;var Ot="mapbox://tiles/";Ot+=At.path.replace(W,"");var Wt=At.params;return O&&(Wt=Wt.filter(function(_e){return!_e.match(/^access_token=/)})),Wt.length&&(Ot+="?"+Wt.join("&")),Ot},vt.prototype.canonicalizeTileset=function(p,O){for(var W=O?Ut(O):!1,pt=[],At=0,Ot=p.tiles||[];At<Ot.length;At+=1){var Wt=Ot[At];Zt(Wt)?pt.push(this.canonicalizeTileURL(Wt,W)):pt.push(Wt)}return pt},vt.prototype._makeAPIURL=function(p,O){var W="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",pt=We(wt.API_URL);if(p.protocol=pt.protocol,p.authority=pt.authority,p.protocol==="http"){var At=p.params.indexOf("secure");At>=0&&p.params.splice(At,1)}if(pt.path!=="/"&&(p.path=""+pt.path+p.path),!wt.REQUIRE_ACCESS_TOKEN)return qe(p);if(O=O||wt.ACCESS_TOKEN,!O)throw new Error("An API access token is required to use Mapbox GL. "+W);if(O[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+W);return p.params=p.params.filter(function(Ot){return Ot.indexOf("access_token")===-1}),p.params.push("access_token="+O),qe(p)};function Ut(p){return p.indexOf("mapbox:")===0}var re=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Zt(p){return re.test(p)}function ue(p){return p.indexOf("sku=")>0&&Zt(p)}function Me(p){for(var O=0,W=p;O<W.length;O+=1){var pt=W[O],At=pt.match(/^access_token=(.*)$/);if(At)return At[1]}return null}var Ce=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function We(p){var O=p.match(Ce);if(!O)throw new Error("Unable to parse URL object");return{protocol:O[1],authority:O[2],path:O[3]||"/",params:O[4]?O[4].split("&"):[]}}function qe(p){var O=p.params.length?"?"+p.params.join("&"):"";return p.protocol+"://"+p.authority+p.path+O}var vr="mapbox.eventData";function _r(p){if(!p)return null;var O=p.split(".");if(!O||O.length!==3)return null;try{var W=JSON.parse(ut(O[1]));return W}catch{return null}}var er=function(p){this.type=p,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};er.prototype.getStorageKey=function(p){var O=_r(wt.ACCESS_TOKEN),W="";return O&&O.u?W=Q(O.u):W=wt.ACCESS_TOKEN||"",p?vr+"."+p+":"+W:vr+":"+W},er.prototype.fetchEventData=function(){var p=X("localStorage"),O=this.getStorageKey(),W=this.getStorageKey("uuid");if(p)try{var pt=s.localStorage.getItem(O);pt&&(this.eventData=JSON.parse(pt));var At=s.localStorage.getItem(W);At&&(this.anonId=At)}catch{j("Unable to read from LocalStorage")}},er.prototype.saveEventData=function(){var p=X("localStorage"),O=this.getStorageKey(),W=this.getStorageKey("uuid");if(p)try{s.localStorage.setItem(W,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(O,JSON.stringify(this.eventData))}catch{j("Unable to write to LocalStorage")}},er.prototype.processRequests=function(p){},er.prototype.postEvent=function(p,O,W,pt){var At=this;if(wt.EVENTS_URL){var Ot=We(wt.EVENTS_URL);Ot.params.push("access_token="+(pt||wt.ACCESS_TOKEN||""));var Wt={event:this.type,created:new Date(p).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:mt,userId:this.anonId},_e=O?M(Wt,O):Wt,De={url:qe(Ot),headers:{"Content-Type":"text/plain"},body:JSON.stringify([_e])};this.pendingRequest=$r(De,function(Je){At.pendingRequest=null,W(Je),At.saveEventData(),At.processRequests(pt)})}},er.prototype.queueRequest=function(p,O){this.queue.push(p),this.processRequests(O)};var Mr=function(p){function O(){p.call(this,"map.load"),this.success={},this.skuToken=""}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.postMapLoadEvent=function(W,pt,At,Ot){this.skuToken=At,(wt.EVENTS_URL&&Ot||wt.ACCESS_TOKEN&&Array.isArray(W)&&W.some(function(Wt){return Ut(Wt)||Zt(Wt)}))&&this.queueRequest({id:pt,timestamp:Date.now()},Ot)},O.prototype.processRequests=function(W){var pt=this;if(!(this.pendingRequest||this.queue.length===0)){var At=this.queue.shift(),Ot=At.id,Wt=At.timestamp;Ot&&this.success[Ot]||(this.anonId||this.fetchEventData(),P(this.anonId)||(this.anonId=b()),this.postEvent(Wt,{skuToken:this.skuToken},function(_e){_e||Ot&&(pt.success[Ot]=!0)},W))}},O}(er),Ir=function(p){function O(W){p.call(this,"appUserTurnstile"),this._customAccessToken=W}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.postTurnstileEvent=function(W,pt){wt.EVENTS_URL&&wt.ACCESS_TOKEN&&Array.isArray(W)&&W.some(function(At){return Ut(At)||Zt(At)})&&this.queueRequest(Date.now(),pt)},O.prototype.processRequests=function(W){var pt=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var At=_r(wt.ACCESS_TOKEN),Ot=At?At.u:wt.ACCESS_TOKEN,Wt=Ot!==this.eventData.tokenU;P(this.anonId)||(this.anonId=b(),Wt=!0);var _e=this.queue.shift();if(this.eventData.lastSuccess){var De=new Date(this.eventData.lastSuccess),Je=new Date(_e),sr=(_e-this.eventData.lastSuccess)/(1440*60*1e3);Wt=Wt||sr>=1||sr<-1||De.getDate()!==Je.getDate()}else Wt=!0;if(!Wt)return this.processRequests();this.postEvent(_e,{"enabled.telemetry":!1},function(Ar){Ar||(pt.eventData.lastSuccess=_e,pt.eventData.tokenU=Ot)},W)}},O}(er),de=new Ir,Dt=de.postTurnstileEvent.bind(de),qt=new Mr,_t=qt.postMapLoadEvent.bind(qt),lt="mapbox-tiles",yt=500,St=50,Ht=1e3*60*7,Yt;function se(){s.caches&&!Yt&&(Yt=s.caches.open(lt))}var ke;function Ee(p,O){if(ke===void 0)try{new Response(new ReadableStream),ke=!0}catch{ke=!1}ke?O(p.body):p.blob().then(O)}function Ue(p,O,W){if(se(),!!Yt){var pt={status:O.status,statusText:O.statusText,headers:new s.Headers};O.headers.forEach(function(Wt,_e){return pt.headers.set(_e,Wt)});var At=et(O.headers.get("Cache-Control")||"");if(!At["no-store"]){At["max-age"]&&pt.headers.set("Expires",new Date(W+At["max-age"]*1e3).toUTCString());var Ot=new Date(pt.headers.get("Expires")).getTime()-W;Ot<Ht||Ee(O,function(Wt){var _e=new s.Response(Wt,pt);se(),Yt&&Yt.then(function(De){return De.put(ir(p.url),_e)}).catch(function(De){return j(De.message)})})}}}function ir(p){var O=p.indexOf("?");return O<0?p:p.slice(0,O)}function ar(p,O){if(se(),!Yt)return O(null);var W=ir(p.url);Yt.then(function(pt){pt.match(W).then(function(At){var Ot=Ye(At);pt.delete(W),Ot&&pt.put(W,At.clone()),O(null,At,Ot)}).catch(O)}).catch(O)}function Ye(p){if(!p)return!1;var O=new Date(p.headers.get("Expires")||0),W=et(p.headers.get("Cache-Control")||"");return O>Date.now()&&!W["no-cache"]}var Er=1/0;function pn(p){Er++,Er>St&&(p.getActor().send("enforceCacheSizeLimit",yt),Er=0)}function dn(p){se(),Yt&&Yt.then(function(O){O.keys().then(function(W){for(var pt=0;pt<W.length-p;pt++)O.delete(W[pt])})})}function bn(p){var O=s.caches.delete(lt);p&&O.catch(p).then(function(){return p()})}function Zn(p,O){yt=p,St=O}var En;function gn(){return En==null&&(En=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&typeof s.createImageBitmap=="function"),En}var da={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(da);var ra=function(p){function O(W,pt,At){pt===401&&Zt(At)&&(W+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),p.call(this,W),this.status=pt,this.url=At,this.name=this.constructor.name,this.message=W}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},O}(Error),Se=st()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol==="blob:"?s.parent:s).location.href},Re=function(p){return/^file:/.test(p)||/^file:/.test(Se())&&!/^\w+:/.test(p)};function Ze(p,O){var W=new s.AbortController,pt=new s.Request(p.url,{method:p.method||"GET",body:p.body,credentials:p.credentials,headers:p.headers,referrer:Se(),signal:W.signal}),At=!1,Ot=!1,Wt=ue(pt.url);p.type==="json"&&pt.headers.set("Accept","application/json");var _e=function(Je,sr,Ar){if(!Ot){if(Je&&Je.message!=="SecurityError"&&j(Je),sr&&Ar)return De(sr);var Pr=Date.now();s.fetch(pt).then(function(Vr){if(Vr.ok){var un=Wt?Vr.clone():null;return De(Vr,un,Pr)}else return O(new ra(Vr.statusText,Vr.status,p.url))}).catch(function(Vr){Vr.code!==20&&O(new Error(Vr.message))})}},De=function(Je,sr,Ar){(p.type==="arrayBuffer"?Je.arrayBuffer():p.type==="json"?Je.json():Je.text()).then(function(Pr){Ot||(sr&&Ar&&Ue(pt,sr,Ar),At=!0,O(null,Pr,Je.headers.get("Cache-Control"),Je.headers.get("Expires")))}).catch(function(Pr){Ot||O(new Error(Pr.message))})};return Wt?ar(pt,_e):_e(null,null),{cancel:function(){Ot=!0,At||W.abort()}}}function tr(p,O){var W=new s.XMLHttpRequest;W.open(p.method||"GET",p.url,!0),p.type==="arrayBuffer"&&(W.responseType="arraybuffer");for(var pt in p.headers)W.setRequestHeader(pt,p.headers[pt]);return p.type==="json"&&(W.responseType="text",W.setRequestHeader("Accept","application/json")),W.withCredentials=p.credentials==="include",W.onerror=function(){O(new Error(W.statusText))},W.onload=function(){if((W.status>=200&&W.status<300||W.status===0)&&W.response!==null){var At=W.response;if(p.type==="json")try{At=JSON.parse(W.response)}catch(Ot){return O(Ot)}O(null,At,W.getResponseHeader("Cache-Control"),W.getResponseHeader("Expires"))}else O(new ra(W.statusText,W.status,p.url))},W.send(p.body),{cancel:function(){return W.abort()}}}var zr=function(p,O){if(!Re(p.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Ze(p,O);if(st()&&self.worker&&self.worker.actor){var W=!0;return self.worker.actor.send("getResource",p,O,void 0,W)}}return tr(p,O)},tn=function(p,O){return zr(M(p,{type:"json"}),O)},Yr=function(p,O){return zr(M(p,{type:"arrayBuffer"}),O)},$r=function(p,O){return zr(M(p,{method:"POST"}),O)};function In(p){var O=s.document.createElement("a");return O.href=p,O.protocol===s.document.location.protocol&&O.host===s.document.location.host}var Nn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Kn(p,O,W,pt){var At=new s.Image,Ot=s.URL;At.onload=function(){O(null,At),Ot.revokeObjectURL(At.src),At.onload=null,s.requestAnimationFrame(function(){At.src=Nn})},At.onerror=function(){return O(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 Wt=new s.Blob([new Uint8Array(p)],{type:"image/png"});At.cacheControl=W,At.expires=pt,At.src=p.byteLength?Ot.createObjectURL(Wt):Nn}function $n(p,O){var W=new s.Blob([new Uint8Array(p)],{type:"image/png"});s.createImageBitmap(W).then(function(pt){O(null,pt)}).catch(function(pt){O(new Error("Could not load image because of "+pt.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var ia,Cn,Fa=function(){ia=[],Cn=0};Fa();var Ga=function(p,O){if(It.supported&&(p.headers||(p.headers={}),p.headers.accept="image/webp,*/*"),Cn>=wt.MAX_PARALLEL_IMAGE_REQUESTS){var W={requestParameters:p,callback:O,cancelled:!1,cancel:function(){this.cancelled=!0}};return ia.push(W),W}Cn++;var pt=!1,At=function(){if(!pt)for(pt=!0,Cn--;ia.length&&Cn<wt.MAX_PARALLEL_IMAGE_REQUESTS;){var Wt=ia.shift(),_e=Wt.requestParameters,De=Wt.callback,Je=Wt.cancelled;Je||(Wt.cancel=Ga(_e,De).cancel)}},Ot=Yr(p,function(Wt,_e,De,Je){At(),Wt?O(Wt):_e&&(gn()?$n(_e,O):Kn(_e,O,De,Je))});return{cancel:function(){Ot.cancel(),At()}}},ve=function(p,O){var W=s.document.createElement("video");W.muted=!0,W.onloadstart=function(){O(null,W)};for(var pt=0;pt<p.length;pt++){var At=s.document.createElement("source");In(p[pt])||(W.crossOrigin="Anonymous"),At.src=p[pt],W.appendChild(At)}return{cancel:function(){}}};function ge(p,O,W){var pt=W[p]&&W[p].indexOf(O)!==-1;pt||(W[p]=W[p]||[],W[p].push(O))}function dr(p,O,W){if(W&&W[p]){var pt=W[p].indexOf(O);pt!==-1&&W[p].splice(pt,1)}}var br=function(p,O){O===void 0&&(O={}),M(this,O),this.type=p},Tr=function(p){function O(W,pt){pt===void 0&&(pt={}),p.call(this,"error",M({error:W},pt))}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O}(br),mr=function(){};mr.prototype.on=function(p,O){return this._listeners=this._listeners||{},ge(p,O,this._listeners),this},mr.prototype.off=function(p,O){return dr(p,O,this._listeners),dr(p,O,this._oneTimeListeners),this},mr.prototype.once=function(p,O){return this._oneTimeListeners=this._oneTimeListeners||{},ge(p,O,this._oneTimeListeners),this},mr.prototype.fire=function(p,O){typeof p=="string"&&(p=new br(p,O||{}));var W=p.type;if(this.listens(W)){p.target=this;for(var pt=this._listeners&&this._listeners[W]?this._listeners[W].slice():[],At=0,Ot=pt;At<Ot.length;At+=1){var Wt=Ot[At];Wt.call(this,p)}for(var _e=this._oneTimeListeners&&this._oneTimeListeners[W]?this._oneTimeListeners[W].slice():[],De=0,Je=_e;De<Je.length;De+=1){var sr=Je[De];dr(W,sr,this._oneTimeListeners),sr.call(this,p)}var Ar=this._eventedParent;Ar&&(M(p,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Ar.fire(p))}else p instanceof Tr&&console.error(p.error);return this},mr.prototype.listens=function(p){return this._listeners&&this._listeners[p]&&this._listeners[p].length>0||this._oneTimeListeners&&this._oneTimeListeners[p]&&this._oneTimeListeners[p].length>0||this._eventedParent&&this._eventedParent.listens(p)},mr.prototype.setEventedParent=function(p,O){return this._eventedParent=p,this._eventedParentData=O,this};var kr=8,Ur={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"}},Or={"*":{type:"source"}},pe=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Ke={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:"*"}},xr={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:"*"}},Gr={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:"*"}},ln={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"}},wn={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"}}},rn={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"}}},Qr={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"}},vn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Oa={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"}},Qa={"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"}},wi={"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"}},ci={"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"}},Ti={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ra={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qi={type:"array",value:"*"},Hi={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Ho={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Ci={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},zo={type:"array",value:"*",minimum:1},qi={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}},qo=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Po={"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"}},hs={"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"}},Gi={"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"}},uo={"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"}},yi={"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"}},ao={"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"}},ts={"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"}},vs={"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"}},As={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},_o={"*":{type:"string"}},Da={$version:kr,$root:Ur,sources:Or,source:pe,source_vector:Ke,source_raster:xr,source_raster_dem:Gr,source_geojson:ln,source_video:wn,source_image:rn,layer:Qr,layout:vn,layout_background:Oa,layout_fill:Qn,layout_circle:Qa,layout_heatmap:Ja,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:wi,layout_symbol:ci,layout_raster:Ti,layout_hillshade:Ra,filter:Qi,filter_operator:Hi,geometry_type:Ho,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:Ci,expression:zo,light:qi,paint:qo,paint_fill:Po,"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:hs,paint_circle:Gi,paint_heatmap:uo,paint_symbol:yi,paint_raster:ao,paint_hillshade:ts,paint_background:vs,transition:As,"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:_o},li=function(p,O,W,pt){this.message=(p?p+": ":"")+W,pt&&(this.identifier=pt),O!=null&&O.__line__&&(this.line=O.__line__)};function wo(p){var O=p.key,W=p.value;return W?[new li(O,W,"constants have been deprecated as of v8")]:[]}function Ms(p){for(var O=[],W=arguments.length-1;W-- >0;)O[W]=arguments[W+1];for(var pt=0,At=O;pt<At.length;pt+=1){var Ot=At[pt];for(var Wt in Ot)p[Wt]=Ot[Wt]}return p}function Di(p){return p instanceof Number||p instanceof String||p instanceof Boolean?p.valueOf():p}function _s(p){if(Array.isArray(p))return p.map(_s);if(p instanceof Object&&!(p instanceof Number||p instanceof String||p instanceof Boolean)){var O={};for(var W in p)O[W]=_s(p[W]);return O}return Di(p)}var No=function(p){function O(W,pt){p.call(this,pt),this.message=pt,this.key=W}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O}(Error),is=function(p,O){O===void 0&&(O=[]),this.parent=p,this.bindings={};for(var W=0,pt=O;W<pt.length;W+=1){var At=pt[W],Ot=At[0],Wt=At[1];this.bindings[Ot]=Wt}};is.prototype.concat=function(p){return new is(this,p)},is.prototype.get=function(p){if(this.bindings[p])return this.bindings[p];if(this.parent)return this.parent.get(p);throw new Error(p+" not found in scope.")},is.prototype.has=function(p){return this.bindings[p]?!0:this.parent?this.parent.has(p):!1};var al={kind:"null"},ii={kind:"number"},io={kind:"string"},co={kind:"boolean"},Is={kind:"color"},Wo={kind:"object"},Bi={kind:"value"},$s={kind:"error"},fl={kind:"collator"},Jo={kind:"formatted"},us={kind:"resolvedImage"};function Ss(p,O){return{kind:"array",itemType:p,N:O}}function Ls(p){if(p.kind==="array"){var O=Ls(p.itemType);return typeof p.N=="number"?"array<"+O+", "+p.N+">":p.itemType.kind==="value"?"array":"array<"+O+">"}else return p.kind}var yl=[al,ii,io,co,Is,Jo,Wo,Ss(Bi),us];function bu(p,O){if(O.kind==="error")return null;if(p.kind==="array"){if(O.kind==="array"&&(O.N===0&&O.itemType.kind==="value"||!bu(p.itemType,O.itemType))&&(typeof p.N!="number"||p.N===O.N))return null}else{if(p.kind===O.kind)return null;if(p.kind==="value")for(var W=0,pt=yl;W<pt.length;W+=1){var At=pt[W];if(!bu(At,O))return null}}return"Expected "+Ls(p)+" but found "+Ls(O)+" instead."}function au(p,O){return O.some(function(W){return W.kind===p.kind})}function fu(p,O){return O.some(function(W){return W==="null"?p===null:W==="array"?Array.isArray(p):W==="object"?p&&!Array.isArray(p)&&typeof p=="object":W===typeof p})}var Ec=e(function(p,O){var W={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 pt(Je){return Je=Math.round(Je),Je<0?0:Je>255?255:Je}function At(Je){return Je<0?0:Je>1?1:Je}function Ot(Je){return Je[Je.length-1]==="%"?pt(parseFloat(Je)/100*255):pt(parseInt(Je))}function Wt(Je){return Je[Je.length-1]==="%"?At(parseFloat(Je)/100):At(parseFloat(Je))}function _e(Je,sr,Ar){return Ar<0?Ar+=1:Ar>1&&(Ar-=1),Ar*6<1?Je+(sr-Je)*Ar*6:Ar*2<1?sr:Ar*3<2?Je+(sr-Je)*(2/3-Ar)*6:Je}function De(Je){var sr=Je.replace(/ /g,"").toLowerCase();if(sr in W)return W[sr].slice();if(sr[0]==="#"){if(sr.length===4){var Ar=parseInt(sr.substr(1),16);return Ar>=0&&Ar<=4095?[(Ar&3840)>>4|(Ar&3840)>>8,Ar&240|(Ar&240)>>4,Ar&15|(Ar&15)<<4,1]:null}else if(sr.length===7){var Ar=parseInt(sr.substr(1),16);return Ar>=0&&Ar<=16777215?[(Ar&16711680)>>16,(Ar&65280)>>8,Ar&255,1]:null}return null}var Pr=sr.indexOf("("),Vr=sr.indexOf(")");if(Pr!==-1&&Vr+1===sr.length){var un=sr.substr(0,Pr),Fn=sr.substr(Pr+1,Vr-(Pr+1)).split(","),ga=1;switch(un){case"rgba":if(Fn.length!==4)return null;ga=Wt(Fn.pop());case"rgb":return Fn.length!==3?null:[Ot(Fn[0]),Ot(Fn[1]),Ot(Fn[2]),ga];case"hsla":if(Fn.length!==4)return null;ga=Wt(Fn.pop());case"hsl":if(Fn.length!==3)return null;var pa=(parseFloat(Fn[0])%360+360)%360/360,Ea=Wt(Fn[1]),ja=Wt(Fn[2]),Aa=ja<=.5?ja*(Ea+1):ja+Ea-ja*Ea,$a=ja*2-Aa;return[pt(_e($a,Aa,pa+1/3)*255),pt(_e($a,Aa,pa)*255),pt(_e($a,Aa,pa-1/3)*255),ga];default:return null}}return null}try{O.parseCSSColor=De}catch{}}),xc=Ec.parseCSSColor,cs=function(p,O,W,pt){pt===void 0&&(pt=1),this.r=p,this.g=O,this.b=W,this.a=pt};cs.parse=function(p){if(p){if(p instanceof cs)return p;if(typeof p=="string"){var O=xc(p);if(O)return new cs(O[0]/255*O[3],O[1]/255*O[3],O[2]/255*O[3],O[3])}}},cs.prototype.toString=function(){var p=this.toArray(),O=p[0],W=p[1],pt=p[2],At=p[3];return"rgba("+Math.round(O)+","+Math.round(W)+","+Math.round(pt)+","+At+")"},cs.prototype.toArray=function(){var p=this,O=p.r,W=p.g,pt=p.b,At=p.a;return At===0?[0,0,0,0]:[O*255/At,W*255/At,pt*255/At,At]},cs.black=new cs(0,0,0,1),cs.white=new cs(1,1,1,1),cs.transparent=new cs(0,0,0,0),cs.red=new cs(1,0,0,1);var Gl=function(p,O,W){p?this.sensitivity=O?"variant":"case":this.sensitivity=O?"accent":"base",this.locale=W,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Gl.prototype.compare=function(p,O){return this.collator.compare(p,O)},Gl.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var zc=function(p,O,W,pt,At){this.text=p,this.image=O,this.scale=W,this.fontStack=pt,this.textColor=At},Al=function(p){this.sections=p};Al.fromString=function(p){return new Al([new zc(p,null,null,null,null)])},Al.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(p){return p.text.length!==0||p.image&&p.image.name.length!==0})},Al.factory=function(p){return p instanceof Al?p:Al.fromString(p)},Al.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(p){return p.text}).join("")},Al.prototype.serialize=function(){for(var p=["format"],O=0,W=this.sections;O<W.length;O+=1){var pt=W[O];if(pt.image){p.push(["image",pt.image.name]);continue}p.push(pt.text);var At={};pt.fontStack&&(At["text-font"]=["literal",pt.fontStack.split(",")]),pt.scale&&(At["font-scale"]=pt.scale),pt.textColor&&(At["text-color"]=["rgba"].concat(pt.textColor.toArray())),p.push(At)}return p};var xl=function(p){this.name=p.name,this.available=p.available};xl.prototype.toString=function(){return this.name},xl.fromString=function(p){return p?new xl({name:p,available:!1}):null},xl.prototype.serialize=function(){return["image",this.name]};function Ml(p,O,W,pt){if(!(typeof p=="number"&&p>=0&&p<=255&&typeof O=="number"&&O>=0&&O<=255&&typeof W=="number"&&W>=0&&W<=255)){var At=typeof pt=="number"?[p,O,W,pt]:[p,O,W];return"Invalid rgba value ["+At.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof pt>"u"||typeof pt=="number"&&pt>=0&&pt<=1?null:"Invalid rgba value ["+[p,O,W,pt].join(", ")+"]: 'a' must be between 0 and 1."}function hu(p){if(p===null||typeof p=="string"||typeof p=="boolean"||typeof p=="number"||p instanceof cs||p instanceof Gl||p instanceof Al||p instanceof xl)return!0;if(Array.isArray(p)){for(var O=0,W=p;O<W.length;O+=1){var pt=W[O];if(!hu(pt))return!1}return!0}else if(typeof p=="object"){for(var At in p)if(!hu(p[At]))return!1;return!0}else return!1}function Fs(p){if(p===null)return al;if(typeof p=="string")return io;if(typeof p=="boolean")return co;if(typeof p=="number")return ii;if(p instanceof cs)return Is;if(p instanceof Gl)return fl;if(p instanceof Al)return Jo;if(p instanceof xl)return us;if(Array.isArray(p)){for(var O=p.length,W,pt=0,At=p;pt<At.length;pt+=1){var Ot=At[pt],Wt=Fs(Ot);if(!W)W=Wt;else{if(W===Wt)continue;W=Bi;break}}return Ss(W||Bi,O)}else return Wo}function _l(p){var O=typeof p;return p===null?"":O==="string"||O==="number"||O==="boolean"?String(p):p instanceof cs||p instanceof Al||p instanceof xl?p.toString():JSON.stringify(p)}var Fo=function(p,O){this.type=p,this.value=O};Fo.parse=function(p,O){if(p.length!==2)return O.error("'literal' expression requires exactly one argument, but found "+(p.length-1)+" instead.");if(!hu(p[1]))return O.error("invalid value");var W=p[1],pt=Fs(W),At=O.expectedType;return pt.kind==="array"&&pt.N===0&&At&&At.kind==="array"&&(typeof At.N!="number"||At.N===0)&&(pt=At),new Fo(pt,W)},Fo.prototype.evaluate=function(){return this.value},Fo.prototype.eachChild=function(){},Fo.prototype.outputDefined=function(){return!0},Fo.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof cs?["rgba"].concat(this.value.toArray()):this.value instanceof Al?this.value.serialize():this.value};var bs=function(p){this.name="ExpressionEvaluationError",this.message=p};bs.prototype.toJSON=function(){return this.message};var Iu={string:io,number:ii,boolean:co,object:Wo},Nl=function(p,O){this.type=p,this.args=O};Nl.parse=function(p,O){if(p.length<2)return O.error("Expected at least one argument.");var W=1,pt,At=p[0];if(At==="array"){var Ot;if(p.length>2){var Wt=p[1];if(typeof Wt!="string"||!(Wt in Iu)||Wt==="object")return O.error('The item type argument of "array" must be one of string, number, boolean',1);Ot=Iu[Wt],W++}else Ot=Bi;var _e;if(p.length>3){if(p[2]!==null&&(typeof p[2]!="number"||p[2]<0||p[2]!==Math.floor(p[2])))return O.error('The length argument to "array" must be a positive integer literal',2);_e=p[2],W++}pt=Ss(Ot,_e)}else pt=Iu[At];for(var De=[];W<p.length;W++){var Je=O.parse(p[W],W,Bi);if(!Je)return null;De.push(Je)}return new Nl(pt,De)},Nl.prototype.evaluate=function(p){for(var O=0;O<this.args.length;O++){var W=this.args[O].evaluate(p),pt=bu(this.type,Fs(W));if(pt){if(O===this.args.length-1)throw new bs("Expected value to be of type "+Ls(this.type)+", but found "+Ls(Fs(W))+" instead.")}else return W}return null},Nl.prototype.eachChild=function(p){this.args.forEach(p)},Nl.prototype.outputDefined=function(){return this.args.every(function(p){return p.outputDefined()})},Nl.prototype.serialize=function(){var p=this.type,O=[p.kind];if(p.kind==="array"){var W=p.itemType;if(W.kind==="string"||W.kind==="number"||W.kind==="boolean"){O.push(W.kind);var pt=p.N;(typeof pt=="number"||this.args.length>1)&&O.push(pt)}}return O.concat(this.args.map(function(At){return At.serialize()}))};var Hu=function(p){this.type=Jo,this.sections=p};Hu.parse=function(p,O){if(p.length<2)return O.error("Expected at least one argument.");var W=p[1];if(!Array.isArray(W)&&typeof W=="object")return O.error("First argument must be an image or text section.");for(var pt=[],At=!1,Ot=1;Ot<=p.length-1;++Ot){var Wt=p[Ot];if(At&&typeof Wt=="object"&&!Array.isArray(Wt)){At=!1;var _e=null;if(Wt["font-scale"]&&(_e=O.parse(Wt["font-scale"],1,ii),!_e))return null;var De=null;if(Wt["text-font"]&&(De=O.parse(Wt["text-font"],1,Ss(io)),!De))return null;var Je=null;if(Wt["text-color"]&&(Je=O.parse(Wt["text-color"],1,Is),!Je))return null;var sr=pt[pt.length-1];sr.scale=_e,sr.font=De,sr.textColor=Je}else{var Ar=O.parse(p[Ot],1,Bi);if(!Ar)return null;var Pr=Ar.type.kind;if(Pr!=="string"&&Pr!=="value"&&Pr!=="null"&&Pr!=="resolvedImage")return O.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");At=!0,pt.push({content:Ar,scale:null,font:null,textColor:null})}}return new Hu(pt)},Hu.prototype.evaluate=function(p){var O=function(W){var pt=W.content.evaluate(p);return Fs(pt)===us?new zc("",pt,null,null,null):new zc(_l(pt),null,W.scale?W.scale.evaluate(p):null,W.font?W.font.evaluate(p).join(","):null,W.textColor?W.textColor.evaluate(p):null)};return new Al(this.sections.map(O))},Hu.prototype.eachChild=function(p){for(var O=0,W=this.sections;O<W.length;O+=1){var pt=W[O];p(pt.content),pt.scale&&p(pt.scale),pt.font&&p(pt.font),pt.textColor&&p(pt.textColor)}},Hu.prototype.outputDefined=function(){return!1},Hu.prototype.serialize=function(){for(var p=["format"],O=0,W=this.sections;O<W.length;O+=1){var pt=W[O];p.push(pt.content.serialize());var At={};pt.scale&&(At["font-scale"]=pt.scale.serialize()),pt.font&&(At["text-font"]=pt.font.serialize()),pt.textColor&&(At["text-color"]=pt.textColor.serialize()),p.push(At)}return p};var qs=function(p){this.type=us,this.input=p};qs.parse=function(p,O){if(p.length!==2)return O.error("Expected two arguments.");var W=O.parse(p[1],1,io);return W?new qs(W):O.error("No image name provided.")},qs.prototype.evaluate=function(p){var O=this.input.evaluate(p),W=xl.fromString(O);return W&&p.availableImages&&(W.available=p.availableImages.indexOf(O)>-1),W},qs.prototype.eachChild=function(p){p(this.input)},qs.prototype.outputDefined=function(){return!1},qs.prototype.serialize=function(){return["image",this.input.serialize()]};var of={"to-boolean":co,"to-color":Is,"to-number":ii,"to-string":io},Oo=function(p,O){this.type=p,this.args=O};Oo.parse=function(p,O){if(p.length<2)return O.error("Expected at least one argument.");var W=p[0];if((W==="to-boolean"||W==="to-string")&&p.length!==2)return O.error("Expected one argument.");for(var pt=of[W],At=[],Ot=1;Ot<p.length;Ot++){var Wt=O.parse(p[Ot],Ot,Bi);if(!Wt)return null;At.push(Wt)}return new Oo(pt,At)},Oo.prototype.evaluate=function(p){if(this.type.kind==="boolean")return!!this.args[0].evaluate(p);if(this.type.kind==="color"){for(var O,W,pt=0,At=this.args;pt<At.length;pt+=1){var Ot=At[pt];if(O=Ot.evaluate(p),W=null,O instanceof cs)return O;if(typeof O=="string"){var Wt=p.parseColor(O);if(Wt)return Wt}else if(Array.isArray(O)&&(O.length<3||O.length>4?W="Invalid rbga value "+JSON.stringify(O)+": expected an array containing either three or four numeric values.":W=Ml(O[0],O[1],O[2],O[3]),!W))return new cs(O[0]/255,O[1]/255,O[2]/255,O[3])}throw new bs(W||"Could not parse color from value '"+(typeof O=="string"?O:String(JSON.stringify(O)))+"'")}else if(this.type.kind==="number"){for(var _e=null,De=0,Je=this.args;De<Je.length;De+=1){var sr=Je[De];if(_e=sr.evaluate(p),_e===null)return 0;var Ar=Number(_e);if(!isNaN(Ar))return Ar}throw new bs("Could not convert "+JSON.stringify(_e)+" to number.")}else return this.type.kind==="formatted"?Al.fromString(_l(this.args[0].evaluate(p))):this.type.kind==="resolvedImage"?xl.fromString(_l(this.args[0].evaluate(p))):_l(this.args[0].evaluate(p))},Oo.prototype.eachChild=function(p){this.args.forEach(p)},Oo.prototype.outputDefined=function(){return this.args.every(function(p){return p.outputDefined()})},Oo.prototype.serialize=function(){if(this.type.kind==="formatted")return new Hu([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new qs(this.args[0]).serialize();var p=["to-"+this.type.kind];return this.eachChild(function(O){p.push(O.serialize())}),p};var vf=["Unknown","Point","LineString","Polygon"],os=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};os.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},os.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?vf[this.feature.type]:this.feature.type:null},os.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},os.prototype.canonicalID=function(){return this.canonical},os.prototype.properties=function(){return this.feature&&this.feature.properties||{}},os.prototype.parseColor=function(p){var O=this._parseColorCache[p];return O||(O=this._parseColorCache[p]=cs.parse(p)),O};var Fi=function(p,O,W,pt){this.name=p,this.type=O,this._evaluate=W,this.args=pt};Fi.prototype.evaluate=function(p){return this._evaluate(p,this.args)},Fi.prototype.eachChild=function(p){this.args.forEach(p)},Fi.prototype.outputDefined=function(){return!1},Fi.prototype.serialize=function(){return[this.name].concat(this.args.map(function(p){return p.serialize()}))},Fi.parse=function(p,O){var W,pt=p[0],At=Fi.definitions[pt];if(!At)return O.error('Unknown expression "'+pt+'". If you wanted a literal array, use ["literal", [...]].',0);for(var Ot=Array.isArray(At)?At[0]:At.type,Wt=Array.isArray(At)?[[At[1],At[2]]]:At.overloads,_e=Wt.filter(function(Mo){var Vo=Mo[0];return!Array.isArray(Vo)||Vo.length===p.length-1}),De=null,Je=0,sr=_e;Je<sr.length;Je+=1){var Ar=sr[Je],Pr=Ar[0],Vr=Ar[1];De=new Bs(O.registry,O.path,null,O.scope);for(var un=[],Fn=!1,ga=1;ga<p.length;ga++){var pa=p[ga],Ea=Array.isArray(Pr)?Pr[ga-1]:Pr.type,ja=De.parse(pa,1+un.length,Ea);if(!ja){Fn=!0;break}un.push(ja)}if(!Fn){if(Array.isArray(Pr)&&Pr.length!==un.length){De.error("Expected "+Pr.length+" arguments, but found "+un.length+" instead.");continue}for(var Aa=0;Aa<un.length;Aa++){var $a=Array.isArray(Pr)?Pr[Aa]:Pr.type,hi=un[Aa];De.concat(Aa+1).checkSubtype($a,hi.type)}if(De.errors.length===0)return new Fi(pt,Ot,Vr,un)}}if(_e.length===1)(W=O.errors).push.apply(W,De.errors);else{for(var Si=_e.length?_e:Wt,Ei=Si.map(function(Mo){var Vo=Mo[0];return nc(Vo)}).join(" | "),ro=[],no=1;no<p.length;no++){var go=O.parse(p[no],1+ro.length);if(!go)return null;ro.push(Ls(go.type))}O.error("Expected arguments of type "+Ei+", but found ("+ro.join(", ")+") instead.")}return null},Fi.register=function(p,O){Fi.definitions=O;for(var W in O)p[W]=Fi};function nc(p){return Array.isArray(p)?"("+p.map(Ls).join(", ")+")":"("+Ls(p.type)+"...)"}var pu=function(p,O,W){this.type=fl,this.locale=W,this.caseSensitive=p,this.diacriticSensitive=O};pu.parse=function(p,O){if(p.length!==2)return O.error("Expected one argument.");var W=p[1];if(typeof W!="object"||Array.isArray(W))return O.error("Collator options argument must be an object.");var pt=O.parse(W["case-sensitive"]===void 0?!1:W["case-sensitive"],1,co);if(!pt)return null;var At=O.parse(W["diacritic-sensitive"]===void 0?!1:W["diacritic-sensitive"],1,co);if(!At)return null;var Ot=null;return W.locale&&(Ot=O.parse(W.locale,1,io),!Ot)?null:new pu(pt,At,Ot)},pu.prototype.evaluate=function(p){return new Gl(this.caseSensitive.evaluate(p),this.diacriticSensitive.evaluate(p),this.locale?this.locale.evaluate(p):null)},pu.prototype.eachChild=function(p){p(this.caseSensitive),p(this.diacriticSensitive),this.locale&&p(this.locale)},pu.prototype.outputDefined=function(){return!1},pu.prototype.serialize=function(){var p={};return p["case-sensitive"]=this.caseSensitive.serialize(),p["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(p.locale=this.locale.serialize()),["collator",p]};var ml=8192;function Lc(p,O){p[0]=Math.min(p[0],O[0]),p[1]=Math.min(p[1],O[1]),p[2]=Math.max(p[2],O[0]),p[3]=Math.max(p[3],O[1])}function qu(p){return(180+p)/360}function dc(p){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+p*Math.PI/360)))/360}function bl(p,O){return!(p[0]<=O[0]||p[2]>=O[2]||p[1]<=O[1]||p[3]>=O[3])}function Yc(p,O){var W=qu(p[0]),pt=dc(p[1]),At=Math.pow(2,O.z);return[Math.round(W*At*ml),Math.round(pt*At*ml)]}function Fc(p,O,W){var pt=p[0]-O[0],At=p[1]-O[1],Ot=p[0]-W[0],Wt=p[1]-W[1];return pt*Wt-Ot*At===0&&pt*Ot<=0&&At*Wt<=0}function mc(p,O,W){return O[1]>p[1]!=W[1]>p[1]&&p[0]<(W[0]-O[0])*(p[1]-O[1])/(W[1]-O[1])+O[0]}function Wu(p,O){for(var W=!1,pt=0,At=O.length;pt<At;pt++)for(var Ot=O[pt],Wt=0,_e=Ot.length;Wt<_e-1;Wt++){if(Fc(p,Ot[Wt],Ot[Wt+1]))return!1;mc(p,Ot[Wt],Ot[Wt+1])&&(W=!W)}return W}function Cc(p,O){for(var W=0;W<O.length;W++)if(Wu(p,O[W]))return!0;return!1}function Ic(p,O){return p[0]*O[1]-p[1]*O[0]}function du(p,O,W,pt){var At=p[0]-W[0],Ot=p[1]-W[1],Wt=O[0]-W[0],_e=O[1]-W[1],De=pt[0]-W[0],Je=pt[1]-W[1],sr=At*Je-De*Ot,Ar=Wt*Je-De*_e;return sr>0&&Ar<0||sr<0&&Ar>0}function Bc(p,O,W,pt){var At=[O[0]-p[0],O[1]-p[1]],Ot=[pt[0]-W[0],pt[1]-W[1]];return Ic(Ot,At)===0?!1:!!(du(p,O,W,pt)&&du(W,pt,p,O))}function Pu(p,O,W){for(var pt=0,At=W;pt<At.length;pt+=1)for(var Ot=At[pt],Wt=0;Wt<Ot.length-1;++Wt)if(Bc(p,O,Ot[Wt],Ot[Wt+1]))return!0;return!1}function wu(p,O){for(var W=0;W<p.length;++W)if(!Wu(p[W],O))return!1;for(var pt=0;pt<p.length-1;++pt)if(Pu(p[pt],p[pt+1],O))return!1;return!0}function wl(p,O){for(var W=0;W<O.length;W++)if(wu(p,O[W]))return!0;return!1}function Ju(p,O,W){for(var pt=[],At=0;At<p.length;At++){for(var Ot=[],Wt=0;Wt<p[At].length;Wt++){var _e=Yc(p[At][Wt],W);Lc(O,_e),Ot.push(_e)}pt.push(Ot)}return pt}function Pc(p,O,W){for(var pt=[],At=0;At<p.length;At++){var Ot=Ju(p[At],O,W);pt.push(Ot)}return pt}function Es(p,O,W,pt){if(p[0]<W[0]||p[0]>W[2]){var At=pt*.5,Ot=p[0]-W[0]>At?-pt:W[0]-p[0]>At?pt:0;Ot===0&&(Ot=p[0]-W[2]>At?-pt:W[2]-p[0]>At?pt:0),p[0]+=Ot}Lc(O,p)}function _c(p){p[0]=p[1]=1/0,p[2]=p[3]=-1/0}function sf(p,O,W,pt){for(var At=Math.pow(2,pt.z)*ml,Ot=[pt.x*ml,pt.y*ml],Wt=[],_e=0,De=p;_e<De.length;_e+=1)for(var Je=De[_e],sr=0,Ar=Je;sr<Ar.length;sr+=1){var Pr=Ar[sr],Vr=[Pr.x+Ot[0],Pr.y+Ot[1]];Es(Vr,O,W,At),Wt.push(Vr)}return Wt}function Rc(p,O,W,pt){for(var At=Math.pow(2,pt.z)*ml,Ot=[pt.x*ml,pt.y*ml],Wt=[],_e=0,De=p;_e<De.length;_e+=1){for(var Je=De[_e],sr=[],Ar=0,Pr=Je;Ar<Pr.length;Ar+=1){var Vr=Pr[Ar],un=[Vr.x+Ot[0],Vr.y+Ot[1]];Lc(O,un),sr.push(un)}Wt.push(sr)}if(O[2]-O[0]<=At/2){_c(O);for(var Fn=0,ga=Wt;Fn<ga.length;Fn+=1)for(var pa=ga[Fn],Ea=0,ja=pa;Ea<ja.length;Ea+=1){var Aa=ja[Ea];Es(Aa,O,W,At)}}return Wt}function gc(p,O){var W=[1/0,1/0,-1/0,-1/0],pt=[1/0,1/0,-1/0,-1/0],At=p.canonicalID();if(O.type==="Polygon"){var Ot=Ju(O.coordinates,pt,At),Wt=sf(p.geometry(),W,pt,At);if(!bl(W,pt))return!1;for(var _e=0,De=Wt;_e<De.length;_e+=1){var Je=De[_e];if(!Wu(Je,Ot))return!1}}if(O.type==="MultiPolygon"){var sr=Pc(O.coordinates,pt,At),Ar=sf(p.geometry(),W,pt,At);if(!bl(W,pt))return!1;for(var Pr=0,Vr=Ar;Pr<Vr.length;Pr+=1){var un=Vr[Pr];if(!Cc(un,sr))return!1}}return!0}function Nc(p,O){var W=[1/0,1/0,-1/0,-1/0],pt=[1/0,1/0,-1/0,-1/0],At=p.canonicalID();if(O.type==="Polygon"){var Ot=Ju(O.coordinates,pt,At),Wt=Rc(p.geometry(),W,pt,At);if(!bl(W,pt))return!1;for(var _e=0,De=Wt;_e<De.length;_e+=1){var Je=De[_e];if(!wu(Je,Ot))return!1}}if(O.type==="MultiPolygon"){var sr=Pc(O.coordinates,pt,At),Ar=Rc(p.geometry(),W,pt,At);if(!bl(W,pt))return!1;for(var Pr=0,Vr=Ar;Pr<Vr.length;Pr+=1){var un=Vr[Pr];if(!wl(un,sr))return!1}}return!0}var Zl=function(p,O){this.type=co,this.geojson=p,this.geometries=O};Zl.parse=function(p,O){if(p.length!==2)return O.error("'within' expression requires exactly one argument, but found "+(p.length-1)+" instead.");if(hu(p[1])){var W=p[1];if(W.type==="FeatureCollection")for(var pt=0;pt<W.features.length;++pt){var At=W.features[pt].geometry.type;if(At==="Polygon"||At==="MultiPolygon")return new Zl(W,W.features[pt].geometry)}else if(W.type==="Feature"){var Ot=W.geometry.type;if(Ot==="Polygon"||Ot==="MultiPolygon")return new Zl(W,W.geometry)}else if(W.type==="Polygon"||W.type==="MultiPolygon")return new Zl(W,W)}return O.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Zl.prototype.evaluate=function(p){if(p.geometry()!=null&&p.canonicalID()!=null){if(p.geometryType()==="Point")return gc(p,this.geometries);if(p.geometryType()==="LineString")return Nc(p,this.geometries)}return!1},Zl.prototype.eachChild=function(){},Zl.prototype.outputDefined=function(){return!0},Zl.prototype.serialize=function(){return["within",this.geojson]};function jc(p){if(p instanceof Fi&&(p.name==="get"&&p.args.length===1||p.name==="feature-state"||p.name==="has"&&p.args.length===1||p.name==="properties"||p.name==="geometry-type"||p.name==="id"||/^filter-/.test(p.name))||p instanceof Zl)return!1;var O=!0;return p.eachChild(function(W){O&&!jc(W)&&(O=!1)}),O}function rl(p){if(p instanceof Fi&&p.name==="feature-state")return!1;var O=!0;return p.eachChild(function(W){O&&!rl(W)&&(O=!1)}),O}function Kl(p,O){if(p instanceof Fi&&O.indexOf(p.name)>=0)return!1;var W=!0;return p.eachChild(function(pt){W&&!Kl(pt,O)&&(W=!1)}),W}var Gu=function(p,O){this.type=O.type,this.name=p,this.boundExpression=O};Gu.parse=function(p,O){if(p.length!==2||typeof p[1]!="string")return O.error("'var' expression requires exactly one string literal argument.");var W=p[1];return O.scope.has(W)?new Gu(W,O.scope.get(W)):O.error('Unknown variable "'+W+'". Make sure "'+W+'" has been bound in an enclosing "let" expression before using it.',1)},Gu.prototype.evaluate=function(p){return this.boundExpression.evaluate(p)},Gu.prototype.eachChild=function(){},Gu.prototype.outputDefined=function(){return!1},Gu.prototype.serialize=function(){return["var",this.name]};var Bs=function(p,O,W,pt,At){O===void 0&&(O=[]),pt===void 0&&(pt=new is),At===void 0&&(At=[]),this.registry=p,this.path=O,this.key=O.map(function(Ot){return"["+Ot+"]"}).join(""),this.scope=pt,this.errors=At,this.expectedType=W};Bs.prototype.parse=function(p,O,W,pt,At){return At===void 0&&(At={}),O?this.concat(O,W,pt)._parse(p,At):this._parse(p,At)},Bs.prototype._parse=function(p,O){(p===null||typeof p=="string"||typeof p=="boolean"||typeof p=="number")&&(p=["literal",p]);function W(Je,sr,Ar){return Ar==="assert"?new Nl(sr,[Je]):Ar==="coerce"?new Oo(sr,[Je]):Je}if(Array.isArray(p)){if(p.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var pt=p[0];if(typeof pt!="string")return this.error("Expression name must be a string, but found "+typeof pt+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var At=this.registry[pt];if(At){var Ot=At.parse(p,this);if(!Ot)return null;if(this.expectedType){var Wt=this.expectedType,_e=Ot.type;if((Wt.kind==="string"||Wt.kind==="number"||Wt.kind==="boolean"||Wt.kind==="object"||Wt.kind==="array")&&_e.kind==="value")Ot=W(Ot,Wt,O.typeAnnotation||"assert");else if((Wt.kind==="color"||Wt.kind==="formatted"||Wt.kind==="resolvedImage")&&(_e.kind==="value"||_e.kind==="string"))Ot=W(Ot,Wt,O.typeAnnotation||"coerce");else if(this.checkSubtype(Wt,_e))return null}if(!(Ot instanceof Fo)&&Ot.type.kind!=="resolvedImage"&&Ou(Ot)){var De=new os;try{Ot=new Fo(Ot.type,Ot.evaluate(De))}catch(Je){return this.error(Je.message),null}}return Ot}return this.error('Unknown expression "'+pt+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof p>"u"?this.error("'undefined' value invalid. Use null instead."):typeof p=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof p+" instead.")},Bs.prototype.concat=function(p,O,W){var pt=typeof p=="number"?this.path.concat(p):this.path,At=W?this.scope.concat(W):this.scope;return new Bs(this.registry,pt,O||null,At,this.errors)},Bs.prototype.error=function(p){for(var O=[],W=arguments.length-1;W-- >0;)O[W]=arguments[W+1];var pt=""+this.key+O.map(function(At){return"["+At+"]"}).join("");this.errors.push(new No(pt,p))},Bs.prototype.checkSubtype=function(p,O){var W=bu(p,O);return W&&this.error(W),W};function Ou(p){if(p instanceof Gu)return Ou(p.boundExpression);if(p instanceof Fi&&p.name==="error"||p instanceof pu||p instanceof Zl)return!1;var O=p instanceof Oo||p instanceof Nl,W=!0;return p.eachChild(function(pt){O?W=W&&Ou(pt):W=W&&pt instanceof Fo}),W?jc(p)&&Kl(p,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Rl(p,O){for(var W=p.length-1,pt=0,At=W,Ot=0,Wt,_e;pt<=At;)if(Ot=Math.floor((pt+At)/2),Wt=p[Ot],_e=p[Ot+1],Wt<=O){if(Ot===W||O<_e)return Ot;pt=Ot+1}else if(Wt>O)At=Ot-1;else throw new bs("Input is not a number.");return 0}var Yl=function(p,O,W){this.type=p,this.input=O,this.labels=[],this.outputs=[];for(var pt=0,At=W;pt<At.length;pt+=1){var Ot=At[pt],Wt=Ot[0],_e=Ot[1];this.labels.push(Wt),this.outputs.push(_e)}};Yl.parse=function(p,O){if(p.length-1<4)return O.error("Expected at least 4 arguments, but found only "+(p.length-1)+".");if((p.length-1)%2!==0)return O.error("Expected an even number of arguments.");var W=O.parse(p[1],1,ii);if(!W)return null;var pt=[],At=null;O.expectedType&&O.expectedType.kind!=="value"&&(At=O.expectedType);for(var Ot=1;Ot<p.length;Ot+=2){var Wt=Ot===1?-1/0:p[Ot],_e=p[Ot+1],De=Ot,Je=Ot+1;if(typeof Wt!="number")return O.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',De);if(pt.length&&pt[pt.length-1][0]>=Wt)return O.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',De);var sr=O.parse(_e,Je,At);if(!sr)return null;At=At||sr.type,pt.push([Wt,sr])}return new Yl(At,W,pt)},Yl.prototype.evaluate=function(p){var O=this.labels,W=this.outputs;if(O.length===1)return W[0].evaluate(p);var pt=this.input.evaluate(p);if(pt<=O[0])return W[0].evaluate(p);var At=O.length;if(pt>=O[At-1])return W[At-1].evaluate(p);var Ot=Rl(O,pt);return W[Ot].evaluate(p)},Yl.prototype.eachChild=function(p){p(this.input);for(var O=0,W=this.outputs;O<W.length;O+=1){var pt=W[O];p(pt)}},Yl.prototype.outputDefined=function(){return this.outputs.every(function(p){return p.outputDefined()})},Yl.prototype.serialize=function(){for(var p=["step",this.input.serialize()],O=0;O<this.labels.length;O++)O>0&&p.push(this.labels[O]),p.push(this.outputs[O].serialize());return p};function Ws(p,O,W){return p*(1-W)+O*W}function ac(p,O,W){return new cs(Ws(p.r,O.r,W),Ws(p.g,O.g,W),Ws(p.b,O.b,W),Ws(p.a,O.a,W))}function Tu(p,O,W){return p.map(function(pt,At){return Ws(pt,O[At],W)})}var Zu=Object.freeze({__proto__:null,number:Ws,color:ac,array:Tu}),bc=.95047,lf=1,Mf=1.08883,ic=4/29,wc=6/29,Fl=3*wc*wc,oc=wc*wc*wc,iu=Math.PI/180,sc=180/Math.PI;function Tc(p){return p>oc?Math.pow(p,1/3):p/Fl+ic}function ku(p){return p>wc?p*p*p:Fl*(p-ic)}function Gs(p){return 255*(p<=.0031308?12.92*p:1.055*Math.pow(p,1/2.4)-.055)}function Du(p){return p/=255,p<=.04045?p/12.92:Math.pow((p+.055)/1.055,2.4)}function Xl(p){var O=Du(p.r),W=Du(p.g),pt=Du(p.b),At=Tc((.4124564*O+.3575761*W+.1804375*pt)/bc),Ot=Tc((.2126729*O+.7151522*W+.072175*pt)/lf),Wt=Tc((.0193339*O+.119192*W+.9503041*pt)/Mf);return{l:116*Ot-16,a:500*(At-Ot),b:200*(Ot-Wt),alpha:p.a}}function Xc(p){var O=(p.l+16)/116,W=isNaN(p.a)?O:O+p.a/500,pt=isNaN(p.b)?O:O-p.b/200;return O=lf*ku(O),W=bc*ku(W),pt=Mf*ku(pt),new cs(Gs(3.2404542*W-1.5371385*O-.4985314*pt),Gs(-.969266*W+1.8760108*O+.041556*pt),Gs(.0556434*W-.2040259*O+1.0572252*pt),p.alpha)}function Vs(p,O,W){return{l:Ws(p.l,O.l,W),a:Ws(p.a,O.a,W),b:Ws(p.b,O.b,W),alpha:Ws(p.alpha,O.alpha,W)}}function vc(p){var O=Xl(p),W=O.l,pt=O.a,At=O.b,Ot=Math.atan2(At,pt)*sc;return{h:Ot<0?Ot+360:Ot,c:Math.sqrt(pt*pt+At*At),l:W,alpha:p.a}}function Ku(p){var O=p.h*iu,W=p.c,pt=p.l;return Xc({l:pt,a:Math.cos(O)*W,b:Math.sin(O)*W,alpha:p.alpha})}function ou(p,O,W){var pt=O-p;return p+W*(pt>180||pt<-180?pt-360*Math.round(pt/360):pt)}function Qu(p,O,W){return{h:ou(p.h,O.h,W),c:Ws(p.c,O.c,W),l:Ws(p.l,O.l,W),alpha:Ws(p.alpha,O.alpha,W)}}var Yu={forward:Xl,reverse:Xc,interpolate:Vs},yc={forward:vc,reverse:Ku,interpolate:Qu},uf=Object.freeze({__proto__:null,lab:Yu,hcl:yc}),zl=function(p,O,W,pt,At){this.type=p,this.operator=O,this.interpolation=W,this.input=pt,this.labels=[],this.outputs=[];for(var Ot=0,Wt=At;Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=_e[0],Je=_e[1];this.labels.push(De),this.outputs.push(Je)}};zl.interpolationFactor=function(p,O,W,pt){var At=0;if(p.name==="exponential")At=Uc(O,p.base,W,pt);else if(p.name==="linear")At=Uc(O,1,W,pt);else if(p.name==="cubic-bezier"){var Ot=p.controlPoints,Wt=new i(Ot[0],Ot[1],Ot[2],Ot[3]);At=Wt.solve(Uc(O,1,W,pt))}return At},zl.parse=function(p,O){var W=p[0],pt=p[1],At=p[2],Ot=p.slice(3);if(!Array.isArray(pt)||pt.length===0)return O.error("Expected an interpolation type expression.",1);if(pt[0]==="linear")pt={name:"linear"};else if(pt[0]==="exponential"){var Wt=pt[1];if(typeof Wt!="number")return O.error("Exponential interpolation requires a numeric base.",1,1);pt={name:"exponential",base:Wt}}else if(pt[0]==="cubic-bezier"){var _e=pt.slice(1);if(_e.length!==4||_e.some(function(ga){return typeof ga!="number"||ga<0||ga>1}))return O.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);pt={name:"cubic-bezier",controlPoints:_e}}else return O.error("Unknown interpolation type "+String(pt[0]),1,0);if(p.length-1<4)return O.error("Expected at least 4 arguments, but found only "+(p.length-1)+".");if((p.length-1)%2!==0)return O.error("Expected an even number of arguments.");if(At=O.parse(At,2,ii),!At)return null;var De=[],Je=null;W==="interpolate-hcl"||W==="interpolate-lab"?Je=Is:O.expectedType&&O.expectedType.kind!=="value"&&(Je=O.expectedType);for(var sr=0;sr<Ot.length;sr+=2){var Ar=Ot[sr],Pr=Ot[sr+1],Vr=sr+3,un=sr+4;if(typeof Ar!="number")return O.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Vr);if(De.length&&De[De.length-1][0]>=Ar)return O.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Vr);var Fn=O.parse(Pr,un,Je);if(!Fn)return null;Je=Je||Fn.type,De.push([Ar,Fn])}return Je.kind!=="number"&&Je.kind!=="color"&&!(Je.kind==="array"&&Je.itemType.kind==="number"&&typeof Je.N=="number")?O.error("Type "+Ls(Je)+" is not interpolatable."):new zl(Je,W,pt,At,De)},zl.prototype.evaluate=function(p){var O=this.labels,W=this.outputs;if(O.length===1)return W[0].evaluate(p);var pt=this.input.evaluate(p);if(pt<=O[0])return W[0].evaluate(p);var At=O.length;if(pt>=O[At-1])return W[At-1].evaluate(p);var Ot=Rl(O,pt),Wt=O[Ot],_e=O[Ot+1],De=zl.interpolationFactor(this.interpolation,pt,Wt,_e),Je=W[Ot].evaluate(p),sr=W[Ot+1].evaluate(p);return this.operator==="interpolate"?Zu[this.type.kind.toLowerCase()](Je,sr,De):this.operator==="interpolate-hcl"?yc.reverse(yc.interpolate(yc.forward(Je),yc.forward(sr),De)):Yu.reverse(Yu.interpolate(Yu.forward(Je),Yu.forward(sr),De))},zl.prototype.eachChild=function(p){p(this.input);for(var O=0,W=this.outputs;O<W.length;O+=1){var pt=W[O];p(pt)}},zl.prototype.outputDefined=function(){return this.outputs.every(function(p){return p.outputDefined()})},zl.prototype.serialize=function(){var p;this.interpolation.name==="linear"?p=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?p=["linear"]:p=["exponential",this.interpolation.base]:p=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var O=[this.operator,p,this.input.serialize()],W=0;W<this.labels.length;W++)O.push(this.labels[W],this.outputs[W].serialize());return O};function Uc(p,O,W,pt){var At=pt-W,Ot=p-W;return At===0?0:O===1?Ot/At:(Math.pow(O,Ot)-1)/(Math.pow(O,At)-1)}var su=function(p,O){this.type=p,this.args=O};su.parse=function(p,O){if(p.length<2)return O.error("Expectected at least one argument.");var W=null,pt=O.expectedType;pt&&pt.kind!=="value"&&(W=pt);for(var At=[],Ot=0,Wt=p.slice(1);Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=O.parse(_e,1+At.length,W,void 0,{typeAnnotation:"omit"});if(!De)return null;W=W||De.type,At.push(De)}var Je=pt&&At.some(function(sr){return bu(pt,sr.type)});return Je?new su(Bi,At):new su(W,At)},su.prototype.evaluate=function(p){for(var O=null,W=0,pt,At=0,Ot=this.args;At<Ot.length;At+=1){var Wt=Ot[At];if(W++,O=Wt.evaluate(p),O&&O instanceof xl&&!O.available&&(pt||(pt=O.name),O=null,W===this.args.length&&(O=pt)),O!==null)break}return O},su.prototype.eachChild=function(p){this.args.forEach(p)},su.prototype.outputDefined=function(){return this.args.every(function(p){return p.outputDefined()})},su.prototype.serialize=function(){var p=["coalesce"];return this.eachChild(function(O){p.push(O.serialize())}),p};var Fu=function(p,O){this.type=O.type,this.bindings=[].concat(p),this.result=O};Fu.prototype.evaluate=function(p){return this.result.evaluate(p)},Fu.prototype.eachChild=function(p){for(var O=0,W=this.bindings;O<W.length;O+=1){var pt=W[O];p(pt[1])}p(this.result)},Fu.parse=function(p,O){if(p.length<4)return O.error("Expected at least 3 arguments, but found "+(p.length-1)+" instead.");for(var W=[],pt=1;pt<p.length-1;pt+=2){var At=p[pt];if(typeof At!="string")return O.error("Expected string, but found "+typeof At+" instead.",pt);if(/[^a-zA-Z0-9_]/.test(At))return O.error("Variable names must contain only alphanumeric characters or '_'.",pt);var Ot=O.parse(p[pt+1],pt+1);if(!Ot)return null;W.push([At,Ot])}var Wt=O.parse(p[p.length-1],p.length-1,O.expectedType,W);return Wt?new Fu(W,Wt):null},Fu.prototype.outputDefined=function(){return this.result.outputDefined()},Fu.prototype.serialize=function(){for(var p=["let"],O=0,W=this.bindings;O<W.length;O+=1){var pt=W[O],At=pt[0],Ot=pt[1];p.push(At,Ot.serialize())}return p.push(this.result.serialize()),p};var Au=function(p,O,W){this.type=p,this.index=O,this.input=W};Au.parse=function(p,O){if(p.length!==3)return O.error("Expected 2 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,ii),pt=O.parse(p[2],2,Ss(O.expectedType||Bi));if(!W||!pt)return null;var At=pt.type;return new Au(At.itemType,W,pt)},Au.prototype.evaluate=function(p){var O=this.index.evaluate(p),W=this.input.evaluate(p);if(O<0)throw new bs("Array index out of bounds: "+O+" < 0.");if(O>=W.length)throw new bs("Array index out of bounds: "+O+" > "+(W.length-1)+".");if(O!==Math.floor(O))throw new bs("Array index must be an integer, but found "+O+" instead.");return W[O]},Au.prototype.eachChild=function(p){p(this.index),p(this.input)},Au.prototype.outputDefined=function(){return!1},Au.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var il=function(p,O){this.type=co,this.needle=p,this.haystack=O};il.parse=function(p,O){if(p.length!==3)return O.error("Expected 2 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,Bi),pt=O.parse(p[2],2,Bi);return!W||!pt?null:au(W.type,[co,io,ii,al,Bi])?new il(W,pt):O.error("Expected first argument to be of type boolean, string, number or null, but found "+Ls(W.type)+" instead")},il.prototype.evaluate=function(p){var O=this.needle.evaluate(p),W=this.haystack.evaluate(p);if(!W)return!1;if(!fu(O,["boolean","string","number","null"]))throw new bs("Expected first argument to be of type boolean, string, number or null, but found "+Ls(Fs(O))+" instead.");if(!fu(W,["string","array"]))throw new bs("Expected second argument to be of type array or string, but found "+Ls(Fs(W))+" instead.");return W.indexOf(O)>=0},il.prototype.eachChild=function(p){p(this.needle),p(this.haystack)},il.prototype.outputDefined=function(){return!0},il.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Cs=function(p,O,W){this.type=ii,this.needle=p,this.haystack=O,this.fromIndex=W};Cs.parse=function(p,O){if(p.length<=2||p.length>=5)return O.error("Expected 3 or 4 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,Bi),pt=O.parse(p[2],2,Bi);if(!W||!pt)return null;if(!au(W.type,[co,io,ii,al,Bi]))return O.error("Expected first argument to be of type boolean, string, number or null, but found "+Ls(W.type)+" instead");if(p.length===4){var At=O.parse(p[3],3,ii);return At?new Cs(W,pt,At):null}else return new Cs(W,pt)},Cs.prototype.evaluate=function(p){var O=this.needle.evaluate(p),W=this.haystack.evaluate(p);if(!fu(O,["boolean","string","number","null"]))throw new bs("Expected first argument to be of type boolean, string, number or null, but found "+Ls(Fs(O))+" instead.");if(!fu(W,["string","array"]))throw new bs("Expected second argument to be of type array or string, but found "+Ls(Fs(W))+" instead.");if(this.fromIndex){var pt=this.fromIndex.evaluate(p);return W.indexOf(O,pt)}return W.indexOf(O)},Cs.prototype.eachChild=function(p){p(this.needle),p(this.haystack),this.fromIndex&&p(this.fromIndex)},Cs.prototype.outputDefined=function(){return!1},Cs.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var p=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),p]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Mu=function(p,O,W,pt,At,Ot){this.inputType=p,this.type=O,this.input=W,this.cases=pt,this.outputs=At,this.otherwise=Ot};Mu.parse=function(p,O){if(p.length<5)return O.error("Expected at least 4 arguments, but found only "+(p.length-1)+".");if(p.length%2!==1)return O.error("Expected an even number of arguments.");var W,pt;O.expectedType&&O.expectedType.kind!=="value"&&(pt=O.expectedType);for(var At={},Ot=[],Wt=2;Wt<p.length-1;Wt+=2){var _e=p[Wt],De=p[Wt+1];Array.isArray(_e)||(_e=[_e]);var Je=O.concat(Wt);if(_e.length===0)return Je.error("Expected at least one branch label.");for(var sr=0,Ar=_e;sr<Ar.length;sr+=1){var Pr=Ar[sr];if(typeof Pr!="number"&&typeof Pr!="string")return Je.error("Branch labels must be numbers or strings.");if(typeof Pr=="number"&&Math.abs(Pr)>Number.MAX_SAFE_INTEGER)return Je.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Pr=="number"&&Math.floor(Pr)!==Pr)return Je.error("Numeric branch labels must be integer values.");if(!W)W=Fs(Pr);else if(Je.checkSubtype(W,Fs(Pr)))return null;if(typeof At[String(Pr)]<"u")return Je.error("Branch labels must be unique.");At[String(Pr)]=Ot.length}var Vr=O.parse(De,Wt,pt);if(!Vr)return null;pt=pt||Vr.type,Ot.push(Vr)}var un=O.parse(p[1],1,Bi);if(!un)return null;var Fn=O.parse(p[p.length-1],p.length-1,pt);return!Fn||un.type.kind!=="value"&&O.concat(1).checkSubtype(W,un.type)?null:new Mu(W,pt,un,At,Ot,Fn)},Mu.prototype.evaluate=function(p){var O=this.input.evaluate(p),W=Fs(O)===this.inputType&&this.outputs[this.cases[O]]||this.otherwise;return W.evaluate(p)},Mu.prototype.eachChild=function(p){p(this.input),this.outputs.forEach(p),p(this.otherwise)},Mu.prototype.outputDefined=function(){return this.outputs.every(function(p){return p.outputDefined()})&&this.otherwise.outputDefined()},Mu.prototype.serialize=function(){for(var p=this,O=["match",this.input.serialize()],W=Object.keys(this.cases).sort(),pt=[],At={},Ot=0,Wt=W;Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=At[this.cases[_e]];De===void 0?(At[this.cases[_e]]=pt.length,pt.push([this.cases[_e],[_e]])):pt[De][1].push(_e)}for(var Je=function(un){return p.inputType.kind==="number"?Number(un):un},sr=0,Ar=pt;sr<Ar.length;sr+=1){var Pr=Ar[sr],De=Pr[0],Vr=Pr[1];Vr.length===1?O.push(Je(Vr[0])):O.push(Vr.map(Je)),O.push(this.outputs[outputIndex$1].serialize())}return O.push(this.otherwise.serialize()),O};var lc=function(p,O,W){this.type=p,this.branches=O,this.otherwise=W};lc.parse=function(p,O){if(p.length<4)return O.error("Expected at least 3 arguments, but found only "+(p.length-1)+".");if(p.length%2!==0)return O.error("Expected an odd number of arguments.");var W;O.expectedType&&O.expectedType.kind!=="value"&&(W=O.expectedType);for(var pt=[],At=1;At<p.length-1;At+=2){var Ot=O.parse(p[At],At,co);if(!Ot)return null;var Wt=O.parse(p[At+1],At+1,W);if(!Wt)return null;pt.push([Ot,Wt]),W=W||Wt.type}var _e=O.parse(p[p.length-1],p.length-1,W);return _e?new lc(W,pt,_e):null},lc.prototype.evaluate=function(p){for(var O=0,W=this.branches;O<W.length;O+=1){var pt=W[O],At=pt[0],Ot=pt[1];if(At.evaluate(p))return Ot.evaluate(p)}return this.otherwise.evaluate(p)},lc.prototype.eachChild=function(p){for(var O=0,W=this.branches;O<W.length;O+=1){var pt=W[O],At=pt[0],Ot=pt[1];p(At),p(Ot)}p(this.otherwise)},lc.prototype.outputDefined=function(){return this.branches.every(function(p){p[0];var O=p[1];return O.outputDefined()})&&this.otherwise.outputDefined()},lc.prototype.serialize=function(){var p=["case"];return this.eachChild(function(O){p.push(O.serialize())}),p};var Su=function(p,O,W,pt){this.type=p,this.input=O,this.beginIndex=W,this.endIndex=pt};Su.parse=function(p,O){if(p.length<=2||p.length>=5)return O.error("Expected 3 or 4 arguments, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1,Bi),pt=O.parse(p[2],2,ii);if(!W||!pt)return null;if(!au(W.type,[Ss(Bi),io,Bi]))return O.error("Expected first argument to be of type array or string, but found "+Ls(W.type)+" instead");if(p.length===4){var At=O.parse(p[3],3,ii);return At?new Su(W.type,W,pt,At):null}else return new Su(W.type,W,pt)},Su.prototype.evaluate=function(p){var O=this.input.evaluate(p),W=this.beginIndex.evaluate(p);if(!fu(O,["string","array"]))throw new bs("Expected first argument to be of type array or string, but found "+Ls(Fs(O))+" instead.");if(this.endIndex){var pt=this.endIndex.evaluate(p);return O.slice(W,pt)}return O.slice(W)},Su.prototype.eachChild=function(p){p(this.input),p(this.beginIndex),this.endIndex&&p(this.endIndex)},Su.prototype.outputDefined=function(){return!1},Su.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var p=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),p]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Oc(p,O){return p==="=="||p==="!="?O.kind==="boolean"||O.kind==="string"||O.kind==="number"||O.kind==="null"||O.kind==="value":O.kind==="string"||O.kind==="number"||O.kind==="value"}function Xe(p,O,W){return O===W}function yr(p,O,W){return O!==W}function Kr(p,O,W){return O<W}function Rr(p,O,W){return O>W}function mn(p,O,W){return O<=W}function Pn(p,O,W){return O>=W}function ha(p,O,W,pt){return pt.compare(O,W)===0}function Ta(p,O,W,pt){return!ha(p,O,W,pt)}function Ua(p,O,W,pt){return pt.compare(O,W)<0}function Ya(p,O,W,pt){return pt.compare(O,W)>0}function va(p,O,W,pt){return pt.compare(O,W)<=0}function Ba(p,O,W,pt){return pt.compare(O,W)>=0}function za(p,O,W){var pt=p!=="=="&&p!=="!=";return function(){function At(Ot,Wt,_e){this.type=co,this.lhs=Ot,this.rhs=Wt,this.collator=_e,this.hasUntypedArgument=Ot.type.kind==="value"||Wt.type.kind==="value"}return At.parse=function(Ot,Wt){if(Ot.length!==3&&Ot.length!==4)return Wt.error("Expected two or three arguments.");var _e=Ot[0],De=Wt.parse(Ot[1],1,Bi);if(!De)return null;if(!Oc(_e,De.type))return Wt.concat(1).error('"'+_e+`" comparisons are not supported for type '`+Ls(De.type)+"'.");var Je=Wt.parse(Ot[2],2,Bi);if(!Je)return null;if(!Oc(_e,Je.type))return Wt.concat(2).error('"'+_e+`" comparisons are not supported for type '`+Ls(Je.type)+"'.");if(De.type.kind!==Je.type.kind&&De.type.kind!=="value"&&Je.type.kind!=="value")return Wt.error("Cannot compare types '"+Ls(De.type)+"' and '"+Ls(Je.type)+"'.");pt&&(De.type.kind==="value"&&Je.type.kind!=="value"?De=new Nl(Je.type,[De]):De.type.kind!=="value"&&Je.type.kind==="value"&&(Je=new Nl(De.type,[Je])));var sr=null;if(Ot.length===4){if(De.type.kind!=="string"&&Je.type.kind!=="string"&&De.type.kind!=="value"&&Je.type.kind!=="value")return Wt.error("Cannot use collator to compare non-string types.");if(sr=Wt.parse(Ot[3],3,fl),!sr)return null}return new At(De,Je,sr)},At.prototype.evaluate=function(Ot){var Wt=this.lhs.evaluate(Ot),_e=this.rhs.evaluate(Ot);if(pt&&this.hasUntypedArgument){var De=Fs(Wt),Je=Fs(_e);if(De.kind!==Je.kind||!(De.kind==="string"||De.kind==="number"))throw new bs('Expected arguments for "'+p+'" to be (string, string) or (number, number), but found ('+De.kind+", "+Je.kind+") instead.")}if(this.collator&&!pt&&this.hasUntypedArgument){var sr=Fs(Wt),Ar=Fs(_e);if(sr.kind!=="string"||Ar.kind!=="string")return O(Ot,Wt,_e)}return this.collator?W(Ot,Wt,_e,this.collator.evaluate(Ot)):O(Ot,Wt,_e)},At.prototype.eachChild=function(Ot){Ot(this.lhs),Ot(this.rhs),this.collator&&Ot(this.collator)},At.prototype.outputDefined=function(){return!0},At.prototype.serialize=function(){var Ot=[p];return this.eachChild(function(Wt){Ot.push(Wt.serialize())}),Ot},At}()}var ca=za("==",Xe,ha),ei=za("!=",yr,Ta),Vi=za("<",Kr,Ua),Oi=za(">",Rr,Ya),Wi=za("<=",mn,va),Xi=za(">=",Pn,Ba),ni=function(p,O,W,pt,At){this.type=io,this.number=p,this.locale=O,this.currency=W,this.minFractionDigits=pt,this.maxFractionDigits=At};ni.parse=function(p,O){if(p.length!==3)return O.error("Expected two arguments.");var W=O.parse(p[1],1,ii);if(!W)return null;var pt=p[2];if(typeof pt!="object"||Array.isArray(pt))return O.error("NumberFormat options argument must be an object.");var At=null;if(pt.locale&&(At=O.parse(pt.locale,1,io),!At))return null;var Ot=null;if(pt.currency&&(Ot=O.parse(pt.currency,1,io),!Ot))return null;var Wt=null;if(pt["min-fraction-digits"]&&(Wt=O.parse(pt["min-fraction-digits"],1,ii),!Wt))return null;var _e=null;return pt["max-fraction-digits"]&&(_e=O.parse(pt["max-fraction-digits"],1,ii),!_e)?null:new ni(W,At,Ot,Wt,_e)},ni.prototype.evaluate=function(p){return new Intl.NumberFormat(this.locale?this.locale.evaluate(p):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(p):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(p):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(p):void 0}).format(this.number.evaluate(p))},ni.prototype.eachChild=function(p){p(this.number),this.locale&&p(this.locale),this.currency&&p(this.currency),this.minFractionDigits&&p(this.minFractionDigits),this.maxFractionDigits&&p(this.maxFractionDigits)},ni.prototype.outputDefined=function(){return!1},ni.prototype.serialize=function(){var p={};return this.locale&&(p.locale=this.locale.serialize()),this.currency&&(p.currency=this.currency.serialize()),this.minFractionDigits&&(p["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(p["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),p]};var Za=function(p){this.type=ii,this.input=p};Za.parse=function(p,O){if(p.length!==2)return O.error("Expected 1 argument, but found "+(p.length-1)+" instead.");var W=O.parse(p[1],1);return W?W.type.kind!=="array"&&W.type.kind!=="string"&&W.type.kind!=="value"?O.error("Expected argument of type string or array, but found "+Ls(W.type)+" instead."):new Za(W):null},Za.prototype.evaluate=function(p){var O=this.input.evaluate(p);if(typeof O=="string"||Array.isArray(O))return O.length;throw new bs("Expected value to be of type string or array, but found "+Ls(Fs(O))+" instead.")},Za.prototype.eachChild=function(p){p(this.input)},Za.prototype.outputDefined=function(){return!1},Za.prototype.serialize=function(){var p=["length"];return this.eachChild(function(O){p.push(O.serialize())}),p};var $i={"==":ca,"!=":ei,">":Oi,"<":Vi,">=":Xi,"<=":Wi,array:Nl,at:Au,boolean:Nl,case:lc,coalesce:su,collator:pu,format:Hu,image:qs,in:il,"index-of":Cs,interpolate:zl,"interpolate-hcl":zl,"interpolate-lab":zl,length:Za,let:Fu,literal:Fo,match:Mu,number:Nl,"number-format":ni,object:Nl,slice:Su,step:Yl,string:Nl,"to-boolean":Oo,"to-color":Oo,"to-number":Oo,"to-string":Oo,var:Gu,within:Zl};function Do(p,O){var W=O[0],pt=O[1],At=O[2],Ot=O[3];W=W.evaluate(p),pt=pt.evaluate(p),At=At.evaluate(p);var Wt=Ot?Ot.evaluate(p):1,_e=Ml(W,pt,At,Wt);if(_e)throw new bs(_e);return new cs(W/255*Wt,pt/255*Wt,At/255*Wt,Wt)}function ss(p,O){return p in O}function Ps(p,O){var W=O[p];return typeof W>"u"?null:W}function ys(p,O,W,pt){for(;W<=pt;){var At=W+pt>>1;if(O[At]===p)return!0;O[At]>p?pt=At-1:W=At+1}return!1}function Os(p){return{type:p}}Fi.register($i,{error:[$s,[io],function(p,O){var W=O[0];throw new bs(W.evaluate(p))}],typeof:[io,[Bi],function(p,O){var W=O[0];return Ls(Fs(W.evaluate(p)))}],"to-rgba":[Ss(ii,4),[Is],function(p,O){var W=O[0];return W.evaluate(p).toArray()}],rgb:[Is,[ii,ii,ii],Do],rgba:[Is,[ii,ii,ii,ii],Do],has:{type:co,overloads:[[[io],function(p,O){var W=O[0];return ss(W.evaluate(p),p.properties())}],[[io,Wo],function(p,O){var W=O[0],pt=O[1];return ss(W.evaluate(p),pt.evaluate(p))}]]},get:{type:Bi,overloads:[[[io],function(p,O){var W=O[0];return Ps(W.evaluate(p),p.properties())}],[[io,Wo],function(p,O){var W=O[0],pt=O[1];return Ps(W.evaluate(p),pt.evaluate(p))}]]},"feature-state":[Bi,[io],function(p,O){var W=O[0];return Ps(W.evaluate(p),p.featureState||{})}],properties:[Wo,[],function(p){return p.properties()}],"geometry-type":[io,[],function(p){return p.geometryType()}],id:[Bi,[],function(p){return p.id()}],zoom:[ii,[],function(p){return p.globals.zoom}],"heatmap-density":[ii,[],function(p){return p.globals.heatmapDensity||0}],"line-progress":[ii,[],function(p){return p.globals.lineProgress||0}],accumulated:[Bi,[],function(p){return p.globals.accumulated===void 0?null:p.globals.accumulated}],"+":[ii,Os(ii),function(p,O){for(var W=0,pt=0,At=O;pt<At.length;pt+=1){var Ot=At[pt];W+=Ot.evaluate(p)}return W}],"*":[ii,Os(ii),function(p,O){for(var W=1,pt=0,At=O;pt<At.length;pt+=1){var Ot=At[pt];W*=Ot.evaluate(p)}return W}],"-":{type:ii,overloads:[[[ii,ii],function(p,O){var W=O[0],pt=O[1];return W.evaluate(p)-pt.evaluate(p)}],[[ii],function(p,O){var W=O[0];return-W.evaluate(p)}]]},"/":[ii,[ii,ii],function(p,O){var W=O[0],pt=O[1];return W.evaluate(p)/pt.evaluate(p)}],"%":[ii,[ii,ii],function(p,O){var W=O[0],pt=O[1];return W.evaluate(p)%pt.evaluate(p)}],ln2:[ii,[],function(){return Math.LN2}],pi:[ii,[],function(){return Math.PI}],e:[ii,[],function(){return Math.E}],"^":[ii,[ii,ii],function(p,O){var W=O[0],pt=O[1];return Math.pow(W.evaluate(p),pt.evaluate(p))}],sqrt:[ii,[ii],function(p,O){var W=O[0];return Math.sqrt(W.evaluate(p))}],log10:[ii,[ii],function(p,O){var W=O[0];return Math.log(W.evaluate(p))/Math.LN10}],ln:[ii,[ii],function(p,O){var W=O[0];return Math.log(W.evaluate(p))}],log2:[ii,[ii],function(p,O){var W=O[0];return Math.log(W.evaluate(p))/Math.LN2}],sin:[ii,[ii],function(p,O){var W=O[0];return Math.sin(W.evaluate(p))}],cos:[ii,[ii],function(p,O){var W=O[0];return Math.cos(W.evaluate(p))}],tan:[ii,[ii],function(p,O){var W=O[0];return Math.tan(W.evaluate(p))}],asin:[ii,[ii],function(p,O){var W=O[0];return Math.asin(W.evaluate(p))}],acos:[ii,[ii],function(p,O){var W=O[0];return Math.acos(W.evaluate(p))}],atan:[ii,[ii],function(p,O){var W=O[0];return Math.atan(W.evaluate(p))}],min:[ii,Os(ii),function(p,O){return Math.min.apply(Math,O.map(function(W){return W.evaluate(p)}))}],max:[ii,Os(ii),function(p,O){return Math.max.apply(Math,O.map(function(W){return W.evaluate(p)}))}],abs:[ii,[ii],function(p,O){var W=O[0];return Math.abs(W.evaluate(p))}],round:[ii,[ii],function(p,O){var W=O[0],pt=W.evaluate(p);return pt<0?-Math.round(-pt):Math.round(pt)}],floor:[ii,[ii],function(p,O){var W=O[0];return Math.floor(W.evaluate(p))}],ceil:[ii,[ii],function(p,O){var W=O[0];return Math.ceil(W.evaluate(p))}],"filter-==":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1];return p.properties()[W.value]===pt.value}],"filter-id-==":[co,[Bi],function(p,O){var W=O[0];return p.id()===W.value}],"filter-type-==":[co,[io],function(p,O){var W=O[0];return p.geometryType()===W.value}],"filter-<":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At<Ot}],"filter-id-<":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt<At}],"filter->":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At>Ot}],"filter-id->":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt>At}],"filter-<=":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At<=Ot}],"filter-id-<=":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt<=At}],"filter->=":[co,[io,Bi],function(p,O){var W=O[0],pt=O[1],At=p.properties()[W.value],Ot=pt.value;return typeof At==typeof Ot&&At>=Ot}],"filter-id->=":[co,[Bi],function(p,O){var W=O[0],pt=p.id(),At=W.value;return typeof pt==typeof At&&pt>=At}],"filter-has":[co,[Bi],function(p,O){var W=O[0];return W.value in p.properties()}],"filter-has-id":[co,[],function(p){return p.id()!==null&&p.id()!==void 0}],"filter-type-in":[co,[Ss(io)],function(p,O){var W=O[0];return W.value.indexOf(p.geometryType())>=0}],"filter-id-in":[co,[Ss(Bi)],function(p,O){var W=O[0];return W.value.indexOf(p.id())>=0}],"filter-in-small":[co,[io,Ss(Bi)],function(p,O){var W=O[0],pt=O[1];return pt.value.indexOf(p.properties()[W.value])>=0}],"filter-in-large":[co,[io,Ss(Bi)],function(p,O){var W=O[0],pt=O[1];return ys(p.properties()[W.value],pt.value,0,pt.value.length-1)}],all:{type:co,overloads:[[[co,co],function(p,O){var W=O[0],pt=O[1];return W.evaluate(p)&&pt.evaluate(p)}],[Os(co),function(p,O){for(var W=0,pt=O;W<pt.length;W+=1){var At=pt[W];if(!At.evaluate(p))return!1}return!0}]]},any:{type:co,overloads:[[[co,co],function(p,O){var W=O[0],pt=O[1];return W.evaluate(p)||pt.evaluate(p)}],[Os(co),function(p,O){for(var W=0,pt=O;W<pt.length;W+=1){var At=pt[W];if(At.evaluate(p))return!0}return!1}]]},"!":[co,[co],function(p,O){var W=O[0];return!W.evaluate(p)}],"is-supported-script":[co,[io],function(p,O){var W=O[0],pt=p.globals&&p.globals.isSupportedScript;return pt?pt(W.evaluate(p)):!0}],upcase:[io,[io],function(p,O){var W=O[0];return W.evaluate(p).toUpperCase()}],downcase:[io,[io],function(p,O){var W=O[0];return W.evaluate(p).toLowerCase()}],concat:[io,Os(Bi),function(p,O){return O.map(function(W){return _l(W.evaluate(p))}).join("")}],"resolved-locale":[io,[fl],function(p,O){var W=O[0];return W.evaluate(p).resolvedLocale()}]});function Yo(p){return{result:"success",value:p}}function ll(p){return{result:"error",value:p}}function el(p){return p["property-type"]==="data-driven"||p["property-type"]==="cross-faded-data-driven"}function Rs(p){return!!p.expression&&p.expression.parameters.indexOf("zoom")>-1}function bi(p){return!!p.expression&&p.expression.interpolated}function so(p){return p instanceof Number?"number":p instanceof String?"string":p instanceof Boolean?"boolean":Array.isArray(p)?"array":p===null?"null":typeof p}function ws(p){return typeof p=="object"&&p!==null&&!Array.isArray(p)}function fs(p){return p}function Ll(p,O){var W=O.type==="color",pt=p.stops&&typeof p.stops[0][0]=="object",At=pt||p.property!==void 0,Ot=pt||!At,Wt=p.type||(bi(O)?"exponential":"interval");if(W&&(p=Ms({},p),p.stops&&(p.stops=p.stops.map(function(Ei){return[Ei[0],cs.parse(Ei[1])]})),p.default?p.default=cs.parse(p.default):p.default=cs.parse(O.default)),p.colorSpace&&p.colorSpace!=="rgb"&&!uf[p.colorSpace])throw new Error("Unknown color space: "+p.colorSpace);var _e,De,Je;if(Wt==="exponential")_e=Jl;else if(Wt==="interval")_e=Bu;else if(Wt==="categorical"){_e=jl,De=Object.create(null);for(var sr=0,Ar=p.stops;sr<Ar.length;sr+=1){var Pr=Ar[sr];De[Pr[0]]=Pr[1]}Je=typeof p.stops[0][0]}else if(Wt==="identity")_e=Ru;else throw new Error('Unknown function type "'+Wt+'"');if(pt){for(var Vr={},un=[],Fn=0;Fn<p.stops.length;Fn++){var ga=p.stops[Fn],pa=ga[0].zoom;Vr[pa]===void 0&&(Vr[pa]={zoom:pa,type:p.type,property:p.property,default:p.default,stops:[]},un.push(pa)),Vr[pa].stops.push([ga[0].value,ga[1]])}for(var Ea=[],ja=0,Aa=un;ja<Aa.length;ja+=1){var $a=Aa[ja];Ea.push([Vr[$a].zoom,Ll(Vr[$a],O)])}var hi={name:"linear"};return{kind:"composite",interpolationType:hi,interpolationFactor:zl.interpolationFactor.bind(void 0,hi),zoomStops:Ea.map(function(Ei){return Ei[0]}),evaluate:function(Ei,ro){var no=Ei.zoom;return Jl({stops:Ea,base:p.base},O,no).evaluate(no,ro)}}}else if(Ot){var Si=Wt==="exponential"?{name:"exponential",base:p.base!==void 0?p.base:1}:null;return{kind:"camera",interpolationType:Si,interpolationFactor:zl.interpolationFactor.bind(void 0,Si),zoomStops:p.stops.map(function(Ei){return Ei[0]}),evaluate:function(Ei){var ro=Ei.zoom;return _e(p,O,ro,De,Je)}}}else return{kind:"source",evaluate:function(Ei,ro){var no=ro&&ro.properties?ro.properties[p.property]:void 0;return no===void 0?$l(p.default,O.default):_e(p,O,no,De,Je)}}}function $l(p,O,W){if(p!==void 0)return p;if(O!==void 0)return O;if(W!==void 0)return W}function jl(p,O,W,pt,At){var Ot=typeof W===At?pt[W]:void 0;return $l(Ot,p.default,O.default)}function Bu(p,O,W){if(so(W)!=="number")return $l(p.default,O.default);var pt=p.stops.length;if(pt===1||W<=p.stops[0][0])return p.stops[0][1];if(W>=p.stops[pt-1][0])return p.stops[pt-1][1];var At=Rl(p.stops.map(function(Ot){return Ot[0]}),W);return p.stops[At][1]}function Jl(p,O,W){var pt=p.base!==void 0?p.base:1;if(so(W)!=="number")return $l(p.default,O.default);var At=p.stops.length;if(At===1||W<=p.stops[0][0])return p.stops[0][1];if(W>=p.stops[At-1][0])return p.stops[At-1][1];var Ot=Rl(p.stops.map(function(Ar){return Ar[0]}),W),Wt=nl(W,pt,p.stops[Ot][0],p.stops[Ot+1][0]),_e=p.stops[Ot][1],De=p.stops[Ot+1][1],Je=Zu[O.type]||fs;if(p.colorSpace&&p.colorSpace!=="rgb"){var sr=uf[p.colorSpace];Je=function(Ar,Pr){return sr.reverse(sr.interpolate(sr.forward(Ar),sr.forward(Pr),Wt))}}return typeof _e.evaluate=="function"?{evaluate:function(){for(var Ar=[],Pr=arguments.length;Pr--;)Ar[Pr]=arguments[Pr];var Vr=_e.evaluate.apply(void 0,Ar),un=De.evaluate.apply(void 0,Ar);if(!(Vr===void 0||un===void 0))return Je(Vr,un,Wt)}}:Je(_e,De,Wt)}function Ru(p,O,W){return O.type==="color"?W=cs.parse(W):O.type==="formatted"?W=Al.fromString(W.toString()):O.type==="resolvedImage"?W=xl.fromString(W.toString()):so(W)!==O.type&&(O.type!=="enum"||!O.values[W])&&(W=void 0),$l(W,p.default,O.default)}function nl(p,O,W,pt){var At=pt-W,Ot=p-W;return At===0?0:O===1?Ot/At:(Math.pow(O,Ot)-1)/(Math.pow(O,At)-1)}var Nu=function(p,O){this.expression=p,this._warningHistory={},this._evaluator=new os,this._defaultValue=O?kt(O):null,this._enumValues=O&&O.type==="enum"?O.values:null};Nu.prototype.evaluateWithoutErrorHandling=function(p,O,W,pt,At,Ot){return this._evaluator.globals=p,this._evaluator.feature=O,this._evaluator.featureState=W,this._evaluator.canonical=pt,this._evaluator.availableImages=At||null,this._evaluator.formattedSection=Ot,this.expression.evaluate(this._evaluator)},Nu.prototype.evaluate=function(p,O,W,pt,At,Ot){this._evaluator.globals=p,this._evaluator.feature=O||null,this._evaluator.featureState=W||null,this._evaluator.canonical=pt,this._evaluator.availableImages=At||null,this._evaluator.formattedSection=Ot||null;try{var Wt=this.expression.evaluate(this._evaluator);if(Wt==null||typeof Wt=="number"&&Wt!==Wt)return this._defaultValue;if(this._enumValues&&!(Wt in this._enumValues))throw new bs("Expected value to be one of "+Object.keys(this._enumValues).map(function(_e){return JSON.stringify(_e)}).join(", ")+", but found "+JSON.stringify(Wt)+" instead.");return Wt}catch(_e){return this._warningHistory[_e.message]||(this._warningHistory[_e.message]=!0,typeof console<"u"&&console.warn(_e.message)),this._defaultValue}};function Ui(p){return Array.isArray(p)&&p.length>0&&typeof p[0]=="string"&&p[0]in $i}function fo(p,O){var W=new Bs($i,[],O?xt(O):void 0),pt=W.parse(p,void 0,void 0,void 0,O&&O.type==="string"?{typeAnnotation:"coerce"}:void 0);return pt?Yo(new Nu(pt,O)):ll(W.errors)}var Ql=function(p,O){this.kind=p,this._styleExpression=O,this.isStateDependent=p!=="constant"&&!rl(O.expression)};Ql.prototype.evaluateWithoutErrorHandling=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluateWithoutErrorHandling(p,O,W,pt,At,Ot)},Ql.prototype.evaluate=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluate(p,O,W,pt,At,Ot)};var ul=function(p,O,W,pt){this.kind=p,this.zoomStops=W,this._styleExpression=O,this.isStateDependent=p!=="camera"&&!rl(O.expression),this.interpolationType=pt};ul.prototype.evaluateWithoutErrorHandling=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluateWithoutErrorHandling(p,O,W,pt,At,Ot)},ul.prototype.evaluate=function(p,O,W,pt,At,Ot){return this._styleExpression.evaluate(p,O,W,pt,At,Ot)},ul.prototype.interpolationFactor=function(p,O,W){return this.interpolationType?zl.interpolationFactor(this.interpolationType,p,O,W):0};function Dc(p,O){if(p=fo(p,O),p.result==="error")return p;var W=p.value.expression,pt=jc(W);if(!pt&&!el(O))return ll([new No("","data expressions not supported")]);var At=Kl(W,["zoom"]);if(!At&&!Rs(O))return ll([new No("","zoom expressions not supported")]);var Ot=at(W);if(!Ot&&!At)return ll([new No("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ot instanceof No)return ll([Ot]);if(Ot instanceof zl&&!bi(O))return ll([new No("",'"interpolate" expressions cannot be used with this property')]);if(!Ot)return Yo(pt?new Ql("constant",p.value):new Ql("source",p.value));var Wt=Ot instanceof zl?Ot.interpolation:void 0;return Yo(pt?new ul("camera",p.value,Ot.labels,Wt):new ul("composite",p.value,Ot.labels,Wt))}var Pt=function(p,O){this._parameters=p,this._specification=O,Ms(this,Ll(this._parameters,this._specification))};Pt.deserialize=function(p){return new Pt(p._parameters,p._specification)},Pt.serialize=function(p){return{_parameters:p._parameters,_specification:p._specification}};function z(p,O){if(ws(p))return new Pt(p,O);if(Ui(p)){var W=Dc(p,O);if(W.result==="error")throw new Error(W.value.map(function(At){return At.key+": "+At.message}).join(", "));return W.value}else{var pt=p;return typeof p=="string"&&O.type==="color"&&(pt=cs.parse(p)),{kind:"constant",evaluate:function(){return pt}}}}function at(p){var O=null;if(p instanceof Fu)O=at(p.result);else if(p instanceof su)for(var W=0,pt=p.args;W<pt.length;W+=1){var At=pt[W];if(O=at(At),O)break}else(p instanceof Yl||p instanceof zl)&&p.input instanceof Fi&&p.input.name==="zoom"&&(O=p);return O instanceof No||p.eachChild(function(Ot){var Wt=at(Ot);Wt instanceof No?O=Wt:!O&&Wt?O=new No("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):O&&Wt&&O!==Wt&&(O=new No("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),O}function xt(p){var O={color:Is,string:io,number:ii,enum:io,boolean:co,formatted:Jo,resolvedImage:us};return p.type==="array"?Ss(O[p.value]||Bi,p.length):O[p.type]}function kt(p){return p.type==="color"&&ws(p.default)?new cs(0,0,0,0):p.type==="color"?cs.parse(p.default)||null:p.default===void 0?null:p.default}function Lt(p){var O=p.key,W=p.value,pt=p.valueSpec||{},At=p.objectElementValidators||{},Ot=p.style,Wt=p.styleSpec,_e=[],De=so(W);if(De!=="object")return[new li(O,W,"object expected, "+De+" found")];for(var Je in W){var sr=Je.split(".")[0],Ar=pt[sr]||pt["*"],Pr=void 0;if(At[sr])Pr=At[sr];else if(pt[sr])Pr=Xo;else if(At["*"])Pr=At["*"];else if(pt["*"])Pr=Xo;else{_e.push(new li(O,W[Je],'unknown property "'+Je+'"'));continue}_e=_e.concat(Pr({key:(O&&O+".")+Je,value:W[Je],valueSpec:Ar,style:Ot,styleSpec:Wt,object:W,objectKey:Je},W))}for(var Vr in pt)At[Vr]||pt[Vr].required&&pt[Vr].default===void 0&&W[Vr]===void 0&&_e.push(new li(O,W,'missing required property "'+Vr+'"'));return _e}function le(p){var O=p.value,W=p.valueSpec,pt=p.style,At=p.styleSpec,Ot=p.key,Wt=p.arrayElementValidator||Xo;if(so(O)!=="array")return[new li(Ot,O,"array expected, "+so(O)+" found")];if(W.length&&O.length!==W.length)return[new li(Ot,O,"array length "+W.length+" expected, length "+O.length+" found")];if(W["min-length"]&&O.length<W["min-length"])return[new li(Ot,O,"array length at least "+W["min-length"]+" expected, length "+O.length+" found")];var _e={type:W.value,values:W.values};At.$version<7&&(_e.function=W.function),so(W.value)==="object"&&(_e=W.value);for(var De=[],Je=0;Je<O.length;Je++)De=De.concat(Wt({array:O,arrayIndex:Je,value:O[Je],valueSpec:_e,style:pt,styleSpec:At,key:Ot+"["+Je+"]"}));return De}function xe(p){var O=p.key,W=p.value,pt=p.valueSpec,At=so(W);return At==="number"&&W!==W&&(At="NaN"),At!=="number"?[new li(O,W,"number expected, "+At+" found")]:"minimum"in pt&&W<pt.minimum?[new li(O,W,W+" is less than the minimum value "+pt.minimum)]:"maximum"in pt&&W>pt.maximum?[new li(O,W,W+" is greater than the maximum value "+pt.maximum)]:[]}function Pe(p){var O=p.valueSpec,W=Di(p.value.type),pt,At={},Ot,Wt,_e=W!=="categorical"&&p.value.property===void 0,De=!_e,Je=so(p.value.stops)==="array"&&so(p.value.stops[0])==="array"&&so(p.value.stops[0][0])==="object",sr=Lt({key:p.key,value:p.value,valueSpec:p.styleSpec.function,style:p.style,styleSpec:p.styleSpec,objectElementValidators:{stops:Ar,default:un}});return W==="identity"&&_e&&sr.push(new li(p.key,p.value,'missing required property "property"')),W!=="identity"&&!p.value.stops&&sr.push(new li(p.key,p.value,'missing required property "stops"')),W==="exponential"&&p.valueSpec.expression&&!bi(p.valueSpec)&&sr.push(new li(p.key,p.value,"exponential functions not supported")),p.styleSpec.$version>=8&&(De&&!el(p.valueSpec)?sr.push(new li(p.key,p.value,"property functions not supported")):_e&&!Rs(p.valueSpec)&&sr.push(new li(p.key,p.value,"zoom functions not supported"))),(W==="categorical"||Je)&&p.value.property===void 0&&sr.push(new li(p.key,p.value,'"property" property is required')),sr;function Ar(Fn){if(W==="identity")return[new li(Fn.key,Fn.value,'identity function may not have a "stops" property')];var ga=[],pa=Fn.value;return ga=ga.concat(le({key:Fn.key,value:pa,valueSpec:Fn.valueSpec,style:Fn.style,styleSpec:Fn.styleSpec,arrayElementValidator:Pr})),so(pa)==="array"&&pa.length===0&&ga.push(new li(Fn.key,pa,"array must have at least one stop")),ga}function Pr(Fn){var ga=[],pa=Fn.value,Ea=Fn.key;if(so(pa)!=="array")return[new li(Ea,pa,"array expected, "+so(pa)+" found")];if(pa.length!==2)return[new li(Ea,pa,"array length 2 expected, length "+pa.length+" found")];if(Je){if(so(pa[0])!=="object")return[new li(Ea,pa,"object expected, "+so(pa[0])+" found")];if(pa[0].zoom===void 0)return[new li(Ea,pa,"object stop key must have zoom")];if(pa[0].value===void 0)return[new li(Ea,pa,"object stop key must have value")];if(Wt&&Wt>Di(pa[0].zoom))return[new li(Ea,pa[0].zoom,"stop zoom values must appear in ascending order")];Di(pa[0].zoom)!==Wt&&(Wt=Di(pa[0].zoom),Ot=void 0,At={}),ga=ga.concat(Lt({key:Ea+"[0]",value:pa[0],valueSpec:{zoom:{}},style:Fn.style,styleSpec:Fn.styleSpec,objectElementValidators:{zoom:xe,value:Vr}}))}else ga=ga.concat(Vr({key:Ea+"[0]",value:pa[0],style:Fn.style,styleSpec:Fn.styleSpec},pa));return Ui(_s(pa[1]))?ga.concat([new li(Ea+"[1]",pa[1],"expressions are not allowed in function stops.")]):ga.concat(Xo({key:Ea+"[1]",value:pa[1],valueSpec:O,style:Fn.style,styleSpec:Fn.styleSpec}))}function Vr(Fn,ga){var pa=so(Fn.value),Ea=Di(Fn.value),ja=Fn.value!==null?Fn.value:ga;if(!pt)pt=pa;else if(pa!==pt)return[new li(Fn.key,ja,pa+" stop domain type must match previous stop domain type "+pt)];if(pa!=="number"&&pa!=="string"&&pa!=="boolean")return[new li(Fn.key,ja,"stop domain value must be a number, string, or boolean")];if(pa!=="number"&&W!=="categorical"){var Aa="number expected, "+pa+" found";return el(O)&&W===void 0&&(Aa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new li(Fn.key,ja,Aa)]}return W==="categorical"&&pa==="number"&&(!isFinite(Ea)||Math.floor(Ea)!==Ea)?[new li(Fn.key,ja,"integer expected, found "+Ea)]:W!=="categorical"&&pa==="number"&&Ot!==void 0&&Ea<Ot?[new li(Fn.key,ja,"stop domain values must appear in ascending order")]:(Ot=Ea,W==="categorical"&&Ea in At?[new li(Fn.key,ja,"stop domain values must be unique")]:(At[Ea]=!0,[]))}function un(Fn){return Xo({key:Fn.key,value:Fn.value,valueSpec:O,style:Fn.style,styleSpec:Fn.styleSpec})}}function $e(p){var O=(p.expressionContext==="property"?Dc:fo)(_s(p.value),p.valueSpec);if(O.result==="error")return O.value.map(function(pt){return new li(""+p.key+pt.key,p.value,pt.message)});var W=O.value.expression||O.value._styleExpression.expression;if(p.expressionContext==="property"&&p.propertyKey==="text-font"&&!W.outputDefined())return[new li(p.key,p.value,'Invalid data expression for "'+p.propertyKey+'". Output values must be contained as literals within the expression.')];if(p.expressionContext==="property"&&p.propertyType==="layout"&&!rl(W))return[new li(p.key,p.value,'"feature-state" data expressions are not supported with layout properties.')];if(p.expressionContext==="filter"&&!rl(W))return[new li(p.key,p.value,'"feature-state" data expressions are not supported with filters.')];if(p.expressionContext&&p.expressionContext.indexOf("cluster")===0){if(!Kl(W,["zoom","feature-state"]))return[new li(p.key,p.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(p.expressionContext==="cluster-initial"&&!jc(W))return[new li(p.key,p.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function hr(p){var O=p.value,W=p.key,pt=so(O);return pt!=="boolean"?[new li(W,O,"boolean expected, "+pt+" found")]:[]}function pr(p){var O=p.key,W=p.value,pt=so(W);return pt!=="string"?[new li(O,W,"color expected, "+pt+" found")]:xc(W)===null?[new li(O,W,'color expected, "'+W+'" found')]:[]}function Br(p){var O=p.key,W=p.value,pt=p.valueSpec,At=[];return Array.isArray(pt.values)?pt.values.indexOf(Di(W))===-1&&At.push(new li(O,W,"expected one of ["+pt.values.join(", ")+"], "+JSON.stringify(W)+" found")):Object.keys(pt.values).indexOf(Di(W))===-1&&At.push(new li(O,W,"expected one of ["+Object.keys(pt.values).join(", ")+"], "+JSON.stringify(W)+" found")),At}function Jr(p){if(p===!0||p===!1)return!0;if(!Array.isArray(p)||p.length===0)return!1;switch(p[0]){case"has":return p.length>=2&&p[1]!=="$id"&&p[1]!=="$type";case"in":return p.length>=3&&(typeof p[1]!="string"||Array.isArray(p[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return p.length!==3||Array.isArray(p[1])||Array.isArray(p[2]);case"any":case"all":for(var O=0,W=p.slice(1);O<W.length;O+=1){var pt=W[O];if(!Jr(pt)&&typeof pt!="boolean")return!1}return!0;default:return!0}}var Rt={type:"boolean",default:!1};function Gt(p){if(p==null)return{filter:function(){return!0},needGeometry:!1};Jr(p)||(p=Te(p));var O=fo(p,Rt);if(O.result==="error")throw new Error(O.value.map(function(pt){return pt.key+": "+pt.message}).join(", "));var W=ce(p);return{filter:function(pt,At,Ot){return O.value.evaluate(pt,At,{},Ot)},needGeometry:W}}function ae(p,O){return p<O?-1:p>O?1:0}function ce(p){if(!Array.isArray(p))return!1;if(p[0]==="within")return!0;for(var O=1;O<p.length;O++)if(ce(p[O]))return!0;return!1}function Te(p){if(!p)return!0;var O=p[0];if(p.length<=1)return O!=="any";var W=O==="=="?ye(p[1],p[2],"=="):O==="!="?gr(ye(p[1],p[2],"==")):O==="<"||O===">"||O==="<="||O===">="?ye(p[1],p[2],O):O==="any"?ze(p.slice(1)):O==="all"?["all"].concat(p.slice(1).map(Te)):O==="none"?["all"].concat(p.slice(1).map(Te).map(gr)):O==="in"?rr(p[1],p.slice(2)):O==="!in"?gr(rr(p[1],p.slice(2))):O==="has"?fr(p[1]):O==="!has"?gr(fr(p[1])):O==="within"?p:!0;return W}function ye(p,O,W){switch(p){case"$type":return["filter-type-"+W,O];case"$id":return["filter-id-"+W,O];default:return["filter-"+W,p,O]}}function ze(p){return["any"].concat(p.map(Te))}function rr(p,O){if(O.length===0)return!1;switch(p){case"$type":return["filter-type-in",["literal",O]];case"$id":return["filter-id-in",["literal",O]];default:return O.length>200&&!O.some(function(W){return typeof W!=typeof O[0]})?["filter-in-large",p,["literal",O.sort(ae)]]:["filter-in-small",p,["literal",O]]}}function fr(p){switch(p){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",p]}}function gr(p){return["!",p]}function Lr(p){return Jr(_s(p.value))?$e(Ms({},p,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Hr(p)}function Hr(p){var O=p.value,W=p.key;if(so(O)!=="array")return[new li(W,O,"array expected, "+so(O)+" found")];var pt=p.styleSpec,At,Ot=[];if(O.length<1)return[new li(W,O,"filter array must have at least 1 element")];switch(Ot=Ot.concat(Br({key:W+"[0]",value:O[0],valueSpec:pt.filter_operator,style:p.style,styleSpec:p.styleSpec})),Di(O[0])){case"<":case"<=":case">":case">=":O.length>=2&&Di(O[1])==="$type"&&Ot.push(new li(W,O,'"$type" cannot be use with operator "'+O[0]+'"'));case"==":case"!=":O.length!==3&&Ot.push(new li(W,O,'filter array for operator "'+O[0]+'" must have 3 elements'));case"in":case"!in":O.length>=2&&(At=so(O[1]),At!=="string"&&Ot.push(new li(W+"[1]",O[1],"string expected, "+At+" found")));for(var Wt=2;Wt<O.length;Wt++)At=so(O[Wt]),Di(O[1])==="$type"?Ot=Ot.concat(Br({key:W+"["+Wt+"]",value:O[Wt],valueSpec:pt.geometry_type,style:p.style,styleSpec:p.styleSpec})):At!=="string"&&At!=="number"&&At!=="boolean"&&Ot.push(new li(W+"["+Wt+"]",O[Wt],"string, number, or boolean expected, "+At+" found"));break;case"any":case"all":case"none":for(var _e=1;_e<O.length;_e++)Ot=Ot.concat(Hr({key:W+"["+_e+"]",value:O[_e],style:p.style,styleSpec:p.styleSpec}));break;case"has":case"!has":At=so(O[1]),O.length!==2?Ot.push(new li(W,O,'filter array for "'+O[0]+'" operator must have 2 elements')):At!=="string"&&Ot.push(new li(W+"[1]",O[1],"string expected, "+At+" found"));break;case"within":At=so(O[1]),O.length!==2?Ot.push(new li(W,O,'filter array for "'+O[0]+'" operator must have 2 elements')):At!=="object"&&Ot.push(new li(W+"[1]",O[1],"object expected, "+At+" found"));break}return Ot}function nn(p,O){var W=p.key,pt=p.style,At=p.styleSpec,Ot=p.value,Wt=p.objectKey,_e=At[O+"_"+p.layerType];if(!_e)return[];var De=Wt.match(/^(.*)-transition$/);if(O==="paint"&&De&&_e[De[1]]&&_e[De[1]].transition)return Xo({key:W,value:Ot,valueSpec:At.transition,style:pt,styleSpec:At});var Je=p.valueSpec||_e[Wt];if(!Je)return[new li(W,Ot,'unknown property "'+Wt+'"')];var sr;if(so(Ot)==="string"&&el(Je)&&!Je.tokens&&(sr=/^{([^}]+)}$/.exec(Ot)))return[new li(W,Ot,'"'+Wt+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(sr[1])+" }`.")];var Ar=[];return p.layerType==="symbol"&&(Wt==="text-field"&&pt&&!pt.glyphs&&Ar.push(new li(W,Ot,'use of "text-field" requires a style "glyphs" property')),Wt==="text-font"&&ws(_s(Ot))&&Di(Ot.type)==="identity"&&Ar.push(new li(W,Ot,'"text-font" does not support identity functions'))),Ar.concat(Xo({key:p.key,value:Ot,valueSpec:Je,style:pt,styleSpec:At,expressionContext:"property",propertyType:O,propertyKey:Wt}))}function cn(p){return nn(p,"paint")}function Mn(p){return nn(p,"layout")}function Jn(p){var O=[],W=p.value,pt=p.key,At=p.style,Ot=p.styleSpec;!W.type&&!W.ref&&O.push(new li(pt,W,'either "type" or "ref" is required'));var Wt=Di(W.type),_e=Di(W.ref);if(W.id)for(var De=Di(W.id),Je=0;Je<p.arrayIndex;Je++){var sr=At.layers[Je];Di(sr.id)===De&&O.push(new li(pt,W.id,'duplicate layer id "'+W.id+'", previously used at line '+sr.id.__line__))}if("ref"in W){["type","source","source-layer","filter","layout"].forEach(function(un){un in W&&O.push(new li(pt,W[un],'"'+un+'" is prohibited for ref layers'))});var Ar;At.layers.forEach(function(un){Di(un.id)===_e&&(Ar=un)}),Ar?Ar.ref?O.push(new li(pt,W.ref,"ref cannot reference another ref layer")):Wt=Di(Ar.type):O.push(new li(pt,W.ref,'ref layer "'+_e+'" not found'))}else if(Wt!=="background")if(!W.source)O.push(new li(pt,W,'missing required property "source"'));else{var Pr=At.sources&&At.sources[W.source],Vr=Pr&&Di(Pr.type);Pr?Vr==="vector"&&Wt==="raster"?O.push(new li(pt,W.source,'layer "'+W.id+'" requires a raster source')):Vr==="raster"&&Wt!=="raster"?O.push(new li(pt,W.source,'layer "'+W.id+'" requires a vector source')):Vr==="vector"&&!W["source-layer"]?O.push(new li(pt,W,'layer "'+W.id+'" must specify a "source-layer"')):Vr==="raster-dem"&&Wt!=="hillshade"?O.push(new li(pt,W.source,"raster-dem source can only be used with layer type 'hillshade'.")):Wt==="line"&&W.paint&&W.paint["line-gradient"]&&(Vr!=="geojson"||!Pr.lineMetrics)&&O.push(new li(pt,W,'layer "'+W.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):O.push(new li(pt,W.source,'source "'+W.source+'" not found'))}return O=O.concat(Lt({key:pt,value:W,valueSpec:Ot.layer,style:p.style,styleSpec:p.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Xo({key:pt+".type",value:W.type,valueSpec:Ot.layer.type,style:p.style,styleSpec:p.styleSpec,object:W,objectKey:"type"})},filter:Lr,layout:function(un){return Lt({layer:W,key:un.key,value:un.value,style:un.style,styleSpec:un.styleSpec,objectElementValidators:{"*":function(Fn){return Mn(Ms({layerType:Wt},Fn))}}})},paint:function(un){return Lt({layer:W,key:un.key,value:un.value,style:un.style,styleSpec:un.styleSpec,objectElementValidators:{"*":function(Fn){return cn(Ms({layerType:Wt},Fn))}}})}}})),O}function _a(p){var O=p.value,W=p.key,pt=so(O);return pt!=="string"?[new li(W,O,"string expected, "+pt+" found")]:[]}var xa={promoteId:ai};function La(p){var O=p.value,W=p.key,pt=p.styleSpec,At=p.style;if(!O.type)return[new li(W,O,'"type" is required')];var Ot=Di(O.type),Wt;switch(Ot){case"vector":case"raster":case"raster-dem":return Wt=Lt({key:W,value:O,valueSpec:pt["source_"+Ot.replace("-","_")],style:p.style,styleSpec:pt,objectElementValidators:xa}),Wt;case"geojson":if(Wt=Lt({key:W,value:O,valueSpec:pt.source_geojson,style:At,styleSpec:pt,objectElementValidators:xa}),O.cluster)for(var _e in O.clusterProperties){var De=O.clusterProperties[_e],Je=De[0],sr=De[1],Ar=typeof Je=="string"?[Je,["accumulated"],["get",_e]]:Je;Wt.push.apply(Wt,$e({key:W+"."+_e+".map",value:sr,expressionContext:"cluster-map"})),Wt.push.apply(Wt,$e({key:W+"."+_e+".reduce",value:Ar,expressionContext:"cluster-reduce"}))}return Wt;case"video":return Lt({key:W,value:O,valueSpec:pt.source_video,style:At,styleSpec:pt});case"image":return Lt({key:W,value:O,valueSpec:pt.source_image,style:At,styleSpec:pt});case"canvas":return[new li(W,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Br({key:W+".type",value:O.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ai(p){var O=p.key,W=p.value;if(so(W)==="string")return _a({key:O,value:W});var pt=[];for(var At in W)pt.push.apply(pt,_a({key:O+"."+At,value:W[At]}));return pt}function Ai(p){var O=p.value,W=p.styleSpec,pt=W.light,At=p.style,Ot=[],Wt=so(O);if(O===void 0)return Ot;if(Wt!=="object")return Ot=Ot.concat([new li("light",O,"object expected, "+Wt+" found")]),Ot;for(var _e in O){var De=_e.match(/^(.*)-transition$/);De&&pt[De[1]]&&pt[De[1]].transition?Ot=Ot.concat(Xo({key:_e,value:O[_e],valueSpec:W.transition,style:At,styleSpec:W})):pt[_e]?Ot=Ot.concat(Xo({key:_e,value:O[_e],valueSpec:pt[_e],style:At,styleSpec:W})):Ot=Ot.concat([new li(_e,O[_e],'unknown property "'+_e+'"')])}return Ot}function mi(p){return _a(p).length===0?[]:$e(p)}function Yi(p){return _a(p).length===0?[]:$e(p)}var Go={"*":function(){return[]},array:le,boolean:hr,number:xe,color:pr,constants:wo,enum:Br,filter:Lr,function:Pe,layer:Jn,object:Lt,source:La,light:Ai,string:_a,formatted:mi,resolvedImage:Yi};function Xo(p){var O=p.value,W=p.valueSpec,pt=p.styleSpec;if(W.expression&&ws(Di(O)))return Pe(p);if(W.expression&&Ui(_s(O)))return $e(p);if(W.type&&Go[W.type])return Go[W.type](p);var At=Lt(Ms({},p,{valueSpec:W.type?pt[W.type]:W}));return At}function po(p){var O=p.value,W=p.key,pt=_a(p);return pt.length||(O.indexOf("{fontstack}")===-1&&pt.push(new li(W,O,'"glyphs" url must include a "{fontstack}" token')),O.indexOf("{range}")===-1&&pt.push(new li(W,O,'"glyphs" url must include a "{range}" token'))),pt}function Qo(p,O){O===void 0&&(O=Da);var W=[];return W=W.concat(Xo({key:"",value:p,valueSpec:O.$root,styleSpec:O,style:p,objectElementValidators:{glyphs:po,"*":function(){return[]}}})),p.constants&&(W=W.concat(wo({key:"constants",value:p.constants}))),Js(W)}Qo.source=Us(La),Qo.light=Us(Ai),Qo.layer=Us(Jn),Qo.filter=Us(Lr),Qo.paintProperty=Us(cn),Qo.layoutProperty=Us(Mn);function Js(p){return[].concat(p).sort(function(O,W){return O.line-W.line})}function Us(p){return function(){for(var O=[],W=arguments.length;W--;)O[W]=arguments[W];return Js(p.apply(this,O))}}var To=Qo,ko=To.light,hl=To.paintProperty,Sl=To.layoutProperty;function tu(p,O){var W=!1;if(O&&O.length)for(var pt=0,At=O;pt<At.length;pt+=1){var Ot=At[pt];p.fire(new Tr(new Error(Ot.message))),W=!0}return W}var gt=Xt,Et=3;function Xt(p,O,W){var pt=this.cells=[];if(p instanceof ArrayBuffer){this.arrayBuffer=p;var At=new Int32Array(this.arrayBuffer);p=At[0],O=At[1],W=At[2],this.d=O+2*W;for(var Ot=0;Ot<this.d*this.d;Ot++){var Wt=At[Et+Ot],_e=At[Et+Ot+1];pt.push(Wt===_e?null:At.subarray(Wt,_e))}var De=At[Et+pt.length],Je=At[Et+pt.length+1];this.keys=At.subarray(De,Je),this.bboxes=At.subarray(Je),this.insert=this._insertReadonly}else{this.d=O+2*W;for(var sr=0;sr<this.d*this.d;sr++)pt.push([]);this.keys=[],this.bboxes=[]}this.n=O,this.extent=p,this.padding=W,this.scale=O/p,this.uid=0;var Ar=W/O*p;this.min=-Ar,this.max=p+Ar}Xt.prototype.insert=function(p,O,W,pt,At){this._forEachCell(O,W,pt,At,this._insertCell,this.uid++),this.keys.push(p),this.bboxes.push(O),this.bboxes.push(W),this.bboxes.push(pt),this.bboxes.push(At)},Xt.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Xt.prototype._insertCell=function(p,O,W,pt,At,Ot){this.cells[At].push(Ot)},Xt.prototype.query=function(p,O,W,pt,At){var Ot=this.min,Wt=this.max;if(p<=Ot&&O<=Ot&&Wt<=W&&Wt<=pt&&!At)return Array.prototype.slice.call(this.keys);var _e=[],De={};return this._forEachCell(p,O,W,pt,this._queryCell,_e,De,At),_e},Xt.prototype._queryCell=function(p,O,W,pt,At,Ot,Wt,_e){var De=this.cells[At];if(De!==null)for(var Je=this.keys,sr=this.bboxes,Ar=0;Ar<De.length;Ar++){var Pr=De[Ar];if(Wt[Pr]===void 0){var Vr=Pr*4;(_e?_e(sr[Vr+0],sr[Vr+1],sr[Vr+2],sr[Vr+3]):p<=sr[Vr+2]&&O<=sr[Vr+3]&&W>=sr[Vr+0]&&pt>=sr[Vr+1])?(Wt[Pr]=!0,Ot.push(Je[Pr])):Wt[Pr]=!1}}},Xt.prototype._forEachCell=function(p,O,W,pt,At,Ot,Wt,_e){for(var De=this._convertToCellCoord(p),Je=this._convertToCellCoord(O),sr=this._convertToCellCoord(W),Ar=this._convertToCellCoord(pt),Pr=De;Pr<=sr;Pr++)for(var Vr=Je;Vr<=Ar;Vr++){var un=this.d*Vr+Pr;if(!(_e&&!_e(this._convertFromCellCoord(Pr),this._convertFromCellCoord(Vr),this._convertFromCellCoord(Pr+1),this._convertFromCellCoord(Vr+1)))&&At.call(this,p,O,W,pt,un,Ot,Wt,_e))return}},Xt.prototype._convertFromCellCoord=function(p){return(p-this.padding)/this.scale},Xt.prototype._convertToCellCoord=function(p){return Math.max(0,Math.min(this.d-1,Math.floor(p*this.scale)+this.padding))},Xt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var p=this.cells,O=Et+this.cells.length+1+1,W=0,pt=0;pt<this.cells.length;pt++)W+=this.cells[pt].length;var At=new Int32Array(O+W+this.keys.length+this.bboxes.length);At[0]=this.extent,At[1]=this.n,At[2]=this.padding;for(var Ot=O,Wt=0;Wt<p.length;Wt++){var _e=p[Wt];At[Et+Wt]=Ot,At.set(_e,Ot),Ot+=_e.length}return At[Et+p.length]=Ot,At.set(this.keys,Ot),Ot+=this.keys.length,At[Et+p.length+1]=Ot,At.set(this.bboxes,Ot),Ot+=this.bboxes.length,At.buffer};var fe=s.ImageData,me=s.ImageBitmap,we={};function Ve(p,O,W){W===void 0&&(W={}),Object.defineProperty(O,"_classRegistryKey",{value:p,writeable:!1}),we[p]={klass:O,omit:W.omit||[],shallow:W.shallow||[]}}Ve("Object",Object),gt.serialize=function(p,O){var W=p.toArrayBuffer();return O&&O.push(W),{buffer:W}},gt.deserialize=function(p){return new gt(p.buffer)},Ve("Grid",gt),Ve("Color",cs),Ve("Error",Error),Ve("ResolvedImage",xl),Ve("StylePropertyFunction",Pt),Ve("StyleExpression",Nu,{omit:["_evaluator"]}),Ve("ZoomDependentExpression",ul),Ve("ZoomConstantExpression",Ql),Ve("CompoundExpression",Fi,{omit:["_evaluate"]});for(var je in $i)$i[je]._classRegistryKey||Ve("Expression_"+je,$i[je]);function or(p){return p&&typeof ArrayBuffer<"u"&&(p instanceof ArrayBuffer||p.constructor&&p.constructor.name==="ArrayBuffer")}function Cr(p){return me&&p instanceof me}function Sr(p,O){if(p==null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||p instanceof Boolean||p instanceof Number||p instanceof String||p instanceof Date||p instanceof RegExp)return p;if(or(p)||Cr(p))return O&&O.push(p),p;if(ArrayBuffer.isView(p)){var W=p;return O&&O.push(W.buffer),W}if(p instanceof fe)return O&&O.push(p.data.buffer),p;if(Array.isArray(p)){for(var pt=[],At=0,Ot=p;At<Ot.length;At+=1){var Wt=Ot[At];pt.push(Sr(Wt,O))}return pt}if(typeof p=="object"){var _e=p.constructor,De=_e._classRegistryKey;if(!De)throw new Error("can't serialize object of unregistered class");var Je=_e.serialize?_e.serialize(p,O):{};if(!_e.serialize){for(var sr in p)if(p.hasOwnProperty(sr)&&!(we[De].omit.indexOf(sr)>=0)){var Ar=p[sr];Je[sr]=we[De].shallow.indexOf(sr)>=0?Ar:Sr(Ar,O)}p instanceof Error&&(Je.message=p.message)}if(Je.$name)throw new Error("$name property is reserved for worker serialization logic.");return De!=="Object"&&(Je.$name=De),Je}throw new Error("can't serialize object of type "+typeof p)}function Wr(p){if(p==null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||p instanceof Boolean||p instanceof Number||p instanceof String||p instanceof Date||p instanceof RegExp||or(p)||Cr(p)||ArrayBuffer.isView(p)||p instanceof fe)return p;if(Array.isArray(p))return p.map(Wr);if(typeof p=="object"){var O=p.$name||"Object",W=we[O],pt=W.klass;if(!pt)throw new Error("can't deserialize unregistered class "+O);if(pt.deserialize)return pt.deserialize(p);for(var At=Object.create(pt.prototype),Ot=0,Wt=Object.keys(p);Ot<Wt.length;Ot+=1){var _e=Wt[Ot];if(_e!=="$name"){var De=p[_e];At[_e]=we[O].shallow.indexOf(_e)>=0?De:Wr(De)}}return At}throw new Error("can't deserialize object of type "+typeof p)}var an=function(){this.first=!0};an.prototype.update=function(p,O){var W=Math.floor(p);return this.first?(this.first=!1,this.lastIntegerZoom=W,this.lastIntegerZoomTime=0,this.lastZoom=p,this.lastFloorZoom=W,!0):(this.lastFloorZoom>W?(this.lastIntegerZoom=W+1,this.lastIntegerZoomTime=O):this.lastFloorZoom<W&&(this.lastIntegerZoom=W,this.lastIntegerZoomTime=O),p!==this.lastZoom?(this.lastZoom=p,this.lastFloorZoom=W,!0):!1)};var on={"Latin-1 Supplement":function(p){return p>=128&&p<=255},Arabic:function(p){return p>=1536&&p<=1791},"Arabic Supplement":function(p){return p>=1872&&p<=1919},"Arabic Extended-A":function(p){return p>=2208&&p<=2303},"Hangul Jamo":function(p){return p>=4352&&p<=4607},"Unified Canadian Aboriginal Syllabics":function(p){return p>=5120&&p<=5759},Khmer:function(p){return p>=6016&&p<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(p){return p>=6320&&p<=6399},"General Punctuation":function(p){return p>=8192&&p<=8303},"Letterlike Symbols":function(p){return p>=8448&&p<=8527},"Number Forms":function(p){return p>=8528&&p<=8591},"Miscellaneous Technical":function(p){return p>=8960&&p<=9215},"Control Pictures":function(p){return p>=9216&&p<=9279},"Optical Character Recognition":function(p){return p>=9280&&p<=9311},"Enclosed Alphanumerics":function(p){return p>=9312&&p<=9471},"Geometric Shapes":function(p){return p>=9632&&p<=9727},"Miscellaneous Symbols":function(p){return p>=9728&&p<=9983},"Miscellaneous Symbols and Arrows":function(p){return p>=11008&&p<=11263},"CJK Radicals Supplement":function(p){return p>=11904&&p<=12031},"Kangxi Radicals":function(p){return p>=12032&&p<=12255},"Ideographic Description Characters":function(p){return p>=12272&&p<=12287},"CJK Symbols and Punctuation":function(p){return p>=12288&&p<=12351},Hiragana:function(p){return p>=12352&&p<=12447},Katakana:function(p){return p>=12448&&p<=12543},Bopomofo:function(p){return p>=12544&&p<=12591},"Hangul Compatibility Jamo":function(p){return p>=12592&&p<=12687},Kanbun:function(p){return p>=12688&&p<=12703},"Bopomofo Extended":function(p){return p>=12704&&p<=12735},"CJK Strokes":function(p){return p>=12736&&p<=12783},"Katakana Phonetic Extensions":function(p){return p>=12784&&p<=12799},"Enclosed CJK Letters and Months":function(p){return p>=12800&&p<=13055},"CJK Compatibility":function(p){return p>=13056&&p<=13311},"CJK Unified Ideographs Extension A":function(p){return p>=13312&&p<=19903},"Yijing Hexagram Symbols":function(p){return p>=19904&&p<=19967},"CJK Unified Ideographs":function(p){return p>=19968&&p<=40959},"Yi Syllables":function(p){return p>=40960&&p<=42127},"Yi Radicals":function(p){return p>=42128&&p<=42191},"Hangul Jamo Extended-A":function(p){return p>=43360&&p<=43391},"Hangul Syllables":function(p){return p>=44032&&p<=55215},"Hangul Jamo Extended-B":function(p){return p>=55216&&p<=55295},"Private Use Area":function(p){return p>=57344&&p<=63743},"CJK Compatibility Ideographs":function(p){return p>=63744&&p<=64255},"Arabic Presentation Forms-A":function(p){return p>=64336&&p<=65023},"Vertical Forms":function(p){return p>=65040&&p<=65055},"CJK Compatibility Forms":function(p){return p>=65072&&p<=65103},"Small Form Variants":function(p){return p>=65104&&p<=65135},"Arabic Presentation Forms-B":function(p){return p>=65136&&p<=65279},"Halfwidth and Fullwidth Forms":function(p){return p>=65280&&p<=65519}};function ta(p){for(var O=0,W=p;O<W.length;O+=1){var pt=W[O];if(Yn(pt.charCodeAt(0)))return!0}return!1}function hn(p){for(var O=0,W=p;O<W.length;O+=1){var pt=W[O];if(!Bn(pt.charCodeAt(0)))return!1}return!0}function Bn(p){return!(on.Arabic(p)||on["Arabic Supplement"](p)||on["Arabic Extended-A"](p)||on["Arabic Presentation Forms-A"](p)||on["Arabic Presentation Forms-B"](p))}function Hn(p){return p<11904?!1:!!(on["Bopomofo Extended"](p)||on.Bopomofo(p)||on["CJK Compatibility Forms"](p)||on["CJK Compatibility Ideographs"](p)||on["CJK Compatibility"](p)||on["CJK Radicals Supplement"](p)||on["CJK Strokes"](p)||on["CJK Symbols and Punctuation"](p)||on["CJK Unified Ideographs Extension A"](p)||on["CJK Unified Ideographs"](p)||on["Enclosed CJK Letters and Months"](p)||on["Halfwidth and Fullwidth Forms"](p)||on.Hiragana(p)||on["Ideographic Description Characters"](p)||on["Kangxi Radicals"](p)||on["Katakana Phonetic Extensions"](p)||on.Katakana(p)||on["Vertical Forms"](p)||on["Yi Radicals"](p)||on["Yi Syllables"](p))}function Yn(p){return p===746||p===747?!0:p<4352?!1:!!(on["Bopomofo Extended"](p)||on.Bopomofo(p)||on["CJK Compatibility Forms"](p)&&!(p>=65097&&p<=65103)||on["CJK Compatibility Ideographs"](p)||on["CJK Compatibility"](p)||on["CJK Radicals Supplement"](p)||on["CJK Strokes"](p)||on["CJK Symbols and Punctuation"](p)&&!(p>=12296&&p<=12305)&&!(p>=12308&&p<=12319)&&p!==12336||on["CJK Unified Ideographs Extension A"](p)||on["CJK Unified Ideographs"](p)||on["Enclosed CJK Letters and Months"](p)||on["Hangul Compatibility Jamo"](p)||on["Hangul Jamo Extended-A"](p)||on["Hangul Jamo Extended-B"](p)||on["Hangul Jamo"](p)||on["Hangul Syllables"](p)||on.Hiragana(p)||on["Ideographic Description Characters"](p)||on.Kanbun(p)||on["Kangxi Radicals"](p)||on["Katakana Phonetic Extensions"](p)||on.Katakana(p)&&p!==12540||on["Halfwidth and Fullwidth Forms"](p)&&p!==65288&&p!==65289&&p!==65293&&!(p>=65306&&p<=65310)&&p!==65339&&p!==65341&&p!==65343&&!(p>=65371&&p<=65503)&&p!==65507&&!(p>=65512&&p<=65519)||on["Small Form Variants"](p)&&!(p>=65112&&p<=65118)&&!(p>=65123&&p<=65126)||on["Unified Canadian Aboriginal Syllabics"](p)||on["Unified Canadian Aboriginal Syllabics Extended"](p)||on["Vertical Forms"](p)||on["Yijing Hexagram Symbols"](p)||on["Yi Syllables"](p)||on["Yi Radicals"](p))}function na(p){return!!(on["Latin-1 Supplement"](p)&&(p===167||p===169||p===174||p===177||p===188||p===189||p===190||p===215||p===247)||on["General Punctuation"](p)&&(p===8214||p===8224||p===8225||p===8240||p===8241||p===8251||p===8252||p===8258||p===8263||p===8264||p===8265||p===8273)||on["Letterlike Symbols"](p)||on["Number Forms"](p)||on["Miscellaneous Technical"](p)&&(p>=8960&&p<=8967||p>=8972&&p<=8991||p>=8996&&p<=9e3||p===9003||p>=9085&&p<=9114||p>=9150&&p<=9165||p===9167||p>=9169&&p<=9179||p>=9186&&p<=9215)||on["Control Pictures"](p)&&p!==9251||on["Optical Character Recognition"](p)||on["Enclosed Alphanumerics"](p)||on["Geometric Shapes"](p)||on["Miscellaneous Symbols"](p)&&!(p>=9754&&p<=9759)||on["Miscellaneous Symbols and Arrows"](p)&&(p>=11026&&p<=11055||p>=11088&&p<=11097||p>=11192&&p<=11243)||on["CJK Symbols and Punctuation"](p)||on.Katakana(p)||on["Private Use Area"](p)||on["CJK Compatibility Forms"](p)||on["Small Form Variants"](p)||on["Halfwidth and Fullwidth Forms"](p)||p===8734||p===8756||p===8757||p>=9984&&p<=10087||p>=10102&&p<=10131||p===65532||p===65533)}function _n(p){return!(Yn(p)||na(p))}function Ha(p){return on.Arabic(p)||on["Arabic Supplement"](p)||on["Arabic Extended-A"](p)||on["Arabic Presentation Forms-A"](p)||on["Arabic Presentation Forms-B"](p)}function Wa(p){return p>=1424&&p<=2303||on["Arabic Presentation Forms-A"](p)||on["Arabic Presentation Forms-B"](p)}function ri(p,O){return!(!O&&Wa(p)||p>=2304&&p<=3583||p>=3840&&p<=4255||on.Khmer(p))}function xi(p){for(var O=0,W=p;O<W.length;O+=1){var pt=W[O];if(Wa(pt.charCodeAt(0)))return!0}return!1}function ki(p,O){for(var W=0,pt=p;W<pt.length;W+=1){var At=pt[W];if(!ri(At.charCodeAt(0),O))return!1}return!0}var zi={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},jo=null,Ii=zi.unavailable,Ji=null,es=function(p){p&&typeof p=="string"&&p.indexOf("NetworkError")>-1&&(Ii=zi.error),jo&&jo(p)};function pl(){Ns.fire(new br("pluginStateChange",{pluginStatus:Ii,pluginURL:Ji}))}var Ns=new mr,fi=function(){return Ii},Ao=function(p){return p({pluginStatus:Ii,pluginURL:Ji}),Ns.on("pluginStateChange",p),p},Bo=function(p,O,W){if(W===void 0&&(W=!1),Ii===zi.deferred||Ii===zi.loading||Ii===zi.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=Tt.resolveURL(p),Ii=zi.deferred,jo=O,pl(),W||Ds()},Ds=function(){if(Ii!==zi.deferred||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ii=zi.loading,pl(),Ji&&Yr({url:Ji},function(p){p?es(p):(Ii=zi.loaded,pl())})},Ts={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ii===zi.loaded||Ts.applyArabicShaping!=null},isLoading:function(){return Ii===zi.loading},setState:function(p){Ii=p.pluginStatus,Ji=p.pluginURL},isParsed:function(){return Ts.applyArabicShaping!=null&&Ts.processBidirectionalText!=null&&Ts.processStyledBidirectionalText!=null},getPluginURL:function(){return Ji}},lu=function(){!Ts.isLoading()&&!Ts.isLoaded()&&fi()==="deferred"&&Ds()},ps=function(p,O){this.zoom=p,O?(this.now=O.now,this.fadeDuration=O.fadeDuration,this.zoomHistory=O.zoomHistory,this.transition=O.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new an,this.transition={})};ps.prototype.isSupportedScript=function(p){return ki(p,Ts.isLoaded())},ps.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ps.prototype.getCrossfadeParameters=function(){var p=this.zoom,O=p-Math.floor(p),W=this.crossFadingFactor();return p>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:O+(1-O)*W}:{fromScale:.5,toScale:1,t:1-(1-W)*O}};var zs=function(p,O){this.property=p,this.value=O,this.expression=z(O===void 0?p.specification.default:O,p.specification)};zs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},zs.prototype.possiblyEvaluate=function(p,O,W){return this.property.possiblyEvaluate(this,p,O,W)};var Eu=function(p){this.property=p,this.value=new zs(p,void 0)};Eu.prototype.transitioned=function(p,O){return new nr(this.property,this.value,O,M({},p.transition,this.transition),p.now)},Eu.prototype.untransitioned=function(){return new nr(this.property,this.value,null,{},0)};var ie=function(p){this._properties=p,this._values=Object.create(p.defaultTransitionablePropertyValues)};ie.prototype.getValue=function(p){return I(this._values[p].value.value)},ie.prototype.setValue=function(p,O){this._values.hasOwnProperty(p)||(this._values[p]=new Eu(this._values[p].property)),this._values[p].value=new zs(this._values[p].property,O===null?void 0:I(O))},ie.prototype.getTransition=function(p){return I(this._values[p].transition)},ie.prototype.setTransition=function(p,O){this._values.hasOwnProperty(p)||(this._values[p]=new Eu(this._values[p].property)),this._values[p].transition=I(O)||void 0},ie.prototype.serialize=function(){for(var p={},O=0,W=Object.keys(this._values);O<W.length;O+=1){var pt=W[O],At=this.getValue(pt);At!==void 0&&(p[pt]=At);var Ot=this.getTransition(pt);Ot!==void 0&&(p[pt+"-transition"]=Ot)}return p},ie.prototype.transitioned=function(p,O){for(var W=new cr(this._properties),pt=0,At=Object.keys(this._values);pt<At.length;pt+=1){var Ot=At[pt];W._values[Ot]=this._values[Ot].transitioned(p,O._values[Ot])}return W},ie.prototype.untransitioned=function(){for(var p=new cr(this._properties),O=0,W=Object.keys(this._values);O<W.length;O+=1){var pt=W[O];p._values[pt]=this._values[pt].untransitioned()}return p};var nr=function(p,O,W,pt,At){this.property=p,this.value=O,this.begin=At+pt.delay||0,this.end=this.begin+pt.duration||0,p.specification.transition&&(pt.delay||pt.duration)&&(this.prior=W)};nr.prototype.possiblyEvaluate=function(p,O,W){var pt=p.now||0,At=this.value.possiblyEvaluate(p,O,W),Ot=this.prior;if(Ot){if(pt>this.end)return this.prior=null,At;if(this.value.isDataDriven())return this.prior=null,At;if(pt<this.begin)return Ot.possiblyEvaluate(p,O,W);var Wt=(pt-this.begin)/(this.end-this.begin);return this.property.interpolate(Ot.possiblyEvaluate(p,O,W),At,g(Wt))}else return At};var cr=function(p){this._properties=p,this._values=Object.create(p.defaultTransitioningPropertyValues)};cr.prototype.possiblyEvaluate=function(p,O,W){for(var pt=new Tn(this._properties),At=0,Ot=Object.keys(this._values);At<Ot.length;At+=1){var Wt=Ot[At];pt._values[Wt]=this._values[Wt].possiblyEvaluate(p,O,W)}return pt},cr.prototype.hasTransition=function(){for(var p=0,O=Object.keys(this._values);p<O.length;p+=1){var W=O[p];if(this._values[W].prior)return!0}return!1};var sn=function(p){this._properties=p,this._values=Object.create(p.defaultPropertyValues)};sn.prototype.getValue=function(p){return I(this._values[p].value)},sn.prototype.setValue=function(p,O){this._values[p]=new zs(this._values[p].property,O===null?void 0:I(O))},sn.prototype.serialize=function(){for(var p={},O=0,W=Object.keys(this._values);O<W.length;O+=1){var pt=W[O],At=this.getValue(pt);At!==void 0&&(p[pt]=At)}return p},sn.prototype.possiblyEvaluate=function(p,O,W){for(var pt=new Tn(this._properties),At=0,Ot=Object.keys(this._values);At<Ot.length;At+=1){var Wt=Ot[At];pt._values[Wt]=this._values[Wt].possiblyEvaluate(p,O,W)}return pt};var zn=function(p,O,W){this.property=p,this.value=O,this.parameters=W};zn.prototype.isConstant=function(){return this.value.kind==="constant"},zn.prototype.constantOr=function(p){return this.value.kind==="constant"?this.value.value:p},zn.prototype.evaluate=function(p,O,W,pt){return this.property.evaluate(this.value,this.parameters,p,O,W,pt)};var Tn=function(p){this._properties=p,this._values=Object.create(p.defaultPossiblyEvaluatedValues)};Tn.prototype.get=function(p){return this._values[p]};var qr=function(p){this.specification=p};qr.prototype.possiblyEvaluate=function(p,O){return p.expression.evaluate(O)},qr.prototype.interpolate=function(p,O,W){var pt=Zu[this.specification.type];return pt?pt(p,O,W):p};var Sn=function(p,O){this.specification=p,this.overrides=O};Sn.prototype.possiblyEvaluate=function(p,O,W,pt){return p.expression.kind==="constant"||p.expression.kind==="camera"?new zn(this,{kind:"constant",value:p.expression.evaluate(O,null,{},W,pt)},O):new zn(this,p.expression,O)},Sn.prototype.interpolate=function(p,O,W){if(p.value.kind!=="constant"||O.value.kind!=="constant")return p;if(p.value.value===void 0||O.value.value===void 0)return new zn(this,{kind:"constant",value:void 0},p.parameters);var pt=Zu[this.specification.type];return pt?new zn(this,{kind:"constant",value:pt(p.value.value,O.value.value,W)},p.parameters):p},Sn.prototype.evaluate=function(p,O,W,pt,At,Ot){return p.kind==="constant"?p.value:p.evaluate(O,W,pt,At,Ot)};var sa=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.possiblyEvaluate=function(W,pt,At,Ot){if(W.value===void 0)return new zn(this,{kind:"constant",value:void 0},pt);if(W.expression.kind==="constant"){var Wt=W.expression.evaluate(pt,null,{},At,Ot),_e=W.property.specification.type==="resolvedImage",De=_e&&typeof Wt!="string"?Wt.name:Wt,Je=this._calculate(De,De,De,pt);return new zn(this,{kind:"constant",value:Je},pt)}else if(W.expression.kind==="camera"){var sr=this._calculate(W.expression.evaluate({zoom:pt.zoom-1}),W.expression.evaluate({zoom:pt.zoom}),W.expression.evaluate({zoom:pt.zoom+1}),pt);return new zn(this,{kind:"constant",value:sr},pt)}else return new zn(this,W.expression,pt)},O.prototype.evaluate=function(W,pt,At,Ot,Wt,_e){if(W.kind==="source"){var De=W.evaluate(pt,At,Ot,Wt,_e);return this._calculate(De,De,De,pt)}else return W.kind==="composite"?this._calculate(W.evaluate({zoom:Math.floor(pt.zoom)-1},At,Ot),W.evaluate({zoom:Math.floor(pt.zoom)},At,Ot),W.evaluate({zoom:Math.floor(pt.zoom)+1},At,Ot),pt):W.value},O.prototype._calculate=function(W,pt,At,Ot){var Wt=Ot.zoom;return Wt>Ot.zoomHistory.lastIntegerZoom?{from:W,to:pt}:{from:At,to:pt}},O.prototype.interpolate=function(W){return W},O}(Sn),ea=function(p){this.specification=p};ea.prototype.possiblyEvaluate=function(p,O,W,pt){if(p.value!==void 0)if(p.expression.kind==="constant"){var At=p.expression.evaluate(O,null,{},W,pt);return this._calculate(At,At,At,O)}else return this._calculate(p.expression.evaluate(new ps(Math.floor(O.zoom-1),O)),p.expression.evaluate(new ps(Math.floor(O.zoom),O)),p.expression.evaluate(new ps(Math.floor(O.zoom+1),O)),O)},ea.prototype._calculate=function(p,O,W,pt){var At=pt.zoom;return At>pt.zoomHistory.lastIntegerZoom?{from:p,to:O}:{from:W,to:O}},ea.prototype.interpolate=function(p){return p};var ka=function(p){this.specification=p};ka.prototype.possiblyEvaluate=function(p,O,W,pt){return!!p.expression.evaluate(O,null,{},W,pt)},ka.prototype.interpolate=function(){return!1};var Ka=function(p){this.properties=p,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var O in p){var W=p[O];W.specification.overridable&&this.overridableProperties.push(O);var pt=this.defaultPropertyValues[O]=new zs(W,void 0),At=this.defaultTransitionablePropertyValues[O]=new Eu(W);this.defaultTransitioningPropertyValues[O]=At.untransitioned(),this.defaultPossiblyEvaluatedValues[O]=pt.possiblyEvaluate({})}};Ve("DataDrivenProperty",Sn),Ve("DataConstantProperty",qr),Ve("CrossFadedDataDrivenProperty",sa),Ve("CrossFadedProperty",ea),Ve("ColorRampProperty",ka);var Va="-transition",fa=function(p){function O(W,pt){if(p.call(this),this.id=W.id,this.type=W.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},W.type!=="custom"&&(W=W,this.metadata=W.metadata,this.minzoom=W.minzoom,this.maxzoom=W.maxzoom,W.type!=="background"&&(this.source=W.source,this.sourceLayer=W["source-layer"],this.filter=W.filter),pt.layout&&(this._unevaluatedLayout=new sn(pt.layout)),pt.paint)){this._transitionablePaint=new ie(pt.paint);for(var At in W.paint)this.setPaintProperty(At,W.paint[At],{validate:!1});for(var Ot in W.layout)this.setLayoutProperty(Ot,W.layout[Ot],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Tn(pt.paint)}}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},O.prototype.getLayoutProperty=function(W){return W==="visibility"?this.visibility:this._unevaluatedLayout.getValue(W)},O.prototype.setLayoutProperty=function(W,pt,At){if(At===void 0&&(At={}),pt!=null){var Ot="layers."+this.id+".layout."+W;if(this._validate(Sl,Ot,W,pt,At))return}if(W==="visibility"){this.visibility=pt;return}this._unevaluatedLayout.setValue(W,pt)},O.prototype.getPaintProperty=function(W){return D(W,Va)?this._transitionablePaint.getTransition(W.slice(0,-Va.length)):this._transitionablePaint.getValue(W)},O.prototype.setPaintProperty=function(W,pt,At){if(At===void 0&&(At={}),pt!=null){var Ot="layers."+this.id+".paint."+W;if(this._validate(hl,Ot,W,pt,At))return!1}if(D(W,Va))return this._transitionablePaint.setTransition(W.slice(0,-Va.length),pt||void 0),!1;var Wt=this._transitionablePaint._values[W],_e=Wt.property.specification["property-type"]==="cross-faded-data-driven",De=Wt.value.isDataDriven(),Je=Wt.value;this._transitionablePaint.setValue(W,pt),this._handleSpecialPaintPropertyUpdate(W);var sr=this._transitionablePaint._values[W].value,Ar=sr.isDataDriven();return Ar||De||_e||this._handleOverridablePaintPropertyUpdate(W,Je,sr)},O.prototype._handleSpecialPaintPropertyUpdate=function(W){},O.prototype._handleOverridablePaintPropertyUpdate=function(W,pt,At){return!1},O.prototype.isHidden=function(W){return this.minzoom&&W<this.minzoom||this.maxzoom&&W>=this.maxzoom?!0:this.visibility==="none"},O.prototype.updateTransitions=function(W){this._transitioningPaint=this._transitionablePaint.transitioned(W,this._transitioningPaint)},O.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},O.prototype.recalculate=function(W,pt){W.getCrossfadeParameters&&(this._crossfadeParameters=W.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(W,void 0,pt)),this.paint=this._transitioningPaint.possiblyEvaluate(W,void 0,pt)},O.prototype.serialize=function(){var W={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&&(W.layout=W.layout||{},W.layout.visibility=this.visibility),R(W,function(pt,At){return pt!==void 0&&!(At==="layout"&&!Object.keys(pt).length)&&!(At==="paint"&&!Object.keys(pt).length)})},O.prototype._validate=function(W,pt,At,Ot,Wt){return Wt===void 0&&(Wt={}),Wt&&Wt.validate===!1?!1:tu(this,W.call(To,{key:pt,layerType:this.type,objectKey:At,value:Ot,styleSpec:Da,style:{glyphs:!0,sprite:!0}}))},O.prototype.is3D=function(){return!1},O.prototype.isTileClipped=function(){return!1},O.prototype.hasOffscreenPass=function(){return!1},O.prototype.resize=function(){},O.prototype.isStateDependent=function(){for(var W in this.paint._values){var pt=this.paint.get(W);if(!(!(pt instanceof zn)||!el(pt.property.specification))&&(pt.value.kind==="source"||pt.value.kind==="composite")&&pt.value.isStateDependent)return!0}return!1},O}(mr),Un={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Nr=function(p,O){this._structArray=p,this._pos1=O*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},fn=128,Xn=5,jn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};jn.serialize=function(p,O){return p._trim(),O&&(p.isTransferred=!0,O.push(p.arrayBuffer)),{length:p.length,arrayBuffer:p.arrayBuffer}},jn.deserialize=function(p){var O=Object.create(this.prototype);return O.arrayBuffer=p.arrayBuffer,O.length=p.length,O.capacity=p.arrayBuffer.byteLength/O.bytesPerElement,O._refreshViews(),O},jn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},jn.prototype.clear=function(){this.length=0},jn.prototype.resize=function(p){this.reserve(p),this.length=p},jn.prototype.reserve=function(p){if(p>this.capacity){this.capacity=Math.max(p,Math.floor(this.capacity*Xn),fn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var O=this.uint8;this._refreshViews(),O&&this.uint8.set(O)}},jn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function kn(p,O){O===void 0&&(O=1);var W=0,pt=0,At=p.map(function(Wt){var _e=Ia(Wt.type),De=W=ya(W,Math.max(O,_e)),Je=Wt.components||1;return pt=Math.max(pt,_e),W+=_e*Je,{name:Wt.name,type:Wt.type,components:Je,offset:De}}),Ot=ya(W,Math.max(pt,O));return{members:At,size:Ot,alignment:O}}function Ia(p){return Un[p].BYTES_PER_ELEMENT}function ya(p,O){return Math.ceil(p/O)*O}var qa=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt){var At=this.length;return this.resize(At+1),this.emplace(At,W,pt)},O.prototype.emplace=function(W,pt,At){var Ot=W*2;return this.int16[Ot+0]=pt,this.int16[Ot+1]=At,W},O}(jn);qa.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",qa);var Rn=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot){var Wt=this.length;return this.resize(Wt+1),this.emplace(Wt,W,pt,At,Ot)},O.prototype.emplace=function(W,pt,At,Ot,Wt){var _e=W*4;return this.int16[_e+0]=pt,this.int16[_e+1]=At,this.int16[_e+2]=Ot,this.int16[_e+3]=Wt,W},O}(jn);Rn.prototype.bytesPerElement=8,Ve("StructArrayLayout4i8",Rn);var An=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e){var De=this.length;return this.resize(De+1),this.emplace(De,W,pt,At,Ot,Wt,_e)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De){var Je=W*6;return this.int16[Je+0]=pt,this.int16[Je+1]=At,this.int16[Je+2]=Ot,this.int16[Je+3]=Wt,this.int16[Je+4]=_e,this.int16[Je+5]=De,W},O}(jn);An.prototype.bytesPerElement=12,Ve("StructArrayLayout2i4i12",An);var Pa=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e){var De=this.length;return this.resize(De+1),this.emplace(De,W,pt,At,Ot,Wt,_e)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De){var Je=W*4,sr=W*8;return this.int16[Je+0]=pt,this.int16[Je+1]=At,this.uint8[sr+4]=Ot,this.uint8[sr+5]=Wt,this.uint8[sr+6]=_e,this.uint8[sr+7]=De,W},O}(jn);Pa.prototype.bytesPerElement=8,Ve("StructArrayLayout2i4ub8",Pa);var ba=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt){var At=this.length;return this.resize(At+1),this.emplace(At,W,pt)},O.prototype.emplace=function(W,pt,At){var Ot=W*2;return this.float32[Ot+0]=pt,this.float32[Ot+1]=At,W},O}(jn);ba.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",ba);var aa=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar){var Pr=this.length;return this.resize(Pr+1),this.emplace(Pr,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr){var Vr=W*10;return this.uint16[Vr+0]=pt,this.uint16[Vr+1]=At,this.uint16[Vr+2]=Ot,this.uint16[Vr+3]=Wt,this.uint16[Vr+4]=_e,this.uint16[Vr+5]=De,this.uint16[Vr+6]=Je,this.uint16[Vr+7]=sr,this.uint16[Vr+8]=Ar,this.uint16[Vr+9]=Pr,W},O}(jn);aa.prototype.bytesPerElement=20,Ve("StructArrayLayout10ui20",aa);var oa=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr){var un=this.length;return this.resize(un+1),this.emplace(un,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un){var Fn=W*12;return this.int16[Fn+0]=pt,this.int16[Fn+1]=At,this.int16[Fn+2]=Ot,this.int16[Fn+3]=Wt,this.uint16[Fn+4]=_e,this.uint16[Fn+5]=De,this.uint16[Fn+6]=Je,this.uint16[Fn+7]=sr,this.int16[Fn+8]=Ar,this.int16[Fn+9]=Pr,this.int16[Fn+10]=Vr,this.int16[Fn+11]=un,W},O}(jn);oa.prototype.bytesPerElement=24,Ve("StructArrayLayout4i4ui4i24",oa);var Sa=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*3;return this.float32[Wt+0]=pt,this.float32[Wt+1]=At,this.float32[Wt+2]=Ot,W},O}(jn);Sa.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",Sa);var _i=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W){var pt=this.length;return this.resize(pt+1),this.emplace(pt,W)},O.prototype.emplace=function(W,pt){var At=W*1;return this.uint32[At+0]=pt,W},O}(jn);_i.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",_i);var pi=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.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)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr){var Ar=this.length;return this.resize(Ar+1),this.emplace(Ar,W,pt,At,Ot,Wt,_e,De,Je,sr)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar){var Pr=W*10,Vr=W*5;return this.int16[Pr+0]=pt,this.int16[Pr+1]=At,this.int16[Pr+2]=Ot,this.int16[Pr+3]=Wt,this.int16[Pr+4]=_e,this.int16[Pr+5]=De,this.uint32[Vr+3]=Je,this.uint16[Pr+8]=sr,this.uint16[Pr+9]=Ar,W},O}(jn);pi.prototype.bytesPerElement=20,Ve("StructArrayLayout6i1ul2ui20",pi);var Ma=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e){var De=this.length;return this.resize(De+1),this.emplace(De,W,pt,At,Ot,Wt,_e)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De){var Je=W*6;return this.int16[Je+0]=pt,this.int16[Je+1]=At,this.int16[Je+2]=Ot,this.int16[Je+3]=Wt,this.int16[Je+4]=_e,this.int16[Je+5]=De,W},O}(jn);Ma.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",Ma);var Na=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt){var _e=this.length;return this.resize(_e+1),this.emplace(_e,W,pt,At,Ot,Wt)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e){var De=W*4,Je=W*8;return this.float32[De+0]=pt,this.float32[De+1]=At,this.float32[De+2]=Ot,this.int16[Je+6]=Wt,this.int16[Je+7]=_e,W},O}(jn);Na.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",Na);var ui=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot){var Wt=this.length;return this.resize(Wt+1),this.emplace(Wt,W,pt,At,Ot)},O.prototype.emplace=function(W,pt,At,Ot,Wt){var _e=W*12,De=W*3;return this.uint8[_e+0]=pt,this.uint8[_e+1]=At,this.float32[De+1]=Ot,this.float32[De+2]=Wt,W},O}(jn);ui.prototype.bytesPerElement=12,Ve("StructArrayLayout2ub2f12",ui);var gi=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*3;return this.uint16[Wt+0]=pt,this.uint16[Wt+1]=At,this.uint16[Wt+2]=Ot,W},O}(jn);gi.prototype.bytesPerElement=6,Ve("StructArrayLayout3ui6",gi);var Ri=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.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)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea){var ja=this.length;return this.resize(ja+1),this.emplace(ja,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja){var Aa=W*24,$a=W*12,hi=W*48;return this.int16[Aa+0]=pt,this.int16[Aa+1]=At,this.uint16[Aa+2]=Ot,this.uint16[Aa+3]=Wt,this.uint32[$a+2]=_e,this.uint32[$a+3]=De,this.uint32[$a+4]=Je,this.uint16[Aa+10]=sr,this.uint16[Aa+11]=Ar,this.uint16[Aa+12]=Pr,this.float32[$a+7]=Vr,this.float32[$a+8]=un,this.uint8[hi+36]=Fn,this.uint8[hi+37]=ga,this.uint8[hi+38]=pa,this.uint32[$a+10]=Ea,this.int16[Aa+22]=ja,W},O}(jn);Ri.prototype.bytesPerElement=48,Ve("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ri);var ds=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.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)},O.prototype.emplaceBack=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei,ro,no,go,Mo,Vo){var vo=this.length;return this.resize(vo+1),this.emplace(vo,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei,ro,no,go,Mo,Vo)},O.prototype.emplace=function(W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei,ro,no,go,Mo,Vo,vo){var bo=W*34,ol=W*17;return this.int16[bo+0]=pt,this.int16[bo+1]=At,this.int16[bo+2]=Ot,this.int16[bo+3]=Wt,this.int16[bo+4]=_e,this.int16[bo+5]=De,this.int16[bo+6]=Je,this.int16[bo+7]=sr,this.uint16[bo+8]=Ar,this.uint16[bo+9]=Pr,this.uint16[bo+10]=Vr,this.uint16[bo+11]=un,this.uint16[bo+12]=Fn,this.uint16[bo+13]=ga,this.uint16[bo+14]=pa,this.uint16[bo+15]=Ea,this.uint16[bo+16]=ja,this.uint16[bo+17]=Aa,this.uint16[bo+18]=$a,this.uint16[bo+19]=hi,this.uint16[bo+20]=Si,this.uint16[bo+21]=Ei,this.uint16[bo+22]=ro,this.uint32[ol+12]=no,this.float32[ol+13]=go,this.float32[ol+14]=Mo,this.float32[ol+15]=Vo,this.float32[ol+16]=vo,W},O}(jn);ds.prototype.bytesPerElement=68,Ve("StructArrayLayout8i15ui1ul4f68",ds);var rs=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W){var pt=this.length;return this.resize(pt+1),this.emplace(pt,W)},O.prototype.emplace=function(W,pt){var At=W*1;return this.float32[At+0]=pt,W},O}(jn);rs.prototype.bytesPerElement=4,Ve("StructArrayLayout1f4",rs);var Zi=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*3;return this.int16[Wt+0]=pt,this.int16[Wt+1]=At,this.int16[Wt+2]=Ot,W},O}(jn);Zi.prototype.bytesPerElement=6,Ve("StructArrayLayout3i6",Zi);var Zs=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At){var Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,W,pt,At)},O.prototype.emplace=function(W,pt,At,Ot){var Wt=W*2,_e=W*4;return this.uint32[Wt+0]=pt,this.uint16[_e+2]=At,this.uint16[_e+3]=Ot,W},O}(jn);Zs.prototype.bytesPerElement=8,Ve("StructArrayLayout1ul2ui8",Zs);var Zo=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt){var At=this.length;return this.resize(At+1),this.emplace(At,W,pt)},O.prototype.emplace=function(W,pt,At){var Ot=W*2;return this.uint16[Ot+0]=pt,this.uint16[Ot+1]=At,W},O}(jn);Zo.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Zo);var Qs=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W){var pt=this.length;return this.resize(pt+1),this.emplace(pt,W)},O.prototype.emplace=function(W,pt){var At=W*1;return this.uint16[At+0]=pt,W},O}(jn);Qs.prototype.bytesPerElement=2,Ve("StructArrayLayout1ui2",Qs);var El=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},O.prototype.emplaceBack=function(W,pt,At,Ot){var Wt=this.length;return this.resize(Wt+1),this.emplace(Wt,W,pt,At,Ot)},O.prototype.emplace=function(W,pt,At,Ot,Wt){var _e=W*4;return this.float32[_e+0]=pt,this.float32[_e+1]=At,this.float32[_e+2]=Ot,this.float32[_e+3]=Wt,W},O}(jn);El.prototype.bytesPerElement=16,Ve("StructArrayLayout4f16",El);var Cl=function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={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 W.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},W.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},W.x1.get=function(){return this._structArray.int16[this._pos2+2]},W.y1.get=function(){return this._structArray.int16[this._pos2+3]},W.x2.get=function(){return this._structArray.int16[this._pos2+4]},W.y2.get=function(){return this._structArray.int16[this._pos2+5]},W.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},W.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},W.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},W.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(O.prototype,W),O}(Nr);Cl.prototype.size=20;var Hs=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new Cl(this,W)},O}(pi);Ve("CollisionBoxArray",Hs);var js=function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={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 W.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},W.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},W.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},W.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},W.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},W.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},W.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},W.segment.get=function(){return this._structArray.uint16[this._pos2+10]},W.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},W.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},W.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},W.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},W.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},W.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},W.placedOrientation.set=function(pt){this._structArray.uint8[this._pos1+37]=pt},W.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},W.hidden.set=function(pt){this._structArray.uint8[this._pos1+38]=pt},W.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},W.crossTileID.set=function(pt){this._structArray.uint32[this._pos4+10]=pt},W.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(O.prototype,W),O}(Nr);js.prototype.size=48;var Ks=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new js(this,W)},O}(Ri);Ve("PlacedSymbolArray",Ks);var Mi=function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={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 W.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},W.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},W.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},W.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},W.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},W.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},W.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},W.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},W.key.get=function(){return this._structArray.uint16[this._pos2+8]},W.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},W.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},W.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},W.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},W.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},W.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},W.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},W.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},W.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},W.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},W.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},W.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},W.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},W.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},W.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},W.crossTileID.set=function(pt){this._structArray.uint32[this._pos4+12]=pt},W.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},W.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},W.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},W.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(O.prototype,W),O}(Nr);Mi.prototype.size=68;var Ys=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new Mi(this,W)},O}(ds);Ve("SymbolInstanceArray",Ys);var Uo=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.getoffsetX=function(W){return this.float32[W*1+0]},O}(rs);Ve("GlyphOffsetArray",Uo);var tl=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.getx=function(W){return this.int16[W*3+0]},O.prototype.gety=function(W){return this.int16[W*3+1]},O.prototype.gettileUnitDistanceFromAnchor=function(W){return this.int16[W*3+2]},O}(Zi);Ve("SymbolLineVertexArray",tl);var Il=function(p){function O(){p.apply(this,arguments)}p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O;var W={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return W.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},W.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},W.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(O.prototype,W),O}(Nr);Il.prototype.size=8;var vi=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.get=function(W){return new Il(this,W)},O}(Zs);Ve("FeatureIndexArray",vi);var lo=kn([{name:"a_pos",components:2,type:"Int16"}],4),ns=lo.members,$o=function(p){p===void 0&&(p=[]),this.segments=p};$o.prototype.prepareSegment=function(p,O,W,pt){var At=this.segments[this.segments.length-1];return p>$o.MAX_VERTEX_ARRAY_LENGTH&&j("Max vertices per segment is "+$o.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+p),(!At||At.vertexLength+p>$o.MAX_VERTEX_ARRAY_LENGTH||At.sortKey!==pt)&&(At={vertexOffset:O.length,primitiveOffset:W.length,vertexLength:0,primitiveLength:0},pt!==void 0&&(At.sortKey=pt),this.segments.push(At)),At},$o.prototype.get=function(){return this.segments},$o.prototype.destroy=function(){for(var p=0,O=this.segments;p<O.length;p+=1){var W=O[p];for(var pt in W.vaos)W.vaos[pt].destroy()}},$o.simpleSegment=function(p,O,W,pt){return new $o([{vertexOffset:p,primitiveOffset:O,vertexLength:W,primitiveLength:pt,vaos:{},sortKey:0}])},$o.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ve("SegmentVector",$o);function U(p,O){return p=l(Math.floor(p),0,255),O=l(Math.floor(O),0,255),256*p+O}var tt=kn([{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"}]),Y=e(function(p){function O(W,pt){var At,Ot,Wt,_e,De,Je,sr,Ar;for(At=W.length&3,Ot=W.length-At,Wt=pt,De=3432918353,Je=461845907,Ar=0;Ar<Ot;)sr=W.charCodeAt(Ar)&255|(W.charCodeAt(++Ar)&255)<<8|(W.charCodeAt(++Ar)&255)<<16|(W.charCodeAt(++Ar)&255)<<24,++Ar,sr=(sr&65535)*De+(((sr>>>16)*De&65535)<<16)&4294967295,sr=sr<<15|sr>>>17,sr=(sr&65535)*Je+(((sr>>>16)*Je&65535)<<16)&4294967295,Wt^=sr,Wt=Wt<<13|Wt>>>19,_e=(Wt&65535)*5+(((Wt>>>16)*5&65535)<<16)&4294967295,Wt=(_e&65535)+27492+(((_e>>>16)+58964&65535)<<16);switch(sr=0,At){case 3:sr^=(W.charCodeAt(Ar+2)&255)<<16;case 2:sr^=(W.charCodeAt(Ar+1)&255)<<8;case 1:sr^=W.charCodeAt(Ar)&255,sr=(sr&65535)*De+(((sr>>>16)*De&65535)<<16)&4294967295,sr=sr<<15|sr>>>17,sr=(sr&65535)*Je+(((sr>>>16)*Je&65535)<<16)&4294967295,Wt^=sr}return Wt^=W.length,Wt^=Wt>>>16,Wt=(Wt&65535)*2246822507+(((Wt>>>16)*2246822507&65535)<<16)&4294967295,Wt^=Wt>>>13,Wt=(Wt&65535)*3266489909+(((Wt>>>16)*3266489909&65535)<<16)&4294967295,Wt^=Wt>>>16,Wt>>>0}p.exports=O}),ft=e(function(p){function O(W,pt){for(var At=W.length,Ot=pt^At,Wt=0,_e;At>=4;)_e=W.charCodeAt(Wt)&255|(W.charCodeAt(++Wt)&255)<<8|(W.charCodeAt(++Wt)&255)<<16|(W.charCodeAt(++Wt)&255)<<24,_e=(_e&65535)*1540483477+(((_e>>>16)*1540483477&65535)<<16),_e^=_e>>>24,_e=(_e&65535)*1540483477+(((_e>>>16)*1540483477&65535)<<16),Ot=(Ot&65535)*1540483477+(((Ot>>>16)*1540483477&65535)<<16)^_e,At-=4,++Wt;switch(At){case 3:Ot^=(W.charCodeAt(Wt+2)&255)<<16;case 2:Ot^=(W.charCodeAt(Wt+1)&255)<<8;case 1:Ot^=W.charCodeAt(Wt)&255,Ot=(Ot&65535)*1540483477+(((Ot>>>16)*1540483477&65535)<<16)}return Ot^=Ot>>>13,Ot=(Ot&65535)*1540483477+(((Ot>>>16)*1540483477&65535)<<16),Ot^=Ot>>>15,Ot>>>0}p.exports=O}),zt=Y,Qt=Y,ne=ft;zt.murmur3=Qt,zt.murmur2=ne;var Ft=function(){this.ids=[],this.positions=[],this.indexed=!1};Ft.prototype.add=function(p,O,W,pt){this.ids.push(he(p)),this.positions.push(O,W,pt)},Ft.prototype.getPositions=function(p){for(var O=he(p),W=0,pt=this.ids.length-1;W<pt;){var At=W+pt>>1;this.ids[At]>=O?pt=At:W=At+1}for(var Ot=[];this.ids[W]===O;){var Wt=this.positions[3*W],_e=this.positions[3*W+1],De=this.positions[3*W+2];Ot.push({index:Wt,start:_e,end:De}),W++}return Ot},Ft.serialize=function(p,O){var W=new Float64Array(p.ids),pt=new Uint32Array(p.positions);return Ne(W,pt,0,W.length-1),O&&O.push(W.buffer,pt.buffer),{ids:W,positions:pt}},Ft.deserialize=function(p){var O=new Ft;return O.ids=p.ids,O.positions=p.positions,O.indexed=!0,O};var $t=Math.pow(2,53)-1;function he(p){var O=+p;return!isNaN(O)&&O<=$t?O:zt(String(p))}function Ne(p,O,W,pt){for(;W<pt;){for(var At=p[W+pt>>1],Ot=W-1,Wt=pt+1;;){do Ot++;while(p[Ot]<At);do Wt--;while(p[Wt]>At);if(Ot>=Wt)break;Ie(p,Ot,Wt),Ie(O,3*Ot,3*Wt),Ie(O,3*Ot+1,3*Wt+1),Ie(O,3*Ot+2,3*Wt+2)}Wt-W<pt-Wt?(Ne(p,O,W,Wt),W=Wt+1):(Ne(p,O,Wt+1,pt),pt=Wt)}}function Ie(p,O,W){var pt=p[O];p[O]=p[W],p[W]=pt}Ve("FeaturePositionMap",Ft);var Fe=function(p,O){this.gl=p.gl,this.location=O},He=function(p){function O(W,pt){p.call(this,W,pt),this.current=0}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){this.current!==W&&(this.current=W,this.gl.uniform1i(this.location,W))},O}(Fe),Ge=function(p){function O(W,pt){p.call(this,W,pt),this.current=0}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){this.current!==W&&(this.current=W,this.gl.uniform1f(this.location,W))},O}(Fe),Ae=function(p){function O(W,pt){p.call(this,W,pt),this.current=[0,0]}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){(W[0]!==this.current[0]||W[1]!==this.current[1])&&(this.current=W,this.gl.uniform2f(this.location,W[0],W[1]))},O}(Fe),Oe=function(p){function O(W,pt){p.call(this,W,pt),this.current=[0,0,0]}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){(W[0]!==this.current[0]||W[1]!==this.current[1]||W[2]!==this.current[2])&&(this.current=W,this.gl.uniform3f(this.location,W[0],W[1],W[2]))},O}(Fe),Le=function(p){function O(W,pt){p.call(this,W,pt),this.current=[0,0,0,0]}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){(W[0]!==this.current[0]||W[1]!==this.current[1]||W[2]!==this.current[2]||W[3]!==this.current[3])&&(this.current=W,this.gl.uniform4f(this.location,W[0],W[1],W[2],W[3]))},O}(Fe),ur=function(p){function O(W,pt){p.call(this,W,pt),this.current=cs.transparent}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){(W.r!==this.current.r||W.g!==this.current.g||W.b!==this.current.b||W.a!==this.current.a)&&(this.current=W,this.gl.uniform4f(this.location,W.r,W.g,W.b,W.a))},O}(Fe),Dr=new Float32Array(16),jr=function(p){function O(W,pt){p.call(this,W,pt),this.current=Dr}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.set=function(W){if(W[12]!==this.current[12]||W[0]!==this.current[0]){this.current=W,this.gl.uniformMatrix4fv(this.location,!1,W);return}for(var pt=1;pt<16;pt++)if(W[pt]!==this.current[pt]){this.current=W,this.gl.uniformMatrix4fv(this.location,!1,W);break}},O}(Fe);function On(p){return[U(255*p.r,255*p.g),U(255*p.b,255*p.a)]}var Ln=function(p,O,W){this.value=p,this.uniformNames=O.map(function(pt){return"u_"+pt}),this.type=W};Ln.prototype.setUniform=function(p,O,W){p.set(W.constantOr(this.value))},Ln.prototype.getBinding=function(p,O,W){return this.type==="color"?new ur(p,O):new Ge(p,O)};var xn=function(p,O){this.uniformNames=O.map(function(W){return"u_"+W}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};xn.prototype.setConstantPatternPositions=function(p,O){this.pixelRatioFrom=O.pixelRatio,this.pixelRatioTo=p.pixelRatio,this.patternFrom=O.tlbr,this.patternTo=p.tlbr},xn.prototype.setUniform=function(p,O,W,pt){var At=pt==="u_pattern_to"?this.patternTo:pt==="u_pattern_from"?this.patternFrom:pt==="u_pixel_ratio_to"?this.pixelRatioTo:pt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;At&&p.set(At)},xn.prototype.getBinding=function(p,O,W){return W.substr(0,9)==="u_pattern"?new Le(p,O):new Ge(p,O)};var Wn=function(p,O,W,pt){this.expression=p,this.type=W,this.maxValue=0,this.paintVertexAttributes=O.map(function(At){return{name:"a_"+At,type:"Float32",components:W==="color"?2:1,offset:0}}),this.paintVertexArray=new pt};Wn.prototype.populatePaintArray=function(p,O,W,pt,At){var Ot=this.paintVertexArray.length,Wt=this.expression.evaluate(new ps(0),O,{},pt,[],At);this.paintVertexArray.resize(p),this._setPaintValue(Ot,p,Wt)},Wn.prototype.updatePaintArray=function(p,O,W,pt){var At=this.expression.evaluate({zoom:0},W,pt);this._setPaintValue(p,O,At)},Wn.prototype._setPaintValue=function(p,O,W){if(this.type==="color")for(var pt=On(W),At=p;At<O;At++)this.paintVertexArray.emplace(At,pt[0],pt[1]);else{for(var Ot=p;Ot<O;Ot++)this.paintVertexArray.emplace(Ot,W);this.maxValue=Math.max(this.maxValue,Math.abs(W))}},Wn.prototype.upload=function(p){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=p.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Wn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Dn=function(p,O,W,pt,At,Ot){this.expression=p,this.uniformNames=O.map(function(Wt){return"u_"+Wt+"_t"}),this.type=W,this.useIntegerZoom=pt,this.zoom=At,this.maxValue=0,this.paintVertexAttributes=O.map(function(Wt){return{name:"a_"+Wt,type:"Float32",components:W==="color"?4:2,offset:0}}),this.paintVertexArray=new Ot};Dn.prototype.populatePaintArray=function(p,O,W,pt,At){var Ot=this.expression.evaluate(new ps(this.zoom),O,{},pt,[],At),Wt=this.expression.evaluate(new ps(this.zoom+1),O,{},pt,[],At),_e=this.paintVertexArray.length;this.paintVertexArray.resize(p),this._setPaintValue(_e,p,Ot,Wt)},Dn.prototype.updatePaintArray=function(p,O,W,pt){var At=this.expression.evaluate({zoom:this.zoom},W,pt),Ot=this.expression.evaluate({zoom:this.zoom+1},W,pt);this._setPaintValue(p,O,At,Ot)},Dn.prototype._setPaintValue=function(p,O,W,pt){if(this.type==="color")for(var At=On(W),Ot=On(pt),Wt=p;Wt<O;Wt++)this.paintVertexArray.emplace(Wt,At[0],At[1],Ot[0],Ot[1]);else{for(var _e=p;_e<O;_e++)this.paintVertexArray.emplace(_e,W,pt);this.maxValue=Math.max(this.maxValue,Math.abs(W),Math.abs(pt))}},Dn.prototype.upload=function(p){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=p.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Dn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Dn.prototype.setUniform=function(p,O){var W=this.useIntegerZoom?Math.floor(O.zoom):O.zoom,pt=l(this.expression.interpolationFactor(W,this.zoom,this.zoom+1),0,1);p.set(pt)},Dn.prototype.getBinding=function(p,O,W){return new Ge(p,O)};var la=function(p,O,W,pt,At,Ot){this.expression=p,this.type=O,this.useIntegerZoom=W,this.zoom=pt,this.layerId=Ot,this.zoomInPaintVertexArray=new At,this.zoomOutPaintVertexArray=new At};la.prototype.populatePaintArray=function(p,O,W){var pt=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(p),this.zoomOutPaintVertexArray.resize(p),this._setPaintValues(pt,p,O.patterns&&O.patterns[this.layerId],W)},la.prototype.updatePaintArray=function(p,O,W,pt,At){this._setPaintValues(p,O,W.patterns&&W.patterns[this.layerId],At)},la.prototype._setPaintValues=function(p,O,W,pt){if(!(!pt||!W)){var At=W.min,Ot=W.mid,Wt=W.max,_e=pt[At],De=pt[Ot],Je=pt[Wt];if(!(!_e||!De||!Je))for(var sr=p;sr<O;sr++)this.zoomInPaintVertexArray.emplace(sr,De.tl[0],De.tl[1],De.br[0],De.br[1],_e.tl[0],_e.tl[1],_e.br[0],_e.br[1],De.pixelRatio,_e.pixelRatio),this.zoomOutPaintVertexArray.emplace(sr,De.tl[0],De.tl[1],De.br[0],De.br[1],Je.tl[0],Je.tl[1],Je.br[0],Je.br[1],De.pixelRatio,Je.pixelRatio)}},la.prototype.upload=function(p){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=p.createVertexBuffer(this.zoomInPaintVertexArray,tt.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=p.createVertexBuffer(this.zoomOutPaintVertexArray,tt.members,this.expression.isStateDependent))},la.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var qn=function(p,O,W){this.binders={},this._buffers=[];var pt=[];for(var At in p.paint._values)if(W(At)){var Ot=p.paint.get(At);if(!(!(Ot instanceof zn)||!el(Ot.property.specification))){var Wt=ma(At,p.type),_e=Ot.value,De=Ot.property.specification.type,Je=Ot.property.useIntegerZoom,sr=Ot.property.specification["property-type"],Ar=sr==="cross-faded"||sr==="cross-faded-data-driven";if(_e.kind==="constant")this.binders[At]=Ar?new xn(_e.value,Wt):new Ln(_e.value,Wt,De),pt.push("/u_"+At);else if(_e.kind==="source"||Ar){var Pr=si(At,De,"source");this.binders[At]=Ar?new la(_e,De,Je,O,Pr,p.id):new Wn(_e,Wt,De,Pr),pt.push("/a_"+At)}else{var Vr=si(At,De,"composite");this.binders[At]=new Dn(_e,Wt,De,Je,O,Vr),pt.push("/z_"+At)}}}this.cacheKey=pt.sort().join("")};qn.prototype.getMaxValue=function(p){var O=this.binders[p];return O instanceof Wn||O instanceof Dn?O.maxValue:0},qn.prototype.populatePaintArrays=function(p,O,W,pt,At){for(var Ot in this.binders){var Wt=this.binders[Ot];(Wt instanceof Wn||Wt instanceof Dn||Wt instanceof la)&&Wt.populatePaintArray(p,O,W,pt,At)}},qn.prototype.setConstantPatternPositions=function(p,O){for(var W in this.binders){var pt=this.binders[W];pt instanceof xn&&pt.setConstantPatternPositions(p,O)}},qn.prototype.updatePaintArrays=function(p,O,W,pt,At){var Ot=!1;for(var Wt in p)for(var _e=O.getPositions(Wt),De=0,Je=_e;De<Je.length;De+=1){var sr=Je[De],Ar=W.feature(sr.index);for(var Pr in this.binders){var Vr=this.binders[Pr];if((Vr instanceof Wn||Vr instanceof Dn||Vr instanceof la)&&Vr.expression.isStateDependent===!0){var un=pt.paint.get(Pr);Vr.expression=un.value,Vr.updatePaintArray(sr.start,sr.end,Ar,p[Wt],At),Ot=!0}}}return Ot},qn.prototype.defines=function(){var p=[];for(var O in this.binders){var W=this.binders[O];(W instanceof Ln||W instanceof xn)&&p.push.apply(p,W.uniformNames.map(function(pt){return"#define HAS_UNIFORM_"+pt}))}return p},qn.prototype.getBinderAttributes=function(){var p=[];for(var O in this.binders){var W=this.binders[O];if(W instanceof Wn||W instanceof Dn)for(var pt=0;pt<W.paintVertexAttributes.length;pt++)p.push(W.paintVertexAttributes[pt].name);else if(W instanceof la)for(var At=0;At<tt.members.length;At++)p.push(tt.members[At].name)}return p},qn.prototype.getBinderUniforms=function(){var p=[];for(var O in this.binders){var W=this.binders[O];if(W instanceof Ln||W instanceof xn||W instanceof Dn)for(var pt=0,At=W.uniformNames;pt<At.length;pt+=1){var Ot=At[pt];p.push(Ot)}}return p},qn.prototype.getPaintVertexBuffers=function(){return this._buffers},qn.prototype.getUniforms=function(p,O){var W=[];for(var pt in this.binders){var At=this.binders[pt];if(At instanceof Ln||At instanceof xn||At instanceof Dn)for(var Ot=0,Wt=At.uniformNames;Ot<Wt.length;Ot+=1){var _e=Wt[Ot];if(O[_e]){var De=At.getBinding(p,O[_e],_e);W.push({name:_e,property:pt,binding:De})}}}return W},qn.prototype.setUniforms=function(p,O,W,pt){for(var At=0,Ot=O;At<Ot.length;At+=1){var Wt=Ot[At],_e=Wt.name,De=Wt.property,Je=Wt.binding;this.binders[De].setUniform(Je,pt,W.get(De),_e)}},qn.prototype.updatePaintBuffers=function(p){this._buffers=[];for(var O in this.binders){var W=this.binders[O];if(p&&W instanceof la){var pt=p.fromScale===2?W.zoomInPaintVertexBuffer:W.zoomOutPaintVertexBuffer;pt&&this._buffers.push(pt)}else(W instanceof Wn||W instanceof Dn)&&W.paintVertexBuffer&&this._buffers.push(W.paintVertexBuffer)}},qn.prototype.upload=function(p){for(var O in this.binders){var W=this.binders[O];(W instanceof Wn||W instanceof Dn||W instanceof la)&&W.upload(p)}this.updatePaintBuffers()},qn.prototype.destroy=function(){for(var p in this.binders){var O=this.binders[p];(O instanceof Wn||O instanceof Dn||O instanceof la)&&O.destroy()}};var Gn=function(p,O,W){W===void 0&&(W=function(){return!0}),this.programConfigurations={};for(var pt=0,At=p;pt<At.length;pt+=1){var Ot=At[pt];this.programConfigurations[Ot.id]=new qn(Ot,O,W)}this.needsUpload=!1,this._featureMap=new Ft,this._bufferOffset=0};Gn.prototype.populatePaintArrays=function(p,O,W,pt,At,Ot){for(var Wt in this.programConfigurations)this.programConfigurations[Wt].populatePaintArrays(p,O,pt,At,Ot);O.id!==void 0&&this._featureMap.add(O.id,W,this._bufferOffset,p),this._bufferOffset=p,this.needsUpload=!0},Gn.prototype.updatePaintArrays=function(p,O,W,pt){for(var At=0,Ot=W;At<Ot.length;At+=1){var Wt=Ot[At];this.needsUpload=this.programConfigurations[Wt.id].updatePaintArrays(p,this._featureMap,O,Wt,pt)||this.needsUpload}},Gn.prototype.get=function(p){return this.programConfigurations[p]},Gn.prototype.upload=function(p){if(this.needsUpload){for(var O in this.programConfigurations)this.programConfigurations[O].upload(p);this.needsUpload=!1}},Gn.prototype.destroy=function(){for(var p in this.programConfigurations)this.programConfigurations[p].destroy()};function ma(p,O){var W={"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 W[p]||[p.replace(O+"-","").replace(/-/g,"_")]}function ti(p){var O={"line-pattern":{source:aa,composite:aa},"fill-pattern":{source:aa,composite:aa},"fill-extrusion-pattern":{source:aa,composite:aa}};return O[p]}function si(p,O,W){var pt={color:{source:ba,composite:El},number:{source:rs,composite:ba}},At=ti(p);return At&&At[W]||pt[O][W]}Ve("ConstantBinder",Ln),Ve("CrossFadedConstantBinder",xn),Ve("SourceExpressionBinder",Wn),Ve("CrossFadedCompositeBinder",la),Ve("CompositeExpressionBinder",Dn),Ve("ProgramConfiguration",qn,{omit:["_buffers"]}),Ve("ProgramConfigurationSet",Gn);var Li=8192,to=15,ls=Math.pow(2,to-1)-1,ms=-ls-1;function Ko(p){for(var O=Li/p.extent,W=p.loadGeometry(),pt=0;pt<W.length;pt++)for(var At=W[pt],Ot=0;Ot<At.length;Ot++){var Wt=At[Ot],_e=Math.round(Wt.x*O),De=Math.round(Wt.y*O);Wt.x=l(_e,ms,ls),Wt.y=l(De,ms,ls),(_e<Wt.x||_e>Wt.x+1||De<Wt.y||De>Wt.y+1)&&j("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return W}function gs(p,O){return{type:p.type,id:p.id,properties:p.properties,geometry:O?Ko(p):[]}}function Pl(p,O,W,pt,At){p.emplaceBack(O*2+(pt+1)/2,W*2+(At+1)/2)}var mo=function(p){this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(O){return O.id}),this.index=p.index,this.hasPattern=!1,this.layoutVertexArray=new qa,this.indexArray=new gi,this.segments=new $o,this.programConfigurations=new Gn(p.layers,p.zoom),this.stateDependentLayerIds=this.layers.filter(function(O){return O.isStateDependent()}).map(function(O){return O.id})};mo.prototype.populate=function(p,O,W){var pt=this.layers[0],At=[],Ot=null;pt.type==="circle"&&(Ot=pt.layout.get("circle-sort-key"));for(var Wt=0,_e=p;Wt<_e.length;Wt+=1){var De=_e[Wt],Je=De.feature,sr=De.id,Ar=De.index,Pr=De.sourceLayerIndex,Vr=this.layers[0]._featureFilter.needGeometry,un=gs(Je,Vr);if(this.layers[0]._featureFilter.filter(new ps(this.zoom),un,W)){var Fn=Ot?Ot.evaluate(un,{},W):void 0,ga={id:sr,properties:Je.properties,type:Je.type,sourceLayerIndex:Pr,index:Ar,geometry:Vr?un.geometry:Ko(Je),patterns:{},sortKey:Fn};At.push(ga)}}Ot&&At.sort(function(ro,no){return ro.sortKey-no.sortKey});for(var pa=0,Ea=At;pa<Ea.length;pa+=1){var ja=Ea[pa],Aa=ja,$a=Aa.geometry,hi=Aa.index,Si=Aa.sourceLayerIndex,Ei=p[hi].feature;this.addFeature(ja,$a,hi,W),O.featureIndex.insert(Ei,$a,hi,Si,this.index)}},mo.prototype.update=function(p,O,W){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(p,O,this.stateDependentLayers,W)},mo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},mo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},mo.prototype.upload=function(p){this.uploaded||(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,ns),this.indexBuffer=p.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(p),this.uploaded=!0},mo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},mo.prototype.addFeature=function(p,O,W,pt){for(var At=0,Ot=O;At<Ot.length;At+=1)for(var Wt=Ot[At],_e=0,De=Wt;_e<De.length;_e+=1){var Je=De[_e],sr=Je.x,Ar=Je.y;if(!(sr<0||sr>=Li||Ar<0||Ar>=Li)){var Pr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,p.sortKey),Vr=Pr.vertexLength;Pl(this.layoutVertexArray,sr,Ar,-1,-1),Pl(this.layoutVertexArray,sr,Ar,1,-1),Pl(this.layoutVertexArray,sr,Ar,1,1),Pl(this.layoutVertexArray,sr,Ar,-1,1),this.indexArray.emplaceBack(Vr,Vr+1,Vr+2),this.indexArray.emplaceBack(Vr,Vr+3,Vr+2),Pr.vertexLength+=4,Pr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,W,{},pt)},Ve("CircleBucket",mo,{omit:["layers"]});function Xs(p,O){for(var W=0;W<p.length;W++)if(yf(O,p[W]))return!0;for(var pt=0;pt<O.length;pt++)if(yf(p,O[pt]))return!0;return!!Zf(p,O)}function tc(p,O,W){return!!(yf(p,O)||_h(O,p,W))}function kc(p,O){if(p.length===1)return Yf(O,p[0]);for(var W=0;W<O.length;W++)for(var pt=O[W],At=0;At<pt.length;At++)if(yf(p,pt[At]))return!0;for(var Ot=0;Ot<p.length;Ot++)if(Yf(O,p[Ot]))return!0;for(var Wt=0;Wt<O.length;Wt++)if(Zf(p,O[Wt]))return!0;return!1}function lh(p,O,W){for(var pt=0;pt<O.length;pt++){var At=O[pt];if(p.length>=3){for(var Ot=0;Ot<At.length;Ot++)if(yf(p,At[Ot]))return!0}if(gh(p,At,W))return!0}return!1}function gh(p,O,W){if(p.length>1){if(Zf(p,O))return!0;for(var pt=0;pt<O.length;pt++)if(_h(O[pt],p,W))return!0}for(var At=0;At<p.length;At++)if(_h(p[At],O,W))return!0;return!1}function Zf(p,O){if(p.length===0||O.length===0)return!1;for(var W=0;W<p.length-1;W++)for(var pt=p[W],At=p[W+1],Ot=0;Ot<O.length-1;Ot++){var Wt=O[Ot],_e=O[Ot+1];if(Kf(pt,At,Wt,_e))return!0}return!1}function Kf(p,O,W,pt){return G(p,W,pt)!==G(O,W,pt)&&G(p,O,W)!==G(p,O,pt)}function _h(p,O,W){var pt=W*W;if(O.length===1)return p.distSqr(O[0])<pt;for(var At=1;At<O.length;At++){var Ot=O[At-1],Wt=O[At];if(Sf(p,Ot,Wt)<pt)return!0}return!1}function Sf(p,O,W){var pt=O.distSqr(W);if(pt===0)return p.distSqr(O);var At=((p.x-O.x)*(W.x-O.x)+(p.y-O.y)*(W.y-O.y))/pt;return At<0?p.distSqr(O):At>1?p.distSqr(W):p.distSqr(W.sub(O)._mult(At)._add(O))}function Yf(p,O){for(var W=!1,pt,At,Ot,Wt=0;Wt<p.length;Wt++){pt=p[Wt];for(var _e=0,De=pt.length-1;_e<pt.length;De=_e++)At=pt[_e],Ot=pt[De],At.y>O.y!=Ot.y>O.y&&O.x<(Ot.x-At.x)*(O.y-At.y)/(Ot.y-At.y)+At.x&&(W=!W)}return W}function yf(p,O){for(var W=!1,pt=0,At=p.length-1;pt<p.length;At=pt++){var Ot=p[pt],Wt=p[At];Ot.y>O.y!=Wt.y>O.y&&O.x<(Wt.x-Ot.x)*(O.y-Ot.y)/(Wt.y-Ot.y)+Ot.x&&(W=!W)}return W}function Ch(p,O,W,pt,At){for(var Ot=0,Wt=p;Ot<Wt.length;Ot+=1){var _e=Wt[Ot];if(O<=_e.x&&W<=_e.y&&pt>=_e.x&&At>=_e.y)return!0}var De=[new o(O,W),new o(O,At),new o(pt,At),new o(pt,W)];if(p.length>2)for(var Je=0,sr=De;Je<sr.length;Je+=1){var Ar=sr[Je];if(yf(p,Ar))return!0}for(var Pr=0;Pr<p.length-1;Pr++){var Vr=p[Pr],un=p[Pr+1];if(ip(Vr,un,De))return!0}return!1}function ip(p,O,W){var pt=W[0],At=W[2];if(p.x<pt.x&&O.x<pt.x||p.x>At.x&&O.x>At.x||p.y<pt.y&&O.y<pt.y||p.y>At.y&&O.y>At.y)return!1;var Ot=G(p,O,W[0]);return Ot!==G(p,O,W[1])||Ot!==G(p,O,W[2])||Ot!==G(p,O,W[3])}function Xf(p,O,W){var pt=O.paint.get(p).value;return pt.kind==="constant"?pt.value:W.programConfigurations.get(O.id).getMaxValue(p)}function $f(p){return Math.sqrt(p[0]*p[0]+p[1]*p[1])}function Ef(p,O,W,pt,At){if(!O[0]&&!O[1])return p;var Ot=o.convert(O)._mult(At);W==="viewport"&&Ot._rotate(-pt);for(var Wt=[],_e=0;_e<p.length;_e++){var De=p[_e];Wt.push(De.sub(Ot))}return Wt}var op=new Ka({"circle-sort-key":new Sn(Da.layout_circle["circle-sort-key"])}),wp=new Ka({"circle-radius":new Sn(Da.paint_circle["circle-radius"]),"circle-color":new Sn(Da.paint_circle["circle-color"]),"circle-blur":new Sn(Da.paint_circle["circle-blur"]),"circle-opacity":new Sn(Da.paint_circle["circle-opacity"]),"circle-translate":new qr(Da.paint_circle["circle-translate"]),"circle-translate-anchor":new qr(Da.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new qr(Da.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new qr(Da.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Sn(Da.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Sn(Da.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Sn(Da.paint_circle["circle-stroke-opacity"])}),sp={paint:wp,layout:op},$c=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var p=arguments,O=0,W=arguments.length;W--;)O+=p[W]*p[W];return Math.sqrt(O)});function Wh(){var p=new $c(4);return $c!=Float32Array&&(p[1]=0,p[2]=0),p[0]=1,p[3]=1,p}function Tp(p,O,W){var pt=O[0],At=O[1],Ot=O[2],Wt=O[3],_e=Math.sin(W),De=Math.cos(W);return p[0]=pt*De+Ot*_e,p[1]=At*De+Wt*_e,p[2]=pt*-_e+Ot*De,p[3]=At*-_e+Wt*De,p}function Jc(){var p=new $c(9);return $c!=Float32Array&&(p[1]=0,p[2]=0,p[3]=0,p[5]=0,p[6]=0,p[7]=0),p[0]=1,p[4]=1,p[8]=1,p}function lp(p,O){var W=Math.sin(O),pt=Math.cos(O);return p[0]=pt,p[1]=W,p[2]=0,p[3]=-W,p[4]=pt,p[5]=0,p[6]=0,p[7]=0,p[8]=1,p}function Zp(){var p=new $c(16);return $c!=Float32Array&&(p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[11]=0,p[12]=0,p[13]=0,p[14]=0),p[0]=1,p[5]=1,p[10]=1,p[15]=1,p}function Kp(p){var O=new $c(16);return O[0]=p[0],O[1]=p[1],O[2]=p[2],O[3]=p[3],O[4]=p[4],O[5]=p[5],O[6]=p[6],O[7]=p[7],O[8]=p[8],O[9]=p[9],O[10]=p[10],O[11]=p[11],O[12]=p[12],O[13]=p[13],O[14]=p[14],O[15]=p[15],O}function bh(p){return p[0]=1,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=1,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[10]=1,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,p}function kp(p,O){var W=O[0],pt=O[1],At=O[2],Ot=O[3],Wt=O[4],_e=O[5],De=O[6],Je=O[7],sr=O[8],Ar=O[9],Pr=O[10],Vr=O[11],un=O[12],Fn=O[13],ga=O[14],pa=O[15],Ea=W*_e-pt*Wt,ja=W*De-At*Wt,Aa=W*Je-Ot*Wt,$a=pt*De-At*_e,hi=pt*Je-Ot*_e,Si=At*Je-Ot*De,Ei=sr*Fn-Ar*un,ro=sr*ga-Pr*un,no=sr*pa-Vr*un,go=Ar*ga-Pr*Fn,Mo=Ar*pa-Vr*Fn,Vo=Pr*pa-Vr*ga,vo=Ea*Vo-ja*Mo+Aa*go+$a*no-hi*ro+Si*Ei;return vo?(vo=1/vo,p[0]=(_e*Vo-De*Mo+Je*go)*vo,p[1]=(At*Mo-pt*Vo-Ot*go)*vo,p[2]=(Fn*Si-ga*hi+pa*$a)*vo,p[3]=(Pr*hi-Ar*Si-Vr*$a)*vo,p[4]=(De*no-Wt*Vo-Je*ro)*vo,p[5]=(W*Vo-At*no+Ot*ro)*vo,p[6]=(ga*Aa-un*Si-pa*ja)*vo,p[7]=(sr*Si-Pr*Aa+Vr*ja)*vo,p[8]=(Wt*Mo-_e*no+Je*Ei)*vo,p[9]=(pt*no-W*Mo-Ot*Ei)*vo,p[10]=(un*hi-Fn*Aa+pa*Ea)*vo,p[11]=(Ar*Aa-sr*hi-Vr*Ea)*vo,p[12]=(_e*ro-Wt*go-De*Ei)*vo,p[13]=(W*go-pt*ro+At*Ei)*vo,p[14]=(Fn*ja-un*$a-ga*Ea)*vo,p[15]=(sr*$a-Ar*ja+Pr*Ea)*vo,p):null}function ec(p,O,W){var pt=O[0],At=O[1],Ot=O[2],Wt=O[3],_e=O[4],De=O[5],Je=O[6],sr=O[7],Ar=O[8],Pr=O[9],Vr=O[10],un=O[11],Fn=O[12],ga=O[13],pa=O[14],Ea=O[15],ja=W[0],Aa=W[1],$a=W[2],hi=W[3];return p[0]=ja*pt+Aa*_e+$a*Ar+hi*Fn,p[1]=ja*At+Aa*De+$a*Pr+hi*ga,p[2]=ja*Ot+Aa*Je+$a*Vr+hi*pa,p[3]=ja*Wt+Aa*sr+$a*un+hi*Ea,ja=W[4],Aa=W[5],$a=W[6],hi=W[7],p[4]=ja*pt+Aa*_e+$a*Ar+hi*Fn,p[5]=ja*At+Aa*De+$a*Pr+hi*ga,p[6]=ja*Ot+Aa*Je+$a*Vr+hi*pa,p[7]=ja*Wt+Aa*sr+$a*un+hi*Ea,ja=W[8],Aa=W[9],$a=W[10],hi=W[11],p[8]=ja*pt+Aa*_e+$a*Ar+hi*Fn,p[9]=ja*At+Aa*De+$a*Pr+hi*ga,p[10]=ja*Ot+Aa*Je+$a*Vr+hi*pa,p[11]=ja*Wt+Aa*sr+$a*un+hi*Ea,ja=W[12],Aa=W[13],$a=W[14],hi=W[15],p[12]=ja*pt+Aa*_e+$a*Ar+hi*Fn,p[13]=ja*At+Aa*De+$a*Pr+hi*ga,p[14]=ja*Ot+Aa*Je+$a*Vr+hi*pa,p[15]=ja*Wt+Aa*sr+$a*un+hi*Ea,p}function Qc(p,O,W){var pt=W[0],At=W[1],Ot=W[2],Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa;return O===p?(p[12]=O[0]*pt+O[4]*At+O[8]*Ot+O[12],p[13]=O[1]*pt+O[5]*At+O[9]*Ot+O[13],p[14]=O[2]*pt+O[6]*At+O[10]*Ot+O[14],p[15]=O[3]*pt+O[7]*At+O[11]*Ot+O[15]):(Wt=O[0],_e=O[1],De=O[2],Je=O[3],sr=O[4],Ar=O[5],Pr=O[6],Vr=O[7],un=O[8],Fn=O[9],ga=O[10],pa=O[11],p[0]=Wt,p[1]=_e,p[2]=De,p[3]=Je,p[4]=sr,p[5]=Ar,p[6]=Pr,p[7]=Vr,p[8]=un,p[9]=Fn,p[10]=ga,p[11]=pa,p[12]=Wt*pt+sr*At+un*Ot+O[12],p[13]=_e*pt+Ar*At+Fn*Ot+O[13],p[14]=De*pt+Pr*At+ga*Ot+O[14],p[15]=Je*pt+Vr*At+pa*Ot+O[15]),p}function Ol(p,O,W){var pt=W[0],At=W[1],Ot=W[2];return p[0]=O[0]*pt,p[1]=O[1]*pt,p[2]=O[2]*pt,p[3]=O[3]*pt,p[4]=O[4]*At,p[5]=O[5]*At,p[6]=O[6]*At,p[7]=O[7]*At,p[8]=O[8]*Ot,p[9]=O[9]*Ot,p[10]=O[10]*Ot,p[11]=O[11]*Ot,p[12]=O[12],p[13]=O[13],p[14]=O[14],p[15]=O[15],p}function Ap(p,O,W){var pt=Math.sin(W),At=Math.cos(W),Ot=O[4],Wt=O[5],_e=O[6],De=O[7],Je=O[8],sr=O[9],Ar=O[10],Pr=O[11];return O!==p&&(p[0]=O[0],p[1]=O[1],p[2]=O[2],p[3]=O[3],p[12]=O[12],p[13]=O[13],p[14]=O[14],p[15]=O[15]),p[4]=Ot*At+Je*pt,p[5]=Wt*At+sr*pt,p[6]=_e*At+Ar*pt,p[7]=De*At+Pr*pt,p[8]=Je*At-Ot*pt,p[9]=sr*At-Wt*pt,p[10]=Ar*At-_e*pt,p[11]=Pr*At-De*pt,p}function Yp(p,O,W){var pt=Math.sin(W),At=Math.cos(W),Ot=O[0],Wt=O[1],_e=O[2],De=O[3],Je=O[4],sr=O[5],Ar=O[6],Pr=O[7];return O!==p&&(p[8]=O[8],p[9]=O[9],p[10]=O[10],p[11]=O[11],p[12]=O[12],p[13]=O[13],p[14]=O[14],p[15]=O[15]),p[0]=Ot*At+Je*pt,p[1]=Wt*At+sr*pt,p[2]=_e*At+Ar*pt,p[3]=De*At+Pr*pt,p[4]=Je*At-Ot*pt,p[5]=sr*At-Wt*pt,p[6]=Ar*At-_e*pt,p[7]=Pr*At-De*pt,p}function C0(p,O,W,pt,At){var Ot=1/Math.tan(O/2),Wt;return p[0]=Ot/W,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=Ot,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[11]=-1,p[12]=0,p[13]=0,p[15]=0,At!=null&&At!==1/0?(Wt=1/(pt-At),p[10]=(At+pt)*Wt,p[14]=2*At*pt*Wt):(p[10]=-1,p[14]=-2*pt),p}function Ul(p,O,W,pt,At,Ot,Wt){var _e=1/(O-W),De=1/(pt-At),Je=1/(Ot-Wt);return p[0]=-2*_e,p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=-2*De,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[10]=2*Je,p[11]=0,p[12]=(O+W)*_e,p[13]=(At+pt)*De,p[14]=(Wt+Ot)*Je,p[15]=1,p}var Gh=ec;function I0(){var p=new $c(3);return $c!=Float32Array&&(p[0]=0,p[1]=0,p[2]=0),p}function Mp(p){var O=new $c(3);return O[0]=p[0],O[1]=p[1],O[2]=p[2],O}function wh(p,O,W){return p[0]=O[0]+W[0],p[1]=O[1]+W[1],p[2]=O[2]+W[2],p}function Zm(p,O,W){return p[0]=O[0]-W[0],p[1]=O[1]-W[1],p[2]=O[2]-W[2],p}function Xp(p,O,W){return p[0]=O[0]*W,p[1]=O[1]*W,p[2]=O[2]*W,p}function o_(p,O){var W=O[0],pt=O[1],At=O[2],Ot=W*W+pt*pt+At*At;return Ot>0&&(Ot=1/Math.sqrt(Ot)),p[0]=O[0]*Ot,p[1]=O[1]*Ot,p[2]=O[2]*Ot,p}function s_(p,O){return p[0]*O[0]+p[1]*O[1]+p[2]*O[2]}function l_(p,O,W){var pt=O[0],At=O[1],Ot=O[2],Wt=W[0],_e=W[1],De=W[2];return p[0]=At*De-Ot*_e,p[1]=Ot*Wt-pt*De,p[2]=pt*_e-At*Wt,p}function u_(p,O,W){var pt=O[0],At=O[1],Ot=O[2];return p[0]=pt*W[0]+At*W[3]+Ot*W[6],p[1]=pt*W[1]+At*W[4]+Ot*W[7],p[2]=pt*W[2]+At*W[5]+Ot*W[8],p}var c_=Zm;(function(){var p=I0();return function(O,W,pt,At,Ot,Wt){var _e,De;for(W||(W=3),pt||(pt=0),At?De=Math.min(At*W+pt,O.length):De=O.length,_e=pt;_e<De;_e+=W)p[0]=O[_e],p[1]=O[_e+1],p[2]=O[_e+2],Ot(p,p,Wt),O[_e]=p[0],O[_e+1]=p[1],O[_e+2]=p[2];return O}})();function f_(){var p=new $c(4);return $c!=Float32Array&&(p[0]=0,p[1]=0,p[2]=0,p[3]=0),p}function h_(p,O,W){return p[0]=O[0]*W,p[1]=O[1]*W,p[2]=O[2]*W,p[3]=O[3]*W,p}function p_(p,O){return p[0]*O[0]+p[1]*O[1]+p[2]*O[2]+p[3]*O[3]}function P0(p,O,W){var pt=O[0],At=O[1],Ot=O[2],Wt=O[3];return p[0]=W[0]*pt+W[4]*At+W[8]*Ot+W[12]*Wt,p[1]=W[1]*pt+W[5]*At+W[9]*Ot+W[13]*Wt,p[2]=W[2]*pt+W[6]*At+W[10]*Ot+W[14]*Wt,p[3]=W[3]*pt+W[7]*At+W[11]*Ot+W[15]*Wt,p}(function(){var p=f_();return function(O,W,pt,At,Ot,Wt){var _e,De;for(W||(W=4),pt||(pt=0),At?De=Math.min(At*W+pt,O.length):De=O.length,_e=pt;_e<De;_e+=W)p[0]=O[_e],p[1]=O[_e+1],p[2]=O[_e+2],p[3]=O[_e+3],Ot(p,p,Wt),O[_e]=p[0],O[_e+1]=p[1],O[_e+2]=p[2],O[_e+3]=p[3];return O}})();function O0(){var p=new $c(2);return $c!=Float32Array&&(p[0]=0,p[1]=0),p}function $p(p){var O=p[0],W=p[1];return O*O+W*W}var Fv=$p;(function(){var p=O0();return function(O,W,pt,At,Ot,Wt){var _e,De;for(W||(W=2),pt||(pt=0),At?De=Math.min(At*W+pt,O.length):De=O.length,_e=pt;_e<De;_e+=W)p[0]=O[_e],p[1]=O[_e+1],Ot(p,p,Wt),O[_e]=p[0],O[_e+1]=p[1];return O}})();var Km=function(p){function O(W){p.call(this,W,sp)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.createBucket=function(W){return new mo(W)},O.prototype.queryRadius=function(W){var pt=W;return Xf("circle-radius",this,pt)+Xf("circle-stroke-width",this,pt)+$f(this.paint.get("circle-translate"))},O.prototype.queryIntersectsFeature=function(W,pt,At,Ot,Wt,_e,De,Je){for(var sr=Ef(W,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),_e.angle,De),Ar=this.paint.get("circle-radius").evaluate(pt,At),Pr=this.paint.get("circle-stroke-width").evaluate(pt,At),Vr=Ar+Pr,un=this.paint.get("circle-pitch-alignment")==="map",Fn=un?sr:d_(sr,Je),ga=un?Vr*De:Vr,pa=0,Ea=Ot;pa<Ea.length;pa+=1)for(var ja=Ea[pa],Aa=0,$a=ja;Aa<$a.length;Aa+=1){var hi=$a[Aa],Si=un?hi:D0(hi,Je),Ei=ga,ro=P0([],[hi.x,hi.y,0,1],Je);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ei*=ro[3]/_e.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ei*=_e.cameraToCenterDistance/ro[3]),tc(Fn,Si,Ei))return!0}return!1},O}(fa);function D0(p,O){var W=P0([],[p.x,p.y,0,1],O);return new o(W[0]/W[3],W[1]/W[3])}function d_(p,O){return p.map(function(W){return D0(W,O)})}var Bv=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O}(mo);Ve("HeatmapBucket",Bv,{omit:["layers"]});function Ym(p,O,W,pt){var At=O.width,Ot=O.height;if(!pt)pt=new Uint8Array(At*Ot*W);else if(pt instanceof Uint8ClampedArray)pt=new Uint8Array(pt.buffer);else if(pt.length!==At*Ot*W)throw new RangeError("mismatched image size");return p.width=At,p.height=Ot,p.data=pt,p}function Xm(p,O,W){var pt=O.width,At=O.height;if(!(pt===p.width&&At===p.height)){var Ot=Ym({},{width:pt,height:At},W);F0(p,Ot,{x:0,y:0},{x:0,y:0},{width:Math.min(p.width,pt),height:Math.min(p.height,At)},W),p.width=pt,p.height=At,p.data=Ot.data}}function F0(p,O,W,pt,At,Ot){if(At.width===0||At.height===0)return O;if(At.width>p.width||At.height>p.height||W.x>p.width-At.width||W.y>p.height-At.height)throw new RangeError("out of range source coordinates for image copy");if(At.width>O.width||At.height>O.height||pt.x>O.width-At.width||pt.y>O.height-At.height)throw new RangeError("out of range destination coordinates for image copy");for(var Wt=p.data,_e=O.data,De=0;De<At.height;De++)for(var Je=((W.y+De)*p.width+W.x)*Ot,sr=((pt.y+De)*O.width+pt.x)*Ot,Ar=0;Ar<At.width*Ot;Ar++)_e[sr+Ar]=Wt[Je+Ar];return O}var Vc=function(p,O){Ym(this,p,1,O)};Vc.prototype.resize=function(p){Xm(this,p,1)},Vc.prototype.clone=function(){return new Vc({width:this.width,height:this.height},new Uint8Array(this.data))},Vc.copy=function(p,O,W,pt,At){F0(p,O,W,pt,At,1)};var xf=function(p,O){Ym(this,p,4,O)};xf.prototype.resize=function(p){Xm(this,p,4)},xf.prototype.replace=function(p,O){O?this.data.set(p):p instanceof Uint8ClampedArray?this.data=new Uint8Array(p.buffer):this.data=p},xf.prototype.clone=function(){return new xf({width:this.width,height:this.height},new Uint8Array(this.data))},xf.copy=function(p,O,W,pt,At){F0(p,O,W,pt,At,4)},Ve("AlphaImage",Vc),Ve("RGBAImage",xf);var Rv=new Ka({"heatmap-radius":new Sn(Da.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Sn(Da.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new qr(Da.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ka(Da.paint_heatmap["heatmap-color"]),"heatmap-opacity":new qr(Da.paint_heatmap["heatmap-opacity"])}),up={paint:Rv};function Jp(p){var O={},W=p.resolution||256,pt=p.clips?p.clips.length:1,At=p.image||new xf({width:W,height:pt}),Ot=function(Ea,ja,Aa){O[p.evaluationKey]=Aa;var $a=p.expression.evaluate(O);At.data[Ea+ja+0]=Math.floor($a.r*255/$a.a),At.data[Ea+ja+1]=Math.floor($a.g*255/$a.a),At.data[Ea+ja+2]=Math.floor($a.b*255/$a.a),At.data[Ea+ja+3]=Math.floor($a.a*255)};if(p.clips)for(var Wt=0,_e=0;Wt<pt;++Wt,_e+=W*4)for(var De=0,Je=0;De<W;De++,Je+=4){var sr=De/(W-1),Ar=p.clips[Wt],Pr=Ar.start,Vr=Ar.end,un=Pr*(1-sr)+Vr*sr;Ot(_e,Je,un)}else for(var Fn=0,ga=0;Fn<W;Fn++,ga+=4){var pa=Fn/(W-1);Ot(0,ga,pa)}return At}var Wd=function(p){function O(W){p.call(this,W,up),this._updateColorRamp()}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.createBucket=function(W){return new Bv(W)},O.prototype._handleSpecialPaintPropertyUpdate=function(W){W==="heatmap-color"&&this._updateColorRamp()},O.prototype._updateColorRamp=function(){var W=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Jp({expression:W,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},O.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},O.prototype.queryRadius=function(){return 0},O.prototype.queryIntersectsFeature=function(){return!1},O.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},O}(fa),Qp=new Ka({"hillshade-illumination-direction":new qr(Da.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new qr(Da.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new qr(Da.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new qr(Da.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new qr(Da.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new qr(Da.paint_hillshade["hillshade-accent-color"])}),B0={paint:Qp},R0=function(p){function O(W){p.call(this,W,B0)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},O}(fa),m_=kn([{name:"a_pos",components:2,type:"Int16"}],4),g_=m_.members,N0=j0,Nv=j0;function j0(p,O,W){W=W||2;var pt=O&&O.length,At=pt?O[0]*W:p.length,Ot=$m(p,0,At,W,!0),Wt=[];if(!Ot||Ot.next===Ot.prev)return Wt;var _e,De,Je,sr,Ar,Pr,Vr;if(pt&&(Ot=Uv(p,O,Ot,W)),p.length>80*W){_e=Je=p[0],De=sr=p[1];for(var un=W;un<At;un+=W)Ar=p[un],Pr=p[un+1],Ar<_e&&(_e=Ar),Pr<De&&(De=Pr),Ar>Je&&(Je=Ar),Pr>sr&&(sr=Pr);Vr=Math.max(Je-_e,sr-De),Vr=Vr!==0?1/Vr:0}return Sp(Ot,Wt,W,_e,De,Vr),Wt}function $m(p,O,W,pt,At){var Ot,Wt;if(At===ng(p,O,W,pt)>0)for(Ot=O;Ot<W;Ot+=pt)Wt=Hv(Ot,p[Ot],p[Ot+1],Wt);else for(Ot=W-pt;Ot>=O;Ot-=pt)Wt=Hv(Ot,p[Ot],p[Ot+1],Wt);return Wt&&td(Wt,Wt.next)&&(Yd(Wt),Wt=Wt.next),Wt}function Zh(p,O){if(!p)return p;O||(O=p);var W=p,pt;do if(pt=!1,!W.steiner&&(td(W,W.next)||uc(W.prev,W,W.next)===0)){if(Yd(W),W=O=W.prev,W===W.next)break;pt=!0}else W=W.next;while(pt||W!==O);return O}function Sp(p,O,W,pt,At,Ot,Wt){if(p){!Wt&&Ot&&Qm(p,pt,At,Ot);for(var _e=p,De,Je;p.prev!==p.next;){if(De=p.prev,Je=p.next,Ot?v_(p,pt,At,Ot):Jm(p)){O.push(De.i/W),O.push(p.i/W),O.push(Je.i/W),Yd(p),p=Je.next,_e=Je.next;continue}if(p=Je,p===_e){Wt?Wt===1?(p=y_(Zh(p),O,W),Sp(p,O,W,pt,At,Ot,2)):Wt===2&&jv(p,O,W,pt,At,Ot):Sp(Zh(p),O,W,pt,At,Ot,1);break}}}}function Jm(p){var O=p.prev,W=p,pt=p.next;if(uc(O,W,pt)>=0)return!1;for(var At=p.next.next;At!==p.prev;){if(fp(O.x,O.y,W.x,W.y,pt.x,pt.y,At.x,At.y)&&uc(At.prev,At,At.next)>=0)return!1;At=At.next}return!0}function v_(p,O,W,pt){var At=p.prev,Ot=p,Wt=p.next;if(uc(At,Ot,Wt)>=0)return!1;for(var _e=At.x<Ot.x?At.x<Wt.x?At.x:Wt.x:Ot.x<Wt.x?Ot.x:Wt.x,De=At.y<Ot.y?At.y<Wt.y?At.y:Wt.y:Ot.y<Wt.y?Ot.y:Wt.y,Je=At.x>Ot.x?At.x>Wt.x?At.x:Wt.x:Ot.x>Wt.x?Ot.x:Wt.x,sr=At.y>Ot.y?At.y>Wt.y?At.y:Wt.y:Ot.y>Wt.y?Ot.y:Wt.y,Ar=tg(_e,De,O,W,pt),Pr=tg(Je,sr,O,W,pt),Vr=p.prevZ,un=p.nextZ;Vr&&Vr.z>=Ar&&un&&un.z<=Pr;){if(Vr!==p.prev&&Vr!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,Vr.x,Vr.y)&&uc(Vr.prev,Vr,Vr.next)>=0||(Vr=Vr.prevZ,un!==p.prev&&un!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,un.x,un.y)&&uc(un.prev,un,un.next)>=0))return!1;un=un.nextZ}for(;Vr&&Vr.z>=Ar;){if(Vr!==p.prev&&Vr!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,Vr.x,Vr.y)&&uc(Vr.prev,Vr,Vr.next)>=0)return!1;Vr=Vr.prevZ}for(;un&&un.z<=Pr;){if(un!==p.prev&&un!==p.next&&fp(At.x,At.y,Ot.x,Ot.y,Wt.x,Wt.y,un.x,un.y)&&uc(un.prev,un,un.next)>=0)return!1;un=un.nextZ}return!0}function y_(p,O,W){var pt=p;do{var At=pt.prev,Ot=pt.next.next;!td(At,Ot)&&Ep(At,pt,pt.next,Ot)&&ed(At,Ot)&&ed(Ot,At)&&(O.push(At.i/W),O.push(pt.i/W),O.push(Ot.i/W),Yd(pt),Yd(pt.next),pt=p=Ot),pt=pt.next}while(pt!==p);return Zh(pt)}function jv(p,O,W,pt,At,Ot){var Wt=p;do{for(var _e=Wt.next.next;_e!==Wt.prev;){if(Wt.i!==_e.i&&__(Wt,_e)){var De=rg(Wt,_e);Wt=Zh(Wt,Wt.next),De=Zh(De,De.next),Sp(Wt,O,W,pt,At,Ot),Sp(De,O,W,pt,At,Ot);return}_e=_e.next}Wt=Wt.next}while(Wt!==p)}function Uv(p,O,W,pt){var At=[],Ot,Wt,_e,De,Je;for(Ot=0,Wt=O.length;Ot<Wt;Ot++)_e=O[Ot]*pt,De=Ot<Wt-1?O[Ot+1]*pt:p.length,Je=$m(p,_e,De,pt,!1),Je===Je.next&&(Je.steiner=!0),At.push(U0(Je));for(At.sort(Gd),Ot=0;Ot<At.length;Ot++)Ih(At[Ot],W),W=Zh(W,W.next);return W}function Gd(p,O){return p.x-O.x}function Ih(p,O){if(O=cp(p,O),O){var W=rg(O,p);Zh(O,O.next),Zh(W,W.next)}}function cp(p,O){var W=O,pt=p.x,At=p.y,Ot=-1/0,Wt;do{if(At<=W.y&&At>=W.next.y&&W.next.y!==W.y){var _e=W.x+(At-W.y)*(W.next.x-W.x)/(W.next.y-W.y);if(_e<=pt&&_e>Ot){if(Ot=_e,_e===pt){if(At===W.y)return W;if(At===W.next.y)return W.next}Wt=W.x<W.next.x?W:W.next}}W=W.next}while(W!==O);if(!Wt)return null;if(pt===Ot)return Wt;var De=Wt,Je=Wt.x,sr=Wt.y,Ar=1/0,Pr;W=Wt;do pt>=W.x&&W.x>=Je&&pt!==W.x&&fp(At<sr?pt:Ot,At,Je,sr,At<sr?Ot:pt,At,W.x,W.y)&&(Pr=Math.abs(At-W.y)/(pt-W.x),ed(W,p)&&(Pr<Ar||Pr===Ar&&(W.x>Wt.x||W.x===Wt.x&&Vv(Wt,W)))&&(Wt=W,Ar=Pr)),W=W.next;while(W!==De);return Wt}function Vv(p,O){return uc(p.prev,p,O.prev)<0&&uc(O.next,p,p.next)<0}function Qm(p,O,W,pt){var At=p;do At.z===null&&(At.z=tg(At.x,At.y,O,W,pt)),At.prevZ=At.prev,At.nextZ=At.next,At=At.next;while(At!==p);At.prevZ.nextZ=null,At.prevZ=null,x_(At)}function x_(p){var O,W,pt,At,Ot,Wt,_e,De,Je=1;do{for(W=p,p=null,Ot=null,Wt=0;W;){for(Wt++,pt=W,_e=0,O=0;O<Je&&(_e++,pt=pt.nextZ,!!pt);O++);for(De=Je;_e>0||De>0&&pt;)_e!==0&&(De===0||!pt||W.z<=pt.z)?(At=W,W=W.nextZ,_e--):(At=pt,pt=pt.nextZ,De--),Ot?Ot.nextZ=At:p=At,At.prevZ=Ot,Ot=At;W=pt}Ot.nextZ=null,Je*=2}while(Wt>1);return p}function tg(p,O,W,pt,At){return p=32767*(p-W)*At,O=32767*(O-pt)*At,p=(p|p<<8)&16711935,p=(p|p<<4)&252645135,p=(p|p<<2)&858993459,p=(p|p<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,p|O<<1}function U0(p){var O=p,W=p;do(O.x<W.x||O.x===W.x&&O.y<W.y)&&(W=O),O=O.next;while(O!==p);return W}function fp(p,O,W,pt,At,Ot,Wt,_e){return(At-Wt)*(O-_e)-(p-Wt)*(Ot-_e)>=0&&(p-Wt)*(pt-_e)-(W-Wt)*(O-_e)>=0&&(W-Wt)*(Ot-_e)-(At-Wt)*(pt-_e)>=0}function __(p,O){return p.next.i!==O.i&&p.prev.i!==O.i&&!eg(p,O)&&(ed(p,O)&&ed(O,p)&&V0(p,O)&&(uc(p.prev,p,O.prev)||uc(p,O.prev,O))||td(p,O)&&uc(p.prev,p,p.next)>0&&uc(O.prev,O,O.next)>0)}function uc(p,O,W){return(O.y-p.y)*(W.x-O.x)-(O.x-p.x)*(W.y-O.y)}function td(p,O){return p.x===O.x&&p.y===O.y}function Ep(p,O,W,pt){var At=Kd(uc(p,O,W)),Ot=Kd(uc(p,O,pt)),Wt=Kd(uc(W,pt,p)),_e=Kd(uc(W,pt,O));return!!(At!==Ot&&Wt!==_e||At===0&&Zd(p,W,O)||Ot===0&&Zd(p,pt,O)||Wt===0&&Zd(W,p,pt)||_e===0&&Zd(W,O,pt))}function Zd(p,O,W){return O.x<=Math.max(p.x,W.x)&&O.x>=Math.min(p.x,W.x)&&O.y<=Math.max(p.y,W.y)&&O.y>=Math.min(p.y,W.y)}function Kd(p){return p>0?1:p<0?-1:0}function eg(p,O){var W=p;do{if(W.i!==p.i&&W.next.i!==p.i&&W.i!==O.i&&W.next.i!==O.i&&Ep(W,W.next,p,O))return!0;W=W.next}while(W!==p);return!1}function ed(p,O){return uc(p.prev,p,p.next)<0?uc(p,O,p.next)>=0&&uc(p,p.prev,O)>=0:uc(p,O,p.prev)<0||uc(p,p.next,O)<0}function V0(p,O){var W=p,pt=!1,At=(p.x+O.x)/2,Ot=(p.y+O.y)/2;do W.y>Ot!=W.next.y>Ot&&W.next.y!==W.y&&At<(W.next.x-W.x)*(Ot-W.y)/(W.next.y-W.y)+W.x&&(pt=!pt),W=W.next;while(W!==p);return pt}function rg(p,O){var W=new H0(p.i,p.x,p.y),pt=new H0(O.i,O.x,O.y),At=p.next,Ot=O.prev;return p.next=O,O.prev=p,W.next=At,At.prev=W,pt.next=W,W.prev=pt,Ot.next=pt,pt.prev=Ot,pt}function Hv(p,O,W,pt){var At=new H0(p,O,W);return pt?(At.next=pt.next,At.prev=pt,pt.next.prev=At,pt.next=At):(At.prev=At,At.next=At),At}function Yd(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function H0(p,O,W){this.i=p,this.x=O,this.y=W,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}j0.deviation=function(p,O,W,pt){var At=O&&O.length,Ot=At?O[0]*W:p.length,Wt=Math.abs(ng(p,0,Ot,W));if(At)for(var _e=0,De=O.length;_e<De;_e++){var Je=O[_e]*W,sr=_e<De-1?O[_e+1]*W:p.length;Wt-=Math.abs(ng(p,Je,sr,W))}var Ar=0;for(_e=0;_e<pt.length;_e+=3){var Pr=pt[_e]*W,Vr=pt[_e+1]*W,un=pt[_e+2]*W;Ar+=Math.abs((p[Pr]-p[un])*(p[Vr+1]-p[Pr+1])-(p[Pr]-p[Vr])*(p[un+1]-p[Pr+1]))}return Wt===0&&Ar===0?0:Math.abs((Ar-Wt)/Wt)};function ng(p,O,W,pt){for(var At=0,Ot=O,Wt=W-pt;Ot<W;Ot+=pt)At+=(p[Wt]-p[Ot])*(p[Ot+1]+p[Wt+1]),Wt=Ot;return At}j0.flatten=function(p){for(var O=p[0][0].length,W={vertices:[],holes:[],dimensions:O},pt=0,At=0;At<p.length;At++){for(var Ot=0;Ot<p[At].length;Ot++)for(var Wt=0;Wt<O;Wt++)W.vertices.push(p[At][Ot][Wt]);At>0&&(pt+=p[At-1].length,W.holes.push(pt))}return W},N0.default=Nv;function b_(p,O,W,pt,At){qv(p,O,W,pt||p.length-1,At||ag)}function qv(p,O,W,pt,At){for(;pt>W;){if(pt-W>600){var Ot=pt-W+1,Wt=O-W+1,_e=Math.log(Ot),De=.5*Math.exp(2*_e/3),Je=.5*Math.sqrt(_e*De*(Ot-De)/Ot)*(Wt-Ot/2<0?-1:1),sr=Math.max(W,Math.floor(O-Wt*De/Ot+Je)),Ar=Math.min(pt,Math.floor(O+(Ot-Wt)*De/Ot+Je));qv(p,O,sr,Ar,At)}var Pr=p[O],Vr=W,un=pt;for(Xd(p,W,O),At(p[pt],Pr)>0&&Xd(p,W,pt);Vr<un;){for(Xd(p,Vr,un),Vr++,un--;At(p[Vr],Pr)<0;)Vr++;for(;At(p[un],Pr)>0;)un--}At(p[W],Pr)===0?Xd(p,W,un):(un++,Xd(p,un,pt)),un<=O&&(W=un+1),O<=un&&(pt=un-1)}}function Xd(p,O,W){var pt=p[O];p[O]=p[W],p[W]=pt}function ag(p,O){return p<O?-1:p>O?1:0}function Ph(p,O){var W=p.length;if(W<=1)return[p];for(var pt=[],At,Ot,Wt=0;Wt<W;Wt++){var _e=rt(p[Wt]);_e!==0&&(p[Wt].area=Math.abs(_e),Ot===void 0&&(Ot=_e<0),Ot===_e<0?(At&&pt.push(At),At=[p[Wt]]):At.push(p[Wt]))}if(At&&pt.push(At),O>1)for(var De=0;De<pt.length;De++)pt[De].length<=O||(b_(pt[De],O,1,pt[De].length-1,Wv),pt[De]=pt[De].slice(0,O));return pt}function Wv(p,O){return O.area-p.area}function q0(p,O,W){for(var pt=W.patternDependencies,At=!1,Ot=0,Wt=O;Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=_e.paint.get(p+"-pattern");De.isConstant()||(At=!0);var Je=De.constantOr(null);Je&&(At=!0,pt[Je.to]=!0,pt[Je.from]=!0)}return At}function W0(p,O,W,pt,At){for(var Ot=At.patternDependencies,Wt=0,_e=O;Wt<_e.length;Wt+=1){var De=_e[Wt],Je=De.paint.get(p+"-pattern"),sr=Je.value;if(sr.kind!=="constant"){var Ar=sr.evaluate({zoom:pt-1},W,{},At.availableImages),Pr=sr.evaluate({zoom:pt},W,{},At.availableImages),Vr=sr.evaluate({zoom:pt+1},W,{},At.availableImages);Ar=Ar&&Ar.name?Ar.name:Ar,Pr=Pr&&Pr.name?Pr.name:Pr,Vr=Vr&&Vr.name?Vr.name:Vr,Ot[Ar]=!0,Ot[Pr]=!0,Ot[Vr]=!0,W.patterns[De.id]={min:Ar,mid:Pr,max:Vr}}}return W}var Gv=500,vh=function(p){this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(O){return O.id}),this.index=p.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new qa,this.indexArray=new gi,this.indexArray2=new Zo,this.programConfigurations=new Gn(p.layers,p.zoom),this.segments=new $o,this.segments2=new $o,this.stateDependentLayerIds=this.layers.filter(function(O){return O.isStateDependent()}).map(function(O){return O.id})};vh.prototype.populate=function(p,O,W){this.hasPattern=q0("fill",this.layers,O);for(var pt=this.layers[0].layout.get("fill-sort-key"),At=[],Ot=0,Wt=p;Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=_e.feature,Je=_e.id,sr=_e.index,Ar=_e.sourceLayerIndex,Pr=this.layers[0]._featureFilter.needGeometry,Vr=gs(De,Pr);if(this.layers[0]._featureFilter.filter(new ps(this.zoom),Vr,W)){var un=pt?pt.evaluate(Vr,{},W,O.availableImages):void 0,Fn={id:Je,properties:De.properties,type:De.type,sourceLayerIndex:Ar,index:sr,geometry:Pr?Vr.geometry:Ko(De),patterns:{},sortKey:un};At.push(Fn)}}pt&&At.sort(function(ro,no){return ro.sortKey-no.sortKey});for(var ga=0,pa=At;ga<pa.length;ga+=1){var Ea=pa[ga],ja=Ea,Aa=ja.geometry,$a=ja.index,hi=ja.sourceLayerIndex;if(this.hasPattern){var Si=W0("fill",this.layers,Ea,this.zoom,O);this.patternFeatures.push(Si)}else this.addFeature(Ea,Aa,$a,W,{});var Ei=p[$a].feature;O.featureIndex.insert(Ei,Aa,$a,hi,this.index)}},vh.prototype.update=function(p,O,W){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(p,O,this.stateDependentLayers,W)},vh.prototype.addFeatures=function(p,O,W){for(var pt=0,At=this.patternFeatures;pt<At.length;pt+=1){var Ot=At[pt];this.addFeature(Ot,Ot.geometry,Ot.index,O,W)}},vh.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},vh.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},vh.prototype.upload=function(p){this.uploaded||(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,g_),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.indexBuffer2=p.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(p),this.uploaded=!0},vh.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},vh.prototype.addFeature=function(p,O,W,pt,At){for(var Ot=0,Wt=Ph(O,Gv);Ot<Wt.length;Ot+=1){for(var _e=Wt[Ot],De=0,Je=0,sr=_e;Je<sr.length;Je+=1){var Ar=sr[Je];De+=Ar.length}for(var Pr=this.segments.prepareSegment(De,this.layoutVertexArray,this.indexArray),Vr=Pr.vertexLength,un=[],Fn=[],ga=0,pa=_e;ga<pa.length;ga+=1){var Ea=pa[ga];if(Ea.length!==0){Ea!==_e[0]&&Fn.push(un.length/2);var ja=this.segments2.prepareSegment(Ea.length,this.layoutVertexArray,this.indexArray2),Aa=ja.vertexLength;this.layoutVertexArray.emplaceBack(Ea[0].x,Ea[0].y),this.indexArray2.emplaceBack(Aa+Ea.length-1,Aa),un.push(Ea[0].x),un.push(Ea[0].y);for(var $a=1;$a<Ea.length;$a++)this.layoutVertexArray.emplaceBack(Ea[$a].x,Ea[$a].y),this.indexArray2.emplaceBack(Aa+$a-1,Aa+$a),un.push(Ea[$a].x),un.push(Ea[$a].y);ja.vertexLength+=Ea.length,ja.primitiveLength+=Ea.length}}for(var hi=N0(un,Fn),Si=0;Si<hi.length;Si+=3)this.indexArray.emplaceBack(Vr+hi[Si],Vr+hi[Si+1],Vr+hi[Si+2]);Pr.vertexLength+=De,Pr.primitiveLength+=hi.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,W,At,pt)},Ve("FillBucket",vh,{omit:["layers","patternFeatures"]});var ig=new Ka({"fill-sort-key":new Sn(Da.layout_fill["fill-sort-key"])}),$d=new Ka({"fill-antialias":new qr(Da.paint_fill["fill-antialias"]),"fill-opacity":new Sn(Da.paint_fill["fill-opacity"]),"fill-color":new Sn(Da.paint_fill["fill-color"]),"fill-outline-color":new Sn(Da.paint_fill["fill-outline-color"]),"fill-translate":new qr(Da.paint_fill["fill-translate"]),"fill-translate-anchor":new qr(Da.paint_fill["fill-translate-anchor"]),"fill-pattern":new sa(Da.paint_fill["fill-pattern"])}),Zv={paint:$d,layout:ig},og=function(p){function O(W){p.call(this,W,Zv)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.recalculate=function(W,pt){p.prototype.recalculate.call(this,W,pt);var At=this.paint._values["fill-outline-color"];At.value.kind==="constant"&&At.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},O.prototype.createBucket=function(W){return new vh(W)},O.prototype.queryRadius=function(){return $f(this.paint.get("fill-translate"))},O.prototype.queryIntersectsFeature=function(W,pt,At,Ot,Wt,_e,De){var Je=Ef(W,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),_e.angle,De);return kc(Je,Ot)},O.prototype.isTileClipped=function(){return!0},O}(fa),Kv=kn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),ph=Kv.members,rd=zp;function zp(p,O,W,pt,At){this.properties={},this.extent=W,this.type=0,this._pbf=p,this._geometry=-1,this._keys=pt,this._values=At,p.readFields(Yv,this,O)}function Yv(p,O,W){p==1?O.id=W.readVarint():p==2?Xv(W,O):p==3?O.type=W.readVarint():p==4&&(O._geometry=W.pos)}function Xv(p,O){for(var W=p.readVarint()+p.pos;p.pos<W;){var pt=O._keys[p.readVarint()],At=O._values[p.readVarint()];O.properties[pt]=At}}zp.types=["Unknown","Point","LineString","Polygon"],zp.prototype.loadGeometry=function(){var p=this._pbf;p.pos=this._geometry;for(var O=p.readVarint()+p.pos,W=1,pt=0,At=0,Ot=0,Wt=[],_e;p.pos<O;){if(pt<=0){var De=p.readVarint();W=De&7,pt=De>>3}if(pt--,W===1||W===2)At+=p.readSVarint(),Ot+=p.readSVarint(),W===1&&(_e&&Wt.push(_e),_e=[]),_e.push(new o(At,Ot));else if(W===7)_e&&_e.push(_e[0].clone());else throw new Error("unknown command "+W)}return _e&&Wt.push(_e),Wt},zp.prototype.bbox=function(){var p=this._pbf;p.pos=this._geometry;for(var O=p.readVarint()+p.pos,W=1,pt=0,At=0,Ot=0,Wt=1/0,_e=-1/0,De=1/0,Je=-1/0;p.pos<O;){if(pt<=0){var sr=p.readVarint();W=sr&7,pt=sr>>3}if(pt--,W===1||W===2)At+=p.readSVarint(),Ot+=p.readSVarint(),At<Wt&&(Wt=At),At>_e&&(_e=At),Ot<De&&(De=Ot),Ot>Je&&(Je=Ot);else if(W!==7)throw new Error("unknown command "+W)}return[Wt,De,_e,Je]},zp.prototype.toGeoJSON=function(p,O,W){var pt=this.extent*Math.pow(2,W),At=this.extent*p,Ot=this.extent*O,Wt=this.loadGeometry(),_e=zp.types[this.type],De,Je;function sr(Vr){for(var un=0;un<Vr.length;un++){var Fn=Vr[un],ga=180-(Fn.y+Ot)*360/pt;Vr[un]=[(Fn.x+At)*360/pt-180,360/Math.PI*Math.atan(Math.exp(ga*Math.PI/180))-90]}}switch(this.type){case 1:var Ar=[];for(De=0;De<Wt.length;De++)Ar[De]=Wt[De][0];Wt=Ar,sr(Wt);break;case 2:for(De=0;De<Wt.length;De++)sr(Wt[De]);break;case 3:for(Wt=$v(Wt),De=0;De<Wt.length;De++)for(Je=0;Je<Wt[De].length;Je++)sr(Wt[De][Je]);break}Wt.length===1?Wt=Wt[0]:_e="Multi"+_e;var Pr={type:"Feature",geometry:{type:_e,coordinates:Wt},properties:this.properties};return"id"in this&&(Pr.id=this.id),Pr};function $v(p){var O=p.length;if(O<=1)return[p];for(var W=[],pt,At,Ot=0;Ot<O;Ot++){var Wt=Jv(p[Ot]);Wt!==0&&(At===void 0&&(At=Wt<0),At===Wt<0?(pt&&W.push(pt),pt=[p[Ot]]):pt.push(p[Ot]))}return pt&&W.push(pt),W}function Jv(p){for(var O=0,W=0,pt=p.length,At=pt-1,Ot,Wt;W<pt;At=W++)Ot=p[W],Wt=p[At],O+=(Wt.x-Ot.x)*(Ot.y+Wt.y);return O}var sg=Qv;function Qv(p,O){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=p,this._keys=[],this._values=[],this._features=[],p.readFields(ty,this,O),this.length=this._features.length}function ty(p,O,W){p===15?O.version=W.readVarint():p===1?O.name=W.readString():p===5?O.extent=W.readVarint():p===2?O._features.push(W.pos):p===3?O._keys.push(W.readString()):p===4&&O._values.push(hp(W))}function hp(p){for(var O=null,W=p.readVarint()+p.pos;p.pos<W;){var pt=p.readVarint()>>3;O=pt===1?p.readString():pt===2?p.readFloat():pt===3?p.readDouble():pt===4?p.readVarint64():pt===5?p.readVarint():pt===6?p.readSVarint():pt===7?p.readBoolean():null}return O}Qv.prototype.feature=function(p){if(p<0||p>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[p];var O=this._pbf.readVarint()+this._pbf.pos;return new rd(this._pbf,O,this.extent,this._keys,this._values)};var ey=ry;function ry(p,O){this.layers=p.readFields(ny,{},O)}function ny(p,O,W){if(p===3){var pt=new sg(W,W.readVarint()+W.pos);pt.length&&(O[pt.name]=pt)}}var ay=ey,w_=rd,T_=sg,Lp={VectorTile:ay,VectorTileFeature:w_,VectorTileLayer:T_},nd=Lp.VectorTileFeature.types,iy=500,ad=Math.pow(2,13);function id(p,O,W,pt,At,Ot,Wt,_e){p.emplaceBack(O,W,Math.floor(pt*ad)*2+Wt,At*ad*2,Ot*ad*2,Math.round(_e))}var uh=function(p){this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(O){return O.id}),this.index=p.index,this.hasPattern=!1,this.layoutVertexArray=new An,this.indexArray=new gi,this.programConfigurations=new Gn(p.layers,p.zoom),this.segments=new $o,this.stateDependentLayerIds=this.layers.filter(function(O){return O.isStateDependent()}).map(function(O){return O.id})};uh.prototype.populate=function(p,O,W){this.features=[],this.hasPattern=q0("fill-extrusion",this.layers,O);for(var pt=0,At=p;pt<At.length;pt+=1){var Ot=At[pt],Wt=Ot.feature,_e=Ot.id,De=Ot.index,Je=Ot.sourceLayerIndex,sr=this.layers[0]._featureFilter.needGeometry,Ar=gs(Wt,sr);if(this.layers[0]._featureFilter.filter(new ps(this.zoom),Ar,W)){var Pr={id:_e,sourceLayerIndex:Je,index:De,geometry:sr?Ar.geometry:Ko(Wt),properties:Wt.properties,type:Wt.type,patterns:{}};this.hasPattern?this.features.push(W0("fill-extrusion",this.layers,Pr,this.zoom,O)):this.addFeature(Pr,Pr.geometry,De,W,{}),O.featureIndex.insert(Wt,Pr.geometry,De,Je,this.index,!0)}}},uh.prototype.addFeatures=function(p,O,W){for(var pt=0,At=this.features;pt<At.length;pt+=1){var Ot=At[pt],Wt=Ot.geometry;this.addFeature(Ot,Wt,Ot.index,O,W)}},uh.prototype.update=function(p,O,W){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(p,O,this.stateDependentLayers,W)},uh.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},uh.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},uh.prototype.upload=function(p){this.uploaded||(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,ph),this.indexBuffer=p.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(p),this.uploaded=!0},uh.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},uh.prototype.addFeature=function(p,O,W,pt,At){for(var Ot=0,Wt=Ph(O,iy);Ot<Wt.length;Ot+=1){for(var _e=Wt[Ot],De=0,Je=0,sr=_e;Je<sr.length;Je+=1){var Ar=sr[Je];De+=Ar.length}for(var Pr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),Vr=0,un=_e;Vr<un.length;Vr+=1){var Fn=un[Vr];if(Fn.length!==0&&!Z0(Fn))for(var ga=0,pa=0;pa<Fn.length;pa++){var Ea=Fn[pa];if(pa>=1){var ja=Fn[pa-1];if(!G0(Ea,ja)){Pr.vertexLength+4>$o.MAX_VERTEX_ARRAY_LENGTH&&(Pr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Aa=Ea.sub(ja)._perp()._unit(),$a=ja.dist(Ea);ga+$a>32768&&(ga=0),id(this.layoutVertexArray,Ea.x,Ea.y,Aa.x,Aa.y,0,0,ga),id(this.layoutVertexArray,Ea.x,Ea.y,Aa.x,Aa.y,0,1,ga),ga+=$a,id(this.layoutVertexArray,ja.x,ja.y,Aa.x,Aa.y,0,0,ga),id(this.layoutVertexArray,ja.x,ja.y,Aa.x,Aa.y,0,1,ga);var hi=Pr.vertexLength;this.indexArray.emplaceBack(hi,hi+2,hi+1),this.indexArray.emplaceBack(hi+1,hi+2,hi+3),Pr.vertexLength+=4,Pr.primitiveLength+=2}}}}if(Pr.vertexLength+De>$o.MAX_VERTEX_ARRAY_LENGTH&&(Pr=this.segments.prepareSegment(De,this.layoutVertexArray,this.indexArray)),nd[p.type]==="Polygon"){for(var Si=[],Ei=[],ro=Pr.vertexLength,no=0,go=_e;no<go.length;no+=1){var Mo=go[no];if(Mo.length!==0){Mo!==_e[0]&&Ei.push(Si.length/2);for(var Vo=0;Vo<Mo.length;Vo++){var vo=Mo[Vo];id(this.layoutVertexArray,vo.x,vo.y,0,0,1,1,0),Si.push(vo.x),Si.push(vo.y)}}}for(var bo=N0(Si,Ei),ol=0;ol<bo.length;ol+=3)this.indexArray.emplaceBack(ro+bo[ol],ro+bo[ol+2],ro+bo[ol+1]);Pr.primitiveLength+=bo.length/3,Pr.vertexLength+=De}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,W,At,pt)},Ve("FillExtrusionBucket",uh,{omit:["layers","features"]});function G0(p,O){return p.x===O.x&&(p.x<0||p.x>Li)||p.y===O.y&&(p.y<0||p.y>Li)}function Z0(p){return p.every(function(O){return O.x<0})||p.every(function(O){return O.x>Li})||p.every(function(O){return O.y<0})||p.every(function(O){return O.y>Li})}var k_=new Ka({"fill-extrusion-opacity":new qr(Da["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Sn(Da["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new qr(Da["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new qr(Da["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new sa(Da["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Sn(Da["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Sn(Da["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new qr(Da["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),A_={paint:k_},M_=function(p){function O(W){p.call(this,W,A_)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.createBucket=function(W){return new uh(W)},O.prototype.queryRadius=function(){return $f(this.paint.get("fill-extrusion-translate"))},O.prototype.is3D=function(){return!0},O.prototype.queryIntersectsFeature=function(W,pt,At,Ot,Wt,_e,De,Je){var sr=Ef(W,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),_e.angle,De),Ar=this.paint.get("fill-extrusion-height").evaluate(pt,At),Pr=this.paint.get("fill-extrusion-base").evaluate(pt,At),Vr=oy(sr,Je,_e,0),un=lg(Ot,Pr,Ar,Je),Fn=un[0],ga=un[1];return pp(Fn,ga,Vr)},O}(fa);function Oh(p,O){return p.x*O.x+p.y*O.y}function cf(p,O){if(p.length===1){for(var W=0,pt=O[W++],At;!At||pt.equals(At);)if(At=O[W++],!At)return 1/0;for(;W<O.length;W++){var Ot=O[W],Wt=p[0],_e=At.sub(pt),De=Ot.sub(pt),Je=Wt.sub(pt),sr=Oh(_e,_e),Ar=Oh(_e,De),Pr=Oh(De,De),Vr=Oh(Je,_e),un=Oh(Je,De),Fn=sr*Pr-Ar*Ar,ga=(Pr*Vr-Ar*un)/Fn,pa=(sr*un-Ar*Vr)/Fn,Ea=1-ga-pa,ja=pt.z*Ea+At.z*ga+Ot.z*pa;if(isFinite(ja))return ja}return 1/0}else{for(var Aa=1/0,$a=0,hi=O;$a<hi.length;$a+=1){var Si=hi[$a];Aa=Math.min(Aa,Si.z)}return Aa}}function pp(p,O,W){var pt=1/0;kc(W,O)&&(pt=cf(W,O[0]));for(var At=0;At<O.length;At++)for(var Ot=O[At],Wt=p[At],_e=0;_e<Ot.length-1;_e++){var De=Ot[_e],Je=Ot[_e+1],sr=Wt[_e],Ar=Wt[_e+1],Pr=[De,Je,Ar,sr,De];Xs(W,Pr)&&(pt=Math.min(pt,cf(W,Pr)))}return pt===1/0?!1:pt}function lg(p,O,W,pt){for(var At=[],Ot=[],Wt=pt[8]*O,_e=pt[9]*O,De=pt[10]*O,Je=pt[11]*O,sr=pt[8]*W,Ar=pt[9]*W,Pr=pt[10]*W,Vr=pt[11]*W,un=0,Fn=p;un<Fn.length;un+=1){for(var ga=Fn[un],pa=[],Ea=[],ja=0,Aa=ga;ja<Aa.length;ja+=1){var $a=Aa[ja],hi=$a.x,Si=$a.y,Ei=pt[0]*hi+pt[4]*Si+pt[12],ro=pt[1]*hi+pt[5]*Si+pt[13],no=pt[2]*hi+pt[6]*Si+pt[14],go=pt[3]*hi+pt[7]*Si+pt[15],Mo=Ei+Wt,Vo=ro+_e,vo=no+De,bo=go+Je,ol=Ei+sr,Hl=ro+Ar,vu=no+Pr,dl=go+Vr,ql=new o(Mo/bo,Vo/bo);ql.z=vo/bo,pa.push(ql);var sl=new o(ol/dl,Hl/dl);sl.z=vu/dl,Ea.push(sl)}At.push(pa),Ot.push(Ea)}return[At,Ot]}function oy(p,O,W,pt){for(var At=[],Ot=0,Wt=p;Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=[_e.x,_e.y,pt,1];P0(De,De,O),At.push(new o(De[0]/De[3],De[1]/De[3]))}return At}var sy=kn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),ug=sy.members,S_=kn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),ly=S_.members,uy=Lp.VectorTileFeature.types,cy=63,fy=Math.cos(75/2*(Math.PI/180)),cg=15,fg=20,hy=15,od=1/2,K0=Math.pow(2,hy-1)/od,_f=function(p){var O=this;this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=p.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(W){O.gradients[W.id]={}}),this.layoutVertexArray=new Pa,this.layoutVertexArray2=new ba,this.indexArray=new gi,this.programConfigurations=new Gn(p.layers,p.zoom),this.segments=new $o,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(W){return W.isStateDependent()}).map(function(W){return W.id})};_f.prototype.populate=function(p,O,W){this.hasPattern=q0("line",this.layers,O);for(var pt=this.layers[0].layout.get("line-sort-key"),At=[],Ot=0,Wt=p;Ot<Wt.length;Ot+=1){var _e=Wt[Ot],De=_e.feature,Je=_e.id,sr=_e.index,Ar=_e.sourceLayerIndex,Pr=this.layers[0]._featureFilter.needGeometry,Vr=gs(De,Pr);if(this.layers[0]._featureFilter.filter(new ps(this.zoom),Vr,W)){var un=pt?pt.evaluate(Vr,{},W):void 0,Fn={id:Je,properties:De.properties,type:De.type,sourceLayerIndex:Ar,index:sr,geometry:Pr?Vr.geometry:Ko(De),patterns:{},sortKey:un};At.push(Fn)}}pt&&At.sort(function(ro,no){return ro.sortKey-no.sortKey});for(var ga=0,pa=At;ga<pa.length;ga+=1){var Ea=pa[ga],ja=Ea,Aa=ja.geometry,$a=ja.index,hi=ja.sourceLayerIndex;if(this.hasPattern){var Si=W0("line",this.layers,Ea,this.zoom,O);this.patternFeatures.push(Si)}else this.addFeature(Ea,Aa,$a,W,{});var Ei=p[$a].feature;O.featureIndex.insert(Ei,Aa,$a,hi,this.index)}},_f.prototype.update=function(p,O,W){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(p,O,this.stateDependentLayers,W)},_f.prototype.addFeatures=function(p,O,W){for(var pt=0,At=this.patternFeatures;pt<At.length;pt+=1){var Ot=At[pt];this.addFeature(Ot,Ot.geometry,Ot.index,O,W)}},_f.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},_f.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_f.prototype.upload=function(p){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=p.createVertexBuffer(this.layoutVertexArray2,ly)),this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,ug),this.indexBuffer=p.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(p),this.uploaded=!0},_f.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},_f.prototype.lineFeatureClips=function(p){if(p.properties&&p.properties.hasOwnProperty("mapbox_clip_start")&&p.properties.hasOwnProperty("mapbox_clip_end")){var O=+p.properties.mapbox_clip_start,W=+p.properties.mapbox_clip_end;return{start:O,end:W}}},_f.prototype.addFeature=function(p,O,W,pt,At){var Ot=this.layers[0].layout,Wt=Ot.get("line-join").evaluate(p,{}),_e=Ot.get("line-cap"),De=Ot.get("line-miter-limit"),Je=Ot.get("line-round-limit");this.lineClips=this.lineFeatureClips(p);for(var sr=0,Ar=O;sr<Ar.length;sr+=1){var Pr=Ar[sr];this.addLine(Pr,p,Wt,_e,De,Je)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,W,At,pt)},_f.prototype.addLine=function(p,O,W,pt,At,Ot){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var Wt=0;Wt<p.length-1;Wt++)this.totalDistance+=p[Wt].dist(p[Wt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var _e=uy[O.type]==="Polygon",De=p.length;De>=2&&p[De-1].equals(p[De-2]);)De--;for(var Je=0;Je<De-1&&p[Je].equals(p[Je+1]);)Je++;if(!(De<(_e?3:2))){W==="bevel"&&(At=1.05);var sr=this.overscaling<=16?cg*Li/(512*this.overscaling):0,Ar=this.segments.prepareSegment(De*10,this.layoutVertexArray,this.indexArray),Pr,Vr=void 0,un=void 0,Fn=void 0,ga=void 0;this.e1=this.e2=-1,_e&&(Pr=p[De-2],ga=p[Je].sub(Pr)._unit()._perp());for(var pa=Je;pa<De;pa++)if(un=pa===De-1?_e?p[Je+1]:void 0:p[pa+1],!(un&&p[pa].equals(un))){ga&&(Fn=ga),Pr&&(Vr=Pr),Pr=p[pa],ga=un?un.sub(Pr)._unit()._perp():Fn,Fn=Fn||ga;var Ea=Fn.add(ga);(Ea.x!==0||Ea.y!==0)&&Ea._unit();var ja=Fn.x*ga.x+Fn.y*ga.y,Aa=Ea.x*ga.x+Ea.y*ga.y,$a=Aa!==0?1/Aa:1/0,hi=2*Math.sqrt(2-2*Aa),Si=Aa<fy&&Vr&&un,Ei=Fn.x*ga.y-Fn.y*ga.x>0;if(Si&&pa>Je){var ro=Pr.dist(Vr);if(ro>2*sr){var no=Pr.sub(Pr.sub(Vr)._mult(sr/ro)._round());this.updateDistance(Vr,no),this.addCurrentVertex(no,Fn,0,0,Ar),Vr=no}}var go=Vr&&un,Mo=go?W:_e?"butt":pt;if(go&&Mo==="round"&&($a<Ot?Mo="miter":$a<=2&&(Mo="fakeround")),Mo==="miter"&&$a>At&&(Mo="bevel"),Mo==="bevel"&&($a>2&&(Mo="flipbevel"),$a<At&&(Mo="miter")),Vr&&this.updateDistance(Vr,Pr),Mo==="miter")Ea._mult($a),this.addCurrentVertex(Pr,Ea,0,0,Ar);else if(Mo==="flipbevel"){if($a>100)Ea=ga.mult(-1);else{var Vo=$a*Fn.add(ga).mag()/Fn.sub(ga).mag();Ea._perp()._mult(Vo*(Ei?-1:1))}this.addCurrentVertex(Pr,Ea,0,0,Ar),this.addCurrentVertex(Pr,Ea.mult(-1),0,0,Ar)}else if(Mo==="bevel"||Mo==="fakeround"){var vo=-Math.sqrt($a*$a-1),bo=Ei?vo:0,ol=Ei?0:vo;if(Vr&&this.addCurrentVertex(Pr,Fn,bo,ol,Ar),Mo==="fakeround")for(var Hl=Math.round(hi*180/Math.PI/fg),vu=1;vu<Hl;vu++){var dl=vu/Hl;if(dl!==.5){var ql=dl-.5,sl=1.0904+ja*(-3.2452+ja*(3.55645-ja*1.43519)),ju=.848013+ja*(-1.06021+ja*.215638);dl=dl+dl*ql*(dl-1)*(sl*ql*ql+ju)}var cu=ga.sub(Fn)._mult(dl)._add(Fn)._unit()._mult(Ei?-1:1);this.addHalfVertex(Pr,cu.x,cu.y,!1,Ei,0,Ar)}un&&this.addCurrentVertex(Pr,ga,-bo,-ol,Ar)}else if(Mo==="butt")this.addCurrentVertex(Pr,Ea,0,0,Ar);else if(Mo==="square"){var Mc=Vr?1:-1;this.addCurrentVertex(Pr,Ea,Mc,Mc,Ar)}else Mo==="round"&&(Vr&&(this.addCurrentVertex(Pr,Fn,0,0,Ar),this.addCurrentVertex(Pr,Fn,1,1,Ar,!0)),un&&(this.addCurrentVertex(Pr,ga,-1,-1,Ar,!0),this.addCurrentVertex(Pr,ga,0,0,Ar)));if(Si&&pa<De-1){var Tf=Pr.dist(un);if(Tf>2*sr){var Zc=Pr.add(un.sub(Pr)._mult(sr/Tf)._round());this.updateDistance(Pr,Zc),this.addCurrentVertex(Zc,ga,0,0,Ar),Pr=Zc}}}}},_f.prototype.addCurrentVertex=function(p,O,W,pt,At,Ot){Ot===void 0&&(Ot=!1);var Wt=O.x+O.y*W,_e=O.y-O.x*W,De=-O.x+O.y*pt,Je=-O.y-O.x*pt;this.addHalfVertex(p,Wt,_e,Ot,!1,W,At),this.addHalfVertex(p,De,Je,Ot,!0,-pt,At),this.distance>K0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(p,O,W,pt,At,Ot))},_f.prototype.addHalfVertex=function(p,O,W,pt,At,Ot,Wt){var _e=p.x,De=p.y,Je=this.lineClips?this.scaledDistance*(K0-1):this.scaledDistance,sr=Je*od;if(this.layoutVertexArray.emplaceBack((_e<<1)+(pt?1:0),(De<<1)+(At?1:0),Math.round(cy*O)+128,Math.round(cy*W)+128,(Ot===0?0:Ot<0?-1:1)+1|(sr&63)<<2,sr>>6),this.lineClips){var Ar=this.scaledDistance-this.lineClips.start,Pr=this.lineClips.end-this.lineClips.start,Vr=Ar/Pr;this.layoutVertexArray2.emplaceBack(Vr,this.lineClipsArray.length)}var un=Wt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,un),Wt.primitiveLength++),At?this.e2=un:this.e1=un},_f.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},_f.prototype.updateDistance=function(p,O){this.distance+=p.dist(O),this.updateScaledDistance()},Ve("LineBucket",_f,{omit:["layers","patternFeatures"]});var hg=new Ka({"line-cap":new qr(Da.layout_line["line-cap"]),"line-join":new Sn(Da.layout_line["line-join"]),"line-miter-limit":new qr(Da.layout_line["line-miter-limit"]),"line-round-limit":new qr(Da.layout_line["line-round-limit"]),"line-sort-key":new Sn(Da.layout_line["line-sort-key"])}),Y0=new Ka({"line-opacity":new Sn(Da.paint_line["line-opacity"]),"line-color":new Sn(Da.paint_line["line-color"]),"line-translate":new qr(Da.paint_line["line-translate"]),"line-translate-anchor":new qr(Da.paint_line["line-translate-anchor"]),"line-width":new Sn(Da.paint_line["line-width"]),"line-gap-width":new Sn(Da.paint_line["line-gap-width"]),"line-offset":new Sn(Da.paint_line["line-offset"]),"line-blur":new Sn(Da.paint_line["line-blur"]),"line-dasharray":new ea(Da.paint_line["line-dasharray"]),"line-pattern":new sa(Da.paint_line["line-pattern"]),"line-gradient":new ka(Da.paint_line["line-gradient"])}),sd={paint:Y0,layout:hg},pg=function(p){function O(){p.apply(this,arguments)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.possiblyEvaluate=function(W,pt){return pt=new ps(Math.floor(pt.zoom),{now:pt.now,fadeDuration:pt.fadeDuration,zoomHistory:pt.zoomHistory,transition:pt.transition}),p.prototype.possiblyEvaluate.call(this,W,pt)},O.prototype.evaluate=function(W,pt,At,Ot){return pt=M({},pt,{zoom:Math.floor(pt.zoom)}),p.prototype.evaluate.call(this,W,pt,At,Ot)},O}(Sn),X0=new pg(sd.paint.properties["line-width"].specification);X0.useIntegerZoom=!0;var dg=function(p){function O(W){p.call(this,W,sd),this.gradientVersion=0}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype._handleSpecialPaintPropertyUpdate=function(W){if(W==="line-gradient"){var pt=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=pt._styleExpression.expression instanceof Yl,this.gradientVersion=(this.gradientVersion+1)%v}},O.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},O.prototype.recalculate=function(W,pt){p.prototype.recalculate.call(this,W,pt),this.paint._values["line-floorwidth"]=X0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,W)},O.prototype.createBucket=function(W){return new _f(W)},O.prototype.queryRadius=function(W){var pt=W,At=py(Xf("line-width",this,pt),Xf("line-gap-width",this,pt)),Ot=Xf("line-offset",this,pt);return At/2+Math.abs(Ot)+$f(this.paint.get("line-translate"))},O.prototype.queryIntersectsFeature=function(W,pt,At,Ot,Wt,_e,De){var Je=Ef(W,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),_e.angle,De),sr=De/2*py(this.paint.get("line-width").evaluate(pt,At),this.paint.get("line-gap-width").evaluate(pt,At)),Ar=this.paint.get("line-offset").evaluate(pt,At);return Ar&&(Ot=H(Ot,Ar*De)),lh(Je,Ot,sr)},O.prototype.isTileClipped=function(){return!0},O}(fa);function py(p,O){return O>0?O+2*p:p}function H(p,O){for(var W=[],pt=new o(0,0),At=0;At<p.length;At++){for(var Ot=p[At],Wt=[],_e=0;_e<Ot.length;_e++){var De=Ot[_e-1],Je=Ot[_e],sr=Ot[_e+1],Ar=_e===0?pt:Je.sub(De)._unit()._perp(),Pr=_e===Ot.length-1?pt:sr.sub(Je)._unit()._perp(),Vr=Ar._add(Pr)._unit(),un=Vr.x*Pr.x+Vr.y*Pr.y;Vr._mult(1/un),Wt.push(Vr._mult(O)._add(Je))}W.push(Wt)}return W}var C=kn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),$=kn([{name:"a_projected_pos",components:3,type:"Float32"}],4);kn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var ht=kn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);kn([{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 Mt=kn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Bt=kn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);kn([{name:"triangle",components:3,type:"Uint16"}]),kn([{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"}]),kn([{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"}]),kn([{type:"Float32",name:"offsetX"}]),kn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function jt(p,O,W){var pt=O.layout.get("text-transform").evaluate(W,{});return pt==="uppercase"?p=p.toLocaleUpperCase():pt==="lowercase"&&(p=p.toLocaleLowerCase()),Ts.applyArabicShaping&&(p=Ts.applyArabicShaping(p)),p}function oe(p,O,W){return p.sections.forEach(function(pt){pt.text=jt(pt.text,O,W)}),p}function be(p){var O={},W={},pt=[],At=0;function Ot(pa){pt.push(p[pa]),At++}function Wt(pa,Ea,ja){var Aa=W[pa];return delete W[pa],W[Ea]=Aa,pt[Aa].geometry[0].pop(),pt[Aa].geometry[0]=pt[Aa].geometry[0].concat(ja[0]),Aa}function _e(pa,Ea,ja){var Aa=O[Ea];return delete O[Ea],O[pa]=Aa,pt[Aa].geometry[0].shift(),pt[Aa].geometry[0]=ja[0].concat(pt[Aa].geometry[0]),Aa}function De(pa,Ea,ja){var Aa=ja?Ea[0][Ea[0].length-1]:Ea[0][0];return pa+":"+Aa.x+":"+Aa.y}for(var Je=0;Je<p.length;Je++){var sr=p[Je],Ar=sr.geometry,Pr=sr.text?sr.text.toString():null;if(!Pr){Ot(Je);continue}var Vr=De(Pr,Ar),un=De(Pr,Ar,!0);if(Vr in W&&un in O&&W[Vr]!==O[un]){var Fn=_e(Vr,un,Ar),ga=Wt(Vr,un,pt[Fn].geometry);delete O[Vr],delete W[un],W[De(Pr,pt[ga].geometry,!0)]=ga,pt[Fn].geometry=null}else Vr in W?Wt(Vr,un,Ar):un in O?_e(Vr,un,Ar):(Ot(Je),O[Vr]=At-1,W[un]=At-1)}return pt.filter(function(pa){return pa.geometry})}var Be={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Qe(p){for(var O="",W=0;W<p.length;W++){var pt=p.charCodeAt(W+1)||null,At=p.charCodeAt(W-1)||null,Ot=(!pt||!_n(pt)||Be[p[W+1]])&&(!At||!_n(At)||Be[p[W-1]]);Ot&&Be[p[W]]?O+=Be[p[W]]:O+=p[W]}return O}var lr=24,wr=function(p,O,W,pt,At){var Ot,Wt,_e=At*8-pt-1,De=(1<<_e)-1,Je=De>>1,sr=-7,Ar=W?At-1:0,Pr=W?-1:1,Vr=p[O+Ar];for(Ar+=Pr,Ot=Vr&(1<<-sr)-1,Vr>>=-sr,sr+=_e;sr>0;Ot=Ot*256+p[O+Ar],Ar+=Pr,sr-=8);for(Wt=Ot&(1<<-sr)-1,Ot>>=-sr,sr+=pt;sr>0;Wt=Wt*256+p[O+Ar],Ar+=Pr,sr-=8);if(Ot===0)Ot=1-Je;else{if(Ot===De)return Wt?NaN:(Vr?-1:1)*(1/0);Wt=Wt+Math.pow(2,pt),Ot=Ot-Je}return(Vr?-1:1)*Wt*Math.pow(2,Ot-pt)},Fr=function(p,O,W,pt,At,Ot){var Wt,_e,De,Je=Ot*8-At-1,sr=(1<<Je)-1,Ar=sr>>1,Pr=At===23?Math.pow(2,-24)-Math.pow(2,-77):0,Vr=pt?0:Ot-1,un=pt?1:-1,Fn=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(_e=isNaN(O)?1:0,Wt=sr):(Wt=Math.floor(Math.log(O)/Math.LN2),O*(De=Math.pow(2,-Wt))<1&&(Wt--,De*=2),Wt+Ar>=1?O+=Pr/De:O+=Pr*Math.pow(2,1-Ar),O*De>=2&&(Wt++,De/=2),Wt+Ar>=sr?(_e=0,Wt=sr):Wt+Ar>=1?(_e=(O*De-1)*Math.pow(2,At),Wt=Wt+Ar):(_e=O*Math.pow(2,Ar-1)*Math.pow(2,At),Wt=0));At>=8;p[W+Vr]=_e&255,Vr+=un,_e/=256,At-=8);for(Wt=Wt<<At|_e,Je+=At;Je>0;p[W+Vr]=Wt&255,Vr+=un,Wt/=256,Je-=8);p[W+Vr-un]|=Fn*128},Zr={read:wr,write:Fr},en=yn;function yn(p){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(p)?p:new Uint8Array(p||0),this.pos=0,this.type=0,this.length=this.buf.length}yn.Varint=0,yn.Fixed64=1,yn.Bytes=2,yn.Fixed32=5;var Vn=65536*65536,Ca=1/Vn,ua=12,wa=typeof TextDecoder>"u"?null:new TextDecoder("utf8");yn.prototype={destroy:function(){this.buf=null},readFields:function(p,O,W){for(W=W||this.length;this.pos<W;){var pt=this.readVarint(),At=pt>>3,Ot=this.pos;this.type=pt&7,p(At,O,this),this.pos===Ot&&this.skip(pt)}return O},readMessage:function(p,O){return this.readFields(p,O,this.readVarint()+this.pos)},readFixed32:function(){var p=Jf(this.buf,this.pos);return this.pos+=4,p},readSFixed32:function(){var p=Hc(this.buf,this.pos);return this.pos+=4,p},readFixed64:function(){var p=Jf(this.buf,this.pos)+Jf(this.buf,this.pos+4)*Vn;return this.pos+=8,p},readSFixed64:function(){var p=Jf(this.buf,this.pos)+Hc(this.buf,this.pos+4)*Vn;return this.pos+=8,p},readFloat:function(){var p=Zr.read(this.buf,this.pos,!0,23,4);return this.pos+=4,p},readDouble:function(){var p=Zr.read(this.buf,this.pos,!0,52,8);return this.pos+=8,p},readVarint:function(p){var O=this.buf,W,pt;return pt=O[this.pos++],W=pt&127,pt<128||(pt=O[this.pos++],W|=(pt&127)<<7,pt<128)||(pt=O[this.pos++],W|=(pt&127)<<14,pt<128)||(pt=O[this.pos++],W|=(pt&127)<<21,pt<128)?W:(pt=O[this.pos],W|=(pt&15)<<28,Xa(W,p,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var p=this.readVarint();return p%2===1?(p+1)/-2:p/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var p=this.readVarint()+this.pos,O=this.pos;return this.pos=p,p-O>=ua&&wa?Rf(this.buf,O,p):Bf(this.buf,O,p)},readBytes:function(){var p=this.readVarint()+this.pos,O=this.buf.subarray(this.pos,p);return this.pos=p,O},readPackedVarint:function(p,O){if(this.type!==yn.Bytes)return p.push(this.readVarint(O));var W=di(this);for(p=p||[];this.pos<W;)p.push(this.readVarint(O));return p},readPackedSVarint:function(p){if(this.type!==yn.Bytes)return p.push(this.readSVarint());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readSVarint());return p},readPackedBoolean:function(p){if(this.type!==yn.Bytes)return p.push(this.readBoolean());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readBoolean());return p},readPackedFloat:function(p){if(this.type!==yn.Bytes)return p.push(this.readFloat());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readFloat());return p},readPackedDouble:function(p){if(this.type!==yn.Bytes)return p.push(this.readDouble());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readDouble());return p},readPackedFixed32:function(p){if(this.type!==yn.Bytes)return p.push(this.readFixed32());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readFixed32());return p},readPackedSFixed32:function(p){if(this.type!==yn.Bytes)return p.push(this.readSFixed32());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readSFixed32());return p},readPackedFixed64:function(p){if(this.type!==yn.Bytes)return p.push(this.readFixed64());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readFixed64());return p},readPackedSFixed64:function(p){if(this.type!==yn.Bytes)return p.push(this.readSFixed64());var O=di(this);for(p=p||[];this.pos<O;)p.push(this.readSFixed64());return p},skip:function(p){var O=p&7;if(O===yn.Varint)for(;this.buf[this.pos++]>127;);else if(O===yn.Bytes)this.pos=this.readVarint()+this.pos;else if(O===yn.Fixed32)this.pos+=4;else if(O===yn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+O)},writeTag:function(p,O){this.writeVarint(p<<3|O)},realloc:function(p){for(var O=this.length||16;O<this.pos+p;)O*=2;if(O!==this.length){var W=new Uint8Array(O);W.set(this.buf),this.buf=W,this.length=O}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(p){this.realloc(4),Ac(this.buf,p,this.pos),this.pos+=4},writeSFixed32:function(p){this.realloc(4),Ac(this.buf,p,this.pos),this.pos+=4},writeFixed64:function(p){this.realloc(8),Ac(this.buf,p&-1,this.pos),Ac(this.buf,Math.floor(p*Ca),this.pos+4),this.pos+=8},writeSFixed64:function(p){this.realloc(8),Ac(this.buf,p&-1,this.pos),Ac(this.buf,Math.floor(p*Ca),this.pos+4),this.pos+=8},writeVarint:function(p){if(p=+p||0,p>268435455||p<0){as(p,this);return}this.realloc(4),this.buf[this.pos++]=p&127|(p>127?128:0),!(p<=127)&&(this.buf[this.pos++]=(p>>>=7)&127|(p>127?128:0),!(p<=127)&&(this.buf[this.pos++]=(p>>>=7)&127|(p>127?128:0),!(p<=127)&&(this.buf[this.pos++]=p>>>7&127)))},writeSVarint:function(p){this.writeVarint(p<0?-p*2-1:p*2)},writeBoolean:function(p){this.writeVarint(!!p)},writeString:function(p){p=String(p),this.realloc(p.length*4),this.pos++;var O=this.pos;this.pos=Nf(this.buf,p,this.pos);var W=this.pos-O;W>=128&&Co(O,W,this),this.pos=O-1,this.writeVarint(W),this.pos+=W},writeFloat:function(p){this.realloc(4),Zr.write(this.buf,p,this.pos,!0,23,4),this.pos+=4},writeDouble:function(p){this.realloc(8),Zr.write(this.buf,p,this.pos,!0,52,8),this.pos+=8},writeBytes:function(p){var O=p.length;this.writeVarint(O),this.realloc(O);for(var W=0;W<O;W++)this.buf[this.pos++]=p[W]},writeRawMessage:function(p,O){this.pos++;var W=this.pos;p(O,this);var pt=this.pos-W;pt>=128&&Co(W,pt,this),this.pos=W-1,this.writeVarint(pt),this.pos+=pt},writeMessage:function(p,O,W){this.writeTag(p,yn.Bytes),this.writeRawMessage(O,W)},writePackedVarint:function(p,O){O.length&&this.writeMessage(p,xo,O)},writePackedSVarint:function(p,O){O.length&&this.writeMessage(p,ho,O)},writePackedBoolean:function(p,O){O.length&&this.writeMessage(p,Io,O)},writePackedFloat:function(p,O){O.length&&this.writeMessage(p,oi,O)},writePackedDouble:function(p,O){O.length&&this.writeMessage(p,Ro,O)},writePackedFixed32:function(p,O){O.length&&this.writeMessage(p,xs,O)},writePackedSFixed32:function(p,O){O.length&&this.writeMessage(p,mu,O)},writePackedFixed64:function(p,O){O.length&&this.writeMessage(p,uu,O)},writePackedSFixed64:function(p,O){O.length&&this.writeMessage(p,tf,O)},writeBytesField:function(p,O){this.writeTag(p,yn.Bytes),this.writeBytes(O)},writeFixed32Field:function(p,O){this.writeTag(p,yn.Fixed32),this.writeFixed32(O)},writeSFixed32Field:function(p,O){this.writeTag(p,yn.Fixed32),this.writeSFixed32(O)},writeFixed64Field:function(p,O){this.writeTag(p,yn.Fixed64),this.writeFixed64(O)},writeSFixed64Field:function(p,O){this.writeTag(p,yn.Fixed64),this.writeSFixed64(O)},writeVarintField:function(p,O){this.writeTag(p,yn.Varint),this.writeVarint(O)},writeSVarintField:function(p,O){this.writeTag(p,yn.Varint),this.writeSVarint(O)},writeStringField:function(p,O){this.writeTag(p,yn.Bytes),this.writeString(O)},writeFloatField:function(p,O){this.writeTag(p,yn.Fixed32),this.writeFloat(O)},writeDoubleField:function(p,O){this.writeTag(p,yn.Fixed64),this.writeDouble(O)},writeBooleanField:function(p,O){this.writeVarintField(p,!!O)}};function Xa(p,O,W){var pt=W.buf,At,Ot;if(Ot=pt[W.pos++],At=(Ot&112)>>4,Ot<128||(Ot=pt[W.pos++],At|=(Ot&127)<<3,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&127)<<10,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&127)<<17,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&127)<<24,Ot<128)||(Ot=pt[W.pos++],At|=(Ot&1)<<31,Ot<128))return oo(p,At,O);throw new Error("Expected varint not more than 10 bytes")}function di(p){return p.type===yn.Bytes?p.readVarint()+p.pos:p.pos+1}function oo(p,O,W){return W?O*4294967296+(p>>>0):(O>>>0)*4294967296+(p>>>0)}function as(p,O){var W,pt;if(p>=0?(W=p%4294967296|0,pt=p/4294967296|0):(W=~(-p%4294967296),pt=~(-p/4294967296),W^4294967295?W=W+1|0:(W=0,pt=pt+1|0)),p>=18446744073709552e3||p<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");O.realloc(10),eo(W,pt,O),Ki(pt,O)}function eo(p,O,W){W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos++]=p&127|128,p>>>=7,W.buf[W.pos]=p&127}function Ki(p,O){var W=(p&7)<<4;O.buf[O.pos++]|=W|((p>>>=3)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127|((p>>>=7)?128:0),p&&(O.buf[O.pos++]=p&127)))))}function Co(p,O,W){var pt=O<=16383?1:O<=2097151?2:O<=268435455?3:Math.floor(Math.log(O)/(Math.LN2*7));W.realloc(pt);for(var At=W.pos-1;At>=p;At--)W.buf[At+pt]=W.buf[At]}function xo(p,O){for(var W=0;W<p.length;W++)O.writeVarint(p[W])}function ho(p,O){for(var W=0;W<p.length;W++)O.writeSVarint(p[W])}function oi(p,O){for(var W=0;W<p.length;W++)O.writeFloat(p[W])}function Ro(p,O){for(var W=0;W<p.length;W++)O.writeDouble(p[W])}function Io(p,O){for(var W=0;W<p.length;W++)O.writeBoolean(p[W])}function xs(p,O){for(var W=0;W<p.length;W++)O.writeFixed32(p[W])}function mu(p,O){for(var W=0;W<p.length;W++)O.writeSFixed32(p[W])}function uu(p,O){for(var W=0;W<p.length;W++)O.writeFixed64(p[W])}function tf(p,O){for(var W=0;W<p.length;W++)O.writeSFixed64(p[W])}function Jf(p,O){return(p[O]|p[O+1]<<8|p[O+2]<<16)+p[O+3]*16777216}function Ac(p,O,W){p[W]=O,p[W+1]=O>>>8,p[W+2]=O>>>16,p[W+3]=O>>>24}function Hc(p,O){return(p[O]|p[O+1]<<8|p[O+2]<<16)+(p[O+3]<<24)}function Bf(p,O,W){for(var pt="",At=O;At<W;){var Ot=p[At],Wt=null,_e=Ot>239?4:Ot>223?3:Ot>191?2:1;if(At+_e>W)break;var De,Je,sr;_e===1?Ot<128&&(Wt=Ot):_e===2?(De=p[At+1],(De&192)===128&&(Wt=(Ot&31)<<6|De&63,Wt<=127&&(Wt=null))):_e===3?(De=p[At+1],Je=p[At+2],(De&192)===128&&(Je&192)===128&&(Wt=(Ot&15)<<12|(De&63)<<6|Je&63,(Wt<=2047||Wt>=55296&&Wt<=57343)&&(Wt=null))):_e===4&&(De=p[At+1],Je=p[At+2],sr=p[At+3],(De&192)===128&&(Je&192)===128&&(sr&192)===128&&(Wt=(Ot&15)<<18|(De&63)<<12|(Je&63)<<6|sr&63,(Wt<=65535||Wt>=1114112)&&(Wt=null))),Wt===null?(Wt=65533,_e=1):Wt>65535&&(Wt-=65536,pt+=String.fromCharCode(Wt>>>10&1023|55296),Wt=56320|Wt&1023),pt+=String.fromCharCode(Wt),At+=_e}return pt}function Rf(p,O,W){return wa.decode(p.subarray(O,W))}function Nf(p,O,W){for(var pt=0,At,Ot;pt<O.length;pt++){if(At=O.charCodeAt(pt),At>55295&&At<57344)if(Ot)if(At<56320){p[W++]=239,p[W++]=191,p[W++]=189,Ot=At;continue}else At=Ot-55296<<10|At-56320|65536,Ot=null;else{At>56319||pt+1===O.length?(p[W++]=239,p[W++]=191,p[W++]=189):Ot=At;continue}else Ot&&(p[W++]=239,p[W++]=191,p[W++]=189,Ot=null);At<128?p[W++]=At:(At<2048?p[W++]=At>>6|192:(At<65536?p[W++]=At>>12|224:(p[W++]=At>>18|240,p[W++]=At>>12&63|128),p[W++]=At>>6&63|128),p[W++]=At&63|128)}return W}var rc=3;function ef(p,O,W){p===1&&W.readMessage(zf,O)}function zf(p,O,W){if(p===3){var pt=W.readMessage(bf,{}),At=pt.id,Ot=pt.bitmap,Wt=pt.width,_e=pt.height,De=pt.left,Je=pt.top,sr=pt.advance;O.push({id:At,bitmap:new Vc({width:Wt+2*rc,height:_e+2*rc},Ot),metrics:{width:Wt,height:_e,left:De,top:Je,advance:sr}})}}function bf(p,O,W){p===1?O.id=W.readVarint():p===2?O.bitmap=W.readBytes():p===3?O.width=W.readVarint():p===4?O.height=W.readVarint():p===5?O.left=W.readSVarint():p===6?O.top=W.readSVarint():p===7&&(O.advance=W.readVarint())}function jf(p){return new en(p).readFields(ef,[])}var ff=rc;function ch(p){for(var O=0,W=0,pt=0,At=p;pt<At.length;pt+=1){var Ot=At[pt];O+=Ot.w*Ot.h,W=Math.max(W,Ot.w)}p.sort(function(ga,pa){return pa.h-ga.h});for(var Wt=Math.max(Math.ceil(Math.sqrt(O/.95)),W),_e=[{x:0,y:0,w:Wt,h:1/0}],De=0,Je=0,sr=0,Ar=p;sr<Ar.length;sr+=1)for(var Pr=Ar[sr],Vr=_e.length-1;Vr>=0;Vr--){var un=_e[Vr];if(!(Pr.w>un.w||Pr.h>un.h)){if(Pr.x=un.x,Pr.y=un.y,Je=Math.max(Je,Pr.y+Pr.h),De=Math.max(De,Pr.x+Pr.w),Pr.w===un.w&&Pr.h===un.h){var Fn=_e.pop();Vr<_e.length&&(_e[Vr]=Fn)}else Pr.h===un.h?(un.x+=Pr.w,un.w-=Pr.w):Pr.w===un.w?(un.y+=Pr.h,un.h-=Pr.h):(_e.push({x:un.x+Pr.w,y:un.y,w:un.w-Pr.w,h:Pr.h}),un.y+=Pr.h,un.h-=Pr.h);break}}return{w:De,h:Je,fill:O/(De*Je)||0}}var zu=1,vl=function(p,O){var W=O.pixelRatio,pt=O.version,At=O.stretchX,Ot=O.stretchY,Wt=O.content;this.paddedRect=p,this.pixelRatio=W,this.stretchX=At,this.stretchY=Ot,this.content=Wt,this.version=pt},Vl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Vl.tl.get=function(){return[this.paddedRect.x+zu,this.paddedRect.y+zu]},Vl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-zu,this.paddedRect.y+this.paddedRect.h-zu]},Vl.tlbr.get=function(){return this.tl.concat(this.br)},Vl.displaySize.get=function(){return[(this.paddedRect.w-zu*2)/this.pixelRatio,(this.paddedRect.h-zu*2)/this.pixelRatio]},Object.defineProperties(vl.prototype,Vl);var eu=function(p,O){var W={},pt={};this.haveRenderCallbacks=[];var At=[];this.addImages(p,W,At),this.addImages(O,pt,At);var Ot=ch(At),Wt=Ot.w,_e=Ot.h,De=new xf({width:Wt||1,height:_e||1});for(var Je in p){var sr=p[Je],Ar=W[Je].paddedRect;xf.copy(sr.data,De,{x:0,y:0},{x:Ar.x+zu,y:Ar.y+zu},sr.data)}for(var Pr in O){var Vr=O[Pr],un=pt[Pr].paddedRect,Fn=un.x+zu,ga=un.y+zu,pa=Vr.data.width,Ea=Vr.data.height;xf.copy(Vr.data,De,{x:0,y:0},{x:Fn,y:ga},Vr.data),xf.copy(Vr.data,De,{x:0,y:Ea-1},{x:Fn,y:ga-1},{width:pa,height:1}),xf.copy(Vr.data,De,{x:0,y:0},{x:Fn,y:ga+Ea},{width:pa,height:1}),xf.copy(Vr.data,De,{x:pa-1,y:0},{x:Fn-1,y:ga},{width:1,height:Ea}),xf.copy(Vr.data,De,{x:0,y:0},{x:Fn+pa,y:ga},{width:1,height:Ea})}this.image=De,this.iconPositions=W,this.patternPositions=pt};eu.prototype.addImages=function(p,O,W){for(var pt in p){var At=p[pt],Ot={x:0,y:0,w:At.data.width+2*zu,h:At.data.height+2*zu};W.push(Ot),O[pt]=new vl(Ot,At),At.hasRenderCallback&&this.haveRenderCallbacks.push(pt)}},eu.prototype.patchUpdatedImages=function(p,O){p.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var W in p.updatedImages)this.patchUpdatedImage(this.iconPositions[W],p.getImage(W),O),this.patchUpdatedImage(this.patternPositions[W],p.getImage(W),O)},eu.prototype.patchUpdatedImage=function(p,O,W){if(!(!p||!O)&&p.version!==O.version){p.version=O.version;var pt=p.tl,At=pt[0],Ot=pt[1];W.update(O.data,void 0,{x:At,y:Ot})}},Ve("ImagePosition",vl),Ve("ImageAtlas",eu);var Xu={horizontal:1,vertical:2,horizontalOnly:3},Lu=-17;function ld(p){for(var O=0,W=p;O<W.length;O+=1){var pt=W[O];if(pt.positionedGlyphs.length!==0)return!1}return!0}var Th=57344,kh=63743,Lf=function(){this.scale=1,this.fontStack="",this.imageName=null};Lf.forText=function(p,O){var W=new Lf;return W.scale=p||1,W.fontStack=O,W},Lf.forImage=function(p){var O=new Lf;return O.imageName=p,O};var gu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};gu.fromFeature=function(p,O){for(var W=new gu,pt=0;pt<p.sections.length;pt++){var At=p.sections[pt];At.image?W.addImageSection(At):W.addTextSection(At,O)}return W},gu.prototype.length=function(){return this.text.length},gu.prototype.getSection=function(p){return this.sections[this.sectionIndex[p]]},gu.prototype.getSectionIndex=function(p){return this.sectionIndex[p]},gu.prototype.getCharCode=function(p){return this.text.charCodeAt(p)},gu.prototype.verticalizePunctuation=function(){this.text=Qe(this.text)},gu.prototype.trim=function(){for(var p=0,O=0;O<this.text.length&&fh[this.text.charCodeAt(O)];O++)p++;for(var W=this.text.length,pt=this.text.length-1;pt>=0&&pt>=p&&fh[this.text.charCodeAt(pt)];pt--)W--;this.text=this.text.substring(p,W),this.sectionIndex=this.sectionIndex.slice(p,W)},gu.prototype.substring=function(p,O){var W=new gu;return W.text=this.text.substring(p,O),W.sectionIndex=this.sectionIndex.slice(p,O),W.sections=this.sections,W},gu.prototype.toString=function(){return this.text},gu.prototype.getMaxScale=function(){var p=this;return this.sectionIndex.reduce(function(O,W){return Math.max(O,p.sections[W].scale)},0)},gu.prototype.addTextSection=function(p,O){this.text+=p.text,this.sections.push(Lf.forText(p.scale,p.fontStack||O));for(var W=this.sections.length-1,pt=0;pt<p.text.length;++pt)this.sectionIndex.push(W)},gu.prototype.addImageSection=function(p){var O=p.image?p.image.name:"";if(O.length===0){j("Can't add FormattedSection with an empty image.");return}var W=this.getNextImageSectionCharCode();if(!W){j("Reached maximum number of images "+(kh-Th+2));return}this.text+=String.fromCharCode(W),this.sections.push(Lf.forImage(O)),this.sectionIndex.push(this.sections.length-1)},gu.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=kh?null:++this.imageSectionID:(this.imageSectionID=Th,this.imageSectionID)};function hf(p,O){for(var W=[],pt=p.text,At=0,Ot=0,Wt=O;Ot<Wt.length;Ot+=1){var _e=Wt[Ot];W.push(p.substring(At,_e)),At=_e}return At<pt.length&&W.push(p.substring(At,pt.length)),W}function yh(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn){var ga=gu.fromFeature(p,At);Ar===Xu.vertical&&ga.verticalizePunctuation();var pa,Ea=Ts.processBidirectionalText,ja=Ts.processStyledBidirectionalText;if(Ea&&ga.sections.length===1){pa=[];for(var Aa=Ea(ga.toString(),xg(ga,Je,Ot,O,pt,Vr,un)),$a=0,hi=Aa;$a<hi.length;$a+=1){var Si=hi[$a],Ei=new gu;Ei.text=Si,Ei.sections=ga.sections;for(var ro=0;ro<Si.length;ro++)Ei.sectionIndex.push(0);pa.push(Ei)}}else if(ja){pa=[];for(var no=ja(ga.text,ga.sectionIndex,xg(ga,Je,Ot,O,pt,Vr,un)),go=0,Mo=no;go<Mo.length;go+=1){var Vo=Mo[go],vo=new gu;vo.text=Vo[0],vo.sectionIndex=Vo[1],vo.sections=ga.sections,pa.push(vo)}}else pa=hf(ga,xg(ga,Je,Ot,O,pt,Vr,un));var bo=[],ol={positionedLines:bo,text:ga.toString(),top:sr[1],bottom:sr[1],left:sr[0],right:sr[0],writingMode:Ar,iconsInText:!1,verticalizable:!1};return E_(ol,O,W,pt,pa,Wt,_e,De,Ar,Je,Pr,Fn),ld(bo)?!1:ol}var fh={};fh[9]=!0,fh[10]=!0,fh[11]=!0,fh[12]=!0,fh[13]=!0,fh[32]=!0;var Uf={};Uf[10]=!0,Uf[32]=!0,Uf[38]=!0,Uf[40]=!0,Uf[41]=!0,Uf[43]=!0,Uf[45]=!0,Uf[47]=!0,Uf[173]=!0,Uf[183]=!0,Uf[8203]=!0,Uf[8208]=!0,Uf[8211]=!0,Uf[8231]=!0;function mg(p,O,W,pt,At,Ot){if(O.imageName){var Wt=pt[O.imageName];return Wt?Wt.displaySize[0]*O.scale*lr/Ot+At:0}else{var _e=W[O.fontStack],De=_e&&_e[p];return De?De.metrics.advance*O.scale+At:0}}function gg(p,O,W,pt,At,Ot){for(var Wt=0,_e=0;_e<p.length();_e++){var De=p.getSection(_e);Wt+=mg(p.getCharCode(_e),De,pt,At,O,Ot)}var Je=Math.max(1,Math.ceil(Wt/W));return Wt/Je}function $0(p,O,W,pt){var At=Math.pow(p-O,2);return pt?p<O?At/2:At*2:At+Math.abs(W)*W}function Kh(p,O,W){var pt=0;return p===10&&(pt-=1e4),W&&(pt+=150),(p===40||p===65288)&&(pt+=50),(O===41||O===65289)&&(pt+=50),pt}function vg(p,O,W,pt,At,Ot){for(var Wt=null,_e=$0(O,W,At,Ot),De=0,Je=pt;De<Je.length;De+=1){var sr=Je[De],Ar=O-sr.x,Pr=$0(Ar,W,At,Ot)+sr.badness;Pr<=_e&&(Wt=sr,_e=Pr)}return{index:p,x:O,priorBreak:Wt,badness:_e}}function yg(p){return p?yg(p.priorBreak).concat(p.index):[]}function xg(p,O,W,pt,At,Ot,Wt){if(Ot!=="point")return[];if(!p)return[];for(var _e=[],De=gg(p,O,W,pt,At,Wt),Je=p.text.indexOf("")>=0,sr=0,Ar=0;Ar<p.length();Ar++){var Pr=p.getSection(Ar),Vr=p.getCharCode(Ar);if(fh[Vr]||(sr+=mg(Vr,Pr,pt,At,O,Wt)),Ar<p.length()-1){var un=Hn(Vr);(Uf[Vr]||un||Pr.imageName)&&_e.push(vg(Ar+1,sr,De,_e,Kh(Vr,p.getCharCode(Ar+1),un&&Je),!1))}}return yg(vg(p.length(),sr,De,_e,0,!0))}function _g(p){var O=.5,W=.5;switch(p){case"right":case"top-right":case"bottom-right":O=1;break;case"left":case"top-left":case"bottom-left":O=0;break}switch(p){case"bottom":case"bottom-right":case"bottom-left":W=1;break;case"top":case"top-right":case"top-left":W=0;break}return{horizontalAlign:O,verticalAlign:W}}function E_(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar){for(var Pr=0,Vr=Lu,un=0,Fn=0,ga=_e==="right"?1:_e==="left"?0:.5,pa=0,Ea=0,ja=At;Ea<ja.length;Ea+=1){var Aa=ja[Ea];Aa.trim();var $a=Aa.getMaxScale(),hi=($a-1)*lr,Si={positionedGlyphs:[],lineOffset:0};p.positionedLines[pa]=Si;var Ei=Si.positionedGlyphs,ro=0;if(!Aa.length()){Vr+=Ot,++pa;continue}for(var no=0;no<Aa.length();no++){var go=Aa.getSection(no),Mo=Aa.getSectionIndex(no),Vo=Aa.getCharCode(no),vo=0,bo=null,ol=null,Hl=null,vu=lr,dl=!(De===Xu.horizontal||!sr&&!Yn(Vo)||sr&&(fh[Vo]||Ha(Vo)));if(go.imageName){var ql=pt[go.imageName];if(!ql)continue;Hl=go.imageName,p.iconsInText=p.iconsInText||!0,ol=ql.paddedRect;var sl=ql.displaySize;go.scale=go.scale*lr/Ar,bo={width:sl[0],height:sl[1],left:zu,top:-ff,advance:dl?sl[1]:sl[0]};var ju=lr-sl[1]*go.scale;vo=hi+ju,vu=bo.advance;var cu=dl?sl[0]*go.scale-lr*$a:sl[1]*go.scale-lr*$a;cu>0&&cu>ro&&(ro=cu)}else{var Mc=W[go.fontStack],Tf=Mc&&Mc[Vo];if(Tf&&Tf.rect)ol=Tf.rect,bo=Tf.metrics;else{var Zc=O[go.fontStack],Vf=Zc&&Zc[Vo];if(!Vf)continue;bo=Vf.metrics}vo=($a-go.scale)*lr}dl?(p.verticalizable=!0,Ei.push({glyph:Vo,imageName:Hl,x:Pr,y:Vr+vo,vertical:dl,scale:go.scale,fontStack:go.fontStack,sectionIndex:Mo,metrics:bo,rect:ol}),Pr+=vu*go.scale+Je):(Ei.push({glyph:Vo,imageName:Hl,x:Pr,y:Vr+vo,vertical:dl,scale:go.scale,fontStack:go.fontStack,sectionIndex:Mo,metrics:bo,rect:ol}),Pr+=bo.advance*go.scale+Je)}if(Ei.length!==0){var Hf=Pr-Je;un=Math.max(Hf,un),z_(Ei,0,Ei.length-1,ga,ro)}Pr=0;var qf=Ot*$a+ro;Si.lineOffset=Math.max(ro,hi),Vr+=qf,Fn=Math.max(qf,Fn),++pa}var df=Vr-Lu,Qf=_g(Wt),th=Qf.horizontalAlign,rf=Qf.verticalAlign;L_(p.positionedLines,ga,th,rf,un,Fn,Ot,df,At.length),p.top+=-rf*df,p.bottom=p.top+df,p.left+=-th*un,p.right=p.left+un}function z_(p,O,W,pt,At){if(!(!pt&&!At))for(var Ot=p[W],Wt=Ot.metrics.advance*Ot.scale,_e=(p[W].x+Wt)*pt,De=O;De<=W;De++)p[De].x-=_e,p[De].y+=At}function L_(p,O,W,pt,At,Ot,Wt,_e,De){var Je=(O-W)*At,sr=0;Ot!==Wt?sr=-_e*pt-Lu:sr=(-pt*De+.5)*Wt;for(var Ar=0,Pr=p;Ar<Pr.length;Ar+=1)for(var Vr=Pr[Ar],un=0,Fn=Vr.positionedGlyphs;un<Fn.length;un+=1){var ga=Fn[un];ga.x+=Je,ga.y+=sr}}function C_(p,O,W){var pt=_g(W),At=pt.horizontalAlign,Ot=pt.verticalAlign,Wt=O[0],_e=O[1],De=Wt-p.displaySize[0]*At,Je=De+p.displaySize[0],sr=_e-p.displaySize[1]*Ot,Ar=sr+p.displaySize[1];return{image:p,top:sr,bottom:Ar,left:De,right:Je}}function dy(p,O,W,pt,At,Ot){var Wt=p.image,_e;if(Wt.content){var De=Wt.content,Je=Wt.pixelRatio||1;_e=[De[0]/Je,De[1]/Je,Wt.displaySize[0]-De[2]/Je,Wt.displaySize[1]-De[3]/Je]}var sr=O.left*Ot,Ar=O.right*Ot,Pr,Vr,un,Fn;W==="width"||W==="both"?(Fn=At[0]+sr-pt[3],Vr=At[0]+Ar+pt[1]):(Fn=At[0]+(sr+Ar-Wt.displaySize[0])/2,Vr=Fn+Wt.displaySize[0]);var ga=O.top*Ot,pa=O.bottom*Ot;return W==="height"||W==="both"?(Pr=At[1]+ga-pt[0],un=At[1]+pa+pt[2]):(Pr=At[1]+(ga+pa-Wt.displaySize[1])/2,un=Pr+Wt.displaySize[1]),{image:Wt,top:Pr,right:Vr,bottom:un,left:Fn,collisionPadding:_e}}var ud=function(p){function O(W,pt,At,Ot){p.call(this,W,pt),this.angle=At,Ot!==void 0&&(this.segment=Ot)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.clone=function(){return new O(this.x,this.y,this.angle,this.segment)},O}(o);Ve("Anchor",ud);var qc=128;function cd(p,O){var W=O.expression;if(W.kind==="constant"){var pt=W.evaluate(new ps(p+1));return{kind:"constant",layoutSize:pt}}else{if(W.kind==="source")return{kind:"source"};for(var At=W.zoomStops,Ot=W.interpolationType,Wt=0;Wt<At.length&&At[Wt]<=p;)Wt++;Wt=Math.max(0,Wt-1);for(var _e=Wt;_e<At.length&&At[_e]<p+1;)_e++;_e=Math.min(At.length-1,_e);var De=At[Wt],Je=At[_e];if(W.kind==="composite")return{kind:"composite",minZoom:De,maxZoom:Je,interpolationType:Ot};var sr=W.evaluate(new ps(De)),Ar=W.evaluate(new ps(Je));return{kind:"camera",minZoom:De,maxZoom:Je,minSize:sr,maxSize:Ar,interpolationType:Ot}}}function bg(p,O,W){var pt=O.uSize,At=O.uSizeT,Ot=W.lowerSize,Wt=W.upperSize;return p.kind==="source"?Ot/qc:p.kind==="composite"?Ws(Ot/qc,Wt/qc,At):pt}function my(p,O){var W=0,pt=0;if(p.kind==="constant")pt=p.layoutSize;else if(p.kind!=="source"){var At=p.interpolationType,Ot=p.minZoom,Wt=p.maxZoom,_e=At?l(zl.interpolationFactor(At,O,Ot,Wt),0,1):0;p.kind==="camera"?pt=Ws(p.minSize,p.maxSize,_e):W=_e}return{uSizeT:W,uSize:pt}}var I_=Object.freeze({__proto__:null,getSizeData:cd,evaluateSizeForFeature:bg,evaluateSizeForZoom:my,SIZE_PACK_FACTOR:qc});function gy(p,O,W,pt,At){if(O.segment===void 0)return!0;for(var Ot=O,Wt=O.segment+1,_e=0;_e>-W/2;){if(Wt--,Wt<0)return!1;_e-=p[Wt].dist(Ot),Ot=p[Wt]}_e+=p[Wt].dist(p[Wt+1]),Wt++;for(var De=[],Je=0;_e<W/2;){var sr=p[Wt-1],Ar=p[Wt],Pr=p[Wt+1];if(!Pr)return!1;var Vr=sr.angleTo(Ar)-Ar.angleTo(Pr);for(Vr=Math.abs((Vr+3*Math.PI)%(Math.PI*2)-Math.PI),De.push({distance:_e,angleDelta:Vr}),Je+=Vr;_e-De[0].distance>pt;)Je-=De.shift().angleDelta;if(Je>At)return!1;Wt++,_e+=Ar.dist(Pr)}return!0}function wf(p){for(var O=0,W=0;W<p.length-1;W++)O+=p[W].dist(p[W+1]);return O}function hh(p,O,W){return p?3/5*O*W:0}function dp(p,O){return Math.max(p?p.right-p.left:0,O?O.right-O.left:0)}function Ah(p,O,W,pt,At,Ot){for(var Wt=hh(W,At,Ot),_e=dp(W,pt)*Ot,De=0,Je=wf(p)/2,sr=0;sr<p.length-1;sr++){var Ar=p[sr],Pr=p[sr+1],Vr=Ar.dist(Pr);if(De+Vr>Je){var un=(Je-De)/Vr,Fn=Ws(Ar.x,Pr.x,un),ga=Ws(Ar.y,Pr.y,un),pa=new ud(Fn,ga,Pr.angleTo(Ar),sr);return pa._round(),!Wt||gy(p,pa,_e,Wt,O)?pa:void 0}De+=Vr}}function Cp(p,O,W,pt,At,Ot,Wt,_e,De){var Je=hh(pt,Ot,Wt),sr=dp(pt,At),Ar=sr*Wt,Pr=p[0].x===0||p[0].x===De||p[0].y===0||p[0].y===De;O-Ar<O/4&&(O=Ar+O/4);var Vr=Ot*2,un=Pr?O/2*_e%O:(sr/2+Vr)*Wt*_e%O;return Mh(p,un,O,Je,W,Ar,Pr,!1,De)}function Mh(p,O,W,pt,At,Ot,Wt,_e,De){for(var Je=Ot/2,sr=wf(p),Ar=0,Pr=O-W,Vr=[],un=0;un<p.length-1;un++){for(var Fn=p[un],ga=p[un+1],pa=Fn.dist(ga),Ea=ga.angleTo(Fn);Pr+W<Ar+pa;){Pr+=W;var ja=(Pr-Ar)/pa,Aa=Ws(Fn.x,ga.x,ja),$a=Ws(Fn.y,ga.y,ja);if(Aa>=0&&Aa<De&&$a>=0&&$a<De&&Pr-Je>=0&&Pr+Je<=sr){var hi=new ud(Aa,$a,Ea,un);hi._round(),(!pt||gy(p,hi,Ot,pt,At))&&Vr.push(hi)}}Ar+=pa}return!_e&&!Vr.length&&!Wt&&(Vr=Mh(p,Ar/2,W,pt,At,Ot,Wt,!0,De)),Vr}function h4(p,O,W,pt,At){for(var Ot=[],Wt=0;Wt<p.length;Wt++)for(var _e=p[Wt],De=void 0,Je=0;Je<_e.length-1;Je++){var sr=_e[Je],Ar=_e[Je+1];sr.x<O&&Ar.x<O||(sr.x<O?sr=new o(O,sr.y+(Ar.y-sr.y)*((O-sr.x)/(Ar.x-sr.x)))._round():Ar.x<O&&(Ar=new o(O,sr.y+(Ar.y-sr.y)*((O-sr.x)/(Ar.x-sr.x)))._round()),!(sr.y<W&&Ar.y<W)&&(sr.y<W?sr=new o(sr.x+(Ar.x-sr.x)*((W-sr.y)/(Ar.y-sr.y)),W)._round():Ar.y<W&&(Ar=new o(sr.x+(Ar.x-sr.x)*((W-sr.y)/(Ar.y-sr.y)),W)._round()),!(sr.x>=pt&&Ar.x>=pt)&&(sr.x>=pt?sr=new o(pt,sr.y+(Ar.y-sr.y)*((pt-sr.x)/(Ar.x-sr.x)))._round():Ar.x>=pt&&(Ar=new o(pt,sr.y+(Ar.y-sr.y)*((pt-sr.x)/(Ar.x-sr.x)))._round()),!(sr.y>=At&&Ar.y>=At)&&(sr.y>=At?sr=new o(sr.x+(Ar.x-sr.x)*((At-sr.y)/(Ar.y-sr.y)),At)._round():Ar.y>=At&&(Ar=new o(sr.x+(Ar.x-sr.x)*((At-sr.y)/(Ar.y-sr.y)),At)._round()),(!De||!sr.equals(De[De.length-1]))&&(De=[sr],Ot.push(De)),De.push(Ar)))))}return Ot}var J0=zu;function p4(p,O,W,pt){var At=[],Ot=p.image,Wt=Ot.pixelRatio,_e=Ot.paddedRect.w-2*J0,De=Ot.paddedRect.h-2*J0,Je=p.right-p.left,sr=p.bottom-p.top,Ar=Ot.stretchX||[[0,_e]],Pr=Ot.stretchY||[[0,De]],Vr=function(ql,sl){return ql+sl[1]-sl[0]},un=Ar.reduce(Vr,0),Fn=Pr.reduce(Vr,0),ga=_e-un,pa=De-Fn,Ea=0,ja=un,Aa=0,$a=Fn,hi=0,Si=ga,Ei=0,ro=pa;if(Ot.content&&pt){var no=Ot.content;Ea=vy(Ar,0,no[0]),Aa=vy(Pr,0,no[1]),ja=vy(Ar,no[0],no[2]),$a=vy(Pr,no[1],no[3]),hi=no[0]-Ea,Ei=no[1]-Aa,Si=no[2]-no[0]-ja,ro=no[3]-no[1]-$a}var go=function(ql,sl,ju,cu){var Mc=yy(ql.stretch-Ea,ja,Je,p.left),Tf=xy(ql.fixed-hi,Si,ql.stretch,un),Zc=yy(sl.stretch-Aa,$a,sr,p.top),Vf=xy(sl.fixed-Ei,ro,sl.stretch,Fn),Hf=yy(ju.stretch-Ea,ja,Je,p.left),qf=xy(ju.fixed-hi,Si,ju.stretch,un),df=yy(cu.stretch-Aa,$a,sr,p.top),Qf=xy(cu.fixed-Ei,ro,cu.stretch,Fn),th=new o(Mc,Zc),rf=new o(Hf,Zc),eh=new o(Hf,df),xh=new o(Mc,df),Op=new o(Tf/Wt,Vf/Wt),pd=new o(qf/Wt,Qf/Wt),dd=O*Math.PI/180;if(dd){var md=Math.sin(dd),om=Math.cos(dd),Dh=[om,-md,md,om];th._matMult(Dh),rf._matMult(Dh),xh._matMult(Dh),eh._matMult(Dh)}var Ay=ql.stretch+ql.fixed,j_=ju.stretch+ju.fixed,My=sl.stretch+sl.fixed,U_=cu.stretch+cu.fixed,Sh={x:Ot.paddedRect.x+J0+Ay,y:Ot.paddedRect.y+J0+My,w:j_-Ay,h:U_-My},sm=Si/Wt/Je,Sy=ro/Wt/sr;return{tl:th,tr:rf,bl:xh,br:eh,tex:Sh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Op,pixelOffsetBR:pd,minFontScaleX:sm,minFontScaleY:Sy,isSDF:W}};if(!pt||!Ot.stretchX&&!Ot.stretchY)At.push(go({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:_e+1},{fixed:0,stretch:De+1}));else for(var Mo=d4(Ar,ga,un),Vo=d4(Pr,pa,Fn),vo=0;vo<Mo.length-1;vo++)for(var bo=Mo[vo],ol=Mo[vo+1],Hl=0;Hl<Vo.length-1;Hl++){var vu=Vo[Hl],dl=Vo[Hl+1];At.push(go(bo,vu,ol,dl))}return At}function vy(p,O,W){for(var pt=0,At=0,Ot=p;At<Ot.length;At+=1){var Wt=Ot[At];pt+=Math.max(O,Math.min(W,Wt[1]))-Math.max(O,Math.min(W,Wt[0]))}return pt}function d4(p,O,W){for(var pt=[{fixed:-J0,stretch:0}],At=0,Ot=p;At<Ot.length;At+=1){var Wt=Ot[At],_e=Wt[0],De=Wt[1],Je=pt[pt.length-1];pt.push({fixed:_e-Je.stretch,stretch:Je.stretch}),pt.push({fixed:_e-Je.stretch,stretch:Je.stretch+(De-_e)})}return pt.push({fixed:O+J0,stretch:W}),pt}function yy(p,O,W,pt){return p/O*W+pt}function xy(p,O,W,pt){return p-O*W/pt}function tI(p,O,W,pt,At,Ot,Wt,_e){for(var De=pt.layout.get("text-rotate").evaluate(Ot,{})*Math.PI/180,Je=[],sr=0,Ar=O.positionedLines;sr<Ar.length;sr+=1)for(var Pr=Ar[sr],Vr=0,un=Pr.positionedGlyphs;Vr<un.length;Vr+=1){var Fn=un[Vr];if(Fn.rect){var ga=Fn.rect||{},pa=1,Ea=ff+pa,ja=!0,Aa=1,$a=0,hi=(At||_e)&&Fn.vertical,Si=Fn.metrics.advance*Fn.scale/2;if(_e&&O.verticalizable){var Ei=(Fn.scale-1)*lr,ro=(lr-Fn.metrics.width*Fn.scale)/2;$a=Pr.lineOffset/2-(Fn.imageName?-ro:Ei)}if(Fn.imageName){var no=Wt[Fn.imageName];ja=no.sdf,Aa=no.pixelRatio,Ea=zu/Aa}var go=At?[Fn.x+Si,Fn.y]:[0,0],Mo=At?[0,0]:[Fn.x+Si+W[0],Fn.y+W[1]-$a],Vo=[0,0];hi&&(Vo=Mo,Mo=[0,0]);var vo=(Fn.metrics.left-Ea)*Fn.scale-Si+Mo[0],bo=(-Fn.metrics.top-Ea)*Fn.scale+Mo[1],ol=vo+ga.w*Fn.scale/Aa,Hl=bo+ga.h*Fn.scale/Aa,vu=new o(vo,bo),dl=new o(ol,bo),ql=new o(vo,Hl),sl=new o(ol,Hl);if(hi){var ju=new o(-Si,Si-Lu),cu=-Math.PI/2,Mc=lr/2-Si,Tf=Fn.imageName?Mc:0,Zc=new o(5-Lu-Mc,-Tf),Vf=new(Function.prototype.bind.apply(o,[null].concat(Vo)));vu._rotateAround(cu,ju)._add(Zc)._add(Vf),dl._rotateAround(cu,ju)._add(Zc)._add(Vf),ql._rotateAround(cu,ju)._add(Zc)._add(Vf),sl._rotateAround(cu,ju)._add(Zc)._add(Vf)}if(De){var Hf=Math.sin(De),qf=Math.cos(De),df=[qf,-Hf,Hf,qf];vu._matMult(df),dl._matMult(df),ql._matMult(df),sl._matMult(df)}var Qf=new o(0,0),th=new o(0,0),rf=0,eh=0;Je.push({tl:vu,tr:dl,bl:ql,br:sl,tex:ga,writingMode:O.writingMode,glyphOffset:go,sectionIndex:Fn.sectionIndex,isSDF:ja,pixelOffsetTL:Qf,pixelOffsetBR:th,minFontScaleX:rf,minFontScaleY:eh})}}return Je}var _y=function(p,O,W,pt,At,Ot,Wt,_e,De,Je){if(this.boxStartIndex=p.length,De){var sr=Ot.top,Ar=Ot.bottom,Pr=Ot.collisionPadding;Pr&&(sr-=Pr[1],Ar+=Pr[3]);var Vr=Ar-sr;Vr>0&&(Vr=Math.max(10,Vr),this.circleDiameter=Vr)}else{var un=Ot.top*Wt-_e,Fn=Ot.bottom*Wt+_e,ga=Ot.left*Wt-_e,pa=Ot.right*Wt+_e,Ea=Ot.collisionPadding;if(Ea&&(ga-=Ea[0]*Wt,un-=Ea[1]*Wt,pa+=Ea[2]*Wt,Fn+=Ea[3]*Wt),Je){var ja=new o(ga,un),Aa=new o(pa,un),$a=new o(ga,Fn),hi=new o(pa,Fn),Si=Je*Math.PI/180;ja._rotate(Si),Aa._rotate(Si),$a._rotate(Si),hi._rotate(Si),ga=Math.min(ja.x,Aa.x,$a.x,hi.x),pa=Math.max(ja.x,Aa.x,$a.x,hi.x),un=Math.min(ja.y,Aa.y,$a.y,hi.y),Fn=Math.max(ja.y,Aa.y,$a.y,hi.y)}p.emplaceBack(O.x,O.y,ga,un,pa,Fn,W,pt,At)}this.boxEndIndex=p.length},Q0=function(p,O){if(p===void 0&&(p=[]),O===void 0&&(O=eI),this.data=p,this.length=this.data.length,this.compare=O,this.length>0)for(var W=(this.length>>1)-1;W>=0;W--)this._down(W)};Q0.prototype.push=function(p){this.data.push(p),this.length++,this._up(this.length-1)},Q0.prototype.pop=function(){if(this.length!==0){var p=this.data[0],O=this.data.pop();return this.length--,this.length>0&&(this.data[0]=O,this._down(0)),p}},Q0.prototype.peek=function(){return this.data[0]},Q0.prototype._up=function(p){for(var O=this,W=O.data,pt=O.compare,At=W[p];p>0;){var Ot=p-1>>1,Wt=W[Ot];if(pt(At,Wt)>=0)break;W[p]=Wt,p=Ot}W[p]=At},Q0.prototype._down=function(p){for(var O=this,W=O.data,pt=O.compare,At=this.length>>1,Ot=W[p];p<At;){var Wt=(p<<1)+1,_e=W[Wt],De=Wt+1;if(De<this.length&&pt(W[De],_e)<0&&(Wt=De,_e=W[De]),pt(_e,Ot)>=0)break;W[p]=_e,p=Wt}W[p]=Ot};function eI(p,O){return p<O?-1:p>O?1:0}function rI(p,O,W){W===void 0&&(W=!1);for(var pt=1/0,At=1/0,Ot=-1/0,Wt=-1/0,_e=p[0],De=0;De<_e.length;De++){var Je=_e[De];(!De||Je.x<pt)&&(pt=Je.x),(!De||Je.y<At)&&(At=Je.y),(!De||Je.x>Ot)&&(Ot=Je.x),(!De||Je.y>Wt)&&(Wt=Je.y)}var sr=Ot-pt,Ar=Wt-At,Pr=Math.min(sr,Ar),Vr=Pr/2,un=new Q0([],nI);if(Pr===0)return new o(pt,At);for(var Fn=pt;Fn<Ot;Fn+=Pr)for(var ga=At;ga<Wt;ga+=Pr)un.push(new tm(Fn+Vr,ga+Vr,Vr,p));for(var pa=iI(p),Ea=un.length;un.length;){var ja=un.pop();(ja.d>pa.d||!pa.d)&&(pa=ja,W&&console.log("found best %d after %d probes",Math.round(1e4*ja.d)/1e4,Ea)),!(ja.max-pa.d<=O)&&(Vr=ja.h/2,un.push(new tm(ja.p.x-Vr,ja.p.y-Vr,Vr,p)),un.push(new tm(ja.p.x+Vr,ja.p.y-Vr,Vr,p)),un.push(new tm(ja.p.x-Vr,ja.p.y+Vr,Vr,p)),un.push(new tm(ja.p.x+Vr,ja.p.y+Vr,Vr,p)),Ea+=4)}return W&&(console.log("num probes: "+Ea),console.log("best distance: "+pa.d)),pa.p}function nI(p,O){return O.max-p.max}function tm(p,O,W,pt){this.p=new o(p,O),this.h=W,this.d=aI(this.p,pt),this.max=this.d+this.h*Math.SQRT2}function aI(p,O){for(var W=!1,pt=1/0,At=0;At<O.length;At++)for(var Ot=O[At],Wt=0,_e=Ot.length,De=_e-1;Wt<_e;De=Wt++){var Je=Ot[Wt],sr=Ot[De];Je.y>p.y!=sr.y>p.y&&p.x<(sr.x-Je.x)*(p.y-Je.y)/(sr.y-Je.y)+Je.x&&(W=!W),pt=Math.min(pt,Sf(p,Je,sr))}return(W?1:-1)*Math.sqrt(pt)}function iI(p){for(var O=0,W=0,pt=0,At=p[0],Ot=0,Wt=At.length,_e=Wt-1;Ot<Wt;_e=Ot++){var De=At[Ot],Je=At[_e],sr=De.x*Je.y-Je.x*De.y;W+=(De.x+Je.x)*sr,pt+=(De.y+Je.y)*sr,O+=sr*3}return new tm(W/O,pt/O,0,p)}var em=7,P_=Number.POSITIVE_INFINITY;function m4(p,O){function W(At,Ot){var Wt=0,_e=0;Ot<0&&(Ot=0);var De=Ot/Math.sqrt(2);switch(At){case"top-right":case"top-left":_e=De-em;break;case"bottom-right":case"bottom-left":_e=-De+em;break;case"bottom":_e=-Ot+em;break;case"top":_e=Ot-em;break}switch(At){case"top-right":case"bottom-right":Wt=-De;break;case"top-left":case"bottom-left":Wt=De;break;case"left":Wt=Ot;break;case"right":Wt=-Ot;break}return[Wt,_e]}function pt(At,Ot,Wt){var _e=0,De=0;switch(Ot=Math.abs(Ot),Wt=Math.abs(Wt),At){case"top-right":case"top-left":case"top":De=Wt-em;break;case"bottom-right":case"bottom-left":case"bottom":De=-Wt+em;break}switch(At){case"top-right":case"bottom-right":case"right":_e=-Ot;break;case"top-left":case"bottom-left":case"left":_e=Ot;break}return[_e,De]}return O[1]!==P_?pt(p,O[0],O[1]):W(p,O[0])}function oI(p,O,W,pt,At,Ot,Wt){p.createArrays();var _e=512*p.overscaling;p.tilePixelRatio=Li/_e,p.compareText={},p.iconsNeedLinear=!1;var De=p.layers[0].layout,Je=p.layers[0]._unevaluatedLayout._values,sr={};if(p.textSizeData.kind==="composite"){var Ar=p.textSizeData,Pr=Ar.minZoom,Vr=Ar.maxZoom;sr.compositeTextSizes=[Je["text-size"].possiblyEvaluate(new ps(Pr),Wt),Je["text-size"].possiblyEvaluate(new ps(Vr),Wt)]}if(p.iconSizeData.kind==="composite"){var un=p.iconSizeData,Fn=un.minZoom,ga=un.maxZoom;sr.compositeIconSizes=[Je["icon-size"].possiblyEvaluate(new ps(Fn),Wt),Je["icon-size"].possiblyEvaluate(new ps(ga),Wt)]}sr.layoutTextSize=Je["text-size"].possiblyEvaluate(new ps(p.zoom+1),Wt),sr.layoutIconSize=Je["icon-size"].possiblyEvaluate(new ps(p.zoom+1),Wt),sr.textMaxSize=Je["text-size"].possiblyEvaluate(new ps(18));for(var pa=De.get("text-line-height")*lr,Ea=De.get("text-rotation-alignment")==="map"&&De.get("symbol-placement")!=="point",ja=De.get("text-keep-upright"),Aa=De.get("text-size"),$a=function(){var Ei=Si[hi],ro=De.get("text-font").evaluate(Ei,{},Wt).join(","),no=Aa.evaluate(Ei,{},Wt),go=sr.layoutTextSize.evaluate(Ei,{},Wt),Mo=sr.layoutIconSize.evaluate(Ei,{},Wt),Vo={horizontal:{},vertical:void 0},vo=Ei.text,bo=[0,0];if(vo){var ol=vo.toString(),Hl=De.get("text-letter-spacing").evaluate(Ei,{},Wt)*lr,vu=hn(ol)?Hl:0,dl=De.get("text-anchor").evaluate(Ei,{},Wt),ql=De.get("text-variable-anchor");if(!ql){var sl=De.get("text-radial-offset").evaluate(Ei,{},Wt);sl?bo=m4(dl,[sl*lr,P_]):bo=De.get("text-offset").evaluate(Ei,{},Wt).map(function(Op){return Op*lr})}var ju=Ea?"center":De.get("text-justify").evaluate(Ei,{},Wt),cu=De.get("symbol-placement"),Mc=cu==="point"?De.get("text-max-width").evaluate(Ei,{},Wt)*lr:0,Tf=function(){p.allowVerticalPlacement&&ta(ol)&&(Vo.vertical=yh(vo,O,W,At,ro,Mc,pa,dl,"left",vu,bo,Xu.vertical,!0,cu,go,no))};if(!Ea&&ql){for(var Zc=ju==="auto"?ql.map(function(Op){return O_(Op)}):[ju],Vf=!1,Hf=0;Hf<Zc.length;Hf++){var qf=Zc[Hf];if(!Vo.horizontal[qf])if(Vf)Vo.horizontal[qf]=Vo.horizontal[0];else{var df=yh(vo,O,W,At,ro,Mc,pa,"center",qf,vu,bo,Xu.horizontal,!1,cu,go,no);df&&(Vo.horizontal[qf]=df,Vf=df.positionedLines.length===1)}}Tf()}else{ju==="auto"&&(ju=O_(dl));var Qf=yh(vo,O,W,At,ro,Mc,pa,dl,ju,vu,bo,Xu.horizontal,!1,cu,go,no);Qf&&(Vo.horizontal[ju]=Qf),Tf(),ta(ol)&&Ea&&ja&&(Vo.vertical=yh(vo,O,W,At,ro,Mc,pa,dl,ju,vu,bo,Xu.vertical,!1,cu,go,no))}}var th=void 0,rf=!1;if(Ei.icon&&Ei.icon.name){var eh=pt[Ei.icon.name];eh&&(th=C_(At[Ei.icon.name],De.get("icon-offset").evaluate(Ei,{},Wt),De.get("icon-anchor").evaluate(Ei,{},Wt)),rf=eh.sdf,p.sdfIcons===void 0?p.sdfIcons=eh.sdf:p.sdfIcons!==eh.sdf&&j("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(eh.pixelRatio!==p.pixelRatio||De.get("icon-rotate").constantOr(1)!==0)&&(p.iconsNeedLinear=!0))}var xh=v4(Vo.horizontal)||Vo.vertical;p.iconsInText=xh?xh.iconsInText:!1,(xh||th)&&sI(p,Ei,Vo,th,pt,sr,go,Mo,bo,rf,Wt)},hi=0,Si=p.features;hi<Si.length;hi+=1)$a();Ot&&p.generateCollisionDebugBuffers()}function O_(p){switch(p){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sI(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr){var Ar=Ot.textMaxSize.evaluate(O,{});Ar===void 0&&(Ar=Wt);var Pr=p.layers[0].layout,Vr=Pr.get("icon-offset").evaluate(O,{},sr),un=v4(W.horizontal),Fn=24,ga=Wt/Fn,pa=p.tilePixelRatio*ga,Ea=p.tilePixelRatio*Ar/Fn,ja=p.tilePixelRatio*_e,Aa=p.tilePixelRatio*Pr.get("symbol-spacing"),$a=Pr.get("text-padding")*p.tilePixelRatio,hi=Pr.get("icon-padding")*p.tilePixelRatio,Si=Pr.get("text-max-angle")/180*Math.PI,Ei=Pr.get("text-rotation-alignment")==="map"&&Pr.get("symbol-placement")!=="point",ro=Pr.get("icon-rotation-alignment")==="map"&&Pr.get("symbol-placement")!=="point",no=Pr.get("symbol-placement"),go=Aa/2,Mo=Pr.get("icon-text-fit"),Vo;pt&&Mo!=="none"&&(p.allowVerticalPlacement&&W.vertical&&(Vo=dy(pt,W.vertical,Mo,Pr.get("icon-text-fit-padding"),Vr,ga)),un&&(pt=dy(pt,un,Mo,Pr.get("icon-text-fit-padding"),Vr,ga)));var vo=function(om,Dh){Dh.x<0||Dh.x>=Li||Dh.y<0||Dh.y>=Li||lI(p,Dh,om,W,pt,At,Vo,p.layers[0],p.collisionBoxArray,O.index,O.sourceLayerIndex,p.index,pa,$a,Ei,De,ja,hi,ro,Vr,O,Ot,Je,sr,Wt)};if(no==="line")for(var bo=0,ol=h4(O.geometry,0,0,Li,Li);bo<ol.length;bo+=1)for(var Hl=ol[bo],vu=Cp(Hl,Aa,Si,W.vertical||un,pt,Fn,Ea,p.overscaling,Li),dl=0,ql=vu;dl<ql.length;dl+=1){var sl=ql[dl],ju=un;(!ju||!uI(p,ju.text,go,sl))&&vo(Hl,sl)}else if(no==="line-center")for(var cu=0,Mc=O.geometry;cu<Mc.length;cu+=1){var Tf=Mc[cu];if(Tf.length>1){var Zc=Ah(Tf,Si,W.vertical||un,pt,Fn,Ea);Zc&&vo(Tf,Zc)}}else if(O.type==="Polygon")for(var Vf=0,Hf=Ph(O.geometry,0);Vf<Hf.length;Vf+=1){var qf=Hf[Vf],df=rI(qf,16);vo(qf[0],new ud(df.x,df.y,0))}else if(O.type==="LineString")for(var Qf=0,th=O.geometry;Qf<th.length;Qf+=1){var rf=th[Qf];vo(rf,new ud(rf[0].x,rf[0].y,0))}else if(O.type==="Point")for(var eh=0,xh=O.geometry;eh<xh.length;eh+=1)for(var Op=xh[eh],pd=0,dd=Op;pd<dd.length;pd+=1){var md=dd[pd];vo([md],new ud(md.x,md.y,0))}}var wg=255,fd=wg*qc;function g4(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un){var Fn=tI(O,W,_e,At,Ot,Wt,pt,p.allowVerticalPlacement),ga=p.textSizeData,pa=null;ga.kind==="source"?(pa=[qc*At.layout.get("text-size").evaluate(Wt,{})],pa[0]>fd&&j(p.layerIds[0]+': Value for "text-size" is >= '+wg+'. Reduce your "text-size".')):ga.kind==="composite"&&(pa=[qc*Vr.compositeTextSizes[0].evaluate(Wt,{},un),qc*Vr.compositeTextSizes[1].evaluate(Wt,{},un)],(pa[0]>fd||pa[1]>fd)&&j(p.layerIds[0]+': Value for "text-size" is >= '+wg+'. Reduce your "text-size".')),p.addSymbols(p.text,Fn,pa,_e,Ot,Wt,Je,O,De.lineStartIndex,De.lineLength,Pr,un);for(var Ea=0,ja=sr;Ea<ja.length;Ea+=1){var Aa=ja[Ea];Ar[Aa]=p.text.placedSymbolArray.length-1}return Fn.length*4}function v4(p){for(var O in p)return p[O];return null}function lI(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr,Vr,un,Fn,ga,pa,Ea,ja,Aa,$a,hi,Si,Ei){var ro,no=p.addToLineVertexArray(O,W),go,Mo,Vo,vo,bo=0,ol=0,Hl=0,vu=0,dl=-1,ql=-1,sl={},ju=zt(""),cu=0,Mc=0;if(_e._unevaluatedLayout.getValue("text-radial-offset")===void 0?(ro=_e.layout.get("text-offset").evaluate(Aa,{},Si).map(function(Ag){return Ag*lr}),cu=ro[0],Mc=ro[1]):(cu=_e.layout.get("text-radial-offset").evaluate(Aa,{},Si)*lr,Mc=P_),p.allowVerticalPlacement&&pt.vertical){var Tf=_e.layout.get("text-rotate").evaluate(Aa,{},Si),Zc=Tf+90,Vf=pt.vertical;Vo=new _y(De,O,Je,sr,Ar,Vf,Pr,Vr,un,Zc),Wt&&(vo=new _y(De,O,Je,sr,Ar,Wt,ga,pa,un,Zc))}if(At){var Hf=_e.layout.get("icon-rotate").evaluate(Aa,{}),qf=_e.layout.get("icon-text-fit")!=="none",df=p4(At,Hf,hi,qf),Qf=Wt?p4(Wt,Hf,hi,qf):void 0;Mo=new _y(De,O,Je,sr,Ar,At,ga,pa,!1,Hf),bo=df.length*4;var th=p.iconSizeData,rf=null;th.kind==="source"?(rf=[qc*_e.layout.get("icon-size").evaluate(Aa,{})],rf[0]>fd&&j(p.layerIds[0]+': Value for "icon-size" is >= '+wg+'. Reduce your "icon-size".')):th.kind==="composite"&&(rf=[qc*$a.compositeIconSizes[0].evaluate(Aa,{},Si),qc*$a.compositeIconSizes[1].evaluate(Aa,{},Si)],(rf[0]>fd||rf[1]>fd)&&j(p.layerIds[0]+': Value for "icon-size" is >= '+wg+'. Reduce your "icon-size".')),p.addSymbols(p.icon,df,rf,ja,Ea,Aa,!1,O,no.lineStartIndex,no.lineLength,-1,Si),dl=p.icon.placedSymbolArray.length-1,Qf&&(ol=Qf.length*4,p.addSymbols(p.icon,Qf,rf,ja,Ea,Aa,Xu.vertical,O,no.lineStartIndex,no.lineLength,-1,Si),ql=p.icon.placedSymbolArray.length-1)}for(var eh in pt.horizontal){var xh=pt.horizontal[eh];if(!go){ju=zt(xh.text);var Op=_e.layout.get("text-rotate").evaluate(Aa,{},Si);go=new _y(De,O,Je,sr,Ar,xh,Pr,Vr,un,Op)}var pd=xh.positionedLines.length===1;if(Hl+=g4(p,O,xh,Ot,_e,un,Aa,Fn,no,pt.vertical?Xu.horizontal:Xu.horizontalOnly,pd?Object.keys(pt.horizontal):[eh],sl,dl,$a,Si),pd)break}pt.vertical&&(vu+=g4(p,O,pt.vertical,Ot,_e,un,Aa,Fn,no,Xu.vertical,["vertical"],sl,ql,$a,Si));var dd=go?go.boxStartIndex:p.collisionBoxArray.length,md=go?go.boxEndIndex:p.collisionBoxArray.length,om=Vo?Vo.boxStartIndex:p.collisionBoxArray.length,Dh=Vo?Vo.boxEndIndex:p.collisionBoxArray.length,Ay=Mo?Mo.boxStartIndex:p.collisionBoxArray.length,j_=Mo?Mo.boxEndIndex:p.collisionBoxArray.length,My=vo?vo.boxStartIndex:p.collisionBoxArray.length,U_=vo?vo.boxEndIndex:p.collisionBoxArray.length,Sh=-1,sm=function(Ag,P4){return Ag&&Ag.circleDiameter?Math.max(Ag.circleDiameter,P4):P4};Sh=sm(go,Sh),Sh=sm(Vo,Sh),Sh=sm(Mo,Sh),Sh=sm(vo,Sh);var Sy=Sh>-1?1:0;Sy&&(Sh*=Ei/lr),p.glyphOffsetArray.length>=ru.MAX_GLYPHS&&j("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Aa.sortKey!==void 0&&p.addToSortKeyRanges(p.symbolInstances.length,Aa.sortKey),p.symbolInstances.emplaceBack(O.x,O.y,sl.right>=0?sl.right:-1,sl.center>=0?sl.center:-1,sl.left>=0?sl.left:-1,sl.vertical||-1,dl,ql,ju,dd,md,om,Dh,Ay,j_,My,U_,Je,Hl,vu,bo,ol,Sy,0,Pr,cu,Mc,Sh)}function uI(p,O,W,pt){var At=p.compareText;if(!(O in At))At[O]=[];else for(var Ot=At[O],Wt=Ot.length-1;Wt>=0;Wt--)if(pt.dist(Ot[Wt])<W)return!0;return At[O].push(pt),!1}var cI=Lp.VectorTileFeature.types,fI=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function by(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar,Pr){var Vr=_e?Math.min(fd,Math.round(_e[0])):0,un=_e?Math.min(fd,Math.round(_e[1])):0;p.emplaceBack(O,W,Math.round(pt*32),Math.round(At*32),Ot,Wt,(Vr<<1)+(De?1:0),un,Je*16,sr*16,Ar*256,Pr*256)}function D_(p,O,W){p.emplaceBack(O.x,O.y,W),p.emplaceBack(O.x,O.y,W),p.emplaceBack(O.x,O.y,W),p.emplaceBack(O.x,O.y,W)}function hI(p){for(var O=0,W=p.sections;O<W.length;O+=1){var pt=W[O];if(xi(pt.text))return!0}return!1}var rm=function(p){this.layoutVertexArray=new oa,this.indexArray=new gi,this.programConfigurations=p,this.segments=new $o,this.dynamicLayoutVertexArray=new Sa,this.opacityVertexArray=new _i,this.placedSymbolArray=new Ks};rm.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},rm.prototype.upload=function(p,O,W,pt){this.isEmpty()||(W&&(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,C.members),this.indexBuffer=p.createIndexBuffer(this.indexArray,O),this.dynamicLayoutVertexBuffer=p.createVertexBuffer(this.dynamicLayoutVertexArray,$.members,!0),this.opacityVertexBuffer=p.createVertexBuffer(this.opacityVertexArray,fI,!0),this.opacityVertexBuffer.itemSize=1),(W||pt)&&this.programConfigurations.upload(p))},rm.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Ve("SymbolBuffers",rm);var Tg=function(p,O,W){this.layoutVertexArray=new p,this.layoutAttributes=O,this.indexArray=new W,this.segments=new $o,this.collisionVertexArray=new ui};Tg.prototype.upload=function(p){this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=p.createVertexBuffer(this.collisionVertexArray,ht.members,!0)},Tg.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ve("CollisionBuffers",Tg);var ru=function(p){this.collisionBoxArray=p.collisionBoxArray,this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(function(_e){return _e.id}),this.index=p.index,this.pixelRatio=p.pixelRatio,this.sourceLayerIndex=p.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=bh([]),this.placementViewportMatrix=bh([]);var O=this.layers[0],W=O._unevaluatedLayout._values;this.textSizeData=cd(this.zoom,W["text-size"]),this.iconSizeData=cd(this.zoom,W["icon-size"]);var pt=this.layers[0].layout,At=pt.get("symbol-sort-key"),Ot=pt.get("symbol-z-order");this.canOverlap=pt.get("text-allow-overlap")||pt.get("icon-allow-overlap")||pt.get("text-ignore-placement")||pt.get("icon-ignore-placement"),this.sortFeaturesByKey=Ot!=="viewport-y"&&At.constantOr(1)!==void 0;var Wt=Ot==="viewport-y"||Ot==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=Wt&&this.canOverlap,pt.get("symbol-placement")==="point"&&(this.writingModes=pt.get("text-writing-mode").map(function(_e){return Xu[_e]})),this.stateDependentLayerIds=this.layers.filter(function(_e){return _e.isStateDependent()}).map(function(_e){return _e.id}),this.sourceID=p.sourceID};ru.prototype.createArrays=function(){this.text=new rm(new Gn(this.layers,this.zoom,function(p){return/^text/.test(p)})),this.icon=new rm(new Gn(this.layers,this.zoom,function(p){return/^icon/.test(p)})),this.glyphOffsetArray=new Uo,this.lineVertexArray=new tl,this.symbolInstances=new Ys},ru.prototype.calculateGlyphDependencies=function(p,O,W,pt,At){for(var Ot=0;Ot<p.length;Ot++)if(O[p.charCodeAt(Ot)]=!0,(W||pt)&&At){var Wt=Be[p.charAt(Ot)];Wt&&(O[Wt.charCodeAt(0)]=!0)}},ru.prototype.populate=function(p,O,W){var pt=this.layers[0],At=pt.layout,Ot=At.get("text-font"),Wt=At.get("text-field"),_e=At.get("icon-image"),De=(Wt.value.kind!=="constant"||Wt.value.value instanceof Al&&!Wt.value.value.isEmpty()||Wt.value.value.toString().length>0)&&(Ot.value.kind!=="constant"||Ot.value.value.length>0),Je=_e.value.kind!=="constant"||!!_e.value.value||Object.keys(_e.parameters).length>0,sr=At.get("symbol-sort-key");if(this.features=[],!(!De&&!Je)){for(var Ar=O.iconDependencies,Pr=O.glyphDependencies,Vr=O.availableImages,un=new ps(this.zoom),Fn=0,ga=p;Fn<ga.length;Fn+=1){var pa=ga[Fn],Ea=pa.feature,ja=pa.id,Aa=pa.index,$a=pa.sourceLayerIndex,hi=pt._featureFilter.needGeometry,Si=gs(Ea,hi);if(pt._featureFilter.filter(un,Si,W)){hi||(Si.geometry=Ko(Ea));var Ei=void 0;if(De){var ro=pt.getValueAndResolveTokens("text-field",Si,W,Vr),no=Al.factory(ro);hI(no)&&(this.hasRTLText=!0),(!this.hasRTLText||fi()==="unavailable"||this.hasRTLText&&Ts.isParsed())&&(Ei=oe(no,pt,Si))}var go=void 0;if(Je){var Mo=pt.getValueAndResolveTokens("icon-image",Si,W,Vr);Mo instanceof xl?go=Mo:go=xl.fromString(Mo)}if(!(!Ei&&!go)){var Vo=this.sortFeaturesByKey?sr.evaluate(Si,{},W):void 0,vo={id:ja,text:Ei,icon:go,index:Aa,sourceLayerIndex:$a,geometry:Si.geometry,properties:Ea.properties,type:cI[Ea.type],sortKey:Vo};if(this.features.push(vo),go&&(Ar[go.name]=!0),Ei){var bo=Ot.evaluate(Si,{},W).join(","),ol=At.get("text-rotation-alignment")==="map"&&At.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Xu.vertical)>=0;for(var Hl=0,vu=Ei.sections;Hl<vu.length;Hl+=1){var dl=vu[Hl];if(dl.image)Ar[dl.image.name]=!0;else{var ql=ta(Ei.toString()),sl=dl.fontStack||bo,ju=Pr[sl]=Pr[sl]||{};this.calculateGlyphDependencies(dl.text,ju,ol,this.allowVerticalPlacement,ql)}}}}}}At.get("symbol-placement")==="line"&&(this.features=be(this.features)),this.sortFeaturesByKey&&this.features.sort(function(cu,Mc){return cu.sortKey-Mc.sortKey})}},ru.prototype.update=function(p,O,W){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(p,O,this.layers,W),this.icon.programConfigurations.updatePaintArrays(p,O,this.layers,W))},ru.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},ru.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},ru.prototype.upload=function(p){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(p),this.iconCollisionBox.upload(p)),this.text.upload(p,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(p,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},ru.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},ru.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},ru.prototype.addToLineVertexArray=function(p,O){var W=this.lineVertexArray.length;if(p.segment!==void 0){for(var pt=p.dist(O[p.segment+1]),At=p.dist(O[p.segment]),Ot={},Wt=p.segment+1;Wt<O.length;Wt++)Ot[Wt]={x:O[Wt].x,y:O[Wt].y,tileUnitDistanceFromAnchor:pt},Wt<O.length-1&&(pt+=O[Wt+1].dist(O[Wt]));for(var _e=p.segment||0;_e>=0;_e--)Ot[_e]={x:O[_e].x,y:O[_e].y,tileUnitDistanceFromAnchor:At},_e>0&&(At+=O[_e-1].dist(O[_e]));for(var De=0;De<O.length;De++){var Je=Ot[De];this.lineVertexArray.emplaceBack(Je.x,Je.y,Je.tileUnitDistanceFromAnchor)}}return{lineStartIndex:W,lineLength:this.lineVertexArray.length-W}},ru.prototype.addSymbols=function(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr,Ar){for(var Pr=p.indexArray,Vr=p.layoutVertexArray,un=p.segments.prepareSegment(4*O.length,Vr,Pr,this.canOverlap?Ot.sortKey:void 0),Fn=this.glyphOffsetArray.length,ga=un.vertexLength,pa=this.allowVerticalPlacement&&Wt===Xu.vertical?Math.PI/2:0,Ea=Ot.text&&Ot.text.sections,ja=0;ja<O.length;ja++){var Aa=O[ja],$a=Aa.tl,hi=Aa.tr,Si=Aa.bl,Ei=Aa.br,ro=Aa.tex,no=Aa.pixelOffsetTL,go=Aa.pixelOffsetBR,Mo=Aa.minFontScaleX,Vo=Aa.minFontScaleY,vo=Aa.glyphOffset,bo=Aa.isSDF,ol=Aa.sectionIndex,Hl=un.vertexLength,vu=vo[1];by(Vr,_e.x,_e.y,$a.x,vu+$a.y,ro.x,ro.y,W,bo,no.x,no.y,Mo,Vo),by(Vr,_e.x,_e.y,hi.x,vu+hi.y,ro.x+ro.w,ro.y,W,bo,go.x,no.y,Mo,Vo),by(Vr,_e.x,_e.y,Si.x,vu+Si.y,ro.x,ro.y+ro.h,W,bo,no.x,go.y,Mo,Vo),by(Vr,_e.x,_e.y,Ei.x,vu+Ei.y,ro.x+ro.w,ro.y+ro.h,W,bo,go.x,go.y,Mo,Vo),D_(p.dynamicLayoutVertexArray,_e,pa),Pr.emplaceBack(Hl,Hl+1,Hl+2),Pr.emplaceBack(Hl+1,Hl+2,Hl+3),un.vertexLength+=4,un.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(vo[0]),(ja===O.length-1||ol!==O[ja+1].sectionIndex)&&p.programConfigurations.populatePaintArrays(Vr.length,Ot,Ot.index,{},Ar,Ea&&Ea[ol])}p.placedSymbolArray.emplaceBack(_e.x,_e.y,Fn,this.glyphOffsetArray.length-Fn,ga,De,Je,_e.segment,W?W[0]:0,W?W[1]:0,pt[0],pt[1],Wt,0,!1,0,sr)},ru.prototype._addCollisionDebugVertex=function(p,O,W,pt,At,Ot){return O.emplaceBack(0,0),p.emplaceBack(W.x,W.y,pt,At,Math.round(Ot.x),Math.round(Ot.y))},ru.prototype.addCollisionDebugVertices=function(p,O,W,pt,At,Ot,Wt){var _e=At.segments.prepareSegment(4,At.layoutVertexArray,At.indexArray),De=_e.vertexLength,Je=At.layoutVertexArray,sr=At.collisionVertexArray,Ar=Wt.anchorX,Pr=Wt.anchorY;this._addCollisionDebugVertex(Je,sr,Ot,Ar,Pr,new o(p,O)),this._addCollisionDebugVertex(Je,sr,Ot,Ar,Pr,new o(W,O)),this._addCollisionDebugVertex(Je,sr,Ot,Ar,Pr,new o(W,pt)),this._addCollisionDebugVertex(Je,sr,Ot,Ar,Pr,new o(p,pt)),_e.vertexLength+=4;var Vr=At.indexArray;Vr.emplaceBack(De,De+1),Vr.emplaceBack(De+1,De+2),Vr.emplaceBack(De+2,De+3),Vr.emplaceBack(De+3,De),_e.primitiveLength+=4},ru.prototype.addDebugCollisionBoxes=function(p,O,W,pt){for(var At=p;At<O;At++){var Ot=this.collisionBoxArray.get(At),Wt=Ot.x1,_e=Ot.y1,De=Ot.x2,Je=Ot.y2;this.addCollisionDebugVertices(Wt,_e,De,Je,pt?this.textCollisionBox:this.iconCollisionBox,Ot.anchorPoint,W)}},ru.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Tg(Ma,Mt.members,Zo),this.iconCollisionBox=new Tg(Ma,Mt.members,Zo);for(var p=0;p<this.symbolInstances.length;p++){var O=this.symbolInstances.get(p);this.addDebugCollisionBoxes(O.textBoxStartIndex,O.textBoxEndIndex,O,!0),this.addDebugCollisionBoxes(O.verticalTextBoxStartIndex,O.verticalTextBoxEndIndex,O,!0),this.addDebugCollisionBoxes(O.iconBoxStartIndex,O.iconBoxEndIndex,O,!1),this.addDebugCollisionBoxes(O.verticalIconBoxStartIndex,O.verticalIconBoxEndIndex,O,!1)}},ru.prototype._deserializeCollisionBoxesForSymbol=function(p,O,W,pt,At,Ot,Wt,_e,De){for(var Je={},sr=O;sr<W;sr++){var Ar=p.get(sr);Je.textBox={x1:Ar.x1,y1:Ar.y1,x2:Ar.x2,y2:Ar.y2,anchorPointX:Ar.anchorPointX,anchorPointY:Ar.anchorPointY},Je.textFeatureIndex=Ar.featureIndex;break}for(var Pr=pt;Pr<At;Pr++){var Vr=p.get(Pr);Je.verticalTextBox={x1:Vr.x1,y1:Vr.y1,x2:Vr.x2,y2:Vr.y2,anchorPointX:Vr.anchorPointX,anchorPointY:Vr.anchorPointY},Je.verticalTextFeatureIndex=Vr.featureIndex;break}for(var un=Ot;un<Wt;un++){var Fn=p.get(un);Je.iconBox={x1:Fn.x1,y1:Fn.y1,x2:Fn.x2,y2:Fn.y2,anchorPointX:Fn.anchorPointX,anchorPointY:Fn.anchorPointY},Je.iconFeatureIndex=Fn.featureIndex;break}for(var ga=_e;ga<De;ga++){var pa=p.get(ga);Je.verticalIconBox={x1:pa.x1,y1:pa.y1,x2:pa.x2,y2:pa.y2,anchorPointX:pa.anchorPointX,anchorPointY:pa.anchorPointY},Je.verticalIconFeatureIndex=pa.featureIndex;break}return Je},ru.prototype.deserializeCollisionBoxes=function(p){this.collisionArrays=[];for(var O=0;O<this.symbolInstances.length;O++){var W=this.symbolInstances.get(O);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(p,W.textBoxStartIndex,W.textBoxEndIndex,W.verticalTextBoxStartIndex,W.verticalTextBoxEndIndex,W.iconBoxStartIndex,W.iconBoxEndIndex,W.verticalIconBoxStartIndex,W.verticalIconBoxEndIndex))}},ru.prototype.hasTextData=function(){return this.text.segments.get().length>0},ru.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ru.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ru.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ru.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ru.prototype.addIndicesForPlacedSymbol=function(p,O){for(var W=p.placedSymbolArray.get(O),pt=W.vertexStartIndex+W.numGlyphs*4,At=W.vertexStartIndex;At<pt;At+=4)p.indexArray.emplaceBack(At,At+1,At+2),p.indexArray.emplaceBack(At+1,At+2,At+3)},ru.prototype.getSortedSymbolIndexes=function(p){if(this.sortedAngle===p&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var O=Math.sin(p),W=Math.cos(p),pt=[],At=[],Ot=[],Wt=0;Wt<this.symbolInstances.length;++Wt){Ot.push(Wt);var _e=this.symbolInstances.get(Wt);pt.push(Math.round(O*_e.anchorX+W*_e.anchorY)|0),At.push(_e.featureIndex)}return Ot.sort(function(De,Je){return pt[De]-pt[Je]||At[Je]-At[De]}),Ot},ru.prototype.addToSortKeyRanges=function(p,O){var W=this.sortKeyRanges[this.sortKeyRanges.length-1];W&&W.sortKey===O?W.symbolInstanceEnd=p+1:this.sortKeyRanges.push({sortKey:O,symbolInstanceStart:p,symbolInstanceEnd:p+1})},ru.prototype.sortFeatures=function(p){var O=this;if(this.sortFeaturesByY&&this.sortedAngle!==p&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(p),this.sortedAngle=p,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var W=0,pt=this.symbolInstanceIndexes;W<pt.length;W+=1){var At=pt[W],Ot=this.symbolInstances.get(At);this.featureSortOrder.push(Ot.featureIndex),[Ot.rightJustifiedTextSymbolIndex,Ot.centerJustifiedTextSymbolIndex,Ot.leftJustifiedTextSymbolIndex].forEach(function(Wt,_e,De){Wt>=0&&De.indexOf(Wt)===_e&&O.addIndicesForPlacedSymbol(O.text,Wt)}),Ot.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ot.verticalPlacedTextSymbolIndex),Ot.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ot.placedIconSymbolIndex),Ot.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ot.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ve("SymbolBucket",ru,{omit:["layers","collisionBoxArray","features","compareText"]}),ru.MAX_GLYPHS=65535,ru.addDynamicAttributes=D_;function pI(p,O){return O.replace(/{([^{}]+)}/g,function(W,pt){return pt in p?String(p[pt]):""})}var dI=new Ka({"symbol-placement":new qr(Da.layout_symbol["symbol-placement"]),"symbol-spacing":new qr(Da.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new qr(Da.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Sn(Da.layout_symbol["symbol-sort-key"]),"symbol-z-order":new qr(Da.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new qr(Da.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new qr(Da.layout_symbol["icon-ignore-placement"]),"icon-optional":new qr(Da.layout_symbol["icon-optional"]),"icon-rotation-alignment":new qr(Da.layout_symbol["icon-rotation-alignment"]),"icon-size":new Sn(Da.layout_symbol["icon-size"]),"icon-text-fit":new qr(Da.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new qr(Da.layout_symbol["icon-text-fit-padding"]),"icon-image":new Sn(Da.layout_symbol["icon-image"]),"icon-rotate":new Sn(Da.layout_symbol["icon-rotate"]),"icon-padding":new qr(Da.layout_symbol["icon-padding"]),"icon-keep-upright":new qr(Da.layout_symbol["icon-keep-upright"]),"icon-offset":new Sn(Da.layout_symbol["icon-offset"]),"icon-anchor":new Sn(Da.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new qr(Da.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new qr(Da.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new qr(Da.layout_symbol["text-rotation-alignment"]),"text-field":new Sn(Da.layout_symbol["text-field"]),"text-font":new Sn(Da.layout_symbol["text-font"]),"text-size":new Sn(Da.layout_symbol["text-size"]),"text-max-width":new Sn(Da.layout_symbol["text-max-width"]),"text-line-height":new qr(Da.layout_symbol["text-line-height"]),"text-letter-spacing":new Sn(Da.layout_symbol["text-letter-spacing"]),"text-justify":new Sn(Da.layout_symbol["text-justify"]),"text-radial-offset":new Sn(Da.layout_symbol["text-radial-offset"]),"text-variable-anchor":new qr(Da.layout_symbol["text-variable-anchor"]),"text-anchor":new Sn(Da.layout_symbol["text-anchor"]),"text-max-angle":new qr(Da.layout_symbol["text-max-angle"]),"text-writing-mode":new qr(Da.layout_symbol["text-writing-mode"]),"text-rotate":new Sn(Da.layout_symbol["text-rotate"]),"text-padding":new qr(Da.layout_symbol["text-padding"]),"text-keep-upright":new qr(Da.layout_symbol["text-keep-upright"]),"text-transform":new Sn(Da.layout_symbol["text-transform"]),"text-offset":new Sn(Da.layout_symbol["text-offset"]),"text-allow-overlap":new qr(Da.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new qr(Da.layout_symbol["text-ignore-placement"]),"text-optional":new qr(Da.layout_symbol["text-optional"])}),mI=new Ka({"icon-opacity":new Sn(Da.paint_symbol["icon-opacity"]),"icon-color":new Sn(Da.paint_symbol["icon-color"]),"icon-halo-color":new Sn(Da.paint_symbol["icon-halo-color"]),"icon-halo-width":new Sn(Da.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Sn(Da.paint_symbol["icon-halo-blur"]),"icon-translate":new qr(Da.paint_symbol["icon-translate"]),"icon-translate-anchor":new qr(Da.paint_symbol["icon-translate-anchor"]),"text-opacity":new Sn(Da.paint_symbol["text-opacity"]),"text-color":new Sn(Da.paint_symbol["text-color"],{runtimeType:Is,getOverride:function(p){return p.textColor},hasOverride:function(p){return!!p.textColor}}),"text-halo-color":new Sn(Da.paint_symbol["text-halo-color"]),"text-halo-width":new Sn(Da.paint_symbol["text-halo-width"]),"text-halo-blur":new Sn(Da.paint_symbol["text-halo-blur"]),"text-translate":new qr(Da.paint_symbol["text-translate"]),"text-translate-anchor":new qr(Da.paint_symbol["text-translate-anchor"])}),F_={paint:mI,layout:dI},nm=function(p){this.type=p.property.overrides?p.property.overrides.runtimeType:al,this.defaultValue=p};nm.prototype.evaluate=function(p){if(p.formattedSection){var O=this.defaultValue.property.overrides;if(O&&O.hasOverride(p.formattedSection))return O.getOverride(p.formattedSection)}return p.feature&&p.featureState?this.defaultValue.evaluate(p.feature,p.featureState):this.defaultValue.property.specification.default},nm.prototype.eachChild=function(p){if(!this.defaultValue.isConstant()){var O=this.defaultValue.value;p(O._styleExpression.expression)}},nm.prototype.outputDefined=function(){return!1},nm.prototype.serialize=function(){return null},Ve("FormatSectionOverride",nm,{omit:["defaultValue"]});var gI=function(p){function O(W){p.call(this,W,F_)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.recalculate=function(W,pt){if(p.prototype.recalculate.call(this,W,pt),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 At=this.layout.get("text-writing-mode");if(At){for(var Ot=[],Wt=0,_e=At;Wt<_e.length;Wt+=1){var De=_e[Wt];Ot.indexOf(De)<0&&Ot.push(De)}this.layout._values["text-writing-mode"]=Ot}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},O.prototype.getValueAndResolveTokens=function(W,pt,At,Ot){var Wt=this.layout.get(W).evaluate(pt,{},At,Ot),_e=this._unevaluatedLayout._values[W];return!_e.isDataDriven()&&!Ui(_e.value)&&Wt?pI(pt.properties,Wt):Wt},O.prototype.createBucket=function(W){return new ru(W)},O.prototype.queryRadius=function(){return 0},O.prototype.queryIntersectsFeature=function(){return!1},O.prototype._setPaintOverrides=function(){for(var W=0,pt=F_.paint.overridableProperties;W<pt.length;W+=1){var At=pt[W];if(O.hasPaintOverride(this.layout,At)){var Ot=this.paint.get(At),Wt=new nm(Ot),_e=new Nu(Wt,Ot.property.specification),De=null;Ot.value.kind==="constant"||Ot.value.kind==="source"?De=new Ql("source",_e):De=new ul("composite",_e,Ot.value.zoomStops,Ot.value._interpolationType),this.paint._values[At]=new zn(Ot.property,De,Ot.parameters)}}},O.prototype._handleOverridablePaintPropertyUpdate=function(W,pt,At){return!this.layout||pt.isDataDriven()||At.isDataDriven()?!1:O.hasPaintOverride(this.layout,W)},O.hasPaintOverride=function(W,pt){var At=W.get("text-field"),Ot=F_.paint.properties[pt],Wt=!1,_e=function(sr){for(var Ar=0,Pr=sr;Ar<Pr.length;Ar+=1){var Vr=Pr[Ar];if(Ot.overrides&&Ot.overrides.hasOverride(Vr)){Wt=!0;return}}};if(At.value.kind==="constant"&&At.value.value instanceof Al)_e(At.value.value.sections);else if(At.value.kind==="source"){var De=function(sr){if(!Wt)if(sr instanceof Fo&&Fs(sr.value)===Jo){var Ar=sr.value;_e(Ar.sections)}else sr instanceof Hu?_e(sr.sections):sr.eachChild(De)},Je=At.value;Je._styleExpression&&De(Je._styleExpression.expression)}return Wt},O}(fa),vI=new Ka({"background-color":new qr(Da.paint_background["background-color"]),"background-pattern":new ea(Da.paint_background["background-pattern"]),"background-opacity":new qr(Da.paint_background["background-opacity"])}),yI={paint:vI},xI=function(p){function O(W){p.call(this,W,yI)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O}(fa),_I=new Ka({"raster-opacity":new qr(Da.paint_raster["raster-opacity"]),"raster-hue-rotate":new qr(Da.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new qr(Da.paint_raster["raster-brightness-min"]),"raster-brightness-max":new qr(Da.paint_raster["raster-brightness-max"]),"raster-saturation":new qr(Da.paint_raster["raster-saturation"]),"raster-contrast":new qr(Da.paint_raster["raster-contrast"]),"raster-resampling":new qr(Da.paint_raster["raster-resampling"]),"raster-fade-duration":new qr(Da.paint_raster["raster-fade-duration"])}),bI={paint:_I},wI=function(p){function O(W){p.call(this,W,bI)}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O}(fa);function TI(p){var O=[],W=p.id;return W===void 0&&O.push({message:"layers."+W+': missing required property "id"'}),p.render===void 0&&O.push({message:"layers."+W+': missing required method "render"'}),p.renderingMode&&p.renderingMode!=="2d"&&p.renderingMode!=="3d"&&O.push({message:"layers."+W+': property "renderingMode" must be either "2d" or "3d"'}),O}var kI=function(p){function O(W){p.call(this,W,{}),this.implementation=W}return p&&(O.__proto__=p),O.prototype=Object.create(p&&p.prototype),O.prototype.constructor=O,O.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},O.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},O.prototype.recalculate=function(){},O.prototype.updateTransitions=function(){},O.prototype.hasTransition=function(){},O.prototype.serialize=function(){},O.prototype.onAdd=function(W){this.implementation.onAdd&&this.implementation.onAdd(W,W.painter.context.gl)},O.prototype.onRemove=function(W){this.implementation.onRemove&&this.implementation.onRemove(W,W.painter.context.gl)},O}(fa),AI={circle:Km,heatmap:Wd,hillshade:R0,fill:og,"fill-extrusion":M_,line:dg,symbol:gI,background:xI,raster:wI};function MI(p){return p.type==="custom"?new kI(p):new AI[p.type](p)}var y4=s.HTMLImageElement,x4=s.HTMLCanvasElement,_4=s.HTMLVideoElement,b4=s.ImageData,wy=s.ImageBitmap,Jd=function(p,O,W,pt){this.context=p,this.format=W,this.texture=p.gl.createTexture(),this.update(O,pt)};Jd.prototype.update=function(p,O,W){var pt=p.width,At=p.height,Ot=(!this.size||this.size[0]!==pt||this.size[1]!==At)&&!W,Wt=this,_e=Wt.context,De=_e.gl;if(this.useMipmap=!!(O&&O.useMipmap),De.bindTexture(De.TEXTURE_2D,this.texture),_e.pixelStoreUnpackFlipY.set(!1),_e.pixelStoreUnpack.set(1),_e.pixelStoreUnpackPremultiplyAlpha.set(this.format===De.RGBA&&(!O||O.premultiply!==!1)),Ot)this.size=[pt,At],p instanceof y4||p instanceof x4||p instanceof _4||p instanceof b4||wy&&p instanceof wy?De.texImage2D(De.TEXTURE_2D,0,this.format,this.format,De.UNSIGNED_BYTE,p):De.texImage2D(De.TEXTURE_2D,0,this.format,pt,At,0,this.format,De.UNSIGNED_BYTE,p.data);else{var Je=W||{x:0,y:0},sr=Je.x,Ar=Je.y;p instanceof y4||p instanceof x4||p instanceof _4||p instanceof b4||wy&&p instanceof wy?De.texSubImage2D(De.TEXTURE_2D,0,sr,Ar,De.RGBA,De.UNSIGNED_BYTE,p):De.texSubImage2D(De.TEXTURE_2D,0,sr,Ar,pt,At,De.RGBA,De.UNSIGNED_BYTE,p.data)}this.useMipmap&&this.isSizePowerOfTwo()&&De.generateMipmap(De.TEXTURE_2D)},Jd.prototype.bind=function(p,O,W){var pt=this,At=pt.context,Ot=At.gl;Ot.bindTexture(Ot.TEXTURE_2D,this.texture),W===Ot.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(W=Ot.LINEAR),p!==this.filter&&(Ot.texParameteri(Ot.TEXTURE_2D,Ot.TEXTURE_MAG_FILTER,p),Ot.texParameteri(Ot.TEXTURE_2D,Ot.TEXTURE_MIN_FILTER,W||p),this.filter=p),O!==this.wrap&&(Ot.texParameteri(Ot.TEXTURE_2D,Ot.TEXTURE_WRAP_S,O),Ot.texParameteri(Ot.TEXTURE_2D,Ot.TEXTURE_WRAP_T,O),this.wrap=O)},Jd.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},Jd.prototype.destroy=function(){var p=this.context,O=p.gl;O.deleteTexture(this.texture),this.texture=null};var B_=function(p){var O=this;this._callback=p,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){O._triggered=!1,O._callback()})};B_.prototype.trigger=function(){var p=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){p._triggered=!1,p._callback()},0))},B_.prototype.remove=function(){delete this._channel,this._callback=function(){}};var am=function(p,O,W){this.target=p,this.parent=O,this.mapId=W,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},L(["receive","process"],this),this.invoker=new B_(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=st()?p:s};am.prototype.send=function(p,O,W,pt,At){var Ot=this;At===void 0&&(At=!1);var Wt=Math.round(Math.random()*1e18).toString(36).substring(0,10);W&&(this.callbacks[Wt]=W);var _e=ot(this.globalScope)?void 0:[];return this.target.postMessage({id:Wt,type:p,hasCallback:!!W,targetMapId:pt,mustQueue:At,sourceMapId:this.mapId,data:Sr(O,_e)},_e),{cancel:function(){W&&delete Ot.callbacks[Wt],Ot.target.postMessage({id:Wt,type:"<cancel>",targetMapId:pt,sourceMapId:Ot.mapId})}}},am.prototype.receive=function(p){var O=p.data,W=O.id;if(W&&!(O.targetMapId&&this.mapId!==O.targetMapId))if(O.type==="<cancel>"){delete this.tasks[W];var pt=this.cancelCallbacks[W];delete this.cancelCallbacks[W],pt&&pt()}else st()||O.mustQueue?(this.tasks[W]=O,this.taskQueue.push(W),this.invoker.trigger()):this.processTask(W,O)},am.prototype.process=function(){if(this.taskQueue.length){var p=this.taskQueue.shift(),O=this.tasks[p];delete this.tasks[p],this.taskQueue.length&&this.invoker.trigger(),O&&this.processTask(p,O)}},am.prototype.processTask=function(p,O){var W=this;if(O.type==="<response>"){var pt=this.callbacks[p];delete this.callbacks[p],pt&&(O.error?pt(Wr(O.error)):pt(null,Wr(O.data)))}else{var At=!1,Ot=ot(this.globalScope)?void 0:[],Wt=O.hasCallback?function(Ar,Pr){At=!0,delete W.cancelCallbacks[p],W.target.postMessage({id:p,type:"<response>",sourceMapId:W.mapId,error:Ar?Sr(Ar):null,data:Sr(Pr,Ot)},Ot)}:function(Ar){At=!0},_e=null,De=Wr(O.data);if(this.parent[O.type])_e=this.parent[O.type](O.sourceMapId,De,Wt);else if(this.parent.getWorkerSource){var Je=O.type.split("."),sr=this.parent.getWorkerSource(O.sourceMapId,Je[0],De.source);_e=sr[Je[1]](De,Wt)}else Wt(new Error("Could not find function "+O.type));!At&&_e&&_e.cancel&&(this.cancelCallbacks[p]=_e.cancel)}},am.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function SI(p,O,W){O=Math.pow(2,W)-O-1;var pt=w4(p*256,O*256,W),At=w4((p+1)*256,(O+1)*256,W);return pt[0]+","+pt[1]+","+At[0]+","+At[1]}function w4(p,O,W){var pt=2*Math.PI*6378137/256/Math.pow(2,W),At=p*pt-2*Math.PI*6378137/2,Ot=O*pt-2*Math.PI*6378137/2;return[At,Ot]}var Wc=function(p,O){p&&(O?this.setSouthWest(p).setNorthEast(O):p.length===4?this.setSouthWest([p[0],p[1]]).setNorthEast([p[2],p[3]]):this.setSouthWest(p[0]).setNorthEast(p[1]))};Wc.prototype.setNorthEast=function(p){return this._ne=p instanceof $u?new $u(p.lng,p.lat):$u.convert(p),this},Wc.prototype.setSouthWest=function(p){return this._sw=p instanceof $u?new $u(p.lng,p.lat):$u.convert(p),this},Wc.prototype.extend=function(p){var O=this._sw,W=this._ne,pt,At;if(p instanceof $u)pt=p,At=p;else if(p instanceof Wc){if(pt=p._sw,At=p._ne,!pt||!At)return this}else{if(Array.isArray(p))if(p.length===4||p.every(Array.isArray)){var Ot=p;return this.extend(Wc.convert(Ot))}else{var Wt=p;return this.extend($u.convert(Wt))}return this}return!O&&!W?(this._sw=new $u(pt.lng,pt.lat),this._ne=new $u(At.lng,At.lat)):(O.lng=Math.min(pt.lng,O.lng),O.lat=Math.min(pt.lat,O.lat),W.lng=Math.max(At.lng,W.lng),W.lat=Math.max(At.lat,W.lat)),this},Wc.prototype.getCenter=function(){return new $u((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Wc.prototype.getSouthWest=function(){return this._sw},Wc.prototype.getNorthEast=function(){return this._ne},Wc.prototype.getNorthWest=function(){return new $u(this.getWest(),this.getNorth())},Wc.prototype.getSouthEast=function(){return new $u(this.getEast(),this.getSouth())},Wc.prototype.getWest=function(){return this._sw.lng},Wc.prototype.getSouth=function(){return this._sw.lat},Wc.prototype.getEast=function(){return this._ne.lng},Wc.prototype.getNorth=function(){return this._ne.lat},Wc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Wc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Wc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Wc.prototype.contains=function(p){var O=$u.convert(p),W=O.lng,pt=O.lat,At=this._sw.lat<=pt&&pt<=this._ne.lat,Ot=this._sw.lng<=W&&W<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ot=this._sw.lng>=W&&W>=this._ne.lng),At&&Ot},Wc.convert=function(p){return!p||p instanceof Wc?p:new Wc(p)};var T4=63710088e-1,$u=function(p,O){if(isNaN(p)||isNaN(O))throw new Error("Invalid LngLat object: ("+p+", "+O+")");if(this.lng=+p,this.lat=+O,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};$u.prototype.wrap=function(){return new $u(x(this.lng,-180,180),this.lat)},$u.prototype.toArray=function(){return[this.lng,this.lat]},$u.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},$u.prototype.distanceTo=function(p){var O=Math.PI/180,W=this.lat*O,pt=p.lat*O,At=Math.sin(W)*Math.sin(pt)+Math.cos(W)*Math.cos(pt)*Math.cos((p.lng-this.lng)*O),Ot=T4*Math.acos(Math.min(At,1));return Ot},$u.prototype.toBounds=function(p){p===void 0&&(p=0);var O=40075017,W=360*p/O,pt=W/Math.cos(Math.PI/180*this.lat);return new Wc(new $u(this.lng-pt,this.lat-W),new $u(this.lng+pt,this.lat+W))},$u.convert=function(p){if(p instanceof $u)return p;if(Array.isArray(p)&&(p.length===2||p.length===3))return new $u(Number(p[0]),Number(p[1]));if(!Array.isArray(p)&&typeof p=="object"&&p!==null)return new $u(Number("lng"in p?p.lng:p.lon),Number(p.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 k4=2*Math.PI*T4;function A4(p){return k4*Math.cos(p*Math.PI/180)}function M4(p){return(180+p)/360}function S4(p){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+p*Math.PI/360)))/360}function E4(p,O){return p/A4(O)}function EI(p){return p*360-180}function R_(p){var O=180-p*360;return 360/Math.PI*Math.atan(Math.exp(O*Math.PI/180))-90}function zI(p,O){return p*A4(R_(O))}function LI(p){return 1/Math.cos(p*Math.PI/180)}var Qd=function(p,O,W){W===void 0&&(W=0),this.x=+p,this.y=+O,this.z=+W};Qd.fromLngLat=function(p,O){O===void 0&&(O=0);var W=$u.convert(p);return new Qd(M4(W.lng),S4(W.lat),E4(O,W.lat))},Qd.prototype.toLngLat=function(){return new $u(EI(this.x),R_(this.y))},Qd.prototype.toAltitude=function(){return zI(this.z,this.y)},Qd.prototype.meterInMercatorCoordinateUnits=function(){return 1/k4*LI(R_(this.y))};var t0=function(p,O,W){this.z=p,this.x=O,this.y=W,this.key=kg(0,p,p,O,W)};t0.prototype.equals=function(p){return this.z===p.z&&this.x===p.x&&this.y===p.y},t0.prototype.url=function(p,O){var W=SI(this.x,this.y,this.z),pt=CI(this.z,this.x,this.y);return p[(this.x+this.y)%p.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(O==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",pt).replace("{bbox-epsg-3857}",W)},t0.prototype.getTilePoint=function(p){var O=Math.pow(2,this.z);return new o((p.x*O-this.x)*Li,(p.y*O-this.y)*Li)},t0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var z4=function(p,O){this.wrap=p,this.canonical=O,this.key=kg(p,O.z,O.z,O.x,O.y)},Gc=function(p,O,W,pt,At){this.overscaledZ=p,this.wrap=O,this.canonical=new t0(W,+pt,+At),this.key=kg(O,p,W,pt,At)};Gc.prototype.equals=function(p){return this.overscaledZ===p.overscaledZ&&this.wrap===p.wrap&&this.canonical.equals(p.canonical)},Gc.prototype.scaledTo=function(p){var O=this.canonical.z-p;return p>this.canonical.z?new Gc(p,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gc(p,this.wrap,p,this.canonical.x>>O,this.canonical.y>>O)},Gc.prototype.calculateScaledKey=function(p,O){var W=this.canonical.z-p;return p>this.canonical.z?kg(this.wrap*+O,p,this.canonical.z,this.canonical.x,this.canonical.y):kg(this.wrap*+O,p,p,this.canonical.x>>W,this.canonical.y>>W)},Gc.prototype.isChildOf=function(p){if(p.wrap!==this.wrap)return!1;var O=this.canonical.z-p.canonical.z;return p.overscaledZ===0||p.overscaledZ<this.overscaledZ&&p.canonical.x===this.canonical.x>>O&&p.canonical.y===this.canonical.y>>O},Gc.prototype.children=function(p){if(this.overscaledZ>=p)return[new Gc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var O=this.canonical.z+1,W=this.canonical.x*2,pt=this.canonical.y*2;return[new Gc(O,this.wrap,O,W,pt),new Gc(O,this.wrap,O,W+1,pt),new Gc(O,this.wrap,O,W,pt+1),new Gc(O,this.wrap,O,W+1,pt+1)]},Gc.prototype.isLessThan=function(p){return this.wrap<p.wrap?!0:this.wrap>p.wrap?!1:this.overscaledZ<p.overscaledZ?!0:this.overscaledZ>p.overscaledZ?!1:this.canonical.x<p.canonical.x?!0:this.canonical.x>p.canonical.x?!1:this.canonical.y<p.canonical.y},Gc.prototype.wrapped=function(){return new Gc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Gc.prototype.unwrapTo=function(p){return new Gc(this.overscaledZ,p,this.canonical.z,this.canonical.x,this.canonical.y)},Gc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Gc.prototype.toUnwrapped=function(){return new z4(this.wrap,this.canonical)},Gc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Gc.prototype.getTilePoint=function(p){return this.canonical.getTilePoint(new Qd(p.x-this.wrap,p.y))};function kg(p,O,W,pt,At){p*=2,p<0&&(p=p*-1-1);var Ot=1<<W;return(Ot*Ot*p+Ot*At+pt).toString(36)+W.toString(36)+O.toString(36)}function CI(p,O,W){for(var pt="",At,Ot=p;Ot>0;Ot--)At=1<<Ot-1,pt+=(O&At?1:0)+(W&At?2:0);return pt}Ve("CanonicalTileID",t0),Ve("OverscaledTileID",Gc,{omit:["posMatrix"]});var Ip=function(p,O,W){if(this.uid=p,O.height!==O.width)throw new RangeError("DEM tiles must be square");if(W&&W!=="mapbox"&&W!=="terrarium")return j('"'+W+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=O.height;var pt=this.dim=O.height-2;this.data=new Uint32Array(O.data.buffer),this.encoding=W||"mapbox";for(var At=0;At<pt;At++)this.data[this._idx(-1,At)]=this.data[this._idx(0,At)],this.data[this._idx(pt,At)]=this.data[this._idx(pt-1,At)],this.data[this._idx(At,-1)]=this.data[this._idx(At,0)],this.data[this._idx(At,pt)]=this.data[this._idx(At,pt-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(pt,-1)]=this.data[this._idx(pt-1,0)],this.data[this._idx(-1,pt)]=this.data[this._idx(0,pt-1)],this.data[this._idx(pt,pt)]=this.data[this._idx(pt-1,pt-1)]};Ip.prototype.get=function(p,O){var W=new Uint8Array(this.data.buffer),pt=this._idx(p,O)*4,At=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return At(W[pt],W[pt+1],W[pt+2])},Ip.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Ip.prototype._idx=function(p,O){if(p<-1||p>=this.dim+1||O<-1||O>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(O+1)*this.stride+(p+1)},Ip.prototype._unpackMapbox=function(p,O,W){return(p*256*256+O*256+W)/10-1e4},Ip.prototype._unpackTerrarium=function(p,O,W){return p*256+O+W/256-32768},Ip.prototype.getPixels=function(){return new xf({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ip.prototype.backfillBorder=function(p,O,W){if(this.dim!==p.dim)throw new Error("dem dimension mismatch");var pt=O*this.dim,At=O*this.dim+this.dim,Ot=W*this.dim,Wt=W*this.dim+this.dim;switch(O){case-1:pt=At-1;break;case 1:At=pt+1;break}switch(W){case-1:Ot=Wt-1;break;case 1:Wt=Ot+1;break}for(var _e=-O*this.dim,De=-W*this.dim,Je=Ot;Je<Wt;Je++)for(var sr=pt;sr<At;sr++)this.data[this._idx(sr,Je)]=p.data[this._idx(sr+_e,Je+De)]},Ve("DEMData",Ip);function II(p,O){var W={};if(!O)return W;for(var pt=function(){var Wt=Ot[At],_e=Wt.layerIds.map(function(Ar){return O.getLayer(Ar)}).filter(Boolean);if(_e.length!==0){Wt.layers=_e,Wt.stateDependentLayerIds&&(Wt.stateDependentLayers=Wt.stateDependentLayerIds.map(function(Ar){return _e.filter(function(Pr){return Pr.id===Ar})[0]}));for(var De=0,Je=_e;De<Je.length;De+=1){var sr=Je[De];W[sr.id]=Wt}}},At=0,Ot=p;At<Ot.length;At+=1)pt();return W}var Ty=function(p){this._stringToNumber={},this._numberToString=[];for(var O=0;O<p.length;O++){var W=p[O];this._stringToNumber[W]=O,this._numberToString[O]=W}};Ty.prototype.encode=function(p){return this._stringToNumber[p]},Ty.prototype.decode=function(p){return this._numberToString[p]};var ky=function(p,O,W,pt,At){this.type="Feature",this._vectorTileFeature=p,p._z=O,p._x=W,p._y=pt,this.properties=p.properties,this.id=At},N_={geometry:{configurable:!0}};N_.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},N_.geometry.set=function(p){this._geometry=p},ky.prototype.toJSON=function(){var p={geometry:this.geometry};for(var O in this)O==="_geometry"||O==="_vectorTileFeature"||(p[O]=this[O]);return p},Object.defineProperties(ky.prototype,N_);var im=function(){this.state={},this.stateChanges={},this.deletedStates={}};im.prototype.updateState=function(p,O,W){var pt=String(O);if(this.stateChanges[p]=this.stateChanges[p]||{},this.stateChanges[p][pt]=this.stateChanges[p][pt]||{},M(this.stateChanges[p][pt],W),this.deletedStates[p]===null){this.deletedStates[p]={};for(var At in this.state[p])At!==pt&&(this.deletedStates[p][At]=null)}else{var Ot=this.deletedStates[p]&&this.deletedStates[p][pt]===null;if(Ot){this.deletedStates[p][pt]={};for(var Wt in this.state[p][pt])W[Wt]||(this.deletedStates[p][pt][Wt]=null)}else for(var _e in W){var De=this.deletedStates[p]&&this.deletedStates[p][pt]&&this.deletedStates[p][pt][_e]===null;De&&delete this.deletedStates[p][pt][_e]}}},im.prototype.removeFeatureState=function(p,O,W){var pt=this.deletedStates[p]===null;if(!pt){var At=String(O);if(this.deletedStates[p]=this.deletedStates[p]||{},W&&O!==void 0)this.deletedStates[p][At]!==null&&(this.deletedStates[p][At]=this.deletedStates[p][At]||{},this.deletedStates[p][At][W]=null);else if(O!==void 0){var Ot=this.stateChanges[p]&&this.stateChanges[p][At];if(Ot){this.deletedStates[p][At]={};for(W in this.stateChanges[p][At])this.deletedStates[p][At][W]=null}else this.deletedStates[p][At]=null}else this.deletedStates[p]=null}},im.prototype.getState=function(p,O){var W=String(O),pt=this.state[p]||{},At=this.stateChanges[p]||{},Ot=M({},pt[W],At[W]);if(this.deletedStates[p]===null)return{};if(this.deletedStates[p]){var Wt=this.deletedStates[p][O];if(Wt===null)return{};for(var _e in Wt)delete Ot[_e]}return Ot},im.prototype.initializeTileState=function(p,O){p.setFeatureState(this.state,O)},im.prototype.coalesceChanges=function(p,O){var W={};for(var pt in this.stateChanges){this.state[pt]=this.state[pt]||{};var At={};for(var Ot in this.stateChanges[pt])this.state[pt][Ot]||(this.state[pt][Ot]={}),M(this.state[pt][Ot],this.stateChanges[pt][Ot]),At[Ot]=this.state[pt][Ot];W[pt]=At}for(var Wt in this.deletedStates){this.state[Wt]=this.state[Wt]||{};var _e={};if(this.deletedStates[Wt]===null)for(var De in this.state[Wt])_e[De]={},this.state[Wt][De]={};else for(var Je in this.deletedStates[Wt]){var sr=this.deletedStates[Wt][Je]===null;if(sr)this.state[Wt][Je]={};else for(var Ar=0,Pr=Object.keys(this.deletedStates[Wt][Je]);Ar<Pr.length;Ar+=1){var Vr=Pr[Ar];delete this.state[Wt][Je][Vr]}_e[Je]=this.state[Wt][Je]}W[Wt]=W[Wt]||{},M(W[Wt],_e)}if(this.stateChanges={},this.deletedStates={},Object.keys(W).length!==0)for(var un in p){var Fn=p[un];Fn.setFeatureState(W,O)}};var Pp=function(p,O){this.tileID=p,this.x=p.canonical.x,this.y=p.canonical.y,this.z=p.canonical.z,this.grid=new gt(Li,16,0),this.grid3D=new gt(Li,16,0),this.featureIndexArray=new vi,this.promoteId=O};Pp.prototype.insert=function(p,O,W,pt,At,Ot){var Wt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(W,pt,At);for(var _e=Ot?this.grid3D:this.grid,De=0;De<O.length;De++){for(var Je=O[De],sr=[1/0,1/0,-1/0,-1/0],Ar=0;Ar<Je.length;Ar++){var Pr=Je[Ar];sr[0]=Math.min(sr[0],Pr.x),sr[1]=Math.min(sr[1],Pr.y),sr[2]=Math.max(sr[2],Pr.x),sr[3]=Math.max(sr[3],Pr.y)}sr[0]<Li&&sr[1]<Li&&sr[2]>=0&&sr[3]>=0&&_e.insert(Wt,sr[0],sr[1],sr[2],sr[3])}},Pp.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Lp.VectorTile(new en(this.rawTileData)).layers,this.sourceLayerCoder=new Ty(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Pp.prototype.query=function(p,O,W,pt){var At=this;this.loadVTLayers();for(var Ot=p.params||{},Wt=Li/p.tileSize/p.scale,_e=Gt(Ot.filter),De=p.queryGeometry,Je=p.queryPadding*Wt,sr=C4(De),Ar=this.grid.query(sr.minX-Je,sr.minY-Je,sr.maxX+Je,sr.maxY+Je),Pr=C4(p.cameraQueryGeometry),Vr=this.grid3D.query(Pr.minX-Je,Pr.minY-Je,Pr.maxX+Je,Pr.maxY+Je,function($a,hi,Si,Ei){return Ch(p.cameraQueryGeometry,$a-Je,hi-Je,Si+Je,Ei+Je)}),un=0,Fn=Vr;un<Fn.length;un+=1){var ga=Fn[un];Ar.push(ga)}Ar.sort(PI);for(var pa={},Ea,ja=function($a){var hi=Ar[$a];if(hi!==Ea){Ea=hi;var Si=At.featureIndexArray.get(hi),Ei=null;At.loadMatchingFeature(pa,Si.bucketIndex,Si.sourceLayerIndex,Si.featureIndex,_e,Ot.layers,Ot.availableImages,O,W,pt,function(ro,no,go){return Ei||(Ei=Ko(ro)),no.queryIntersectsFeature(De,ro,go,Ei,At.z,p.transform,Wt,p.pixelPosMatrix)})}},Aa=0;Aa<Ar.length;Aa++)ja(Aa);return pa},Pp.prototype.loadMatchingFeature=function(p,O,W,pt,At,Ot,Wt,_e,De,Je,sr){var Ar=this.bucketLayerIDs[O];if(!(Ot&&!F(Ot,Ar))){var Pr=this.sourceLayerCoder.decode(W),Vr=this.vtLayers[Pr],un=Vr.feature(pt);if(At.needGeometry){var Fn=gs(un,!0);if(!At.filter(new ps(this.tileID.overscaledZ),Fn,this.tileID.canonical))return}else if(!At.filter(new ps(this.tileID.overscaledZ),un))return;for(var ga=this.getId(un,Pr),pa=0;pa<Ar.length;pa++){var Ea=Ar[pa];if(!(Ot&&Ot.indexOf(Ea)<0)){var ja=_e[Ea];if(ja){var Aa={};ga!==void 0&&Je&&(Aa=Je.getState(ja.sourceLayer||"_geojsonTileLayer",ga));var $a=M({},De[Ea]);$a.paint=L4($a.paint,ja.paint,un,Aa,Wt),$a.layout=L4($a.layout,ja.layout,un,Aa,Wt);var hi=!sr||sr(un,ja,Aa);if(hi){var Si=new ky(un,this.z,this.x,this.y,ga);Si.layer=$a;var Ei=p[Ea];Ei===void 0&&(Ei=p[Ea]=[]),Ei.push({featureIndex:pt,feature:Si,intersectionZ:hi})}}}}}},Pp.prototype.lookupSymbolFeatures=function(p,O,W,pt,At,Ot,Wt,_e){var De={};this.loadVTLayers();for(var Je=Gt(At),sr=0,Ar=p;sr<Ar.length;sr+=1){var Pr=Ar[sr];this.loadMatchingFeature(De,W,pt,Pr,Je,Ot,Wt,_e,O)}return De},Pp.prototype.hasLayer=function(p){for(var O=0,W=this.bucketLayerIDs;O<W.length;O+=1)for(var pt=W[O],At=0,Ot=pt;At<Ot.length;At+=1){var Wt=Ot[At];if(p===Wt)return!0}return!1},Pp.prototype.getId=function(p,O){var W=p.id;if(this.promoteId){var pt=typeof this.promoteId=="string"?this.promoteId:this.promoteId[O];W=p.properties[pt],typeof W=="boolean"&&(W=Number(W))}return W},Ve("FeatureIndex",Pp,{omit:["rawTileData","sourceLayerCoder"]});function L4(p,O,W,pt,At){return B(p,function(Ot,Wt){var _e=O instanceof Tn?O.get(Wt):null;return _e&&_e.evaluate?_e.evaluate(W,pt,At):_e})}function C4(p){for(var O=1/0,W=1/0,pt=-1/0,At=-1/0,Ot=0,Wt=p;Ot<Wt.length;Ot+=1){var _e=Wt[Ot];O=Math.min(O,_e.x),W=Math.min(W,_e.y),pt=Math.max(pt,_e.x),At=Math.max(At,_e.y)}return{minX:O,minY:W,maxX:pt,maxY:At}}function PI(p,O){return O-p}var OI=3e4,pf=function(p,O){this.tileID=p,this.uid=h(),this.uses=0,this.tileSize=O,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};pf.prototype.registerFadeDuration=function(p){var O=p+this.timeAdded;O<Tt.now()||this.fadeEndTime&&O<this.fadeEndTime||(this.fadeEndTime=O)},pf.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},pf.prototype.loadVectorData=function(p,O,W){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!p){this.collisionBoxArray=new Hs;return}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=II(p.buckets,O.style),this.hasSymbolBuckets=!1;for(var pt in this.buckets){var At=this.buckets[pt];if(At instanceof ru)if(this.hasSymbolBuckets=!0,W)At.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var Ot in this.buckets){var Wt=this.buckets[Ot];if(Wt instanceof ru&&Wt.hasRTLText){this.hasRTLText=!0,lu();break}}this.queryPadding=0;for(var _e in this.buckets){var De=this.buckets[_e];this.queryPadding=Math.max(this.queryPadding,O.style.getLayer(_e).queryRadius(De))}p.imageAtlas&&(this.imageAtlas=p.imageAtlas),p.glyphAtlasImage&&(this.glyphAtlasImage=p.glyphAtlasImage)},pf.prototype.unloadVectorData=function(){for(var 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"},pf.prototype.getBucket=function(p){return this.buckets[p.id]},pf.prototype.upload=function(p){for(var O in this.buckets){var W=this.buckets[O];W.uploadPending()&&W.upload(p)}var pt=p.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Jd(p,this.imageAtlas.image,pt.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Jd(p,this.glyphAtlasImage,pt.ALPHA),this.glyphAtlasImage=null)},pf.prototype.prepare=function(p){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(p,this.imageAtlasTexture)},pf.prototype.queryRenderedFeatures=function(p,O,W,pt,At,Ot,Wt,_e,De,Je){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:pt,cameraQueryGeometry:At,scale:Ot,tileSize:this.tileSize,pixelPosMatrix:Je,transform:_e,params:Wt,queryPadding:this.queryPadding*De},p,O,W)},pf.prototype.querySourceFeatures=function(p,O){var W=this.latestFeatureIndex;if(!(!W||!W.rawTileData)){var pt=W.loadVTLayers(),At=O?O.sourceLayer:"",Ot=pt._geojsonTileLayer||pt[At];if(Ot)for(var Wt=Gt(O&&O.filter),_e=this.tileID.canonical,De=_e.z,Je=_e.x,sr=_e.y,Ar={z:De,x:Je,y:sr},Pr=0;Pr<Ot.length;Pr++){var Vr=Ot.feature(Pr);if(Wt.needGeometry){var un=gs(Vr,!0);if(!Wt.filter(new ps(this.tileID.overscaledZ),un,this.tileID.canonical))continue}else if(!Wt.filter(new ps(this.tileID.overscaledZ),Vr))continue;var Fn=W.getId(Vr,At),ga=new ky(Vr,De,Je,sr,Fn);ga.tile=Ar,p.push(ga)}}},pf.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},pf.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},pf.prototype.setExpiryData=function(p){var O=this.expirationTime;if(p.cacheControl){var W=et(p.cacheControl);W["max-age"]&&(this.expirationTime=Date.now()+W["max-age"]*1e3)}else p.expires&&(this.expirationTime=new Date(p.expires).getTime());if(this.expirationTime){var pt=Date.now(),At=!1;if(this.expirationTime>pt)At=!1;else if(!O)At=!0;else if(this.expirationTime<O)At=!0;else{var Ot=this.expirationTime-O;Ot?this.expirationTime=pt+Math.max(Ot,OI):At=!0}At?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},pf.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)},pf.prototype.setFeatureState=function(p,O){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(p).length===0)){var W=this.latestFeatureIndex.loadVTLayers();for(var pt in this.buckets)if(O.style.hasLayer(pt)){var At=this.buckets[pt],Ot=At.layers[0].sourceLayer||"_geojsonTileLayer",Wt=W[Ot],_e=p[Ot];if(!(!Wt||!_e||Object.keys(_e).length===0)){At.update(_e,Wt,this.imageAtlas&&this.imageAtlas.patternPositions||{});var De=O&&O.style&&O.style.getLayer(pt);De&&(this.queryPadding=Math.max(this.queryPadding,De.queryRadius(At)))}}}},pf.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},pf.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Tt.now()},pf.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},pf.prototype.setHoldDuration=function(p){this.symbolFadeHoldUntil=Tt.now()+p},pf.prototype.setDependencies=function(p,O){for(var W={},pt=0,At=O;pt<At.length;pt+=1){var Ot=At[pt];W[Ot]=!0}this.dependencies[p]=W},pf.prototype.hasDependency=function(p,O){for(var W=0,pt=p;W<pt.length;W+=1){var At=pt[W],Ot=this.dependencies[At];if(Ot)for(var Wt=0,_e=O;Wt<_e.length;Wt+=1){var De=_e[Wt];if(Ot[De])return!0}}return!1};var DI=["type","source","source-layer","minzoom","maxzoom","filter","layout"],hd=s.performance,I4=function(p){this._marks={start:[p.url,"start"].join("#"),end:[p.url,"end"].join("#"),measure:p.url.toString()},hd.mark(this._marks.start)};I4.prototype.finish=function(){hd.mark(this._marks.end);var p=hd.getEntriesByName(this._marks.measure);return p.length===0&&(hd.measure(this._marks.measure,this._marks.start,this._marks.end),p=hd.getEntriesByName(this._marks.measure),hd.clearMarks(this._marks.start),hd.clearMarks(this._marks.end),hd.clearMeasures(this._marks.measure)),p},t.Actor=am,t.AlphaImage=Vc,t.CanonicalTileID=t0,t.CollisionBoxArray=Hs,t.Color=cs,t.DEMData=Ip,t.DataConstantProperty=qr,t.DictionaryCoder=Ty,t.EXTENT=Li,t.ErrorEvent=Tr,t.EvaluationParameters=ps,t.Event=br,t.Evented=mr,t.FeatureIndex=Pp,t.FillBucket=vh,t.FillExtrusionBucket=uh,t.ImageAtlas=eu,t.ImagePosition=vl,t.LineBucket=_f,t.LngLat=$u,t.LngLatBounds=Wc,t.MercatorCoordinate=Qd,t.ONE_EM=lr,t.OverscaledTileID=Gc,t.Point=o,t.Point$1=o,t.Properties=Ka,t.Protobuf=en,t.RGBAImage=xf,t.RequestManager=vt,t.RequestPerformance=I4,t.ResourceType=da,t.SegmentVector=$o,t.SourceFeatureState=im,t.StructArrayLayout1ui2=Qs,t.StructArrayLayout2f1f2i16=Na,t.StructArrayLayout2i4=qa,t.StructArrayLayout3ui6=gi,t.StructArrayLayout4i8=Rn,t.SymbolBucket=ru,t.Texture=Jd,t.Tile=pf,t.Transitionable=ie,t.Uniform1f=Ge,t.Uniform1i=He,t.Uniform2f=Ae,t.Uniform3f=Oe,t.Uniform4f=Le,t.UniformColor=ur,t.UniformMatrix4f=jr,t.UnwrappedTileID=z4,t.ValidationError=li,t.WritingMode=Xu,t.ZoomHistory=an,t.add=wh,t.addDynamicAttributes=D_,t.asyncAll=y,t.bezier=m,t.bindAll=L,t.browser=Tt,t.cacheEntryPossiblyAdded=pn,t.clamp=l,t.clearTileCache=bn,t.clipLine=h4,t.clone=Kp,t.clone$1=I,t.clone$2=Mp,t.collisionCircleLayout=Bt,t.config=wt,t.create=Zp,t.create$1=Jc,t.create$2=Wh,t.createCommonjsModule=e,t.createExpression=fo,t.createLayout=kn,t.createStyleLayer=MI,t.cross=l_,t.deepEqual=f,t.dot=s_,t.dot$1=p_,t.ease=w,t.emitValidationErrors=tu,t.endsWith=D,t.enforceCacheSizeLimit=dn,t.evaluateSizeForFeature=bg,t.evaluateSizeForZoom=my,t.evaluateVariableOffset=m4,t.evented=Ns,t.extend=M,t.featureFilter=Gt,t.filterObject=R,t.fromRotation=lp,t.getAnchorAlignment=_g,t.getAnchorJustification=O_,t.getArrayBuffer=Yr,t.getImage=Ga,t.getJSON=tn,t.getRTLTextPluginStatus=fi,t.getReferrer=Se,t.getVideo=ve,t.identity=bh,t.invert=kp,t.isChar=on,t.isMapboxURL=Ut,t.keysDifference=k,t.makeRequest=zr,t.mapObject=B,t.mercatorXfromLng=M4,t.mercatorYfromLat=S4,t.mercatorZfromAltitude=E4,t.mul=Gh,t.multiply=ec,t.mvt=Lp,t.nextPowerOfTwo=_,t.normalize=o_,t.number=Ws,t.offscreenCanvasSupported=gn,t.ortho=Ul,t.parseGlyphPBF=jf,t.pbf=en,t.performSymbolLayout=oI,t.perspective=C0,t.pick=T,t.plugin=Ts,t.polygonIntersectsPolygon=Xs,t.postMapLoadEvent=_t,t.postTurnstileEvent=Dt,t.potpack=ch,t.refProperties=DI,t.register=Ve,t.registerForPluginStateChange=Ao,t.renderColorRamp=Jp,t.rotate=Tp,t.rotateX=Ap,t.rotateZ=Yp,t.scale=Ol,t.scale$1=h_,t.scale$2=Xp,t.setCacheLimits=Zn,t.setRTLTextPlugin=Bo,t.sphericalToCartesian=ct,t.sqrLen=Fv,t.styleSpec=Da,t.sub=c_,t.symbolSize=I_,t.transformMat3=u_,t.transformMat4=P0,t.translate=Qc,t.triggerPluginCompletionEvent=es,t.uniqueId=h,t.validateCustomStyleLayer=TI,t.validateLight=ko,t.validateStyle=To,t.values=S,t.vectorTile=Lp,t.version=r,t.warnOnce=j,t.webpSupported=It,t.window=s,t.wrap=x}),A(["./shared"],function(t){function e(Se){var Re=typeof Se;if(Re==="number"||Re==="boolean"||Re==="string"||Se===void 0||Se===null)return JSON.stringify(Se);if(Array.isArray(Se)){for(var Ze="[",tr=0,zr=Se;tr<zr.length;tr+=1){var tn=zr[tr];Ze+=e(tn)+","}return Ze+"]"}for(var Yr=Object.keys(Se).sort(),$r="{",In=0;In<Yr.length;In++)$r+=JSON.stringify(Yr[In])+":"+e(Se[Yr[In]])+",";return $r+"}"}function r(Se){for(var Re="",Ze=0,tr=t.refProperties;Ze<tr.length;Ze+=1){var zr=tr[Ze];Re+="/"+e(Se[zr])}return Re}function i(Se,Re){for(var Ze={},tr=0;tr<Se.length;tr++){var zr=Re&&Re[Se[tr].id]||r(Se[tr]);Re&&(Re[Se[tr].id]=zr);var tn=Ze[zr];tn||(tn=Ze[zr]=[]),tn.push(Se[tr])}var Yr=[];for(var $r in Ze)Yr.push(Ze[$r]);return Yr}var n=function(Se){this.keyCache={},Se&&this.replace(Se)};n.prototype.replace=function(Se){this._layerConfigs={},this._layers={},this.update(Se,[])},n.prototype.update=function(Se,Re){for(var Ze=this,tr=0,zr=Se;tr<zr.length;tr+=1){var tn=zr[tr];this._layerConfigs[tn.id]=tn;var Yr=this._layers[tn.id]=t.createStyleLayer(tn);Yr._featureFilter=t.featureFilter(Yr.filter),this.keyCache[tn.id]&&delete this.keyCache[tn.id]}for(var $r=0,In=Re;$r<In.length;$r+=1){var Nn=In[$r];delete this.keyCache[Nn],delete this._layerConfigs[Nn],delete this._layers[Nn]}this.familiesBySource={};for(var Kn=i(t.values(this._layerConfigs),this.keyCache),$n=0,ia=Kn;$n<ia.length;$n+=1){var Cn=ia[$n],Fa=Cn.map(function(Tr){return Ze._layers[Tr.id]}),Ga=Fa[0];if(Ga.visibility!=="none"){var ve=Ga.source||"",ge=this.familiesBySource[ve];ge||(ge=this.familiesBySource[ve]={});var dr=Ga.sourceLayer||"_geojsonTileLayer",br=ge[dr];br||(br=ge[dr]=[]),br.push(Fa)}}};var o=1,a=function(Se){var Re={},Ze=[];for(var tr in Se){var zr=Se[tr],tn=Re[tr]={};for(var Yr in zr){var $r=zr[+Yr];if(!(!$r||$r.bitmap.width===0||$r.bitmap.height===0)){var In={x:0,y:0,w:$r.bitmap.width+2*o,h:$r.bitmap.height+2*o};Ze.push(In),tn[Yr]={rect:In,metrics:$r.metrics}}}}var Nn=t.potpack(Ze),Kn=Nn.w,$n=Nn.h,ia=new t.AlphaImage({width:Kn||1,height:$n||1});for(var Cn in Se){var Fa=Se[Cn];for(var Ga in Fa){var ve=Fa[+Ga];if(!(!ve||ve.bitmap.width===0||ve.bitmap.height===0)){var ge=Re[Cn][Ga].rect;t.AlphaImage.copy(ve.bitmap,ia,{x:0,y:0},{x:ge.x+o,y:ge.y+o},ve.bitmap)}}}this.image=ia,this.positions=Re};t.register("GlyphAtlas",a);var s=function(Se){this.tileID=new t.OverscaledTileID(Se.tileID.overscaledZ,Se.tileID.wrap,Se.tileID.canonical.z,Se.tileID.canonical.x,Se.tileID.canonical.y),this.uid=Se.uid,this.zoom=Se.zoom,this.pixelRatio=Se.pixelRatio,this.tileSize=Se.tileSize,this.source=Se.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Se.showCollisionBoxes,this.collectResourceTiming=!!Se.collectResourceTiming,this.returnDependencies=!!Se.returnDependencies,this.promoteId=Se.promoteId};s.prototype.parse=function(Se,Re,Ze,tr,zr){var tn=this;this.status="parsing",this.data=Se,this.collisionBoxArray=new t.CollisionBoxArray;var Yr=new t.DictionaryCoder(Object.keys(Se.layers).sort()),$r=new t.FeatureIndex(this.tileID,this.promoteId);$r.bucketLayerIDs=[];var In={},Nn={featureIndex:$r,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ze},Kn=Re.familiesBySource[this.source];for(var $n in Kn){var ia=Se.layers[$n];if(ia){ia.version===1&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+$n+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Cn=Yr.encode($n),Fa=[],Ga=0;Ga<ia.length;Ga++){var ve=ia.feature(Ga),ge=$r.getId(ve,$n);Fa.push({feature:ve,id:ge,index:Ga,sourceLayerIndex:Cn})}for(var dr=0,br=Kn[$n];dr<br.length;dr+=1){var Tr=br[dr],mr=Tr[0];if(!(mr.minzoom&&this.zoom<Math.floor(mr.minzoom))&&!(mr.maxzoom&&this.zoom>=mr.maxzoom)&&mr.visibility!=="none"){f(Tr,this.zoom,Ze);var kr=In[mr.id]=mr.createBucket({index:$r.bucketLayerIDs.length,layers:Tr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Cn,sourceID:this.source});kr.populate(Fa,Nn,this.tileID.canonical),$r.bucketLayerIDs.push(Tr.map(function(rn){return rn.id}))}}}}var Ur,Or,pe,Ke,xr=t.mapObject(Nn.glyphDependencies,function(rn){return Object.keys(rn).map(Number)});Object.keys(xr).length?tr.send("getGlyphs",{uid:this.uid,stacks:xr},function(rn,Qr){Ur||(Ur=rn,Or=Qr,wn.call(tn))}):Or={};var Gr=Object.keys(Nn.iconDependencies);Gr.length?tr.send("getImages",{icons:Gr,source:this.source,tileID:this.tileID,type:"icons"},function(rn,Qr){Ur||(Ur=rn,pe=Qr,wn.call(tn))}):pe={};var ln=Object.keys(Nn.patternDependencies);ln.length?tr.send("getImages",{icons:ln,source:this.source,tileID:this.tileID,type:"patterns"},function(rn,Qr){Ur||(Ur=rn,Ke=Qr,wn.call(tn))}):Ke={},wn.call(this);function wn(){if(Ur)return zr(Ur);if(Or&&pe&&Ke){var rn=new a(Or),Qr=new t.ImageAtlas(pe,Ke);for(var vn in In){var Oa=In[vn];Oa instanceof t.SymbolBucket?(f(Oa.layers,this.zoom,Ze),t.performSymbolLayout(Oa,Or,rn.positions,pe,Qr.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Oa.hasPattern&&(Oa instanceof t.LineBucket||Oa instanceof t.FillBucket||Oa instanceof t.FillExtrusionBucket)&&(f(Oa.layers,this.zoom,Ze),Oa.addFeatures(Nn,this.tileID.canonical,Qr.patternPositions))}this.status="done",zr(null,{buckets:t.values(In).filter(function(Qn){return!Qn.isEmpty()}),featureIndex:$r,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:rn.image,imageAtlas:Qr,glyphMap:this.returnDependencies?Or:null,iconMap:this.returnDependencies?pe:null,glyphPositions:this.returnDependencies?rn.positions:null})}}};function f(Se,Re,Ze){for(var tr=new t.EvaluationParameters(Re),zr=0,tn=Se;zr<tn.length;zr+=1){var Yr=tn[zr];Yr.recalculate(tr,Ze)}}function v(Se,Re){var Ze=t.getArrayBuffer(Se.request,function(tr,zr,tn,Yr){tr?Re(tr):zr&&Re(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(zr)),rawData:zr,cacheControl:tn,expires:Yr})});return function(){Ze.cancel(),Re()}}var g=function(Se,Re,Ze,tr){this.actor=Se,this.layerIndex=Re,this.availableImages=Ze,this.loadVectorData=tr||v,this.loading={},this.loaded={}};g.prototype.loadTile=function(Se,Re){var Ze=this,tr=Se.uid;this.loading||(this.loading={});var zr=Se&&Se.request&&Se.request.collectResourceTiming?new t.RequestPerformance(Se.request):!1,tn=this.loading[tr]=new s(Se);tn.abort=this.loadVectorData(Se,function(Yr,$r){if(delete Ze.loading[tr],Yr||!$r)return tn.status="done",Ze.loaded[tr]=tn,Re(Yr);var In=$r.rawData,Nn={};$r.expires&&(Nn.expires=$r.expires),$r.cacheControl&&(Nn.cacheControl=$r.cacheControl);var Kn={};if(zr){var $n=zr.finish();$n&&(Kn.resourceTiming=JSON.parse(JSON.stringify($n)))}tn.vectorTile=$r.vectorTile,tn.parse($r.vectorTile,Ze.layerIndex,Ze.availableImages,Ze.actor,function(ia,Cn){if(ia||!Cn)return Re(ia);Re(null,t.extend({rawTileData:In.slice(0)},Cn,Nn,Kn))}),Ze.loaded=Ze.loaded||{},Ze.loaded[tr]=tn})},g.prototype.reloadTile=function(Se,Re){var Ze=this,tr=this.loaded,zr=Se.uid,tn=this;if(tr&&tr[zr]){var Yr=tr[zr];Yr.showCollisionBoxes=Se.showCollisionBoxes;var $r=function(In,Nn){var Kn=Yr.reloadCallback;Kn&&(delete Yr.reloadCallback,Yr.parse(Yr.vectorTile,tn.layerIndex,Ze.availableImages,tn.actor,Kn)),Re(In,Nn)};Yr.status==="parsing"?Yr.reloadCallback=$r:Yr.status==="done"&&(Yr.vectorTile?Yr.parse(Yr.vectorTile,this.layerIndex,this.availableImages,this.actor,$r):$r())}},g.prototype.abortTile=function(Se,Re){var Ze=this.loading,tr=Se.uid;Ze&&Ze[tr]&&Ze[tr].abort&&(Ze[tr].abort(),delete Ze[tr]),Re()},g.prototype.removeTile=function(Se,Re){var Ze=this.loaded,tr=Se.uid;Ze&&Ze[tr]&&delete Ze[tr],Re()};var m=t.window.ImageBitmap,w=function(){this.loaded={}};w.prototype.loadTile=function(Se,Re){var Ze=Se.uid,tr=Se.encoding,zr=Se.rawImageData,tn=m&&zr instanceof m?this.getImageData(zr):zr,Yr=new t.DEMData(Ze,tn,tr);this.loaded=this.loaded||{},this.loaded[Ze]=Yr,Re(null,Yr)},w.prototype.getImageData=function(Se){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(Se.width,Se.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=Se.width,this.offscreenCanvas.height=Se.height,this.offscreenCanvasContext.drawImage(Se,0,0,Se.width,Se.height);var Re=this.offscreenCanvasContext.getImageData(-1,-1,Se.width+2,Se.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:Re.width,height:Re.height},Re.data)},w.prototype.removeTile=function(Se){var Re=this.loaded,Ze=Se.uid;Re&&Re[Ze]&&delete Re[Ze]};var l=x;function x(Se,Re){var Ze=Se&&Se.type,tr;if(Ze==="FeatureCollection")for(tr=0;tr<Se.features.length;tr++)x(Se.features[tr],Re);else if(Ze==="GeometryCollection")for(tr=0;tr<Se.geometries.length;tr++)x(Se.geometries[tr],Re);else if(Ze==="Feature")x(Se.geometry,Re);else if(Ze==="Polygon")y(Se.coordinates,Re);else if(Ze==="MultiPolygon")for(tr=0;tr<Se.coordinates.length;tr++)y(Se.coordinates[tr],Re);return Se}function y(Se,Re){if(Se.length!==0){S(Se[0],Re);for(var Ze=1;Ze<Se.length;Ze++)S(Se[Ze],!Re)}}function S(Se,Re){for(var Ze=0,tr=0,zr=Se.length,tn=zr-1;tr<zr;tn=tr++)Ze+=(Se[tr][0]-Se[tn][0])*(Se[tn][1]+Se[tr][1]);Ze>=0!=!!Re&&Se.reverse()}var k=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,M=function(Se){this._feature=Se,this.extent=t.EXTENT,this.type=Se.type,this.properties=Se.tags,"id"in Se&&!isNaN(Se.id)&&(this.id=parseInt(Se.id,10))};M.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Se=[],Re=0,Ze=this._feature.geometry;Re<Ze.length;Re+=1){var tr=Ze[Re];Se.push([new t.Point$1(tr[0],tr[1])])}return Se}else{for(var zr=[],tn=0,Yr=this._feature.geometry;tn<Yr.length;tn+=1){for(var $r=Yr[tn],In=[],Nn=0,Kn=$r;Nn<Kn.length;Nn+=1){var $n=Kn[Nn];In.push(new t.Point$1($n[0],$n[1]))}zr.push(In)}return zr}},M.prototype.toGeoJSON=function(Se,Re,Ze){return k.call(this,Se,Re,Ze)};var T=function(Se){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=Se.length,this._features=Se};T.prototype.feature=function(Se){return new M(this._features[Se])};var c=t.vectorTile.VectorTileFeature,h=b;function b(Se,Re){this.options=Re||{},this.features=Se,this.length=Se.length}b.prototype.feature=function(Se){return new _(this.features[Se],this.options.extent)};function _(Se,Re){this.id=typeof Se.id=="number"?Se.id:void 0,this.type=Se.type,this.rawGeometry=Se.type===1?[Se.geometry]:Se.geometry,this.properties=Se.tags,this.extent=Re||4096}_.prototype.loadGeometry=function(){var Se=this.rawGeometry;this.geometry=[];for(var Re=0;Re<Se.length;Re++){for(var Ze=Se[Re],tr=[],zr=0;zr<Ze.length;zr++)tr.push(new t.Point$1(Ze[zr][0],Ze[zr][1]));this.geometry.push(tr)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Se=this.geometry,Re=1/0,Ze=-1/0,tr=1/0,zr=-1/0,tn=0;tn<Se.length;tn++)for(var Yr=Se[tn],$r=0;$r<Yr.length;$r++){var In=Yr[$r];Re=Math.min(Re,In.x),Ze=Math.max(Ze,In.x),tr=Math.min(tr,In.y),zr=Math.max(zr,In.y)}return[Re,tr,Ze,zr]},_.prototype.toGeoJSON=c.prototype.toGeoJSON;var P=R,L=R,D=I,B=h;function R(Se){var Re=new t.pbf;return F(Se,Re),Re.finish()}function I(Se,Re){Re=Re||{};var Ze={};for(var tr in Se)Ze[tr]=new h(Se[tr].features,Re),Ze[tr].name=tr,Ze[tr].version=Re.version,Ze[tr].extent=Re.extent;return R({layers:Ze})}function F(Se,Re){for(var Ze in Se.layers)Re.writeMessage(3,N,Se.layers[Ze])}function N(Se,Re){Re.writeVarintField(15,Se.version||1),Re.writeStringField(1,Se.name||""),Re.writeVarintField(5,Se.extent||4096);var Ze,tr={keys:[],values:[],keycache:{},valuecache:{}};for(Ze=0;Ze<Se.length;Ze++)tr.feature=Se.feature(Ze),Re.writeMessage(2,j,tr);var zr=tr.keys;for(Ze=0;Ze<zr.length;Ze++)Re.writeStringField(3,zr[Ze]);var tn=tr.values;for(Ze=0;Ze<tn.length;Ze++)Re.writeMessage(4,et,tn[Ze])}function j(Se,Re){var Ze=Se.feature;Ze.id!==void 0&&Re.writeVarintField(1,Ze.id),Re.writeMessage(2,G,Se),Re.writeVarintField(3,Ze.type),Re.writeMessage(4,st,Ze)}function G(Se,Re){var Ze=Se.feature,tr=Se.keys,zr=Se.values,tn=Se.keycache,Yr=Se.valuecache;for(var $r in Ze.properties){var In=tn[$r];typeof In>"u"&&(tr.push($r),In=tr.length-1,tn[$r]=In),Re.writeVarint(In);var Nn=Ze.properties[$r],Kn=typeof Nn;Kn!=="string"&&Kn!=="boolean"&&Kn!=="number"&&(Nn=JSON.stringify(Nn));var $n=Kn+":"+Nn,ia=Yr[$n];typeof ia>"u"&&(zr.push(Nn),ia=zr.length-1,Yr[$n]=ia),Re.writeVarint(ia)}}function rt(Se,Re){return(Re<<3)+(Se&7)}function ct(Se){return Se<<1^Se>>31}function st(Se,Re){for(var Ze=Se.loadGeometry(),tr=Se.type,zr=0,tn=0,Yr=Ze.length,$r=0;$r<Yr;$r++){var In=Ze[$r],Nn=1;tr===1&&(Nn=In.length),Re.writeVarint(rt(1,Nn));for(var Kn=tr===3?In.length-1:In.length,$n=0;$n<Kn;$n++){$n===1&&tr!==1&&Re.writeVarint(rt(2,Kn-1));var ia=In[$n].x-zr,Cn=In[$n].y-tn;Re.writeVarint(ct(ia)),Re.writeVarint(ct(Cn)),zr+=ia,tn+=Cn}tr===3&&Re.writeVarint(rt(7,1))}}function et(Se,Re){var Ze=typeof Se;Ze==="string"?Re.writeStringField(1,Se):Ze==="boolean"?Re.writeBooleanField(7,Se):Ze==="number"&&(Se%1!==0?Re.writeDoubleField(3,Se):Se<0?Re.writeSVarintField(6,Se):Re.writeVarintField(5,Se))}P.fromVectorTileJs=L,P.fromGeojsonVt=D,P.GeoJSONWrapper=B;function K(Se,Re,Ze,tr,zr,tn){if(!(zr-tr<=Ze)){var Yr=tr+zr>>1;ot(Se,Re,Yr,tr,zr,tn%2),K(Se,Re,Ze,tr,Yr-1,tn+1),K(Se,Re,Ze,Yr+1,zr,tn+1)}}function ot(Se,Re,Ze,tr,zr,tn){for(;zr>tr;){if(zr-tr>600){var Yr=zr-tr+1,$r=Ze-tr+1,In=Math.log(Yr),Nn=.5*Math.exp(2*In/3),Kn=.5*Math.sqrt(In*Nn*(Yr-Nn)/Yr)*($r-Yr/2<0?-1:1),$n=Math.max(tr,Math.floor(Ze-$r*Nn/Yr+Kn)),ia=Math.min(zr,Math.floor(Ze+(Yr-$r)*Nn/Yr+Kn));ot(Se,Re,Ze,$n,ia,tn)}var Cn=Re[2*Ze+tn],Fa=tr,Ga=zr;for(X(Se,Re,tr,Ze),Re[2*zr+tn]>Cn&&X(Se,Re,tr,zr);Fa<Ga;){for(X(Se,Re,Fa,Ga),Fa++,Ga--;Re[2*Fa+tn]<Cn;)Fa++;for(;Re[2*Ga+tn]>Cn;)Ga--}Re[2*tr+tn]===Cn?X(Se,Re,tr,Ga):(Ga++,X(Se,Re,Ga,zr)),Ga<=Ze&&(tr=Ga+1),Ze<=Ga&&(zr=Ga-1)}}function X(Se,Re,Ze,tr){Q(Se,Ze,tr),Q(Re,2*Ze,2*tr),Q(Re,2*Ze+1,2*tr+1)}function Q(Se,Re,Ze){var tr=Se[Re];Se[Re]=Se[Ze],Se[Ze]=tr}function ut(Se,Re,Ze,tr,zr,tn,Yr){for(var $r=[0,Se.length-1,0],In=[],Nn,Kn;$r.length;){var $n=$r.pop(),ia=$r.pop(),Cn=$r.pop();if(ia-Cn<=Yr){for(var Fa=Cn;Fa<=ia;Fa++)Nn=Re[2*Fa],Kn=Re[2*Fa+1],Nn>=Ze&&Nn<=zr&&Kn>=tr&&Kn<=tn&&In.push(Se[Fa]);continue}var Ga=Math.floor((Cn+ia)/2);Nn=Re[2*Ga],Kn=Re[2*Ga+1],Nn>=Ze&&Nn<=zr&&Kn>=tr&&Kn<=tn&&In.push(Se[Ga]);var ve=($n+1)%2;($n===0?Ze<=Nn:tr<=Kn)&&($r.push(Cn),$r.push(Ga-1),$r.push(ve)),($n===0?zr>=Nn:tn>=Kn)&&($r.push(Ga+1),$r.push(ia),$r.push(ve))}return In}function J(Se,Re,Ze,tr,zr,tn){for(var Yr=[0,Se.length-1,0],$r=[],In=zr*zr;Yr.length;){var Nn=Yr.pop(),Kn=Yr.pop(),$n=Yr.pop();if(Kn-$n<=tn){for(var ia=$n;ia<=Kn;ia++)q(Re[2*ia],Re[2*ia+1],Ze,tr)<=In&&$r.push(Se[ia]);continue}var Cn=Math.floor(($n+Kn)/2),Fa=Re[2*Cn],Ga=Re[2*Cn+1];q(Fa,Ga,Ze,tr)<=In&&$r.push(Se[Cn]);var ve=(Nn+1)%2;(Nn===0?Ze-zr<=Fa:tr-zr<=Ga)&&(Yr.push($n),Yr.push(Cn-1),Yr.push(ve)),(Nn===0?Ze+zr>=Fa:tr+zr>=Ga)&&(Yr.push(Cn+1),Yr.push(Kn),Yr.push(ve))}return $r}function q(Se,Re,Ze,tr){var zr=Se-Ze,tn=Re-tr;return zr*zr+tn*tn}var it=function(Se){return Se[0]},nt=function(Se){return Se[1]},dt=function(Se,Re,Ze,tr,zr){Re===void 0&&(Re=it),Ze===void 0&&(Ze=nt),tr===void 0&&(tr=64),zr===void 0&&(zr=Float64Array),this.nodeSize=tr,this.points=Se;for(var tn=Se.length<65536?Uint16Array:Uint32Array,Yr=this.ids=new tn(Se.length),$r=this.coords=new zr(Se.length*2),In=0;In<Se.length;In++)Yr[In]=In,$r[2*In]=Re(Se[In]),$r[2*In+1]=Ze(Se[In]);K(Yr,$r,tr,0,Yr.length-1,0)};dt.prototype.range=function(Se,Re,Ze,tr){return ut(this.ids,this.coords,Se,Re,Ze,tr,this.nodeSize)},dt.prototype.within=function(Se,Re,Ze){return J(this.ids,this.coords,Se,Re,Ze,this.nodeSize)};var Tt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Se){return Se}},wt=function(Se){this.options=bt(Object.create(Tt),Se),this.trees=new Array(this.options.maxZoom+1)};wt.prototype.load=function(Se){var Re=this.options,Ze=Re.log,tr=Re.minZoom,zr=Re.maxZoom,tn=Re.nodeSize;Ze&&console.time("total time");var Yr="prepare "+Se.length+" points";Ze&&console.time(Yr),this.points=Se;for(var $r=[],In=0;In<Se.length;In++)Se[In].geometry&&$r.push(Ct(Se[In],In));this.trees[zr+1]=new dt($r,vt,Ut,tn,Float32Array),Ze&&console.timeEnd(Yr);for(var Nn=zr;Nn>=tr;Nn--){var Kn=+Date.now();$r=this._cluster($r,Nn),this.trees[Nn]=new dt($r,vt,Ut,tn,Float32Array),Ze&&console.log("z%d: %d clusters in %dms",Nn,$r.length,+Date.now()-Kn)}return Ze&&console.timeEnd("total time"),this},wt.prototype.getClusters=function(Se,Re){var Ze=((Se[0]+180)%360+360)%360-180,tr=Math.max(-90,Math.min(90,Se[1])),zr=Se[2]===180?180:((Se[2]+180)%360+360)%360-180,tn=Math.max(-90,Math.min(90,Se[3]));if(Se[2]-Se[0]>=360)Ze=-180,zr=180;else if(Ze>zr){var Yr=this.getClusters([Ze,tr,180,tn],Re),$r=this.getClusters([-180,tr,zr,tn],Re);return Yr.concat($r)}for(var In=this.trees[this._limitZoom(Re)],Nn=In.range(Jt(Ze),te(tn),Jt(zr),te(tr)),Kn=[],$n=0,ia=Nn;$n<ia.length;$n+=1){var Cn=ia[$n],Fa=In.points[Cn];Kn.push(Fa.numPoints?Nt(Fa):this.points[Fa.index])}return Kn},wt.prototype.getChildren=function(Se){var Re=this._getOriginId(Se),Ze=this._getOriginZoom(Se),tr="No cluster with the specified id.",zr=this.trees[Ze];if(!zr)throw new Error(tr);var tn=zr.points[Re];if(!tn)throw new Error(tr);for(var Yr=this.options.radius/(this.options.extent*Math.pow(2,Ze-1)),$r=zr.within(tn.x,tn.y,Yr),In=[],Nn=0,Kn=$r;Nn<Kn.length;Nn+=1){var $n=Kn[Nn],ia=zr.points[$n];ia.parentId===Se&&In.push(ia.numPoints?Nt(ia):this.points[ia.index])}if(In.length===0)throw new Error(tr);return In},wt.prototype.getLeaves=function(Se,Re,Ze){Re=Re||10,Ze=Ze||0;var tr=[];return this._appendLeaves(tr,Se,Re,Ze,0),tr},wt.prototype.getTile=function(Se,Re,Ze){var tr=this.trees[this._limitZoom(Se)],zr=Math.pow(2,Se),tn=this.options,Yr=tn.extent,$r=tn.radius,In=$r/Yr,Nn=(Ze-In)/zr,Kn=(Ze+1+In)/zr,$n={features:[]};return this._addTileFeatures(tr.range((Re-In)/zr,Nn,(Re+1+In)/zr,Kn),tr.points,Re,Ze,zr,$n),Re===0&&this._addTileFeatures(tr.range(1-In/zr,Nn,1,Kn),tr.points,zr,Ze,zr,$n),Re===zr-1&&this._addTileFeatures(tr.range(0,Nn,In/zr,Kn),tr.points,-1,Ze,zr,$n),$n.features.length?$n:null},wt.prototype.getClusterExpansionZoom=function(Se){for(var Re=this._getOriginZoom(Se)-1;Re<=this.options.maxZoom;){var Ze=this.getChildren(Se);if(Re++,Ze.length!==1)break;Se=Ze[0].properties.cluster_id}return Re},wt.prototype._appendLeaves=function(Se,Re,Ze,tr,zr){for(var tn=this.getChildren(Re),Yr=0,$r=tn;Yr<$r.length;Yr+=1){var In=$r[Yr],Nn=In.properties;if(Nn&&Nn.cluster?zr+Nn.point_count<=tr?zr+=Nn.point_count:zr=this._appendLeaves(Se,Nn.cluster_id,Ze,tr,zr):zr<tr?zr++:Se.push(In),Se.length===Ze)break}return zr},wt.prototype._addTileFeatures=function(Se,Re,Ze,tr,zr,tn){for(var Yr=0,$r=Se;Yr<$r.length;Yr+=1){var In=$r[Yr],Nn=Re[In],Kn=Nn.numPoints,$n={type:1,geometry:[[Math.round(this.options.extent*(Nn.x*zr-Ze)),Math.round(this.options.extent*(Nn.y*zr-tr))]],tags:Kn?ee(Nn):this.points[Nn.index].properties},ia=void 0;Kn?ia=Nn.id:this.options.generateId?ia=Nn.index:this.points[Nn.index].id&&(ia=this.points[Nn.index].id),ia!==void 0&&($n.id=ia),tn.features.push($n)}},wt.prototype._limitZoom=function(Se){return Math.max(this.options.minZoom,Math.min(+Se,this.options.maxZoom+1))},wt.prototype._cluster=function(Se,Re){for(var Ze=[],tr=this.options,zr=tr.radius,tn=tr.extent,Yr=tr.reduce,$r=tr.minPoints,In=zr/(tn*Math.pow(2,Re)),Nn=0;Nn<Se.length;Nn++){var Kn=Se[Nn];if(!(Kn.zoom<=Re)){Kn.zoom=Re;for(var $n=this.trees[Re+1],ia=$n.within(Kn.x,Kn.y,In),Cn=Kn.numPoints||1,Fa=Cn,Ga=0,ve=ia;Ga<ve.length;Ga+=1){var ge=ve[Ga],dr=$n.points[ge];dr.zoom>Re&&(Fa+=dr.numPoints||1)}if(Fa>=$r){for(var br=Kn.x*Cn,Tr=Kn.y*Cn,mr=Yr&&Cn>1?this._map(Kn,!0):null,kr=(Nn<<5)+(Re+1)+this.points.length,Ur=0,Or=ia;Ur<Or.length;Ur+=1){var pe=Or[Ur],Ke=$n.points[pe];if(!(Ke.zoom<=Re)){Ke.zoom=Re;var xr=Ke.numPoints||1;br+=Ke.x*xr,Tr+=Ke.y*xr,Ke.parentId=kr,Yr&&(mr||(mr=this._map(Kn,!0)),Yr(mr,this._map(Ke)))}}Kn.parentId=kr,Ze.push(It(br/Fa,Tr/Fa,kr,Fa,mr))}else if(Ze.push(Kn),Fa>1)for(var Gr=0,ln=ia;Gr<ln.length;Gr+=1){var wn=ln[Gr],rn=$n.points[wn];rn.zoom<=Re||(rn.zoom=Re,Ze.push(rn))}}}return Ze},wt.prototype._getOriginId=function(Se){return Se-this.points.length>>5},wt.prototype._getOriginZoom=function(Se){return(Se-this.points.length)%32},wt.prototype._map=function(Se,Re){if(Se.numPoints)return Re?bt({},Se.properties):Se.properties;var Ze=this.points[Se.index].properties,tr=this.options.map(Ze);return Re&&tr===Ze?bt({},tr):tr};function It(Se,Re,Ze,tr,zr){return{x:Se,y:Re,zoom:1/0,id:Ze,parentId:-1,numPoints:tr,properties:zr}}function Ct(Se,Re){var Ze=Se.geometry.coordinates,tr=Ze[0],zr=Ze[1];return{x:Jt(tr),y:te(zr),zoom:1/0,index:Re,parentId:-1}}function Nt(Se){return{type:"Feature",id:Se.id,properties:ee(Se),geometry:{type:"Point",coordinates:[Kt(Se.x),mt(Se.y)]}}}function ee(Se){var Re=Se.numPoints,Ze=Re>=1e4?Math.round(Re/1e3)+"k":Re>=1e3?Math.round(Re/100)/10+"k":Re;return bt(bt({},Se.properties),{cluster:!0,cluster_id:Se.id,point_count:Re,point_count_abbreviated:Ze})}function Jt(Se){return Se/360+.5}function te(Se){var Re=Math.sin(Se*Math.PI/180),Ze=.5-.25*Math.log((1+Re)/(1-Re))/Math.PI;return Ze<0?0:Ze>1?1:Ze}function Kt(Se){return(Se-.5)*360}function mt(Se){var Re=(180-Se*360)*Math.PI/180;return 360*Math.atan(Math.exp(Re))/Math.PI-90}function bt(Se,Re){for(var Ze in Re)Se[Ze]=Re[Ze];return Se}function vt(Se){return Se.x}function Ut(Se){return Se.y}function re(Se,Re,Ze,tr){for(var zr=tr,tn=Ze-Re>>1,Yr=Ze-Re,$r,In=Se[Re],Nn=Se[Re+1],Kn=Se[Ze],$n=Se[Ze+1],ia=Re+3;ia<Ze;ia+=3){var Cn=Zt(Se[ia],Se[ia+1],In,Nn,Kn,$n);if(Cn>zr)$r=ia,zr=Cn;else if(Cn===zr){var Fa=Math.abs(ia-tn);Fa<Yr&&($r=ia,Yr=Fa)}}zr>tr&&($r-Re>3&&re(Se,Re,$r,tr),Se[$r+2]=zr,Ze-$r>3&&re(Se,$r,Ze,tr))}function Zt(Se,Re,Ze,tr,zr,tn){var Yr=zr-Ze,$r=tn-tr;if(Yr!==0||$r!==0){var In=((Se-Ze)*Yr+(Re-tr)*$r)/(Yr*Yr+$r*$r);In>1?(Ze=zr,tr=tn):In>0&&(Ze+=Yr*In,tr+=$r*In)}return Yr=Se-Ze,$r=Re-tr,Yr*Yr+$r*$r}function ue(Se,Re,Ze,tr){var zr={id:typeof Se>"u"?null:Se,type:Re,geometry:Ze,tags:tr,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Me(zr),zr}function Me(Se){var Re=Se.geometry,Ze=Se.type;if(Ze==="Point"||Ze==="MultiPoint"||Ze==="LineString")Ce(Se,Re);else if(Ze==="Polygon"||Ze==="MultiLineString")for(var tr=0;tr<Re.length;tr++)Ce(Se,Re[tr]);else if(Ze==="MultiPolygon")for(tr=0;tr<Re.length;tr++)for(var zr=0;zr<Re[tr].length;zr++)Ce(Se,Re[tr][zr])}function Ce(Se,Re){for(var Ze=0;Ze<Re.length;Ze+=3)Se.minX=Math.min(Se.minX,Re[Ze]),Se.minY=Math.min(Se.minY,Re[Ze+1]),Se.maxX=Math.max(Se.maxX,Re[Ze]),Se.maxY=Math.max(Se.maxY,Re[Ze+1])}function We(Se,Re){var Ze=[];if(Se.type==="FeatureCollection")for(var tr=0;tr<Se.features.length;tr++)qe(Ze,Se.features[tr],Re,tr);else Se.type==="Feature"?qe(Ze,Se,Re):qe(Ze,{geometry:Se},Re);return Ze}function qe(Se,Re,Ze,tr){if(Re.geometry){var zr=Re.geometry.coordinates,tn=Re.geometry.type,Yr=Math.pow(Ze.tolerance/((1<<Ze.maxZoom)*Ze.extent),2),$r=[],In=Re.id;if(Ze.promoteId?In=Re.properties[Ze.promoteId]:Ze.generateId&&(In=tr||0),tn==="Point")vr(zr,$r);else if(tn==="MultiPoint")for(var Nn=0;Nn<zr.length;Nn++)vr(zr[Nn],$r);else if(tn==="LineString")_r(zr,$r,Yr,!1);else if(tn==="MultiLineString")if(Ze.lineMetrics){for(Nn=0;Nn<zr.length;Nn++)$r=[],_r(zr[Nn],$r,Yr,!1),Se.push(ue(In,"LineString",$r,Re.properties));return}else er(zr,$r,Yr,!1);else if(tn==="Polygon")er(zr,$r,Yr,!0);else if(tn==="MultiPolygon")for(Nn=0;Nn<zr.length;Nn++){var Kn=[];er(zr[Nn],Kn,Yr,!0),$r.push(Kn)}else if(tn==="GeometryCollection"){for(Nn=0;Nn<Re.geometry.geometries.length;Nn++)qe(Se,{id:In,geometry:Re.geometry.geometries[Nn],properties:Re.properties},Ze,tr);return}else throw new Error("Input data is not a valid GeoJSON object.");Se.push(ue(In,tn,$r,Re.properties))}}function vr(Se,Re){Re.push(Mr(Se[0])),Re.push(Ir(Se[1])),Re.push(0)}function _r(Se,Re,Ze,tr){for(var zr,tn,Yr=0,$r=0;$r<Se.length;$r++){var In=Mr(Se[$r][0]),Nn=Ir(Se[$r][1]);Re.push(In),Re.push(Nn),Re.push(0),$r>0&&(tr?Yr+=(zr*Nn-In*tn)/2:Yr+=Math.sqrt(Math.pow(In-zr,2)+Math.pow(Nn-tn,2))),zr=In,tn=Nn}var Kn=Re.length-3;Re[2]=1,re(Re,0,Kn,Ze),Re[Kn+2]=1,Re.size=Math.abs(Yr),Re.start=0,Re.end=Re.size}function er(Se,Re,Ze,tr){for(var zr=0;zr<Se.length;zr++){var tn=[];_r(Se[zr],tn,Ze,tr),Re.push(tn)}}function Mr(Se){return Se/360+.5}function Ir(Se){var Re=Math.sin(Se*Math.PI/180),Ze=.5-.25*Math.log((1+Re)/(1-Re))/Math.PI;return Ze<0?0:Ze>1?1:Ze}function de(Se,Re,Ze,tr,zr,tn,Yr,$r){if(Ze/=Re,tr/=Re,tn>=Ze&&Yr<tr)return Se;if(Yr<Ze||tn>=tr)return null;for(var In=[],Nn=0;Nn<Se.length;Nn++){var Kn=Se[Nn],$n=Kn.geometry,ia=Kn.type,Cn=zr===0?Kn.minX:Kn.minY,Fa=zr===0?Kn.maxX:Kn.maxY;if(Cn>=Ze&&Fa<tr){In.push(Kn);continue}else if(Fa<Ze||Cn>=tr)continue;var Ga=[];if(ia==="Point"||ia==="MultiPoint")Dt($n,Ga,Ze,tr,zr);else if(ia==="LineString")qt($n,Ga,Ze,tr,zr,!1,$r.lineMetrics);else if(ia==="MultiLineString")lt($n,Ga,Ze,tr,zr,!1);else if(ia==="Polygon")lt($n,Ga,Ze,tr,zr,!0);else if(ia==="MultiPolygon")for(var ve=0;ve<$n.length;ve++){var ge=[];lt($n[ve],ge,Ze,tr,zr,!0),ge.length&&Ga.push(ge)}if(Ga.length){if($r.lineMetrics&&ia==="LineString"){for(ve=0;ve<Ga.length;ve++)In.push(ue(Kn.id,ia,Ga[ve],Kn.tags));continue}(ia==="LineString"||ia==="MultiLineString")&&(Ga.length===1?(ia="LineString",Ga=Ga[0]):ia="MultiLineString"),(ia==="Point"||ia==="MultiPoint")&&(ia=Ga.length===3?"Point":"MultiPoint"),In.push(ue(Kn.id,ia,Ga,Kn.tags))}}return In.length?In:null}function Dt(Se,Re,Ze,tr,zr){for(var tn=0;tn<Se.length;tn+=3){var Yr=Se[tn+zr];Yr>=Ze&&Yr<=tr&&(Re.push(Se[tn]),Re.push(Se[tn+1]),Re.push(Se[tn+2]))}}function qt(Se,Re,Ze,tr,zr,tn,Yr){for(var $r=_t(Se),In=zr===0?St:Ht,Nn=Se.start,Kn,$n,ia=0;ia<Se.length-3;ia+=3){var Cn=Se[ia],Fa=Se[ia+1],Ga=Se[ia+2],ve=Se[ia+3],ge=Se[ia+4],dr=zr===0?Cn:Fa,br=zr===0?ve:ge,Tr=!1;Yr&&(Kn=Math.sqrt(Math.pow(Cn-ve,2)+Math.pow(Fa-ge,2))),dr<Ze?br>Ze&&($n=In($r,Cn,Fa,ve,ge,Ze),Yr&&($r.start=Nn+Kn*$n)):dr>tr?br<tr&&($n=In($r,Cn,Fa,ve,ge,tr),Yr&&($r.start=Nn+Kn*$n)):yt($r,Cn,Fa,Ga),br<Ze&&dr>=Ze&&($n=In($r,Cn,Fa,ve,ge,Ze),Tr=!0),br>tr&&dr<=tr&&($n=In($r,Cn,Fa,ve,ge,tr),Tr=!0),!tn&&Tr&&(Yr&&($r.end=Nn+Kn*$n),Re.push($r),$r=_t(Se)),Yr&&(Nn+=Kn)}var mr=Se.length-3;Cn=Se[mr],Fa=Se[mr+1],Ga=Se[mr+2],dr=zr===0?Cn:Fa,dr>=Ze&&dr<=tr&&yt($r,Cn,Fa,Ga),mr=$r.length-3,tn&&mr>=3&&($r[mr]!==$r[0]||$r[mr+1]!==$r[1])&&yt($r,$r[0],$r[1],$r[2]),$r.length&&Re.push($r)}function _t(Se){var Re=[];return Re.size=Se.size,Re.start=Se.start,Re.end=Se.end,Re}function lt(Se,Re,Ze,tr,zr,tn){for(var Yr=0;Yr<Se.length;Yr++)qt(Se[Yr],Re,Ze,tr,zr,tn,!1)}function yt(Se,Re,Ze,tr){Se.push(Re),Se.push(Ze),Se.push(tr)}function St(Se,Re,Ze,tr,zr,tn){var Yr=(tn-Re)/(tr-Re);return Se.push(tn),Se.push(Ze+(zr-Ze)*Yr),Se.push(1),Yr}function Ht(Se,Re,Ze,tr,zr,tn){var Yr=(tn-Ze)/(zr-Ze);return Se.push(Re+(tr-Re)*Yr),Se.push(tn),Se.push(1),Yr}function Yt(Se,Re){var Ze=Re.buffer/Re.extent,tr=Se,zr=de(Se,1,-1-Ze,Ze,0,-1,2,Re),tn=de(Se,1,1-Ze,2+Ze,0,-1,2,Re);return(zr||tn)&&(tr=de(Se,1,-Ze,1+Ze,0,-1,2,Re)||[],zr&&(tr=se(zr,1).concat(tr)),tn&&(tr=tr.concat(se(tn,-1)))),tr}function se(Se,Re){for(var Ze=[],tr=0;tr<Se.length;tr++){var zr=Se[tr],tn=zr.type,Yr;if(tn==="Point"||tn==="MultiPoint"||tn==="LineString")Yr=ke(zr.geometry,Re);else if(tn==="MultiLineString"||tn==="Polygon"){Yr=[];for(var $r=0;$r<zr.geometry.length;$r++)Yr.push(ke(zr.geometry[$r],Re))}else if(tn==="MultiPolygon")for(Yr=[],$r=0;$r<zr.geometry.length;$r++){for(var In=[],Nn=0;Nn<zr.geometry[$r].length;Nn++)In.push(ke(zr.geometry[$r][Nn],Re));Yr.push(In)}Ze.push(ue(zr.id,tn,Yr,zr.tags))}return Ze}function ke(Se,Re){var Ze=[];Ze.size=Se.size,Se.start!==void 0&&(Ze.start=Se.start,Ze.end=Se.end);for(var tr=0;tr<Se.length;tr+=3)Ze.push(Se[tr]+Re,Se[tr+1],Se[tr+2]);return Ze}function Ee(Se,Re){if(Se.transformed)return Se;var Ze=1<<Se.z,tr=Se.x,zr=Se.y,tn,Yr,$r;for(tn=0;tn<Se.features.length;tn++){var In=Se.features[tn],Nn=In.geometry,Kn=In.type;if(In.geometry=[],Kn===1)for(Yr=0;Yr<Nn.length;Yr+=2)In.geometry.push(Ue(Nn[Yr],Nn[Yr+1],Re,Ze,tr,zr));else for(Yr=0;Yr<Nn.length;Yr++){var $n=[];for($r=0;$r<Nn[Yr].length;$r+=2)$n.push(Ue(Nn[Yr][$r],Nn[Yr][$r+1],Re,Ze,tr,zr));In.geometry.push($n)}}return Se.transformed=!0,Se}function Ue(Se,Re,Ze,tr,zr,tn){return[Math.round(Ze*(Se*tr-zr)),Math.round(Ze*(Re*tr-tn))]}function ir(Se,Re,Ze,tr,zr){for(var tn=Re===zr.maxZoom?0:zr.tolerance/((1<<Re)*zr.extent),Yr={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:Ze,y:tr,z:Re,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},$r=0;$r<Se.length;$r++){Yr.numFeatures++,ar(Yr,Se[$r],tn,zr);var In=Se[$r].minX,Nn=Se[$r].minY,Kn=Se[$r].maxX,$n=Se[$r].maxY;In<Yr.minX&&(Yr.minX=In),Nn<Yr.minY&&(Yr.minY=Nn),Kn>Yr.maxX&&(Yr.maxX=Kn),$n>Yr.maxY&&(Yr.maxY=$n)}return Yr}function ar(Se,Re,Ze,tr){var zr=Re.geometry,tn=Re.type,Yr=[];if(tn==="Point"||tn==="MultiPoint")for(var $r=0;$r<zr.length;$r+=3)Yr.push(zr[$r]),Yr.push(zr[$r+1]),Se.numPoints++,Se.numSimplified++;else if(tn==="LineString")Ye(Yr,zr,Se,Ze,!1,!1);else if(tn==="MultiLineString"||tn==="Polygon")for($r=0;$r<zr.length;$r++)Ye(Yr,zr[$r],Se,Ze,tn==="Polygon",$r===0);else if(tn==="MultiPolygon")for(var In=0;In<zr.length;In++){var Nn=zr[In];for($r=0;$r<Nn.length;$r++)Ye(Yr,Nn[$r],Se,Ze,!0,$r===0)}if(Yr.length){var Kn=Re.tags||null;if(tn==="LineString"&&tr.lineMetrics){Kn={};for(var $n in Re.tags)Kn[$n]=Re.tags[$n];Kn.mapbox_clip_start=zr.start/zr.size,Kn.mapbox_clip_end=zr.end/zr.size}var ia={geometry:Yr,type:tn==="Polygon"||tn==="MultiPolygon"?3:tn==="LineString"||tn==="MultiLineString"?2:1,tags:Kn};Re.id!==null&&(ia.id=Re.id),Se.features.push(ia)}}function Ye(Se,Re,Ze,tr,zr,tn){var Yr=tr*tr;if(tr>0&&Re.size<(zr?Yr:tr)){Ze.numPoints+=Re.length/3;return}for(var $r=[],In=0;In<Re.length;In+=3)(tr===0||Re[In+2]>Yr)&&(Ze.numSimplified++,$r.push(Re[In]),$r.push(Re[In+1])),Ze.numPoints++;zr&&Er($r,tn),Se.push($r)}function Er(Se,Re){for(var Ze=0,tr=0,zr=Se.length,tn=zr-2;tr<zr;tn=tr,tr+=2)Ze+=(Se[tr]-Se[tn])*(Se[tr+1]+Se[tn+1]);if(Ze>0===Re)for(tr=0,zr=Se.length;tr<zr/2;tr+=2){var Yr=Se[tr],$r=Se[tr+1];Se[tr]=Se[zr-2-tr],Se[tr+1]=Se[zr-1-tr],Se[zr-2-tr]=Yr,Se[zr-1-tr]=$r}}function pn(Se,Re){return new dn(Se,Re)}function dn(Se,Re){Re=this.options=Zn(Object.create(this.options),Re);var Ze=Re.debug;if(Ze&&console.time("preprocess data"),Re.maxZoom<0||Re.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(Re.promoteId&&Re.generateId)throw new Error("promoteId and generateId cannot be used together.");var tr=We(Se,Re);this.tiles={},this.tileCoords=[],Ze&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Re.indexMaxZoom,Re.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),tr=Yt(tr,Re),tr.length&&this.splitTile(tr,0,0,0),Ze&&(tr.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)))}dn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},dn.prototype.splitTile=function(Se,Re,Ze,tr,zr,tn,Yr){for(var $r=[Se,Re,Ze,tr],In=this.options,Nn=In.debug;$r.length;){tr=$r.pop(),Ze=$r.pop(),Re=$r.pop(),Se=$r.pop();var Kn=1<<Re,$n=bn(Re,Ze,tr),ia=this.tiles[$n];if(!ia&&(Nn>1&&console.time("creation"),ia=this.tiles[$n]=ir(Se,Re,Ze,tr,In),this.tileCoords.push({z:Re,x:Ze,y:tr}),Nn)){Nn>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Re,Ze,tr,ia.numFeatures,ia.numPoints,ia.numSimplified),console.timeEnd("creation"));var Cn="z"+Re;this.stats[Cn]=(this.stats[Cn]||0)+1,this.total++}if(ia.source=Se,zr){if(Re===In.maxZoom||Re===zr)continue;var Fa=1<<zr-Re;if(Ze!==Math.floor(tn/Fa)||tr!==Math.floor(Yr/Fa))continue}else if(Re===In.indexMaxZoom||ia.numPoints<=In.indexMaxPoints)continue;if(ia.source=null,Se.length!==0){Nn>1&&console.time("clipping");var Ga=.5*In.buffer/In.extent,ve=.5-Ga,ge=.5+Ga,dr=1+Ga,br,Tr,mr,kr,Ur,Or;br=Tr=mr=kr=null,Ur=de(Se,Kn,Ze-Ga,Ze+ge,0,ia.minX,ia.maxX,In),Or=de(Se,Kn,Ze+ve,Ze+dr,0,ia.minX,ia.maxX,In),Se=null,Ur&&(br=de(Ur,Kn,tr-Ga,tr+ge,1,ia.minY,ia.maxY,In),Tr=de(Ur,Kn,tr+ve,tr+dr,1,ia.minY,ia.maxY,In),Ur=null),Or&&(mr=de(Or,Kn,tr-Ga,tr+ge,1,ia.minY,ia.maxY,In),kr=de(Or,Kn,tr+ve,tr+dr,1,ia.minY,ia.maxY,In),Or=null),Nn>1&&console.timeEnd("clipping"),$r.push(br||[],Re+1,Ze*2,tr*2),$r.push(Tr||[],Re+1,Ze*2,tr*2+1),$r.push(mr||[],Re+1,Ze*2+1,tr*2),$r.push(kr||[],Re+1,Ze*2+1,tr*2+1)}}},dn.prototype.getTile=function(Se,Re,Ze){var tr=this.options,zr=tr.extent,tn=tr.debug;if(Se<0||Se>24)return null;var Yr=1<<Se;Re=(Re%Yr+Yr)%Yr;var $r=bn(Se,Re,Ze);if(this.tiles[$r])return Ee(this.tiles[$r],zr);tn>1&&console.log("drilling down to z%d-%d-%d",Se,Re,Ze);for(var In=Se,Nn=Re,Kn=Ze,$n;!$n&&In>0;)In--,Nn=Math.floor(Nn/2),Kn=Math.floor(Kn/2),$n=this.tiles[bn(In,Nn,Kn)];return!$n||!$n.source?null:(tn>1&&console.log("found parent tile z%d-%d-%d",In,Nn,Kn),tn>1&&console.time("drilling down"),this.splitTile($n.source,In,Nn,Kn,Se,Re,Ze),tn>1&&console.timeEnd("drilling down"),this.tiles[$r]?Ee(this.tiles[$r],zr):null)};function bn(Se,Re,Ze){return((1<<Se)*Ze+Re)*32+Se}function Zn(Se,Re){for(var Ze in Re)Se[Ze]=Re[Ze];return Se}function En(Se,Re){var Ze=Se.tileID.canonical;if(!this._geoJSONIndex)return Re(null,null);var tr=this._geoJSONIndex.getTile(Ze.z,Ze.x,Ze.y);if(!tr)return Re(null,null);var zr=new T(tr.features),tn=P(zr);(tn.byteOffset!==0||tn.byteLength!==tn.buffer.byteLength)&&(tn=new Uint8Array(tn)),Re(null,{vectorTile:zr,rawData:tn.buffer})}var gn=function(Se){function Re(Ze,tr,zr,tn){Se.call(this,Ze,tr,zr,En),tn&&(this.loadGeoJSON=tn)}return Se&&(Re.__proto__=Se),Re.prototype=Object.create(Se&&Se.prototype),Re.prototype.constructor=Re,Re.prototype.loadData=function(Ze,tr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=tr,this._pendingLoadDataParams=Ze,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},Re.prototype._loadData=function(){var Ze=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var tr=this._pendingCallback,zr=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var tn=zr&&zr.request&&zr.request.collectResourceTiming?new t.RequestPerformance(zr.request):!1;this.loadGeoJSON(zr,function(Yr,$r){if(Yr||!$r)return tr(Yr);if(typeof $r!="object")return tr(new Error("Input data given to '"+zr.source+"' is not a valid GeoJSON object."));l($r,!0);try{if(zr.filter){var In=t.createExpression(zr.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(In.result==="error")throw new Error(In.value.map(function(ia){return ia.key+": "+ia.message}).join(", "));var Nn=$r.features.filter(function(ia){return In.value.evaluate({zoom:0},ia)});$r={type:"FeatureCollection",features:Nn}}Ze._geoJSONIndex=zr.cluster?new wt(da(zr)).load($r.features):pn($r,zr.geojsonVtOptions)}catch(ia){return tr(ia)}Ze.loaded={};var Kn={};if(tn){var $n=tn.finish();$n&&(Kn.resourceTiming={},Kn.resourceTiming[zr.source]=JSON.parse(JSON.stringify($n)))}tr(null,Kn)})}},Re.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},Re.prototype.reloadTile=function(Ze,tr){var zr=this.loaded,tn=Ze.uid;return zr&&zr[tn]?Se.prototype.reloadTile.call(this,Ze,tr):this.loadTile(Ze,tr)},Re.prototype.loadGeoJSON=function(Ze,tr){if(Ze.request)t.getJSON(Ze.request,tr);else if(typeof Ze.data=="string")try{return tr(null,JSON.parse(Ze.data))}catch{return tr(new Error("Input data given to '"+Ze.source+"' is not a valid GeoJSON object."))}else return tr(new Error("Input data given to '"+Ze.source+"' is not a valid GeoJSON object."))},Re.prototype.removeSource=function(Ze,tr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),tr()},Re.prototype.getClusterExpansionZoom=function(Ze,tr){try{tr(null,this._geoJSONIndex.getClusterExpansionZoom(Ze.clusterId))}catch(zr){tr(zr)}},Re.prototype.getClusterChildren=function(Ze,tr){try{tr(null,this._geoJSONIndex.getChildren(Ze.clusterId))}catch(zr){tr(zr)}},Re.prototype.getClusterLeaves=function(Ze,tr){try{tr(null,this._geoJSONIndex.getLeaves(Ze.clusterId,Ze.limit,Ze.offset))}catch(zr){tr(zr)}},Re}(g);function da(Se){var Re=Se.superclusterOptions,Ze=Se.clusterProperties;if(!Ze||!Re)return Re;for(var tr={},zr={},tn={accumulated:null,zoom:0},Yr={properties:null},$r=Object.keys(Ze),In=0,Nn=$r;In<Nn.length;In+=1){var Kn=Nn[In],$n=Ze[Kn],ia=$n[0],Cn=$n[1],Fa=t.createExpression(Cn),Ga=t.createExpression(typeof ia=="string"?[ia,["accumulated"],["get",Kn]]:ia);tr[Kn]=Fa.value,zr[Kn]=Ga.value}return Re.map=function(ve){Yr.properties=ve;for(var ge={},dr=0,br=$r;dr<br.length;dr+=1){var Tr=br[dr];ge[Tr]=tr[Tr].evaluate(tn,Yr)}return ge},Re.reduce=function(ve,ge){Yr.properties=ge;for(var dr=0,br=$r;dr<br.length;dr+=1){var Tr=br[dr];tn.accumulated=ve[Tr],ve[Tr]=zr[Tr].evaluate(tn,Yr)}},Re}var ra=function(Se){var Re=this;this.self=Se,this.actor=new t.Actor(Se,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:g,geojson:gn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(Ze,tr){if(Re.workerSourceTypes[Ze])throw new Error('Worker source with name "'+Ze+'" already registered.');Re.workerSourceTypes[Ze]=tr},this.self.registerRTLTextPlugin=function(Ze){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=Ze.applyArabicShaping,t.plugin.processBidirectionalText=Ze.processBidirectionalText,t.plugin.processStyledBidirectionalText=Ze.processStyledBidirectionalText}};return ra.prototype.setReferrer=function(Se,Re){this.referrer=Re},ra.prototype.setImages=function(Se,Re,Ze){this.availableImages[Se]=Re;for(var tr in this.workerSources[Se]){var zr=this.workerSources[Se][tr];for(var tn in zr)zr[tn].availableImages=Re}Ze()},ra.prototype.setLayers=function(Se,Re,Ze){this.getLayerIndex(Se).replace(Re),Ze()},ra.prototype.updateLayers=function(Se,Re,Ze){this.getLayerIndex(Se).update(Re.layers,Re.removedIds),Ze()},ra.prototype.loadTile=function(Se,Re,Ze){this.getWorkerSource(Se,Re.type,Re.source).loadTile(Re,Ze)},ra.prototype.loadDEMTile=function(Se,Re,Ze){this.getDEMWorkerSource(Se,Re.source).loadTile(Re,Ze)},ra.prototype.reloadTile=function(Se,Re,Ze){this.getWorkerSource(Se,Re.type,Re.source).reloadTile(Re,Ze)},ra.prototype.abortTile=function(Se,Re,Ze){this.getWorkerSource(Se,Re.type,Re.source).abortTile(Re,Ze)},ra.prototype.removeTile=function(Se,Re,Ze){this.getWorkerSource(Se,Re.type,Re.source).removeTile(Re,Ze)},ra.prototype.removeDEMTile=function(Se,Re){this.getDEMWorkerSource(Se,Re.source).removeTile(Re)},ra.prototype.removeSource=function(Se,Re,Ze){if(!(!this.workerSources[Se]||!this.workerSources[Se][Re.type]||!this.workerSources[Se][Re.type][Re.source])){var tr=this.workerSources[Se][Re.type][Re.source];delete this.workerSources[Se][Re.type][Re.source],tr.removeSource!==void 0?tr.removeSource(Re,Ze):Ze()}},ra.prototype.loadWorkerSource=function(Se,Re,Ze){try{this.self.importScripts(Re.url),Ze()}catch(tr){Ze(tr.toString())}},ra.prototype.syncRTLPluginState=function(Se,Re,Ze){try{t.plugin.setState(Re);var tr=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&tr!=null){this.self.importScripts(tr);var zr=t.plugin.isParsed(),tn=zr?void 0:new Error("RTL Text Plugin failed to import scripts from "+tr);Ze(tn,zr)}}catch(Yr){Ze(Yr.toString())}},ra.prototype.getAvailableImages=function(Se){var Re=this.availableImages[Se];return Re||(Re=[]),Re},ra.prototype.getLayerIndex=function(Se){var Re=this.layerIndexes[Se];return Re||(Re=this.layerIndexes[Se]=new n),Re},ra.prototype.getWorkerSource=function(Se,Re,Ze){var tr=this;if(this.workerSources[Se]||(this.workerSources[Se]={}),this.workerSources[Se][Re]||(this.workerSources[Se][Re]={}),!this.workerSources[Se][Re][Ze]){var zr={send:function(tn,Yr,$r){tr.actor.send(tn,Yr,$r,Se)}};this.workerSources[Se][Re][Ze]=new this.workerSourceTypes[Re](zr,this.getLayerIndex(Se),this.getAvailableImages(Se))}return this.workerSources[Se][Re][Ze]},ra.prototype.getDEMWorkerSource=function(Se,Re){return this.demWorkerSources[Se]||(this.demWorkerSources[Se]={}),this.demWorkerSources[Se][Re]||(this.demWorkerSources[Se][Re]=new w),this.demWorkerSources[Se][Re]},ra.prototype.enforceCacheSizeLimit=function(Se,Re){t.enforceCacheSizeLimit(Re)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new ra(self)),ra}),A(["./shared"],function(t){var e=t.createCommonjsModule(function(U){U.exports?U.exports=tt:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=tt,window.mapboxgl.notSupportedReason=Y);function tt(Oe){return!Y(Oe)}function Y(Oe){if(!ft())return"not a browser";if(!zt())return"insufficent Array support";if(!Qt())return"insufficient Function support";if(!ne())return"insufficient Object support";if(!Ft())return"insufficient JSON support";if(!$t())return"insufficient worker support";if(!he())return"insufficient Uint8ClampedArray support";if(!Ne())return"insufficient ArrayBuffer support";if(!Ie())return"insufficient Canvas/getImageData support";if(!He(Oe&&Oe.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function ft(){return typeof window<"u"&&typeof document<"u"}function zt(){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 Qt(){return Function.prototype&&Function.prototype.bind}function ne(){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 Ft(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function $t(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var Oe=new Blob([""],{type:"text/javascript"}),Le=URL.createObjectURL(Oe),ur,Dr;try{Dr=new Worker(Le),ur=!0}catch{ur=!1}return Dr&&Dr.terminate(),URL.revokeObjectURL(Le),ur}function he(){return"Uint8ClampedArray"in window}function Ne(){return ArrayBuffer.isView}function Ie(){var Oe=document.createElement("canvas");Oe.width=Oe.height=1;var Le=Oe.getContext("2d");if(!Le)return!1;var ur=Le.getImageData(0,0,1,1);return ur&&ur.width===Oe.width}var Fe={};function He(Oe){return Fe[Oe]===void 0&&(Fe[Oe]=Ae(Oe)),Fe[Oe]}tt.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Ge(Oe){var Le=document.createElement("canvas"),ur=Object.create(tt.webGLContextAttributes);return ur.failIfMajorPerformanceCaveat=Oe,Le.probablySupportsContext?Le.probablySupportsContext("webgl",ur)||Le.probablySupportsContext("experimental-webgl",ur):Le.supportsContext?Le.supportsContext("webgl",ur)||Le.supportsContext("experimental-webgl",ur):Le.getContext("webgl",ur)||Le.getContext("experimental-webgl",ur)}function Ae(Oe){var Le=Ge(Oe);if(!Le)return!1;var ur=Le.createShader(Le.VERTEX_SHADER);return!ur||Le.isContextLost()?!1:(Le.shaderSource(ur,"void main() {}"),Le.compileShader(ur),Le.getShaderParameter(ur,Le.COMPILE_STATUS)===!0)}}),r={};r.create=function(U,tt,Y){var ft=t.window.document.createElement(U);return tt!==void 0&&(ft.className=tt),Y&&Y.appendChild(ft),ft},r.createNS=function(U,tt){var Y=t.window.document.createElementNS(U,tt);return Y};var i=t.window.document&&t.window.document.documentElement.style;function n(U){if(!i)return U[0];for(var tt=0;tt<U.length;tt++)if(U[tt]in i)return U[tt];return U[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(U,tt){U.style[s]=tt};var f=!1;try{var v=Object.defineProperty({},"passive",{get:function(){f=!0}});t.window.addEventListener("test",v,v),t.window.removeEventListener("test",v,v)}catch{f=!1}r.addEventListener=function(U,tt,Y,ft){ft===void 0&&(ft={}),"passive"in ft&&f?U.addEventListener(tt,Y,ft):U.addEventListener(tt,Y,ft.capture)},r.removeEventListener=function(U,tt,Y,ft){ft===void 0&&(ft={}),"passive"in ft&&f?U.removeEventListener(tt,Y,ft):U.removeEventListener(tt,Y,ft.capture)};var g=function(U){U.preventDefault(),U.stopPropagation(),t.window.removeEventListener("click",g,!0)};r.suppressClick=function(){t.window.addEventListener("click",g,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",g,!0)},0)},r.mousePos=function(U,tt){var Y=U.getBoundingClientRect();return new t.Point(tt.clientX-Y.left-U.clientLeft,tt.clientY-Y.top-U.clientTop)},r.touchPos=function(U,tt){for(var Y=U.getBoundingClientRect(),ft=[],zt=0;zt<tt.length;zt++)ft.push(new t.Point(tt[zt].clientX-Y.left-U.clientLeft,tt[zt].clientY-Y.top-U.clientTop));return ft},r.mouseButton=function(U){return typeof t.window.InstallTrigger<"u"&&U.button===2&&U.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:U.button},r.remove=function(U){U.parentNode&&U.parentNode.removeChild(U)};function m(U,tt,Y){var ft,zt,Qt,ne=t.browser.devicePixelRatio>1?"@2x":"",Ft=t.getJSON(tt.transformRequest(tt.normalizeSpriteURL(U,ne,".json"),t.ResourceType.SpriteJSON),function(Ne,Ie){Ft=null,Qt||(Qt=Ne,ft=Ie,he())}),$t=t.getImage(tt.transformRequest(tt.normalizeSpriteURL(U,ne,".png"),t.ResourceType.SpriteImage),function(Ne,Ie){$t=null,Qt||(Qt=Ne,zt=Ie,he())});function he(){if(Qt)Y(Qt);else if(ft&&zt){var Ne=t.browser.getImageData(zt),Ie={};for(var Fe in ft){var He=ft[Fe],Ge=He.width,Ae=He.height,Oe=He.x,Le=He.y,ur=He.sdf,Dr=He.pixelRatio,jr=He.stretchX,On=He.stretchY,Ln=He.content,xn=new t.RGBAImage({width:Ge,height:Ae});t.RGBAImage.copy(Ne,xn,{x:Oe,y:Le},{x:0,y:0},{width:Ge,height:Ae}),Ie[Fe]={data:xn,pixelRatio:Dr,sdf:ur,stretchX:jr,stretchY:On,content:Ln}}Y(null,Ie)}}return{cancel:function(){Ft&&(Ft.cancel(),Ft=null),$t&&($t.cancel(),$t=null)}}}function w(U){var tt=U.userImage;if(tt&&tt.render){var Y=tt.render();if(Y)return U.data.replace(new Uint8Array(tt.data.buffer)),!0}return!1}var l=1,x=function(U){function tt(){U.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 U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.isLoaded=function(){return this.loaded},tt.prototype.setLoaded=function(Y){if(this.loaded!==Y&&(this.loaded=Y,Y)){for(var ft=0,zt=this.requestors;ft<zt.length;ft+=1){var Qt=zt[ft],ne=Qt.ids,Ft=Qt.callback;this._notify(ne,Ft)}this.requestors=[]}},tt.prototype.getImage=function(Y){return this.images[Y]},tt.prototype.addImage=function(Y,ft){this._validate(Y,ft)&&(this.images[Y]=ft)},tt.prototype._validate=function(Y,ft){var zt=!0;return this._validateStretch(ft.stretchX,ft.data&&ft.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+Y+'" has invalid "stretchX" value'))),zt=!1),this._validateStretch(ft.stretchY,ft.data&&ft.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+Y+'" has invalid "stretchY" value'))),zt=!1),this._validateContent(ft.content,ft)||(this.fire(new t.ErrorEvent(new Error('Image "'+Y+'" has invalid "content" value'))),zt=!1),zt},tt.prototype._validateStretch=function(Y,ft){if(!Y)return!0;for(var zt=0,Qt=0,ne=Y;Qt<ne.length;Qt+=1){var Ft=ne[Qt];if(Ft[0]<zt||Ft[1]<Ft[0]||ft<Ft[1])return!1;zt=Ft[1]}return!0},tt.prototype._validateContent=function(Y,ft){return Y?!(Y.length!==4||Y[0]<0||ft.data.width<Y[0]||Y[1]<0||ft.data.height<Y[1]||Y[2]<0||ft.data.width<Y[2]||Y[3]<0||ft.data.height<Y[3]||Y[2]<Y[0]||Y[3]<Y[1]):!0},tt.prototype.updateImage=function(Y,ft){var zt=this.images[Y];ft.version=zt.version+1,this.images[Y]=ft,this.updatedImages[Y]=!0},tt.prototype.removeImage=function(Y){var ft=this.images[Y];delete this.images[Y],delete this.patterns[Y],ft.userImage&&ft.userImage.onRemove&&ft.userImage.onRemove()},tt.prototype.listImages=function(){return Object.keys(this.images)},tt.prototype.getImages=function(Y,ft){var zt=!0;if(!this.isLoaded())for(var Qt=0,ne=Y;Qt<ne.length;Qt+=1){var Ft=ne[Qt];this.images[Ft]||(zt=!1)}this.isLoaded()||zt?this._notify(Y,ft):this.requestors.push({ids:Y,callback:ft})},tt.prototype._notify=function(Y,ft){for(var zt={},Qt=0,ne=Y;Qt<ne.length;Qt+=1){var Ft=ne[Qt];this.images[Ft]||this.fire(new t.Event("styleimagemissing",{id:Ft}));var $t=this.images[Ft];$t?zt[Ft]={data:$t.data.clone(),pixelRatio:$t.pixelRatio,sdf:$t.sdf,version:$t.version,stretchX:$t.stretchX,stretchY:$t.stretchY,content:$t.content,hasRenderCallback:!!($t.userImage&&$t.userImage.render)}:t.warnOnce('Image "'+Ft+'" 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.')}ft(null,zt)},tt.prototype.getPixelSize=function(){var Y=this.atlasImage,ft=Y.width,zt=Y.height;return{width:ft,height:zt}},tt.prototype.getPattern=function(Y){var ft=this.patterns[Y],zt=this.getImage(Y);if(!zt)return null;if(ft&&ft.position.version===zt.version)return ft.position;if(ft)ft.position.version=zt.version;else{var Qt=zt.data.width+l*2,ne=zt.data.height+l*2,Ft={w:Qt,h:ne,x:0,y:0},$t=new t.ImagePosition(Ft,zt);this.patterns[Y]={bin:Ft,position:$t}}return this._updatePatternAtlas(),this.patterns[Y].position},tt.prototype.bind=function(Y){var ft=Y.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(Y,this.atlasImage,ft.RGBA),this.atlasTexture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE)},tt.prototype._updatePatternAtlas=function(){var Y=[];for(var ft in this.patterns)Y.push(this.patterns[ft].bin);var zt=t.potpack(Y),Qt=zt.w,ne=zt.h,Ft=this.atlasImage;Ft.resize({width:Qt||1,height:ne||1});for(var $t in this.patterns){var he=this.patterns[$t],Ne=he.bin,Ie=Ne.x+l,Fe=Ne.y+l,He=this.images[$t].data,Ge=He.width,Ae=He.height;t.RGBAImage.copy(He,Ft,{x:0,y:0},{x:Ie,y:Fe},{width:Ge,height:Ae}),t.RGBAImage.copy(He,Ft,{x:0,y:Ae-1},{x:Ie,y:Fe-1},{width:Ge,height:1}),t.RGBAImage.copy(He,Ft,{x:0,y:0},{x:Ie,y:Fe+Ae},{width:Ge,height:1}),t.RGBAImage.copy(He,Ft,{x:Ge-1,y:0},{x:Ie-1,y:Fe},{width:1,height:Ae}),t.RGBAImage.copy(He,Ft,{x:0,y:0},{x:Ie+Ge,y:Fe},{width:1,height:Ae})}this.dirty=!0},tt.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},tt.prototype.dispatchRenderCallbacks=function(Y){for(var ft=0,zt=Y;ft<zt.length;ft+=1){var Qt=zt[ft];if(!this.callbackDispatchedThisFrame[Qt]){this.callbackDispatchedThisFrame[Qt]=!0;var ne=this.images[Qt],Ft=w(ne);Ft&&this.updateImage(Qt,ne)}}},tt}(t.Evented);function y(U,tt,Y,ft,zt){var Qt=tt*256,ne=Qt+255,Ft=ft.transformRequest(ft.normalizeGlyphsURL(Y).replace("{fontstack}",U).replace("{range}",Qt+"-"+ne),t.ResourceType.Glyphs);t.getArrayBuffer(Ft,function($t,he){if($t)zt($t);else if(he){for(var Ne={},Ie=0,Fe=t.parseGlyphPBF(he);Ie<Fe.length;Ie+=1){var He=Fe[Ie];Ne[He.id]=He}zt(null,Ne)}})}var S=T,k=T,M=1e20;function T(U,tt,Y,ft,zt,Qt){this.fontSize=U||24,this.buffer=tt===void 0?3:tt,this.cutoff=ft||.25,this.fontFamily=zt||"sans-serif",this.fontWeight=Qt||"normal",this.radius=Y||8;var ne=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=ne,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(ne*ne),this.gridInner=new Float64Array(ne*ne),this.f=new Float64Array(ne),this.d=new Float64Array(ne),this.z=new Float64Array(ne+1),this.v=new Int16Array(ne),this.middle=Math.round(ne/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}T.prototype.draw=function(U){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(U,this.buffer,this.middle);for(var tt=this.ctx.getImageData(0,0,this.size,this.size),Y=new Uint8ClampedArray(this.size*this.size),ft=0;ft<this.size*this.size;ft++){var zt=tt.data[ft*4+3]/255;this.gridOuter[ft]=zt===1?0:zt===0?M:Math.pow(Math.max(0,.5-zt),2),this.gridInner[ft]=zt===1?M:zt===0?0:Math.pow(Math.max(0,zt-.5),2)}for(c(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),c(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),ft=0;ft<this.size*this.size;ft++){var Qt=this.gridOuter[ft]-this.gridInner[ft];Y[ft]=Math.max(0,Math.min(255,Math.round(255-255*(Qt/this.radius+this.cutoff))))}return Y};function c(U,tt,Y,ft,zt,Qt,ne){for(var Ft=0;Ft<tt;Ft++){for(var $t=0;$t<Y;$t++)ft[$t]=U[$t*tt+Ft];for(h(ft,zt,Qt,ne,Y),$t=0;$t<Y;$t++)U[$t*tt+Ft]=zt[$t]}for($t=0;$t<Y;$t++){for(Ft=0;Ft<tt;Ft++)ft[Ft]=U[$t*tt+Ft];for(h(ft,zt,Qt,ne,tt),Ft=0;Ft<tt;Ft++)U[$t*tt+Ft]=Math.sqrt(zt[Ft])}}function h(U,tt,Y,ft,zt){Y[0]=0,ft[0]=-M,ft[1]=+M;for(var Qt=1,ne=0;Qt<zt;Qt++){for(var Ft=(U[Qt]+Qt*Qt-(U[Y[ne]]+Y[ne]*Y[ne]))/(2*Qt-2*Y[ne]);Ft<=ft[ne];)ne--,Ft=(U[Qt]+Qt*Qt-(U[Y[ne]]+Y[ne]*Y[ne]))/(2*Qt-2*Y[ne]);ne++,Y[ne]=Qt,ft[ne]=Ft,ft[ne+1]=+M}for(Qt=0,ne=0;Qt<zt;Qt++){for(;ft[ne+1]<Qt;)ne++;tt[Qt]=(Qt-Y[ne])*(Qt-Y[ne])+U[Y[ne]]}}S.default=k;var b=function(U,tt){this.requestManager=U,this.localIdeographFontFamily=tt,this.entries={}};b.prototype.setURL=function(U){this.url=U},b.prototype.getGlyphs=function(U,tt){var Y=this,ft=[];for(var zt in U)for(var Qt=0,ne=U[zt];Qt<ne.length;Qt+=1){var Ft=ne[Qt];ft.push({stack:zt,id:Ft})}t.asyncAll(ft,function($t,he){var Ne=$t.stack,Ie=$t.id,Fe=Y.entries[Ne];Fe||(Fe=Y.entries[Ne]={glyphs:{},requests:{},ranges:{}});var He=Fe.glyphs[Ie];if(He!==void 0){he(null,{stack:Ne,id:Ie,glyph:He});return}if(He=Y._tinySDF(Fe,Ne,Ie),He){Fe.glyphs[Ie]=He,he(null,{stack:Ne,id:Ie,glyph:He});return}var Ge=Math.floor(Ie/256);if(Ge*256>65535){he(new Error("glyphs > 65535 not supported"));return}if(Fe.ranges[Ge]){he(null,{stack:Ne,id:Ie,glyph:He});return}var Ae=Fe.requests[Ge];Ae||(Ae=Fe.requests[Ge]=[],b.loadGlyphRange(Ne,Ge,Y.url,Y.requestManager,function(Oe,Le){if(Le){for(var ur in Le)Y._doesCharSupportLocalGlyph(+ur)||(Fe.glyphs[+ur]=Le[+ur]);Fe.ranges[Ge]=!0}for(var Dr=0,jr=Ae;Dr<jr.length;Dr+=1){var On=jr[Dr];On(Oe,Le)}delete Fe.requests[Ge]})),Ae.push(function(Oe,Le){Oe?he(Oe):Le&&he(null,{stack:Ne,id:Ie,glyph:Le[Ie]||null})})},function($t,he){if($t)tt($t);else if(he){for(var Ne={},Ie=0,Fe=he;Ie<Fe.length;Ie+=1){var He=Fe[Ie],Ge=He.stack,Ae=He.id,Oe=He.glyph;(Ne[Ge]||(Ne[Ge]={}))[Ae]=Oe&&{id:Oe.id,bitmap:Oe.bitmap.clone(),metrics:Oe.metrics}}tt(null,Ne)}})},b.prototype._doesCharSupportLocalGlyph=function(U){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](U)||t.isChar["Hangul Syllables"](U)||t.isChar.Hiragana(U)||t.isChar.Katakana(U))},b.prototype._tinySDF=function(U,tt,Y){var ft=this.localIdeographFontFamily;if(ft&&this._doesCharSupportLocalGlyph(Y)){var zt=U.tinySDF;if(!zt){var Qt="400";/bold/i.test(tt)?Qt="900":/medium/i.test(tt)?Qt="500":/light/i.test(tt)&&(Qt="200"),zt=U.tinySDF=new b.TinySDF(24,3,8,.25,ft,Qt)}return{id:Y,bitmap:new t.AlphaImage({width:30,height:30},zt.draw(String.fromCharCode(Y))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},b.loadGlyphRange=y,b.TinySDF=S;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(U,tt){return t.sphericalToCartesian(U.expression.evaluate(tt))},_.prototype.interpolate=function(U,tt,Y){return{x:t.number(U.x,tt.x,Y),y:t.number(U.y,tt.y,Y),z:t.number(U.z,tt.z,Y)}};var P=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)}),L="-transition",D=function(U){function tt(Y){U.call(this),this._transitionable=new t.Transitionable(P),this.setLight(Y),this._transitioning=this._transitionable.untransitioned()}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getLight=function(){return this._transitionable.serialize()},tt.prototype.setLight=function(Y,ft){if(ft===void 0&&(ft={}),!this._validate(t.validateLight,Y,ft))for(var zt in Y){var Qt=Y[zt];t.endsWith(zt,L)?this._transitionable.setTransition(zt.slice(0,-L.length),Qt):this._transitionable.setValue(zt,Qt)}},tt.prototype.updateTransitions=function(Y){this._transitioning=this._transitionable.transitioned(Y,this._transitioning)},tt.prototype.hasTransition=function(){return this._transitioning.hasTransition()},tt.prototype.recalculate=function(Y){this.properties=this._transitioning.possiblyEvaluate(Y)},tt.prototype._validate=function(Y,ft,zt){return zt&&zt.validate===!1?!1:t.emitValidationErrors(this,Y.call(t.validateStyle,t.extend({value:ft,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},tt}(t.Evented),B=function(U,tt){this.width=U,this.height=tt,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};B.prototype.getDash=function(U,tt){var Y=U.join(",")+String(tt);return this.dashEntry[Y]||(this.dashEntry[Y]=this.addDash(U,tt)),this.dashEntry[Y]},B.prototype.getDashRanges=function(U,tt,Y){var ft=U.length%2===1,zt=[],Qt=ft?-U[U.length-1]*Y:0,ne=U[0]*Y,Ft=!0;zt.push({left:Qt,right:ne,isDash:Ft,zeroLength:U[0]===0});for(var $t=U[0],he=1;he<U.length;he++){Ft=!Ft;var Ne=U[he];Qt=$t*Y,$t+=Ne,ne=$t*Y,zt.push({left:Qt,right:ne,isDash:Ft,zeroLength:Ne===0})}return zt},B.prototype.addRoundDash=function(U,tt,Y){for(var ft=tt/2,zt=-Y;zt<=Y;zt++)for(var Qt=this.nextRow+Y+zt,ne=this.width*Qt,Ft=0,$t=U[Ft],he=0;he<this.width;he++){he/$t.right>1&&($t=U[++Ft]);var Ne=Math.abs(he-$t.left),Ie=Math.abs(he-$t.right),Fe=Math.min(Ne,Ie),He=void 0,Ge=zt/Y*(ft+1);if($t.isDash){var Ae=ft-Math.abs(Ge);He=Math.sqrt(Fe*Fe+Ae*Ae)}else He=ft-Math.sqrt(Fe*Fe+Ge*Ge);this.data[ne+he]=Math.max(0,Math.min(255,He+128))}},B.prototype.addRegularDash=function(U){for(var tt=U.length-1;tt>=0;--tt){var Y=U[tt],ft=U[tt+1];Y.zeroLength?U.splice(tt,1):ft&&ft.isDash===Y.isDash&&(ft.left=Y.left,U.splice(tt,1))}var zt=U[0],Qt=U[U.length-1];zt.isDash===Qt.isDash&&(zt.left=Qt.left-this.width,Qt.right=zt.right+this.width);for(var ne=this.width*this.nextRow,Ft=0,$t=U[Ft],he=0;he<this.width;he++){he/$t.right>1&&($t=U[++Ft]);var Ne=Math.abs(he-$t.left),Ie=Math.abs(he-$t.right),Fe=Math.min(Ne,Ie),He=$t.isDash?Fe:-Fe;this.data[ne+he]=Math.max(0,Math.min(255,He+128))}},B.prototype.addDash=function(U,tt){var Y=tt?7:0,ft=2*Y+1;if(this.nextRow+ft>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var zt=0,Qt=0;Qt<U.length;Qt++)zt+=U[Qt];if(zt!==0){var ne=this.width/zt,Ft=this.getDashRanges(U,this.width,ne);tt?this.addRoundDash(Ft,ne,Y):this.addRegularDash(Ft)}var $t={y:(this.nextRow+Y+.5)/this.height,height:2*Y/this.height,width:zt};return this.nextRow+=ft,this.dirty=!0,$t},B.prototype.bind=function(U){var tt=U.gl;this.texture?(tt.bindTexture(tt.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,tt.texSubImage2D(tt.TEXTURE_2D,0,0,0,this.width,this.height,tt.ALPHA,tt.UNSIGNED_BYTE,this.data))):(this.texture=tt.createTexture(),tt.bindTexture(tt.TEXTURE_2D,this.texture),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_WRAP_S,tt.REPEAT),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_WRAP_T,tt.REPEAT),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_MIN_FILTER,tt.LINEAR),tt.texParameteri(tt.TEXTURE_2D,tt.TEXTURE_MAG_FILTER,tt.LINEAR),tt.texImage2D(tt.TEXTURE_2D,0,tt.ALPHA,this.width,this.height,0,tt.ALPHA,tt.UNSIGNED_BYTE,this.data))};var R=function U(tt,Y){this.workerPool=tt,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var ft=this.workerPool.acquire(this.id),zt=0;zt<ft.length;zt++){var Qt=ft[zt],ne=new U.Actor(Qt,Y,this.id);ne.name="Worker "+zt,this.actors.push(ne)}};R.prototype.broadcast=function(U,tt,Y){Y=Y||function(){},t.asyncAll(this.actors,function(ft,zt){ft.send(U,tt,zt)},Y)},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(U){U.remove()}),this.actors=[],this.workerPool.release(this.id)},R.Actor=t.Actor;function I(U,tt,Y){var ft=function(zt,Qt){if(zt)return Y(zt);if(Qt){var ne=t.pick(t.extend(Qt,U),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);Qt.vector_layers&&(ne.vectorLayers=Qt.vector_layers,ne.vectorLayerIds=ne.vectorLayers.map(function(Ft){return Ft.id})),ne.tiles=tt.canonicalizeTileset(ne,U.url),Y(null,ne)}};return U.url?t.getJSON(tt.transformRequest(tt.normalizeSourceURL(U.url),t.ResourceType.Source),ft):t.browser.frame(function(){return ft(null,U)})}var F=function(U,tt,Y){this.bounds=t.LngLatBounds.convert(this.validateBounds(U)),this.minzoom=tt||0,this.maxzoom=Y||24};F.prototype.validateBounds=function(U){return!Array.isArray(U)||U.length!==4?[-180,-90,180,90]:[Math.max(-180,U[0]),Math.max(-90,U[1]),Math.min(180,U[2]),Math.min(90,U[3])]},F.prototype.contains=function(U){var tt=Math.pow(2,U.z),Y={minX:Math.floor(t.mercatorXfromLng(this.bounds.getWest())*tt),minY:Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*tt),maxX:Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*tt),maxY:Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*tt)},ft=U.x>=Y.minX&&U.x<Y.maxX&&U.y>=Y.minY&&U.y<Y.maxY;return ft};var N=function(U){function tt(Y,ft,zt,Qt){if(U.call(this),this.id=Y,this.dispatcher=zt,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(ft,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},ft),this._collectResourceTiming=ft.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Qt)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(){var Y=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=I(this._options,this.map._requestManager,function(ft,zt){Y._tileJSONRequest=null,Y._loaded=!0,ft?Y.fire(new t.ErrorEvent(ft)):zt&&(t.extend(Y,zt),zt.bounds&&(Y.tileBounds=new F(zt.bounds,Y.minzoom,Y.maxzoom)),t.postTurnstileEvent(zt.tiles,Y.map._requestManager._customAccessToken),t.postMapLoadEvent(zt.tiles,Y.map._getMapId(),Y.map._requestManager._skuToken,Y.map._requestManager._customAccessToken),Y.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),Y.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},tt.prototype.loaded=function(){return this._loaded},tt.prototype.hasTile=function(Y){return!this.tileBounds||this.tileBounds.contains(Y.canonical)},tt.prototype.onAdd=function(Y){this.map=Y,this.load()},tt.prototype.setSourceProperty=function(Y){this._tileJSONRequest&&this._tileJSONRequest.cancel(),Y();var ft=this.map.style.sourceCaches[this.id];ft.clearTiles(),this.load()},tt.prototype.setTiles=function(Y){var ft=this;return this.setSourceProperty(function(){ft._options.tiles=Y}),this},tt.prototype.setUrl=function(Y){var ft=this;return this.setSourceProperty(function(){ft.url=Y,ft._options.url=Y}),this},tt.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},tt.prototype.serialize=function(){return t.extend({},this._options)},tt.prototype.loadTile=function(Y,ft){var zt=this.map._requestManager.normalizeTileURL(Y.tileID.canonical.url(this.tiles,this.scheme)),Qt={request:this.map._requestManager.transformRequest(zt,t.ResourceType.Tile),uid:Y.uid,tileID:Y.tileID,zoom:Y.tileID.overscaledZ,tileSize:this.tileSize*Y.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Qt.request.collectResourceTiming=this._collectResourceTiming,!Y.actor||Y.state==="expired"?(Y.actor=this.dispatcher.getActor(),Y.request=Y.actor.send("loadTile",Qt,ne.bind(this))):Y.state==="loading"?Y.reloadCallback=ft:Y.request=Y.actor.send("reloadTile",Qt,ne.bind(this));function ne(Ft,$t){if(delete Y.request,Y.aborted)return ft(null);if(Ft&&Ft.status!==404)return ft(Ft);$t&&$t.resourceTiming&&(Y.resourceTiming=$t.resourceTiming),this.map._refreshExpiredTiles&&$t&&Y.setExpiryData($t),Y.loadVectorData($t,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),ft(null),Y.reloadCallback&&(this.loadTile(Y,Y.reloadCallback),Y.reloadCallback=null)}},tt.prototype.abortTile=function(Y){Y.request&&(Y.request.cancel(),delete Y.request),Y.actor&&Y.actor.send("abortTile",{uid:Y.uid,type:this.type,source:this.id},void 0)},tt.prototype.unloadTile=function(Y){Y.unloadVectorData(),Y.actor&&Y.actor.send("removeTile",{uid:Y.uid,type:this.type,source:this.id},void 0)},tt.prototype.hasTransition=function(){return!1},tt}(t.Evented),j=function(U){function tt(Y,ft,zt,Qt){U.call(this),this.id=Y,this.dispatcher=zt,this.setEventedParent(Qt),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"},ft),t.extend(this,t.pick(ft,["url","scheme","tileSize"]))}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(){var Y=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=I(this._options,this.map._requestManager,function(ft,zt){Y._tileJSONRequest=null,Y._loaded=!0,ft?Y.fire(new t.ErrorEvent(ft)):zt&&(t.extend(Y,zt),zt.bounds&&(Y.tileBounds=new F(zt.bounds,Y.minzoom,Y.maxzoom)),t.postTurnstileEvent(zt.tiles),t.postMapLoadEvent(zt.tiles,Y.map._getMapId(),Y.map._requestManager._skuToken),Y.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),Y.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},tt.prototype.loaded=function(){return this._loaded},tt.prototype.onAdd=function(Y){this.map=Y,this.load()},tt.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},tt.prototype.serialize=function(){return t.extend({},this._options)},tt.prototype.hasTile=function(Y){return!this.tileBounds||this.tileBounds.contains(Y.canonical)},tt.prototype.loadTile=function(Y,ft){var zt=this,Qt=this.map._requestManager.normalizeTileURL(Y.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);Y.request=t.getImage(this.map._requestManager.transformRequest(Qt,t.ResourceType.Tile),function(ne,Ft){if(delete Y.request,Y.aborted)Y.state="unloaded",ft(null);else if(ne)Y.state="errored",ft(ne);else if(Ft){zt.map._refreshExpiredTiles&&Y.setExpiryData(Ft),delete Ft.cacheControl,delete Ft.expires;var $t=zt.map.painter.context,he=$t.gl;Y.texture=zt.map.painter.getTileTexture(Ft.width),Y.texture?Y.texture.update(Ft,{useMipmap:!0}):(Y.texture=new t.Texture($t,Ft,he.RGBA,{useMipmap:!0}),Y.texture.bind(he.LINEAR,he.CLAMP_TO_EDGE,he.LINEAR_MIPMAP_NEAREST),$t.extTextureFilterAnisotropic&&he.texParameterf(he.TEXTURE_2D,$t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$t.extTextureFilterAnisotropicMax)),Y.state="loaded",t.cacheEntryPossiblyAdded(zt.dispatcher),ft(null)}})},tt.prototype.abortTile=function(Y,ft){Y.request&&(Y.request.cancel(),delete Y.request),ft()},tt.prototype.unloadTile=function(Y,ft){Y.texture&&this.map.painter.saveTileTexture(Y.texture),ft()},tt.prototype.hasTransition=function(){return!1},tt}(t.Evented),G=function(U){function tt(Y,ft,zt,Qt){U.call(this,Y,ft,zt,Qt),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},ft),this.encoding=ft.encoding||"mapbox"}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},tt.prototype.loadTile=function(Y,ft){var zt=this.map._requestManager.normalizeTileURL(Y.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);Y.request=t.getImage(this.map._requestManager.transformRequest(zt,t.ResourceType.Tile),Qt.bind(this)),Y.neighboringTiles=this._getNeighboringTiles(Y.tileID);function Qt(Ft,$t){if(delete Y.request,Y.aborted)Y.state="unloaded",ft(null);else if(Ft)Y.state="errored",ft(Ft);else if($t){this.map._refreshExpiredTiles&&Y.setExpiryData($t),delete $t.cacheControl,delete $t.expires;var he=t.window.ImageBitmap&&$t instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported(),Ne=he?$t:t.browser.getImageData($t,1),Ie={uid:Y.uid,coord:Y.tileID,source:this.id,rawImageData:Ne,encoding:this.encoding};(!Y.actor||Y.state==="expired")&&(Y.actor=this.dispatcher.getActor(),Y.actor.send("loadDEMTile",Ie,ne.bind(this)))}}function ne(Ft,$t){Ft&&(Y.state="errored",ft(Ft)),$t&&(Y.dem=$t,Y.needsHillshadePrepare=!0,Y.state="loaded",ft(null))}},tt.prototype._getNeighboringTiles=function(Y){var ft=Y.canonical,zt=Math.pow(2,ft.z),Qt=(ft.x-1+zt)%zt,ne=ft.x===0?Y.wrap-1:Y.wrap,Ft=(ft.x+1+zt)%zt,$t=ft.x+1===zt?Y.wrap+1:Y.wrap,he={};return he[new t.OverscaledTileID(Y.overscaledZ,ne,ft.z,Qt,ft.y).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,$t,ft.z,Ft,ft.y).key]={backfilled:!1},ft.y>0&&(he[new t.OverscaledTileID(Y.overscaledZ,ne,ft.z,Qt,ft.y-1).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,Y.wrap,ft.z,ft.x,ft.y-1).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,$t,ft.z,Ft,ft.y-1).key]={backfilled:!1}),ft.y+1<zt&&(he[new t.OverscaledTileID(Y.overscaledZ,ne,ft.z,Qt,ft.y+1).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,Y.wrap,ft.z,ft.x,ft.y+1).key]={backfilled:!1},he[new t.OverscaledTileID(Y.overscaledZ,$t,ft.z,Ft,ft.y+1).key]={backfilled:!1}),he},tt.prototype.unloadTile=function(Y){Y.demTexture&&this.map.painter.saveTileTexture(Y.demTexture),Y.fbo&&(Y.fbo.destroy(),delete Y.fbo),Y.dem&&delete Y.dem,delete Y.neighboringTiles,Y.state="unloaded",Y.actor&&Y.actor.send("removeDEMTile",{uid:Y.uid,source:this.id})},tt}(j),rt=function(U){function tt(Y,ft,zt,Qt){U.call(this),this.id=Y,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=zt.getActor(),this.setEventedParent(Qt),this._data=ft.data,this._options=t.extend({},ft),this._collectResourceTiming=ft.collectResourceTiming,this._resourceTiming=[],ft.maxzoom!==void 0&&(this.maxzoom=ft.maxzoom),ft.type&&(this.type=ft.type),ft.attribution&&(this.attribution=ft.attribution),this.promoteId=ft.promoteId;var ne=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:ft.cluster||!1,geojsonVtOptions:{buffer:(ft.buffer!==void 0?ft.buffer:128)*ne,tolerance:(ft.tolerance!==void 0?ft.tolerance:.375)*ne,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:ft.lineMetrics||!1,generateId:ft.generateId||!1},superclusterOptions:{maxZoom:ft.clusterMaxZoom!==void 0?Math.min(ft.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,ft.clusterMinPoints||2),extent:t.EXTENT,radius:(ft.clusterRadius||50)*ne,log:!1,generateId:ft.generateId||!1},clusterProperties:ft.clusterProperties,filter:ft.filter},ft.workerOptions)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(){var Y=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(ft){if(ft){Y.fire(new t.ErrorEvent(ft));return}var zt={dataType:"source",sourceDataType:"metadata"};Y._collectResourceTiming&&Y._resourceTiming&&Y._resourceTiming.length>0&&(zt.resourceTiming=Y._resourceTiming,Y._resourceTiming=[]),Y.fire(new t.Event("data",zt))})},tt.prototype.onAdd=function(Y){this.map=Y,this.load()},tt.prototype.setData=function(Y){var ft=this;return this._data=Y,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(zt){if(zt){ft.fire(new t.ErrorEvent(zt));return}var Qt={dataType:"source",sourceDataType:"content"};ft._collectResourceTiming&&ft._resourceTiming&&ft._resourceTiming.length>0&&(Qt.resourceTiming=ft._resourceTiming,ft._resourceTiming=[]),ft.fire(new t.Event("data",Qt))}),this},tt.prototype.getClusterExpansionZoom=function(Y,ft){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:Y,source:this.id},ft),this},tt.prototype.getClusterChildren=function(Y,ft){return this.actor.send("geojson.getClusterChildren",{clusterId:Y,source:this.id},ft),this},tt.prototype.getClusterLeaves=function(Y,ft,zt,Qt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:Y,limit:ft,offset:zt},Qt),this},tt.prototype._updateWorkerData=function(Y){var ft=this;this._loaded=!1;var zt=t.extend({},this.workerOptions),Qt=this._data;typeof Qt=="string"?(zt.request=this.map._requestManager.transformRequest(t.browser.resolveURL(Qt),t.ResourceType.Source),zt.request.collectResourceTiming=this._collectResourceTiming):zt.data=JSON.stringify(Qt),this.actor.send(this.type+".loadData",zt,function(ne,Ft){ft._removed||Ft&&Ft.abandoned||(ft._loaded=!0,Ft&&Ft.resourceTiming&&Ft.resourceTiming[ft.id]&&(ft._resourceTiming=Ft.resourceTiming[ft.id].slice(0)),ft.actor.send(ft.type+".coalesce",{source:zt.source},null),Y(ne))})},tt.prototype.loaded=function(){return this._loaded},tt.prototype.loadTile=function(Y,ft){var zt=this,Qt=Y.actor?"reloadTile":"loadTile";Y.actor=this.actor;var ne={type:this.type,uid:Y.uid,tileID:Y.tileID,zoom:Y.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Y.request=this.actor.send(Qt,ne,function(Ft,$t){return delete Y.request,Y.unloadVectorData(),Y.aborted?ft(null):Ft?ft(Ft):(Y.loadVectorData($t,zt.map.painter,Qt==="reloadTile"),ft(null))})},tt.prototype.abortTile=function(Y){Y.request&&(Y.request.cancel(),delete Y.request),Y.aborted=!0},tt.prototype.unloadTile=function(Y){Y.unloadVectorData(),this.actor.send("removeTile",{uid:Y.uid,type:this.type,source:this.id})},tt.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},tt.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},tt.prototype.hasTransition=function(){return!1},tt}(t.Evented),ct=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),st=function(U){function tt(Y,ft,zt,Qt){U.call(this),this.id=Y,this.dispatcher=zt,this.coordinates=ft.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Qt),this.options=ft}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(Y,ft){var zt=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(Qt,ne){zt._loaded=!0,Qt?zt.fire(new t.ErrorEvent(Qt)):ne&&(zt.image=ne,Y&&(zt.coordinates=Y),ft&&ft(),zt._finishLoading())})},tt.prototype.loaded=function(){return this._loaded},tt.prototype.updateImage=function(Y){var ft=this;return!this.image||!Y.url?this:(this.options.url=Y.url,this.load(Y.coordinates,function(){ft.texture=null}),this)},tt.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},tt.prototype.onAdd=function(Y){this.map=Y,this.load()},tt.prototype.setCoordinates=function(Y){var ft=this;this.coordinates=Y;var zt=Y.map(t.MercatorCoordinate.fromLngLat);this.tileID=et(zt),this.minzoom=this.maxzoom=this.tileID.z;var Qt=zt.map(function(ne){return ft.tileID.getTilePoint(ne)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(Qt[0].x,Qt[0].y,0,0),this._boundsArray.emplaceBack(Qt[1].x,Qt[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(Qt[3].x,Qt[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(Qt[2].x,Qt[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},tt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var Y=this.map.painter.context,ft=Y.gl;this.boundsBuffer||(this.boundsBuffer=Y.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(Y,this.image,ft.RGBA),this.texture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE));for(var zt in this.tiles){var Qt=this.tiles[zt];Qt.state!=="loaded"&&(Qt.state="loaded",Qt.texture=this.texture)}}},tt.prototype.loadTile=function(Y,ft){this.tileID&&this.tileID.equals(Y.tileID.canonical)?(this.tiles[String(Y.tileID.wrap)]=Y,Y.buckets={},ft(null)):(Y.state="errored",ft(null))},tt.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},tt.prototype.hasTransition=function(){return!1},tt}(t.Evented);function et(U){for(var tt=1/0,Y=1/0,ft=-1/0,zt=-1/0,Qt=0,ne=U;Qt<ne.length;Qt+=1){var Ft=ne[Qt];tt=Math.min(tt,Ft.x),Y=Math.min(Y,Ft.y),ft=Math.max(ft,Ft.x),zt=Math.max(zt,Ft.y)}var $t=ft-tt,he=zt-Y,Ne=Math.max($t,he),Ie=Math.max(0,Math.floor(-Math.log(Ne)/Math.LN2)),Fe=Math.pow(2,Ie);return new t.CanonicalTileID(Ie,Math.floor((tt+ft)/2*Fe),Math.floor((Y+zt)/2*Fe))}var K=function(U){function tt(Y,ft,zt,Qt){U.call(this,Y,ft,zt,Qt),this.roundZoom=!0,this.type="video",this.options=ft}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.load=function(){var Y=this;this._loaded=!1;var ft=this.options;this.urls=[];for(var zt=0,Qt=ft.urls;zt<Qt.length;zt+=1){var ne=Qt[zt];this.urls.push(this.map._requestManager.transformRequest(ne,t.ResourceType.Source).url)}t.getVideo(this.urls,function(Ft,$t){Y._loaded=!0,Ft?Y.fire(new t.ErrorEvent(Ft)):$t&&(Y.video=$t,Y.video.loop=!0,Y.video.addEventListener("playing",function(){Y.map.triggerRepaint()}),Y.map&&Y.video.play(),Y._finishLoading())})},tt.prototype.pause=function(){this.video&&this.video.pause()},tt.prototype.play=function(){this.video&&this.video.play()},tt.prototype.seek=function(Y){if(this.video){var ft=this.video.seekable;Y<ft.start(0)||Y>ft.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+ft.start(0)+" and "+ft.end(0)+"-second mark."))):this.video.currentTime=Y}},tt.prototype.getVideo=function(){return this.video},tt.prototype.onAdd=function(Y){this.map||(this.map=Y,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},tt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var Y=this.map.painter.context,ft=Y.gl;this.boundsBuffer||(this.boundsBuffer=Y.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE),ft.texSubImage2D(ft.TEXTURE_2D,0,0,0,ft.RGBA,ft.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(Y,this.video,ft.RGBA),this.texture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE));for(var zt in this.tiles){var Qt=this.tiles[zt];Qt.state!=="loaded"&&(Qt.state="loaded",Qt.texture=this.texture)}}},tt.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},tt.prototype.hasTransition=function(){return this.video&&!this.video.paused},tt}(st),ot=function(U){function tt(Y,ft,zt,Qt){U.call(this,Y,ft,zt,Qt),ft.coordinates?(!Array.isArray(ft.coordinates)||ft.coordinates.length!==4||ft.coordinates.some(function(ne){return!Array.isArray(ne)||ne.length!==2||ne.some(function(Ft){return typeof Ft!="number"})}))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'missing required property "coordinates"'))),ft.animate&&typeof ft.animate!="boolean"&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,null,'optional "animate" property must be a boolean value'))),ft.canvas?typeof ft.canvas!="string"&&!(ft.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+Y,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."+Y,null,'missing required property "canvas"'))),this.options=ft,this.animate=ft.animate!==void 0?ft.animate:!0}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.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()},tt.prototype.getCanvas=function(){return this.canvas},tt.prototype.onAdd=function(Y){this.map=Y,this.load(),this.canvas&&this.animate&&this.play()},tt.prototype.onRemove=function(){this.pause()},tt.prototype.prepare=function(){var Y=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,Y=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,Y=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var ft=this.map.painter.context,zt=ft.gl;this.boundsBuffer||(this.boundsBuffer=ft.createVertexBuffer(this._boundsArray,ct.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(Y||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(ft,this.canvas,zt.RGBA,{premultiply:!0});for(var Qt in this.tiles){var ne=this.tiles[Qt];ne.state!=="loaded"&&(ne.state="loaded",ne.texture=this.texture)}}},tt.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},tt.prototype.hasTransition=function(){return this._playing},tt.prototype._hasInvalidDimensions=function(){for(var Y=0,ft=[this.canvas.width,this.canvas.height];Y<ft.length;Y+=1){var zt=ft[Y];if(isNaN(zt)||zt<=0)return!0}return!1},tt}(st),X={vector:N,raster:j,"raster-dem":G,geojson:rt,video:K,image:st,canvas:ot},Q=function(U,tt,Y,ft){var zt=new X[tt.type](U,tt,Y,ft);if(zt.id!==U)throw new Error("Expected Source id to be "+U+" instead of "+zt.id);return t.bindAll(["load","abort","unload","serialize","prepare"],zt),zt},ut=function(U){return X[U]},J=function(U,tt){X[U]=tt};function q(U,tt){var Y=t.identity([]);return t.translate(Y,Y,[1,1,0]),t.scale(Y,Y,[U.width*.5,U.height*.5,1]),t.multiply(Y,Y,U.calculatePosMatrix(tt.toUnwrapped()))}function it(U,tt,Y){if(U)for(var ft=0,zt=U;ft<zt.length;ft+=1){var Qt=zt[ft],ne=tt[Qt];if(ne&&ne.source===Y&&ne.type==="fill-extrusion")return!0}else for(var Ft in tt){var $t=tt[Ft];if($t.source===Y&&$t.type==="fill-extrusion")return!0}return!1}function nt(U,tt,Y,ft,zt,Qt){var ne=it(zt&&zt.layers,tt,U.id),Ft=Qt.maxPitchScaleFactor(),$t=U.tilesIn(ft,Ft,ne);$t.sort(wt);for(var he=[],Ne=0,Ie=$t;Ne<Ie.length;Ne+=1){var Fe=Ie[Ne];he.push({wrappedTileID:Fe.tileID.wrapped().key,queryResults:Fe.tile.queryRenderedFeatures(tt,Y,U._state,Fe.queryGeometry,Fe.cameraQueryGeometry,Fe.scale,zt,Qt,Ft,q(U.transform,Fe.tileID))})}var He=It(he);for(var Ge in He)He[Ge].forEach(function(Ae){var Oe=Ae.feature,Le=U.getFeatureState(Oe.layer["source-layer"],Oe.id);Oe.source=Oe.layer.source,Oe.layer["source-layer"]&&(Oe.sourceLayer=Oe.layer["source-layer"]),Oe.state=Le});return He}function dt(U,tt,Y,ft,zt,Qt,ne){for(var Ft={},$t=Qt.queryRenderedSymbols(ft),he=[],Ne=0,Ie=Object.keys($t).map(Number);Ne<Ie.length;Ne+=1){var Fe=Ie[Ne];he.push(ne[Fe])}he.sort(wt);for(var He=function(){var ur=Ae[Ge],Dr=ur.featureIndex.lookupSymbolFeatures($t[ur.bucketInstanceId],tt,ur.bucketIndex,ur.sourceLayerIndex,zt.filter,zt.layers,zt.availableImages,U);for(var jr in Dr){var On=Ft[jr]=Ft[jr]||[],Ln=Dr[jr];Ln.sort(function(la,qn){var Gn=ur.featureSortOrder;if(Gn){var ma=Gn.indexOf(la.featureIndex),ti=Gn.indexOf(qn.featureIndex);return ti-ma}else return qn.featureIndex-la.featureIndex});for(var xn=0,Wn=Ln;xn<Wn.length;xn+=1){var Dn=Wn[xn];On.push(Dn)}}},Ge=0,Ae=he;Ge<Ae.length;Ge+=1)He();var Oe=function(ur){Ft[ur].forEach(function(Dr){var jr=Dr.feature,On=U[ur],Ln=Y[On.source],xn=Ln.getFeatureState(jr.layer["source-layer"],jr.id);jr.source=jr.layer.source,jr.layer["source-layer"]&&(jr.sourceLayer=jr.layer["source-layer"]),jr.state=xn})};for(var Le in Ft)Oe(Le);return Ft}function Tt(U,tt){for(var Y=U.getRenderableIds().map(function($t){return U.getTileByID($t)}),ft=[],zt={},Qt=0;Qt<Y.length;Qt++){var ne=Y[Qt],Ft=ne.tileID.canonical.key;zt[Ft]||(zt[Ft]=!0,ne.querySourceFeatures(ft,tt))}return ft}function wt(U,tt){var Y=U.tileID,ft=tt.tileID;return Y.overscaledZ-ft.overscaledZ||Y.canonical.y-ft.canonical.y||Y.wrap-ft.wrap||Y.canonical.x-ft.canonical.x}function It(U){for(var tt={},Y={},ft=0,zt=U;ft<zt.length;ft+=1){var Qt=zt[ft],ne=Qt.queryResults,Ft=Qt.wrappedTileID,$t=Y[Ft]=Y[Ft]||{};for(var he in ne)for(var Ne=ne[he],Ie=$t[he]=$t[he]||{},Fe=tt[he]=tt[he]||[],He=0,Ge=Ne;He<Ge.length;He+=1){var Ae=Ge[He];Ie[Ae.featureIndex]||(Ie[Ae.featureIndex]=!0,Fe.push(Ae))}}return tt}var Ct=function(U,tt){this.max=U,this.onRemove=tt,this.reset()};Ct.prototype.reset=function(){for(var U in this.data)for(var tt=0,Y=this.data[U];tt<Y.length;tt+=1){var ft=Y[tt];ft.timeout&&clearTimeout(ft.timeout),this.onRemove(ft.value)}return this.data={},this.order=[],this},Ct.prototype.add=function(U,tt,Y){var ft=this,zt=U.wrapped().key;this.data[zt]===void 0&&(this.data[zt]=[]);var Qt={value:tt,timeout:void 0};if(Y!==void 0&&(Qt.timeout=setTimeout(function(){ft.remove(U,Qt)},Y)),this.data[zt].push(Qt),this.order.push(zt),this.order.length>this.max){var ne=this._getAndRemoveByKey(this.order[0]);ne&&this.onRemove(ne)}return this},Ct.prototype.has=function(U){return U.wrapped().key in this.data},Ct.prototype.getAndRemove=function(U){return this.has(U)?this._getAndRemoveByKey(U.wrapped().key):null},Ct.prototype._getAndRemoveByKey=function(U){var tt=this.data[U].shift();return tt.timeout&&clearTimeout(tt.timeout),this.data[U].length===0&&delete this.data[U],this.order.splice(this.order.indexOf(U),1),tt.value},Ct.prototype.getByKey=function(U){var tt=this.data[U];return tt?tt[0].value:null},Ct.prototype.get=function(U){if(!this.has(U))return null;var tt=this.data[U.wrapped().key][0];return tt.value},Ct.prototype.remove=function(U,tt){if(!this.has(U))return this;var Y=U.wrapped().key,ft=tt===void 0?0:this.data[Y].indexOf(tt),zt=this.data[Y][ft];return this.data[Y].splice(ft,1),zt.timeout&&clearTimeout(zt.timeout),this.data[Y].length===0&&delete this.data[Y],this.onRemove(zt.value),this.order.splice(this.order.indexOf(Y),1),this},Ct.prototype.setMaxSize=function(U){for(this.max=U;this.order.length>this.max;){var tt=this._getAndRemoveByKey(this.order[0]);tt&&this.onRemove(tt)}return this},Ct.prototype.filter=function(U){var tt=[];for(var Y in this.data)for(var ft=0,zt=this.data[Y];ft<zt.length;ft+=1){var Qt=zt[ft];U(Qt.value)||tt.push(Qt)}for(var ne=0,Ft=tt;ne<Ft.length;ne+=1){var $t=Ft[ne];this.remove($t.value.tileID,$t)}};var Nt=function(U,tt,Y){this.context=U;var ft=U.gl;this.buffer=ft.createBuffer(),this.dynamicDraw=!!Y,this.context.unbindVAO(),U.bindElementBuffer.set(this.buffer),ft.bufferData(ft.ELEMENT_ARRAY_BUFFER,tt.arrayBuffer,this.dynamicDraw?ft.DYNAMIC_DRAW:ft.STATIC_DRAW),this.dynamicDraw||delete tt.arrayBuffer};Nt.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Nt.prototype.updateData=function(U){var tt=this.context.gl;this.context.unbindVAO(),this.bind(),tt.bufferSubData(tt.ELEMENT_ARRAY_BUFFER,0,U.arrayBuffer)},Nt.prototype.destroy=function(){var U=this.context.gl;this.buffer&&(U.deleteBuffer(this.buffer),delete this.buffer)};var ee={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Jt=function(U,tt,Y,ft){this.length=tt.length,this.attributes=Y,this.itemSize=tt.bytesPerElement,this.dynamicDraw=ft,this.context=U;var zt=U.gl;this.buffer=zt.createBuffer(),U.bindVertexBuffer.set(this.buffer),zt.bufferData(zt.ARRAY_BUFFER,tt.arrayBuffer,this.dynamicDraw?zt.DYNAMIC_DRAW:zt.STATIC_DRAW),this.dynamicDraw||delete tt.arrayBuffer};Jt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Jt.prototype.updateData=function(U){var tt=this.context.gl;this.bind(),tt.bufferSubData(tt.ARRAY_BUFFER,0,U.arrayBuffer)},Jt.prototype.enableAttributes=function(U,tt){for(var Y=0;Y<this.attributes.length;Y++){var ft=this.attributes[Y],zt=tt.attributes[ft.name];zt!==void 0&&U.enableVertexAttribArray(zt)}},Jt.prototype.setVertexAttribPointers=function(U,tt,Y){for(var ft=0;ft<this.attributes.length;ft++){var zt=this.attributes[ft],Qt=tt.attributes[zt.name];Qt!==void 0&&U.vertexAttribPointer(Qt,zt.components,U[ee[zt.type]],!1,this.itemSize,zt.offset+this.itemSize*(Y||0))}},Jt.prototype.destroy=function(){var U=this.context.gl;this.buffer&&(U.deleteBuffer(this.buffer),delete this.buffer)};var te=function(U){this.gl=U.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};te.prototype.get=function(){return this.current},te.prototype.set=function(U){},te.prototype.getDefault=function(){return this.default},te.prototype.setDefault=function(){this.set(this.default)};var Kt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return t.Color.transparent},tt.prototype.set=function(Y){var ft=this.current;Y.r===ft.r&&Y.g===ft.g&&Y.b===ft.b&&Y.a===ft.a&&!this.dirty||(this.gl.clearColor(Y.r,Y.g,Y.b,Y.a),this.current=Y,this.dirty=!1)},tt}(te),mt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return 1},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.clearDepth(Y),this.current=Y,this.dirty=!1)},tt}(te),bt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return 0},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.clearStencil(Y),this.current=Y,this.dirty=!1)},tt}(te),vt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return[!0,!0,!0,!0]},tt.prototype.set=function(Y){var ft=this.current;Y[0]===ft[0]&&Y[1]===ft[1]&&Y[2]===ft[2]&&Y[3]===ft[3]&&!this.dirty||(this.gl.colorMask(Y[0],Y[1],Y[2],Y[3]),this.current=Y,this.dirty=!1)},tt}(te),Ut=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!0},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.depthMask(Y),this.current=Y,this.dirty=!1)},tt}(te),re=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return 255},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.stencilMask(Y),this.current=Y,this.dirty=!1)},tt}(te),Zt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},tt.prototype.set=function(Y){var ft=this.current;Y.func===ft.func&&Y.ref===ft.ref&&Y.mask===ft.mask&&!this.dirty||(this.gl.stencilFunc(Y.func,Y.ref,Y.mask),this.current=Y,this.dirty=!1)},tt}(te),ue=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){var Y=this.gl;return[Y.KEEP,Y.KEEP,Y.KEEP]},tt.prototype.set=function(Y){var ft=this.current;Y[0]===ft[0]&&Y[1]===ft[1]&&Y[2]===ft[2]&&!this.dirty||(this.gl.stencilOp(Y[0],Y[1],Y[2]),this.current=Y,this.dirty=!1)},tt}(te),Me=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!1},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;Y?ft.enable(ft.STENCIL_TEST):ft.disable(ft.STENCIL_TEST),this.current=Y,this.dirty=!1}},tt}(te),Ce=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return[0,1]},tt.prototype.set=function(Y){var ft=this.current;Y[0]===ft[0]&&Y[1]===ft[1]&&!this.dirty||(this.gl.depthRange(Y[0],Y[1]),this.current=Y,this.dirty=!1)},tt}(te),We=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!1},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;Y?ft.enable(ft.DEPTH_TEST):ft.disable(ft.DEPTH_TEST),this.current=Y,this.dirty=!1}},tt}(te),qe=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return this.gl.LESS},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.depthFunc(Y),this.current=Y,this.dirty=!1)},tt}(te),vr=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!1},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;Y?ft.enable(ft.BLEND):ft.disable(ft.BLEND),this.current=Y,this.dirty=!1}},tt}(te),_r=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){var Y=this.gl;return[Y.ONE,Y.ZERO]},tt.prototype.set=function(Y){var ft=this.current;Y[0]===ft[0]&&Y[1]===ft[1]&&!this.dirty||(this.gl.blendFunc(Y[0],Y[1]),this.current=Y,this.dirty=!1)},tt}(te),er=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return t.Color.transparent},tt.prototype.set=function(Y){var ft=this.current;Y.r===ft.r&&Y.g===ft.g&&Y.b===ft.b&&Y.a===ft.a&&!this.dirty||(this.gl.blendColor(Y.r,Y.g,Y.b,Y.a),this.current=Y,this.dirty=!1)},tt}(te),Mr=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return this.gl.FUNC_ADD},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.blendEquation(Y),this.current=Y,this.dirty=!1)},tt}(te),Ir=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!1},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;Y?ft.enable(ft.CULL_FACE):ft.disable(ft.CULL_FACE),this.current=Y,this.dirty=!1}},tt}(te),de=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return this.gl.BACK},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.cullFace(Y),this.current=Y,this.dirty=!1)},tt}(te),Dt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return this.gl.CCW},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.frontFace(Y),this.current=Y,this.dirty=!1)},tt}(te),qt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.useProgram(Y),this.current=Y,this.dirty=!1)},tt}(te),_t=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return this.gl.TEXTURE0},tt.prototype.set=function(Y){Y===this.current&&!this.dirty||(this.gl.activeTexture(Y),this.current=Y,this.dirty=!1)},tt}(te),lt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){var Y=this.gl;return[0,0,Y.drawingBufferWidth,Y.drawingBufferHeight]},tt.prototype.set=function(Y){var ft=this.current;Y[0]===ft[0]&&Y[1]===ft[1]&&Y[2]===ft[2]&&Y[3]===ft[3]&&!this.dirty||(this.gl.viewport(Y[0],Y[1],Y[2],Y[3]),this.current=Y,this.dirty=!1)},tt}(te),yt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.bindFramebuffer(ft.FRAMEBUFFER,Y),this.current=Y,this.dirty=!1}},tt}(te),St=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.bindRenderbuffer(ft.RENDERBUFFER,Y),this.current=Y,this.dirty=!1}},tt}(te),Ht=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.bindTexture(ft.TEXTURE_2D,Y),this.current=Y,this.dirty=!1}},tt}(te),Yt=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.bindBuffer(ft.ARRAY_BUFFER,Y),this.current=Y,this.dirty=!1}},tt}(te),se=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){var ft=this.gl;ft.bindBuffer(ft.ELEMENT_ARRAY_BUFFER,Y),this.current=Y,this.dirty=!1},tt}(te),ke=function(U){function tt(Y){U.call(this,Y),this.vao=Y.extVertexArrayObject}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt.prototype.set=function(Y){!this.vao||Y===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(Y),this.current=Y,this.dirty=!1)},tt}(te),Ee=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return 4},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.pixelStorei(ft.UNPACK_ALIGNMENT,Y),this.current=Y,this.dirty=!1}},tt}(te),Ue=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!1},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Y),this.current=Y,this.dirty=!1}},tt}(te),ir=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return!1},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){var ft=this.gl;ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,Y),this.current=Y,this.dirty=!1}},tt}(te),ar=function(U){function tt(Y,ft){U.call(this,Y),this.context=Y,this.parent=ft}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getDefault=function(){return null},tt}(te),Ye=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.setDirty=function(){this.dirty=!0},tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var ft=this.gl;ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_2D,Y,0),this.current=Y,this.dirty=!1}},tt}(ar),Er=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.set=function(Y){if(!(Y===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var ft=this.gl;ft.framebufferRenderbuffer(ft.FRAMEBUFFER,ft.DEPTH_ATTACHMENT,ft.RENDERBUFFER,Y),this.current=Y,this.dirty=!1}},tt}(ar),pn=function(U,tt,Y,ft){this.context=U,this.width=tt,this.height=Y;var zt=U.gl,Qt=this.framebuffer=zt.createFramebuffer();this.colorAttachment=new Ye(U,Qt),ft&&(this.depthAttachment=new Er(U,Qt))};pn.prototype.destroy=function(){var U=this.context.gl,tt=this.colorAttachment.get();if(tt&&U.deleteTexture(tt),this.depthAttachment){var Y=this.depthAttachment.get();Y&&U.deleteRenderbuffer(Y)}U.deleteFramebuffer(this.framebuffer)};var dn=519,bn=function(U,tt,Y){this.func=U,this.mask=tt,this.range=Y};bn.ReadOnly=!1,bn.ReadWrite=!0,bn.disabled=new bn(dn,bn.ReadOnly,[0,1]);var Zn=519,En=7680,gn=function(U,tt,Y,ft,zt,Qt){this.test=U,this.ref=tt,this.mask=Y,this.fail=ft,this.depthFail=zt,this.pass=Qt};gn.disabled=new gn({func:Zn,mask:0},0,0,En,En,En);var da=0,ra=1,Se=771,Re=function(U,tt,Y){this.blendFunction=U,this.blendColor=tt,this.mask=Y};Re.Replace=[ra,da],Re.disabled=new Re(Re.Replace,t.Color.transparent,[!1,!1,!1,!1]),Re.unblended=new Re(Re.Replace,t.Color.transparent,[!0,!0,!0,!0]),Re.alphaBlended=new Re([ra,Se],t.Color.transparent,[!0,!0,!0,!0]);var Ze=1029,tr=2305,zr=function(U,tt,Y){this.enable=U,this.mode=tt,this.frontFace=Y};zr.disabled=new zr(!1,Ze,tr),zr.backCCW=new zr(!0,Ze,tr);var tn=function(U){this.gl=U,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Kt(this),this.clearDepth=new mt(this),this.clearStencil=new bt(this),this.colorMask=new vt(this),this.depthMask=new Ut(this),this.stencilMask=new re(this),this.stencilFunc=new Zt(this),this.stencilOp=new ue(this),this.stencilTest=new Me(this),this.depthRange=new Ce(this),this.depthTest=new We(this),this.depthFunc=new qe(this),this.blend=new vr(this),this.blendFunc=new _r(this),this.blendColor=new er(this),this.blendEquation=new Mr(this),this.cullFace=new Ir(this),this.cullFaceSide=new de(this),this.frontFace=new Dt(this),this.program=new qt(this),this.activeTexture=new _t(this),this.viewport=new lt(this),this.bindFramebuffer=new yt(this),this.bindRenderbuffer=new St(this),this.bindTexture=new Ht(this),this.bindVertexBuffer=new Yt(this),this.bindElementBuffer=new se(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ke(this),this.pixelStoreUnpack=new Ee(this),this.pixelStoreUnpackPremultiplyAlpha=new Ue(this),this.pixelStoreUnpackFlipY=new ir(this),this.extTextureFilterAnisotropic=U.getExtension("EXT_texture_filter_anisotropic")||U.getExtension("MOZ_EXT_texture_filter_anisotropic")||U.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=U.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=U.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(U.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=U.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=U.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=U.getParameter(U.MAX_TEXTURE_SIZE)};tn.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()},tn.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},tn.prototype.createIndexBuffer=function(U,tt){return new Nt(this,U,tt)},tn.prototype.createVertexBuffer=function(U,tt,Y){return new Jt(this,U,tt,Y)},tn.prototype.createRenderbuffer=function(U,tt,Y){var ft=this.gl,zt=ft.createRenderbuffer();return this.bindRenderbuffer.set(zt),ft.renderbufferStorage(ft.RENDERBUFFER,U,tt,Y),this.bindRenderbuffer.set(null),zt},tn.prototype.createFramebuffer=function(U,tt,Y){return new pn(this,U,tt,Y)},tn.prototype.clear=function(U){var tt=U.color,Y=U.depth,ft=this.gl,zt=0;tt&&(zt|=ft.COLOR_BUFFER_BIT,this.clearColor.set(tt),this.colorMask.set([!0,!0,!0,!0])),typeof Y<"u"&&(zt|=ft.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(Y),this.depthMask.set(!0)),ft.clear(zt)},tn.prototype.setCullFace=function(U){U.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(U.mode),this.frontFace.set(U.frontFace))},tn.prototype.setDepthMode=function(U){U.func===this.gl.ALWAYS&&!U.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(U.func),this.depthMask.set(U.mask),this.depthRange.set(U.range))},tn.prototype.setStencilMode=function(U){U.test.func===this.gl.ALWAYS&&!U.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(U.mask),this.stencilOp.set([U.fail,U.depthFail,U.pass]),this.stencilFunc.set({func:U.test.func,ref:U.ref,mask:U.test.mask}))},tn.prototype.setColorMode=function(U){t.deepEqual(U.blendFunction,Re.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(U.blendFunction),this.blendColor.set(U.blendColor)),this.colorMask.set(U.mask)},tn.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Yr=function(U){function tt(Y,ft,zt){var Qt=this;U.call(this),this.id=Y,this.dispatcher=zt,this.on("data",function(ne){ne.dataType==="source"&&ne.sourceDataType==="metadata"&&(Qt._sourceLoaded=!0),Qt._sourceLoaded&&!Qt._paused&&ne.dataType==="source"&&ne.sourceDataType==="content"&&(Qt.reload(),Qt.transform&&Qt.update(Qt.transform))}),this.on("error",function(){Qt._sourceErrored=!0}),this._source=Q(Y,ft,zt,this),this._tiles={},this._cache=new Ct(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.onAdd=function(Y){this.map=Y,this._maxTileCacheSize=Y?Y._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(Y)},tt.prototype.onRemove=function(Y){this._source&&this._source.onRemove&&this._source.onRemove(Y)},tt.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var Y in this._tiles){var ft=this._tiles[Y];if(ft.state!=="loaded"&&ft.state!=="errored")return!1}return!0},tt.prototype.getSource=function(){return this._source},tt.prototype.pause=function(){this._paused=!0},tt.prototype.resume=function(){if(this._paused){var Y=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,Y&&this.reload(),this.transform&&this.update(this.transform)}},tt.prototype._loadTile=function(Y,ft){return this._source.loadTile(Y,ft)},tt.prototype._unloadTile=function(Y){if(this._source.unloadTile)return this._source.unloadTile(Y,function(){})},tt.prototype._abortTile=function(Y){if(this._source.abortTile)return this._source.abortTile(Y,function(){})},tt.prototype.serialize=function(){return this._source.serialize()},tt.prototype.prepare=function(Y){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var ft in this._tiles){var zt=this._tiles[ft];zt.upload(Y),zt.prepare(this.map.style.imageManager)}},tt.prototype.getIds=function(){return t.values(this._tiles).map(function(Y){return Y.tileID}).sort($r).map(function(Y){return Y.key})},tt.prototype.getRenderableIds=function(Y){var ft=this,zt=[];for(var Qt in this._tiles)this._isIdRenderable(Qt,Y)&&zt.push(this._tiles[Qt]);return Y?zt.sort(function(ne,Ft){var $t=ne.tileID,he=Ft.tileID,Ne=new t.Point($t.canonical.x,$t.canonical.y)._rotate(ft.transform.angle),Ie=new t.Point(he.canonical.x,he.canonical.y)._rotate(ft.transform.angle);return $t.overscaledZ-he.overscaledZ||Ie.y-Ne.y||Ie.x-Ne.x}).map(function(ne){return ne.tileID.key}):zt.map(function(ne){return ne.tileID}).sort($r).map(function(ne){return ne.key})},tt.prototype.hasRenderableParent=function(Y){var ft=this.findLoadedParent(Y,0);return ft?this._isIdRenderable(ft.tileID.key):!1},tt.prototype._isIdRenderable=function(Y,ft){return this._tiles[Y]&&this._tiles[Y].hasData()&&!this._coveredTiles[Y]&&(ft||!this._tiles[Y].holdingForFade())},tt.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var Y in this._tiles)this._tiles[Y].state!=="errored"&&this._reloadTile(Y,"reloading")},tt.prototype._reloadTile=function(Y,ft){var zt=this._tiles[Y];zt&&(zt.state!=="loading"&&(zt.state=ft),this._loadTile(zt,this._tileLoaded.bind(this,zt,Y,ft)))},tt.prototype._tileLoaded=function(Y,ft,zt,Qt){if(Qt){Y.state="errored",Qt.status!==404?this._source.fire(new t.ErrorEvent(Qt,{tile:Y})):this.update(this.transform);return}Y.timeAdded=t.browser.now(),zt==="expired"&&(Y.refreshedUponExpiration=!0),this._setTileReloadTimer(ft,Y),this.getSource().type==="raster-dem"&&Y.dem&&this._backfillDEM(Y),this._state.initializeTileState(Y,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:Y,coord:Y.tileID}))},tt.prototype._backfillDEM=function(Y){for(var ft=this.getRenderableIds(),zt=0;zt<ft.length;zt++){var Qt=ft[zt];if(Y.neighboringTiles&&Y.neighboringTiles[Qt]){var ne=this.getTileByID(Qt);Ft(Y,ne),Ft(ne,Y)}}function Ft($t,he){$t.needsHillshadePrepare=!0;var Ne=he.tileID.canonical.x-$t.tileID.canonical.x,Ie=he.tileID.canonical.y-$t.tileID.canonical.y,Fe=Math.pow(2,$t.tileID.canonical.z),He=he.tileID.key;Ne===0&&Ie===0||Math.abs(Ie)>1||(Math.abs(Ne)>1&&(Math.abs(Ne+Fe)===1?Ne+=Fe:Math.abs(Ne-Fe)===1&&(Ne-=Fe)),!(!he.dem||!$t.dem)&&($t.dem.backfillBorder(he.dem,Ne,Ie),$t.neighboringTiles&&$t.neighboringTiles[He]&&($t.neighboringTiles[He].backfilled=!0)))}},tt.prototype.getTile=function(Y){return this.getTileByID(Y.key)},tt.prototype.getTileByID=function(Y){return this._tiles[Y]},tt.prototype._retainLoadedChildren=function(Y,ft,zt,Qt){for(var ne in this._tiles){var Ft=this._tiles[ne];if(!(Qt[ne]||!Ft.hasData()||Ft.tileID.overscaledZ<=ft||Ft.tileID.overscaledZ>zt)){for(var $t=Ft.tileID;Ft&&Ft.tileID.overscaledZ>ft+1;){var he=Ft.tileID.scaledTo(Ft.tileID.overscaledZ-1);Ft=this._tiles[he.key],Ft&&Ft.hasData()&&($t=he)}for(var Ne=$t;Ne.overscaledZ>ft;)if(Ne=Ne.scaledTo(Ne.overscaledZ-1),Y[Ne.key]){Qt[$t.key]=$t;break}}}},tt.prototype.findLoadedParent=function(Y,ft){if(Y.key in this._loadedParentTiles){var zt=this._loadedParentTiles[Y.key];return zt&&zt.tileID.overscaledZ>=ft?zt:null}for(var Qt=Y.overscaledZ-1;Qt>=ft;Qt--){var ne=Y.scaledTo(Qt),Ft=this._getLoadedTile(ne);if(Ft)return Ft}},tt.prototype._getLoadedTile=function(Y){var ft=this._tiles[Y.key];if(ft&&ft.hasData())return ft;var zt=this._cache.getByKey(Y.wrapped().key);return zt},tt.prototype.updateCacheSize=function(Y){var ft=Math.ceil(Y.width/this._source.tileSize)+1,zt=Math.ceil(Y.height/this._source.tileSize)+1,Qt=ft*zt,ne=5,Ft=Math.floor(Qt*ne),$t=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ft):Ft;this._cache.setMaxSize($t)},tt.prototype.handleWrapJump=function(Y){var ft=this._prevLng===void 0?Y:this._prevLng,zt=Y-ft,Qt=zt/360,ne=Math.round(Qt);if(this._prevLng=Y,ne){var Ft={};for(var $t in this._tiles){var he=this._tiles[$t];he.tileID=he.tileID.unwrapTo(he.tileID.wrap+ne),Ft[he.tileID.key]=he}this._tiles=Ft;for(var Ne in this._timers)clearTimeout(this._timers[Ne]),delete this._timers[Ne];for(var Ie in this._tiles){var Fe=this._tiles[Ie];this._setTileReloadTimer(Ie,Fe)}}},tt.prototype.update=function(Y){var ft=this;if(this.transform=Y,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(Y),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var zt;this.used?this._source.tileID?zt=Y.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Dn){return new t.OverscaledTileID(Dn.canonical.z,Dn.wrap,Dn.canonical.z,Dn.canonical.x,Dn.canonical.y)}):(zt=Y.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(zt=zt.filter(function(Dn){return ft._source.hasTile(Dn)}))):zt=[];var Qt=Y.coveringZoomLevel(this._source),ne=Math.max(Qt-tt.maxOverzooming,this._source.minzoom),Ft=Math.max(Qt+tt.maxUnderzooming,this._source.minzoom),$t=this._updateRetainedTiles(zt,Qt);if(In(this._source.type)){for(var he={},Ne={},Ie=Object.keys($t),Fe=0,He=Ie;Fe<He.length;Fe+=1){var Ge=He[Fe],Ae=$t[Ge],Oe=this._tiles[Ge];if(!(!Oe||Oe.fadeEndTime&&Oe.fadeEndTime<=t.browser.now())){var Le=this.findLoadedParent(Ae,ne);Le&&(this._addTile(Le.tileID),he[Le.tileID.key]=Le.tileID),Ne[Ge]=Ae}}this._retainLoadedChildren(Ne,Qt,Ft,$t);for(var ur in he)$t[ur]||(this._coveredTiles[ur]=!0,$t[ur]=he[ur])}for(var Dr in $t)this._tiles[Dr].clearFadeHold();for(var jr=t.keysDifference(this._tiles,$t),On=0,Ln=jr;On<Ln.length;On+=1){var xn=Ln[On],Wn=this._tiles[xn];Wn.hasSymbolBuckets&&!Wn.holdingForFade()?Wn.setHoldDuration(this.map._fadeDuration):(!Wn.hasSymbolBuckets||Wn.symbolFadeFinished())&&this._removeTile(xn)}this._updateLoadedParentTileCache()}},tt.prototype.releaseSymbolFadeTiles=function(){for(var Y in this._tiles)this._tiles[Y].holdingForFade()&&this._removeTile(Y)},tt.prototype._updateRetainedTiles=function(Y,ft){for(var zt={},Qt={},ne=Math.max(ft-tt.maxOverzooming,this._source.minzoom),Ft=Math.max(ft+tt.maxUnderzooming,this._source.minzoom),$t={},he=0,Ne=Y;he<Ne.length;he+=1){var Ie=Ne[he],Fe=this._addTile(Ie);zt[Ie.key]=Ie,!Fe.hasData()&&ft<this._source.maxzoom&&($t[Ie.key]=Ie)}this._retainLoadedChildren($t,ft,Ft,zt);for(var He=0,Ge=Y;He<Ge.length;He+=1){var Ae=Ge[He],Oe=this._tiles[Ae.key];if(!Oe.hasData()){if(ft+1>this._source.maxzoom){var Le=Ae.children(this._source.maxzoom)[0],ur=this.getTile(Le);if(ur&&ur.hasData()){zt[Le.key]=Le;continue}}else{var Dr=Ae.children(this._source.maxzoom);if(zt[Dr[0].key]&&zt[Dr[1].key]&&zt[Dr[2].key]&&zt[Dr[3].key])continue}for(var jr=Oe.wasRequested(),On=Ae.overscaledZ-1;On>=ne;--On){var Ln=Ae.scaledTo(On);if(Qt[Ln.key]||(Qt[Ln.key]=!0,Oe=this.getTile(Ln),!Oe&&jr&&(Oe=this._addTile(Ln)),Oe&&(zt[Ln.key]=Ln,jr=Oe.wasRequested(),Oe.hasData())))break}}}return zt},tt.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var Y in this._tiles){for(var ft=[],zt=void 0,Qt=this._tiles[Y].tileID;Qt.overscaledZ>0;){if(Qt.key in this._loadedParentTiles){zt=this._loadedParentTiles[Qt.key];break}ft.push(Qt.key);var ne=Qt.scaledTo(Qt.overscaledZ-1);if(zt=this._getLoadedTile(ne),zt)break;Qt=ne}for(var Ft=0,$t=ft;Ft<$t.length;Ft+=1){var he=$t[Ft];this._loadedParentTiles[he]=zt}}},tt.prototype._addTile=function(Y){var ft=this._tiles[Y.key];if(ft)return ft;ft=this._cache.getAndRemove(Y),ft&&(this._setTileReloadTimer(Y.key,ft),ft.tileID=Y,this._state.initializeTileState(ft,this.map?this.map.painter:null),this._cacheTimers[Y.key]&&(clearTimeout(this._cacheTimers[Y.key]),delete this._cacheTimers[Y.key],this._setTileReloadTimer(Y.key,ft)));var zt=!!ft;return zt||(ft=new t.Tile(Y,this._source.tileSize*Y.overscaleFactor()),this._loadTile(ft,this._tileLoaded.bind(this,ft,Y.key,ft.state))),ft?(ft.uses++,this._tiles[Y.key]=ft,zt||this._source.fire(new t.Event("dataloading",{tile:ft,coord:ft.tileID,dataType:"source"})),ft):null},tt.prototype._setTileReloadTimer=function(Y,ft){var zt=this;Y in this._timers&&(clearTimeout(this._timers[Y]),delete this._timers[Y]);var Qt=ft.getExpiryTimeout();Qt&&(this._timers[Y]=setTimeout(function(){zt._reloadTile(Y,"expired"),delete zt._timers[Y]},Qt))},tt.prototype._removeTile=function(Y){var ft=this._tiles[Y];ft&&(ft.uses--,delete this._tiles[Y],this._timers[Y]&&(clearTimeout(this._timers[Y]),delete this._timers[Y]),!(ft.uses>0)&&(ft.hasData()&&ft.state!=="reloading"?this._cache.add(ft.tileID,ft,ft.getExpiryTimeout()):(ft.aborted=!0,this._abortTile(ft),this._unloadTile(ft))))},tt.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var Y in this._tiles)this._removeTile(Y);this._cache.reset()},tt.prototype.tilesIn=function(Y,ft,zt){var Qt=this,ne=[],Ft=this.transform;if(!Ft)return ne;for(var $t=zt?Ft.getCameraQueryGeometry(Y):Y,he=Y.map(function(On){return Ft.pointCoordinate(On)}),Ne=$t.map(function(On){return Ft.pointCoordinate(On)}),Ie=this.getIds(),Fe=1/0,He=1/0,Ge=-1/0,Ae=-1/0,Oe=0,Le=Ne;Oe<Le.length;Oe+=1){var ur=Le[Oe];Fe=Math.min(Fe,ur.x),He=Math.min(He,ur.y),Ge=Math.max(Ge,ur.x),Ae=Math.max(Ae,ur.y)}for(var Dr=function(On){var Ln=Qt._tiles[Ie[On]];if(!Ln.holdingForFade()){var xn=Ln.tileID,Wn=Math.pow(2,Ft.zoom-Ln.tileID.overscaledZ),Dn=ft*Ln.queryPadding*t.EXTENT/Ln.tileSize/Wn,la=[xn.getTilePoint(new t.MercatorCoordinate(Fe,He)),xn.getTilePoint(new t.MercatorCoordinate(Ge,Ae))];if(la[0].x-Dn<t.EXTENT&&la[0].y-Dn<t.EXTENT&&la[1].x+Dn>=0&&la[1].y+Dn>=0){var qn=he.map(function(ma){return xn.getTilePoint(ma)}),Gn=Ne.map(function(ma){return xn.getTilePoint(ma)});ne.push({tile:Ln,tileID:xn,queryGeometry:qn,cameraQueryGeometry:Gn,scale:Wn})}}},jr=0;jr<Ie.length;jr++)Dr(jr);return ne},tt.prototype.getVisibleCoordinates=function(Y){for(var ft=this,zt=this.getRenderableIds(Y).map(function($t){return ft._tiles[$t].tileID}),Qt=0,ne=zt;Qt<ne.length;Qt+=1){var Ft=ne[Qt];Ft.posMatrix=this.transform.calculatePosMatrix(Ft.toUnwrapped())}return zt},tt.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(In(this._source.type))for(var Y in this._tiles){var ft=this._tiles[Y];if(ft.fadeEndTime!==void 0&&ft.fadeEndTime>=t.browser.now())return!0}return!1},tt.prototype.setFeatureState=function(Y,ft,zt){Y=Y||"_geojsonTileLayer",this._state.updateState(Y,ft,zt)},tt.prototype.removeFeatureState=function(Y,ft,zt){Y=Y||"_geojsonTileLayer",this._state.removeFeatureState(Y,ft,zt)},tt.prototype.getFeatureState=function(Y,ft){return Y=Y||"_geojsonTileLayer",this._state.getState(Y,ft)},tt.prototype.setDependencies=function(Y,ft,zt){var Qt=this._tiles[Y];Qt&&Qt.setDependencies(ft,zt)},tt.prototype.reloadTilesForDependencies=function(Y,ft){for(var zt in this._tiles){var Qt=this._tiles[zt];Qt.hasDependency(Y,ft)&&this._reloadTile(zt,"reloading")}this._cache.filter(function(ne){return!ne.hasDependency(Y,ft)})},tt}(t.Evented);Yr.maxOverzooming=10,Yr.maxUnderzooming=3;function $r(U,tt){var Y=Math.abs(U.wrap*2)-+(U.wrap<0),ft=Math.abs(tt.wrap*2)-+(tt.wrap<0);return U.overscaledZ-tt.overscaledZ||ft-Y||tt.canonical.y-U.canonical.y||tt.canonical.x-U.canonical.x}function In(U){return U==="raster"||U==="image"||U==="video"}function Nn(){return new t.window.Worker($o.workerUrl)}var Kn="mapboxgl_preloaded_worker_pool",$n=function(){this.active={}};$n.prototype.acquire=function(U){if(!this.workers)for(this.workers=[];this.workers.length<$n.workerCount;)this.workers.push(new Nn);return this.active[U]=!0,this.workers.slice()},$n.prototype.release=function(U){delete this.active[U],this.numActive()===0&&(this.workers.forEach(function(tt){tt.terminate()}),this.workers=null)},$n.prototype.isPreloaded=function(){return!!this.active[Kn]},$n.prototype.numActive=function(){return Object.keys(this.active).length};var ia=Math.floor(t.browser.hardwareConcurrency/2);$n.workerCount=Math.max(Math.min(ia,6),1);var Cn;function Fa(){return Cn||(Cn=new $n),Cn}function Ga(){var U=Fa();U.acquire(Kn)}function ve(){var U=Cn;U&&(U.isPreloaded()&&U.numActive()===1?(U.release(Kn),Cn=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 ge(U,tt){var Y={};for(var ft in U)ft!=="ref"&&(Y[ft]=U[ft]);return t.refProperties.forEach(function(zt){zt in tt&&(Y[zt]=tt[zt])}),Y}function dr(U){U=U.slice();for(var tt=Object.create(null),Y=0;Y<U.length;Y++)tt[U[Y].id]=U[Y];for(var ft=0;ft<U.length;ft++)"ref"in U[ft]&&(U[ft]=ge(U[ft],tt[U[ft].ref]));return U}function br(){var U={},tt=t.styleSpec.$version;for(var Y in t.styleSpec.$root){var ft=t.styleSpec.$root[Y];if(ft.required){var zt=null;Y==="version"?zt=tt:ft.type==="array"?zt=[]:zt={},zt!=null&&(U[Y]=zt)}}return U}var Tr={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 mr(U,tt,Y){Y.push({command:Tr.addSource,args:[U,tt[U]]})}function kr(U,tt,Y){tt.push({command:Tr.removeSource,args:[U]}),Y[U]=!0}function Ur(U,tt,Y,ft){kr(U,Y,ft),mr(U,tt,Y)}function Or(U,tt,Y){var ft;for(ft in U[Y])if(U[Y].hasOwnProperty(ft)&&ft!=="data"&&!t.deepEqual(U[Y][ft],tt[Y][ft]))return!1;for(ft in tt[Y])if(tt[Y].hasOwnProperty(ft)&&ft!=="data"&&!t.deepEqual(U[Y][ft],tt[Y][ft]))return!1;return!0}function pe(U,tt,Y,ft){U=U||{},tt=tt||{};var zt;for(zt in U)U.hasOwnProperty(zt)&&(tt.hasOwnProperty(zt)||kr(zt,Y,ft));for(zt in tt)tt.hasOwnProperty(zt)&&(U.hasOwnProperty(zt)?t.deepEqual(U[zt],tt[zt])||(U[zt].type==="geojson"&&tt[zt].type==="geojson"&&Or(U,tt,zt)?Y.push({command:Tr.setGeoJSONSourceData,args:[zt,tt[zt].data]}):Ur(zt,tt,Y,ft)):mr(zt,tt,Y))}function Ke(U,tt,Y,ft,zt,Qt){U=U||{},tt=tt||{};var ne;for(ne in U)U.hasOwnProperty(ne)&&(t.deepEqual(U[ne],tt[ne])||Y.push({command:Qt,args:[ft,ne,tt[ne],zt]}));for(ne in tt)!tt.hasOwnProperty(ne)||U.hasOwnProperty(ne)||t.deepEqual(U[ne],tt[ne])||Y.push({command:Qt,args:[ft,ne,tt[ne],zt]})}function xr(U){return U.id}function Gr(U,tt){return U[tt.id]=tt,U}function ln(U,tt,Y){U=U||[],tt=tt||[];var ft=U.map(xr),zt=tt.map(xr),Qt=U.reduce(Gr,{}),ne=tt.reduce(Gr,{}),Ft=ft.slice(),$t=Object.create(null),he,Ne,Ie,Fe,He,Ge,Ae;for(he=0,Ne=0;he<ft.length;he++)Ie=ft[he],ne.hasOwnProperty(Ie)?Ne++:(Y.push({command:Tr.removeLayer,args:[Ie]}),Ft.splice(Ft.indexOf(Ie,Ne),1));for(he=0,Ne=0;he<zt.length;he++)Ie=zt[zt.length-1-he],Ft[Ft.length-1-he]!==Ie&&(Qt.hasOwnProperty(Ie)?(Y.push({command:Tr.removeLayer,args:[Ie]}),Ft.splice(Ft.lastIndexOf(Ie,Ft.length-Ne),1)):Ne++,Ge=Ft[Ft.length-he],Y.push({command:Tr.addLayer,args:[ne[Ie],Ge]}),Ft.splice(Ft.length-he,0,Ie),$t[Ie]=!0);for(he=0;he<zt.length;he++)if(Ie=zt[he],Fe=Qt[Ie],He=ne[Ie],!($t[Ie]||t.deepEqual(Fe,He))){if(!t.deepEqual(Fe.source,He.source)||!t.deepEqual(Fe["source-layer"],He["source-layer"])||!t.deepEqual(Fe.type,He.type)){Y.push({command:Tr.removeLayer,args:[Ie]}),Ge=Ft[Ft.lastIndexOf(Ie)+1],Y.push({command:Tr.addLayer,args:[He,Ge]});continue}Ke(Fe.layout,He.layout,Y,Ie,null,Tr.setLayoutProperty),Ke(Fe.paint,He.paint,Y,Ie,null,Tr.setPaintProperty),t.deepEqual(Fe.filter,He.filter)||Y.push({command:Tr.setFilter,args:[Ie,He.filter]}),(!t.deepEqual(Fe.minzoom,He.minzoom)||!t.deepEqual(Fe.maxzoom,He.maxzoom))&&Y.push({command:Tr.setLayerZoomRange,args:[Ie,He.minzoom,He.maxzoom]});for(Ae in Fe)Fe.hasOwnProperty(Ae)&&(Ae==="layout"||Ae==="paint"||Ae==="filter"||Ae==="metadata"||Ae==="minzoom"||Ae==="maxzoom"||(Ae.indexOf("paint.")===0?Ke(Fe[Ae],He[Ae],Y,Ie,Ae.slice(6),Tr.setPaintProperty):t.deepEqual(Fe[Ae],He[Ae])||Y.push({command:Tr.setLayerProperty,args:[Ie,Ae,He[Ae]]})));for(Ae in He)!He.hasOwnProperty(Ae)||Fe.hasOwnProperty(Ae)||Ae==="layout"||Ae==="paint"||Ae==="filter"||Ae==="metadata"||Ae==="minzoom"||Ae==="maxzoom"||(Ae.indexOf("paint.")===0?Ke(Fe[Ae],He[Ae],Y,Ie,Ae.slice(6),Tr.setPaintProperty):t.deepEqual(Fe[Ae],He[Ae])||Y.push({command:Tr.setLayerProperty,args:[Ie,Ae,He[Ae]]}))}}function wn(U,tt){if(!U)return[{command:Tr.setStyle,args:[tt]}];var Y=[];try{if(!t.deepEqual(U.version,tt.version))return[{command:Tr.setStyle,args:[tt]}];t.deepEqual(U.center,tt.center)||Y.push({command:Tr.setCenter,args:[tt.center]}),t.deepEqual(U.zoom,tt.zoom)||Y.push({command:Tr.setZoom,args:[tt.zoom]}),t.deepEqual(U.bearing,tt.bearing)||Y.push({command:Tr.setBearing,args:[tt.bearing]}),t.deepEqual(U.pitch,tt.pitch)||Y.push({command:Tr.setPitch,args:[tt.pitch]}),t.deepEqual(U.sprite,tt.sprite)||Y.push({command:Tr.setSprite,args:[tt.sprite]}),t.deepEqual(U.glyphs,tt.glyphs)||Y.push({command:Tr.setGlyphs,args:[tt.glyphs]}),t.deepEqual(U.transition,tt.transition)||Y.push({command:Tr.setTransition,args:[tt.transition]}),t.deepEqual(U.light,tt.light)||Y.push({command:Tr.setLight,args:[tt.light]});var ft={},zt=[];pe(U.sources,tt.sources,zt,ft);var Qt=[];U.layers&&U.layers.forEach(function(ne){ft[ne.source]?Y.push({command:Tr.removeLayer,args:[ne.id]}):Qt.push(ne)}),Y=Y.concat(zt),ln(Qt,tt.layers,Y)}catch(ne){console.warn("Unable to compute style diff:",ne),Y=[{command:Tr.setStyle,args:[tt]}]}return Y}var rn=function(U,tt){this.reset(U,tt)};rn.prototype.reset=function(U,tt){this.points=U||[],this._distances=[0];for(var Y=1;Y<this.points.length;Y++)this._distances[Y]=this._distances[Y-1]+this.points[Y].dist(this.points[Y-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(tt||0,this.length*.5),this.paddedLength=this.length-this.padding*2},rn.prototype.lerp=function(U){if(this.points.length===1)return this.points[0];U=t.clamp(U,0,1);for(var tt=1,Y=this._distances[tt],ft=U*this.paddedLength+this.padding;Y<ft&&tt<this._distances.length;)Y=this._distances[++tt];var zt=tt-1,Qt=this._distances[zt],ne=Y-Qt,Ft=ne>0?(ft-Qt)/ne:0;return this.points[zt].mult(1-Ft).add(this.points[tt].mult(Ft))};var Qr=function(U,tt,Y){var ft=this.boxCells=[],zt=this.circleCells=[];this.xCellCount=Math.ceil(U/Y),this.yCellCount=Math.ceil(tt/Y);for(var Qt=0;Qt<this.xCellCount*this.yCellCount;Qt++)ft.push([]),zt.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=U,this.height=tt,this.xScale=this.xCellCount/U,this.yScale=this.yCellCount/tt,this.boxUid=0,this.circleUid=0};Qr.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qr.prototype.insert=function(U,tt,Y,ft,zt){this._forEachCell(tt,Y,ft,zt,this._insertBoxCell,this.boxUid++),this.boxKeys.push(U),this.bboxes.push(tt),this.bboxes.push(Y),this.bboxes.push(ft),this.bboxes.push(zt)},Qr.prototype.insertCircle=function(U,tt,Y,ft){this._forEachCell(tt-ft,Y-ft,tt+ft,Y+ft,this._insertCircleCell,this.circleUid++),this.circleKeys.push(U),this.circles.push(tt),this.circles.push(Y),this.circles.push(ft)},Qr.prototype._insertBoxCell=function(U,tt,Y,ft,zt,Qt){this.boxCells[zt].push(Qt)},Qr.prototype._insertCircleCell=function(U,tt,Y,ft,zt,Qt){this.circleCells[zt].push(Qt)},Qr.prototype._query=function(U,tt,Y,ft,zt,Qt){if(Y<0||U>this.width||ft<0||tt>this.height)return zt?!1:[];var ne=[];if(U<=0&&tt<=0&&this.width<=Y&&this.height<=ft){if(zt)return!0;for(var Ft=0;Ft<this.boxKeys.length;Ft++)ne.push({key:this.boxKeys[Ft],x1:this.bboxes[Ft*4],y1:this.bboxes[Ft*4+1],x2:this.bboxes[Ft*4+2],y2:this.bboxes[Ft*4+3]});for(var $t=0;$t<this.circleKeys.length;$t++){var he=this.circles[$t*3],Ne=this.circles[$t*3+1],Ie=this.circles[$t*3+2];ne.push({key:this.circleKeys[$t],x1:he-Ie,y1:Ne-Ie,x2:he+Ie,y2:Ne+Ie})}return Qt?ne.filter(Qt):ne}else{var Fe={hitTest:zt,seenUids:{box:{},circle:{}}};return this._forEachCell(U,tt,Y,ft,this._queryCell,ne,Fe,Qt),zt?ne.length>0:ne}},Qr.prototype._queryCircle=function(U,tt,Y,ft,zt){var Qt=U-Y,ne=U+Y,Ft=tt-Y,$t=tt+Y;if(ne<0||Qt>this.width||$t<0||Ft>this.height)return ft?!1:[];var he=[],Ne={hitTest:ft,circle:{x:U,y:tt,radius:Y},seenUids:{box:{},circle:{}}};return this._forEachCell(Qt,Ft,ne,$t,this._queryCellCircle,he,Ne,zt),ft?he.length>0:he},Qr.prototype.query=function(U,tt,Y,ft,zt){return this._query(U,tt,Y,ft,!1,zt)},Qr.prototype.hitTest=function(U,tt,Y,ft,zt){return this._query(U,tt,Y,ft,!0,zt)},Qr.prototype.hitTestCircle=function(U,tt,Y,ft){return this._queryCircle(U,tt,Y,!0,ft)},Qr.prototype._queryCell=function(U,tt,Y,ft,zt,Qt,ne,Ft){var $t=ne.seenUids,he=this.boxCells[zt];if(he!==null)for(var Ne=this.bboxes,Ie=0,Fe=he;Ie<Fe.length;Ie+=1){var He=Fe[Ie];if(!$t.box[He]){$t.box[He]=!0;var Ge=He*4;if(U<=Ne[Ge+2]&&tt<=Ne[Ge+3]&&Y>=Ne[Ge+0]&&ft>=Ne[Ge+1]&&(!Ft||Ft(this.boxKeys[He]))){if(ne.hitTest)return Qt.push(!0),!0;Qt.push({key:this.boxKeys[He],x1:Ne[Ge],y1:Ne[Ge+1],x2:Ne[Ge+2],y2:Ne[Ge+3]})}}}var Ae=this.circleCells[zt];if(Ae!==null)for(var Oe=this.circles,Le=0,ur=Ae;Le<ur.length;Le+=1){var Dr=ur[Le];if(!$t.circle[Dr]){$t.circle[Dr]=!0;var jr=Dr*3;if(this._circleAndRectCollide(Oe[jr],Oe[jr+1],Oe[jr+2],U,tt,Y,ft)&&(!Ft||Ft(this.circleKeys[Dr]))){if(ne.hitTest)return Qt.push(!0),!0;var On=Oe[jr],Ln=Oe[jr+1],xn=Oe[jr+2];Qt.push({key:this.circleKeys[Dr],x1:On-xn,y1:Ln-xn,x2:On+xn,y2:Ln+xn})}}}},Qr.prototype._queryCellCircle=function(U,tt,Y,ft,zt,Qt,ne,Ft){var $t=ne.circle,he=ne.seenUids,Ne=this.boxCells[zt];if(Ne!==null)for(var Ie=this.bboxes,Fe=0,He=Ne;Fe<He.length;Fe+=1){var Ge=He[Fe];if(!he.box[Ge]){he.box[Ge]=!0;var Ae=Ge*4;if(this._circleAndRectCollide($t.x,$t.y,$t.radius,Ie[Ae+0],Ie[Ae+1],Ie[Ae+2],Ie[Ae+3])&&(!Ft||Ft(this.boxKeys[Ge])))return Qt.push(!0),!0}}var Oe=this.circleCells[zt];if(Oe!==null)for(var Le=this.circles,ur=0,Dr=Oe;ur<Dr.length;ur+=1){var jr=Dr[ur];if(!he.circle[jr]){he.circle[jr]=!0;var On=jr*3;if(this._circlesCollide(Le[On],Le[On+1],Le[On+2],$t.x,$t.y,$t.radius)&&(!Ft||Ft(this.circleKeys[jr])))return Qt.push(!0),!0}}},Qr.prototype._forEachCell=function(U,tt,Y,ft,zt,Qt,ne,Ft){for(var $t=this._convertToXCellCoord(U),he=this._convertToYCellCoord(tt),Ne=this._convertToXCellCoord(Y),Ie=this._convertToYCellCoord(ft),Fe=$t;Fe<=Ne;Fe++)for(var He=he;He<=Ie;He++){var Ge=this.xCellCount*He+Fe;if(zt.call(this,U,tt,Y,ft,Ge,Qt,ne,Ft))return}},Qr.prototype._convertToXCellCoord=function(U){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(U*this.xScale)))},Qr.prototype._convertToYCellCoord=function(U){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(U*this.yScale)))},Qr.prototype._circlesCollide=function(U,tt,Y,ft,zt,Qt){var ne=ft-U,Ft=zt-tt,$t=Y+Qt;return $t*$t>ne*ne+Ft*Ft},Qr.prototype._circleAndRectCollide=function(U,tt,Y,ft,zt,Qt,ne){var Ft=(Qt-ft)/2,$t=Math.abs(U-(ft+Ft));if($t>Ft+Y)return!1;var he=(ne-zt)/2,Ne=Math.abs(tt-(zt+he));if(Ne>he+Y)return!1;if($t<=Ft||Ne<=he)return!0;var Ie=$t-Ft,Fe=Ne-he;return Ie*Ie+Fe*Fe<=Y*Y};function vn(U,tt,Y,ft,zt){var Qt=t.create();return tt?(t.scale(Qt,Qt,[1/zt,1/zt,1]),Y||t.rotateZ(Qt,Qt,ft.angle)):t.multiply(Qt,ft.labelPlaneMatrix,U),Qt}function Oa(U,tt,Y,ft,zt){if(tt){var Qt=t.clone(U);return t.scale(Qt,Qt,[zt,zt,1]),Y||t.rotateZ(Qt,Qt,-ft.angle),Qt}else return ft.glCoordMatrix}function Qn(U,tt){var Y=[U.x,U.y,0,1];zo(Y,Y,tt);var ft=Y[3];return{point:new t.Point(Y[0]/ft,Y[1]/ft),signedDistanceFromCamera:ft}}function Qa(U,tt){return .5+.5*(U/tt)}function Ja(U,tt){var Y=U[0]/U[3],ft=U[1]/U[3],zt=Y>=-tt[0]&&Y<=tt[0]&&ft>=-tt[1]&&ft<=tt[1];return zt}function wi(U,tt,Y,ft,zt,Qt,ne,Ft){var $t=ft?U.textSizeData:U.iconSizeData,he=t.evaluateSizeForZoom($t,Y.transform.zoom),Ne=[256/Y.width*2+1,256/Y.height*2+1],Ie=ft?U.text.dynamicLayoutVertexArray:U.icon.dynamicLayoutVertexArray;Ie.clear();for(var Fe=U.lineVertexArray,He=ft?U.text.placedSymbolArray:U.icon.placedSymbolArray,Ge=Y.transform.width/Y.transform.height,Ae=!1,Oe=0;Oe<He.length;Oe++){var Le=He.get(Oe);if(Le.hidden||Le.writingMode===t.WritingMode.vertical&&!Ae){Ci(Le.numGlyphs,Ie);continue}Ae=!1;var ur=[Le.anchorX,Le.anchorY,0,1];if(t.transformMat4(ur,ur,tt),!Ja(ur,Ne)){Ci(Le.numGlyphs,Ie);continue}var Dr=ur[3],jr=Qa(Y.transform.cameraToCenterDistance,Dr),On=t.evaluateSizeForFeature($t,he,Le),Ln=ne?On/jr:On*jr,xn=new t.Point(Le.anchorX,Le.anchorY),Wn=Qn(xn,zt).point,Dn={},la=Ra(Le,Ln,!1,Ft,tt,zt,Qt,U.glyphOffsetArray,Fe,Ie,Wn,xn,Dn,Ge);Ae=la.useVertical,(la.notEnoughRoom||Ae||la.needsFlipping&&Ra(Le,Ln,!0,Ft,tt,zt,Qt,U.glyphOffsetArray,Fe,Ie,Wn,xn,Dn,Ge).notEnoughRoom)&&Ci(Le.numGlyphs,Ie)}ft?U.text.dynamicLayoutVertexBuffer.updateData(Ie):U.icon.dynamicLayoutVertexBuffer.updateData(Ie)}function ci(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne){var Ie=Ft.glyphStartIndex+Ft.numGlyphs,Fe=Ft.lineStartIndex,He=Ft.lineStartIndex+Ft.lineLength,Ge=tt.getoffsetX(Ft.glyphStartIndex),Ae=tt.getoffsetX(Ie-1),Oe=Hi(U*Ge,Y,ft,zt,Qt,ne,Ft.segment,Fe,He,$t,he,Ne);if(!Oe)return null;var Le=Hi(U*Ae,Y,ft,zt,Qt,ne,Ft.segment,Fe,He,$t,he,Ne);return Le?{first:Oe,last:Le}:null}function Ti(U,tt,Y,ft){if(U===t.WritingMode.horizontal){var zt=Math.abs(Y.y-tt.y),Qt=Math.abs(Y.x-tt.x)*ft;if(zt>Qt)return{useVertical:!0}}return(U===t.WritingMode.vertical?tt.y<Y.y:tt.x>Y.x)?{needsFlipping:!0}:null}function Ra(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie,Fe,He){var Ge=tt/24,Ae=U.lineOffsetX*Ge,Oe=U.lineOffsetY*Ge,Le;if(U.numGlyphs>1){var ur=U.glyphStartIndex+U.numGlyphs,Dr=U.lineStartIndex,jr=U.lineStartIndex+U.lineLength,On=ci(Ge,Ft,Ae,Oe,Y,Ne,Ie,U,$t,Qt,Fe);if(!On)return{notEnoughRoom:!0};var Ln=Qn(On.first.point,ne).point,xn=Qn(On.last.point,ne).point;if(ft&&!Y){var Wn=Ti(U.writingMode,Ln,xn,He);if(Wn)return Wn}Le=[On.first];for(var Dn=U.glyphStartIndex+1;Dn<ur-1;Dn++)Le.push(Hi(Ge*Ft.getoffsetX(Dn),Ae,Oe,Y,Ne,Ie,U.segment,Dr,jr,$t,Qt,Fe));Le.push(On.last)}else{if(ft&&!Y){var la=Qn(Ie,zt).point,qn=U.lineStartIndex+U.segment+1,Gn=new t.Point($t.getx(qn),$t.gety(qn)),ma=Qn(Gn,zt),ti=ma.signedDistanceFromCamera>0?ma.point:Qi(Ie,Gn,la,1,zt),si=Ti(U.writingMode,la,ti,He);if(si)return si}var Li=Hi(Ge*Ft.getoffsetX(U.glyphStartIndex),Ae,Oe,Y,Ne,Ie,U.segment,U.lineStartIndex,U.lineStartIndex+U.lineLength,$t,Qt,Fe);if(!Li)return{notEnoughRoom:!0};Le=[Li]}for(var to=0,ls=Le;to<ls.length;to+=1){var ms=ls[to];t.addDynamicAttributes(he,ms.point,ms.angle)}return{}}function Qi(U,tt,Y,ft,zt){var Qt=Qn(U.add(U.sub(tt)._unit()),zt).point,ne=Y.sub(Qt);return Y.add(ne._mult(ft/ne.mag()))}function Hi(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie){var Fe=ft?U-tt:U+tt,He=Fe>0?1:-1,Ge=0;ft&&(He*=-1,Ge=Math.PI),He<0&&(Ge+=Math.PI);for(var Ae=He>0?Ft+ne:Ft+ne+1,Oe=zt,Le=zt,ur=0,Dr=0,jr=Math.abs(Fe),On=[];ur+Dr<=jr;){if(Ae+=He,Ae<Ft||Ae>=$t)return null;if(Le=Oe,On.push(Oe),Oe=Ie[Ae],Oe===void 0){var Ln=new t.Point(he.getx(Ae),he.gety(Ae)),xn=Qn(Ln,Ne);if(xn.signedDistanceFromCamera>0)Oe=Ie[Ae]=xn.point;else{var Wn=Ae-He,Dn=ur===0?Qt:new t.Point(he.getx(Wn),he.gety(Wn));Oe=Qi(Dn,Ln,Le,jr-ur+1,Ne)}}ur+=Dr,Dr=Le.dist(Oe)}var la=(jr-ur)/Dr,qn=Oe.sub(Le),Gn=qn.mult(la)._add(Le);Gn._add(qn._unit()._perp()._mult(Y*He));var ma=Ge+Math.atan2(Oe.y-Le.y,Oe.x-Le.x);return On.push(Gn),{point:Gn,angle:ma,path:On}}var Ho=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ci(U,tt){for(var Y=0;Y<U;Y++){var ft=tt.length;tt.resize(ft+4),tt.float32.set(Ho,ft*3)}}function zo(U,tt,Y){var ft=tt[0],zt=tt[1];return U[0]=Y[0]*ft+Y[4]*zt+Y[12],U[1]=Y[1]*ft+Y[5]*zt+Y[13],U[3]=Y[3]*ft+Y[7]*zt+Y[15],U}var qi=100,qo=function(U,tt,Y){tt===void 0&&(tt=new Qr(U.width+2*qi,U.height+2*qi,25)),Y===void 0&&(Y=new Qr(U.width+2*qi,U.height+2*qi,25)),this.transform=U,this.grid=tt,this.ignoredGrid=Y,this.pitchfactor=Math.cos(U._pitch)*U.cameraToCenterDistance,this.screenRightBoundary=U.width+qi,this.screenBottomBoundary=U.height+qi,this.gridRightBoundary=U.width+2*qi,this.gridBottomBoundary=U.height+2*qi};qo.prototype.placeCollisionBox=function(U,tt,Y,ft,zt){var Qt=this.projectAndGetPerspectiveRatio(ft,U.anchorPointX,U.anchorPointY),ne=Y*Qt.perspectiveRatio,Ft=U.x1*ne+Qt.point.x,$t=U.y1*ne+Qt.point.y,he=U.x2*ne+Qt.point.x,Ne=U.y2*ne+Qt.point.y;return!this.isInsideGrid(Ft,$t,he,Ne)||!tt&&this.grid.hitTest(Ft,$t,he,Ne,zt)?{box:[],offscreen:!1}:{box:[Ft,$t,he,Ne],offscreen:this.isOffscreen(Ft,$t,he,Ne)}},qo.prototype.placeCollisionCircles=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie,Fe){var He=[],Ge=new t.Point(tt.anchorX,tt.anchorY),Ae=Qn(Ge,Qt),Oe=Qa(this.transform.cameraToCenterDistance,Ae.signedDistanceFromCamera),Le=he?zt/Oe:zt*Oe,ur=Le/t.ONE_EM,Dr=Qn(Ge,ne).point,jr={},On=tt.lineOffsetX*ur,Ln=tt.lineOffsetY*ur,xn=ci(ur,ft,On,Ln,!1,Dr,Ge,tt,Y,ne,jr),Wn=!1,Dn=!1,la=!0;if(xn){for(var qn=Ie*.5*Oe+Fe,Gn=new t.Point(-qi,-qi),ma=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),ti=new rn,si=xn.first,Li=xn.last,to=[],ls=si.path.length-1;ls>=1;ls--)to.push(si.path[ls]);for(var ms=1;ms<Li.path.length;ms++)to.push(Li.path[ms]);var Ko=qn*2.5;if(Ft){var gs=to.map(function(Ef){return Qn(Ef,Ft)});gs.some(function(Ef){return Ef.signedDistanceFromCamera<=0})?to=[]:to=gs.map(function(Ef){return Ef.point})}var Pl=[];if(to.length>0){for(var mo=to[0].clone(),Xs=to[0].clone(),tc=1;tc<to.length;tc++)mo.x=Math.min(mo.x,to[tc].x),mo.y=Math.min(mo.y,to[tc].y),Xs.x=Math.max(Xs.x,to[tc].x),Xs.y=Math.max(Xs.y,to[tc].y);mo.x>=Gn.x&&Xs.x<=ma.x&&mo.y>=Gn.y&&Xs.y<=ma.y?Pl=[to]:Xs.x<Gn.x||mo.x>ma.x||Xs.y<Gn.y||mo.y>ma.y?Pl=[]:Pl=t.clipLine([to],Gn.x,Gn.y,ma.x,ma.y)}for(var kc=0,lh=Pl;kc<lh.length;kc+=1){var gh=lh[kc];ti.reset(gh,qn*.25);var Zf=0;ti.length<=.5*qn?Zf=1:Zf=Math.ceil(ti.paddedLength/Ko)+1;for(var Kf=0;Kf<Zf;Kf++){var _h=Kf/Math.max(Zf-1,1),Sf=ti.lerp(_h),Yf=Sf.x+qi,yf=Sf.y+qi;He.push(Yf,yf,qn,0);var Ch=Yf-qn,ip=yf-qn,Xf=Yf+qn,$f=yf+qn;if(la=la&&this.isOffscreen(Ch,ip,Xf,$f),Dn=Dn||this.isInsideGrid(Ch,ip,Xf,$f),!U&&this.grid.hitTestCircle(Yf,yf,qn,Ne)&&(Wn=!0,!$t))return{circles:[],offscreen:!1,collisionDetected:Wn}}}}return{circles:!$t&&Wn||!Dn?[]:He,offscreen:la,collisionDetected:Wn}},qo.prototype.queryRenderedSymbols=function(U){if(U.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var tt=[],Y=1/0,ft=1/0,zt=-1/0,Qt=-1/0,ne=0,Ft=U;ne<Ft.length;ne+=1){var $t=Ft[ne],he=new t.Point($t.x+qi,$t.y+qi);Y=Math.min(Y,he.x),ft=Math.min(ft,he.y),zt=Math.max(zt,he.x),Qt=Math.max(Qt,he.y),tt.push(he)}for(var Ne=this.grid.query(Y,ft,zt,Qt).concat(this.ignoredGrid.query(Y,ft,zt,Qt)),Ie={},Fe={},He=0,Ge=Ne;He<Ge.length;He+=1){var Ae=Ge[He],Oe=Ae.key;if(Ie[Oe.bucketInstanceId]===void 0&&(Ie[Oe.bucketInstanceId]={}),!Ie[Oe.bucketInstanceId][Oe.featureIndex]){var Le=[new t.Point(Ae.x1,Ae.y1),new t.Point(Ae.x2,Ae.y1),new t.Point(Ae.x2,Ae.y2),new t.Point(Ae.x1,Ae.y2)];t.polygonIntersectsPolygon(tt,Le)&&(Ie[Oe.bucketInstanceId][Oe.featureIndex]=!0,Fe[Oe.bucketInstanceId]===void 0&&(Fe[Oe.bucketInstanceId]=[]),Fe[Oe.bucketInstanceId].push(Oe.featureIndex))}}return Fe},qo.prototype.insertCollisionBox=function(U,tt,Y,ft,zt){var Qt=tt?this.ignoredGrid:this.grid,ne={bucketInstanceId:Y,featureIndex:ft,collisionGroupID:zt};Qt.insert(ne,U[0],U[1],U[2],U[3])},qo.prototype.insertCollisionCircles=function(U,tt,Y,ft,zt){for(var Qt=tt?this.ignoredGrid:this.grid,ne={bucketInstanceId:Y,featureIndex:ft,collisionGroupID:zt},Ft=0;Ft<U.length;Ft+=4)Qt.insertCircle(ne,U[Ft],U[Ft+1],U[Ft+2])},qo.prototype.projectAndGetPerspectiveRatio=function(U,tt,Y){var ft=[tt,Y,0,1];zo(ft,ft,U);var zt=new t.Point((ft[0]/ft[3]+1)/2*this.transform.width+qi,(-ft[1]/ft[3]+1)/2*this.transform.height+qi);return{point:zt,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/ft[3])}},qo.prototype.isOffscreen=function(U,tt,Y,ft){return Y<qi||U>=this.screenRightBoundary||ft<qi||tt>this.screenBottomBoundary},qo.prototype.isInsideGrid=function(U,tt,Y,ft){return Y>=0&&U<this.gridRightBoundary&&ft>=0&&tt<this.gridBottomBoundary},qo.prototype.getViewportMatrix=function(){var U=t.identity([]);return t.translate(U,U,[-qi,-qi,0]),U};function Po(U,tt,Y){return tt*(t.EXTENT/(U.tileSize*Math.pow(2,Y-U.tileID.overscaledZ)))}var hs=function(U,tt,Y,ft){U?this.opacity=Math.max(0,Math.min(1,U.opacity+(U.placed?tt:-tt))):this.opacity=ft&&Y?1:0,this.placed=Y};hs.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Gi=function(U,tt,Y,ft,zt){this.text=new hs(U?U.text:null,tt,Y,zt),this.icon=new hs(U?U.icon:null,tt,ft,zt)};Gi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var uo=function(U,tt,Y){this.text=U,this.icon=tt,this.skipFade=Y},yi=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ao=function(U,tt,Y,ft,zt){this.bucketInstanceId=U,this.featureIndex=tt,this.sourceLayerIndex=Y,this.bucketIndex=ft,this.tileID=zt},ts=function(U){this.crossSourceCollisions=U,this.maxGroupID=0,this.collisionGroups={}};ts.prototype.get=function(U){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[U]){var tt=++this.maxGroupID;this.collisionGroups[U]={ID:tt,predicate:function(Y){return Y.collisionGroupID===tt}}}return this.collisionGroups[U]};function vs(U,tt,Y,ft,zt){var Qt=t.getAnchorAlignment(U),ne=Qt.horizontalAlign,Ft=Qt.verticalAlign,$t=-(ne-.5)*tt,he=-(Ft-.5)*Y,Ne=t.evaluateVariableOffset(U,ft);return new t.Point($t+Ne[0]*zt,he+Ne[1]*zt)}function As(U,tt,Y,ft,zt,Qt){var ne=U.x1,Ft=U.x2,$t=U.y1,he=U.y2,Ne=U.anchorPointX,Ie=U.anchorPointY,Fe=new t.Point(tt,Y);return ft&&Fe._rotate(zt?Qt:-Qt),{x1:ne+Fe.x,y1:$t+Fe.y,x2:Ft+Fe.x,y2:he+Fe.y,anchorPointX:Ne,anchorPointY:Ie}}var _o=function(U,tt,Y,ft){this.transform=U.clone(),this.collisionIndex=new qo(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=tt,this.retainedQueryData={},this.collisionGroups=new ts(Y),this.collisionCircleArrays={},this.prevPlacement=ft,ft&&(ft.prevPlacement=void 0),this.placedOrientations={}};_o.prototype.getBucketParts=function(U,tt,Y,ft){var zt=Y.getBucket(tt),Qt=Y.latestFeatureIndex;if(!(!zt||!Qt||tt.id!==zt.layerIds[0])){var ne=Y.collisionBoxArray,Ft=zt.layers[0].layout,$t=Math.pow(2,this.transform.zoom-Y.tileID.overscaledZ),he=Y.tileSize/t.EXTENT,Ne=this.transform.calculatePosMatrix(Y.tileID.toUnwrapped()),Ie=Ft.get("text-pitch-alignment")==="map",Fe=Ft.get("text-rotation-alignment")==="map",He=Po(Y,1,this.transform.zoom),Ge=vn(Ne,Ie,Fe,this.transform,He),Ae=null;if(Ie){var Oe=Oa(Ne,Ie,Fe,this.transform,He);Ae=t.multiply([],this.transform.labelPlaneMatrix,Oe)}this.retainedQueryData[zt.bucketInstanceId]=new ao(zt.bucketInstanceId,Qt,zt.sourceLayerIndex,zt.index,Y.tileID);var Le={bucket:zt,layout:Ft,posMatrix:Ne,textLabelPlaneMatrix:Ge,labelToScreenMatrix:Ae,scale:$t,textPixelRatio:he,holdingForFade:Y.holdingForFade(),collisionBoxArray:ne,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(zt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(zt.sourceID)};if(ft)for(var ur=0,Dr=zt.sortKeyRanges;ur<Dr.length;ur+=1){var jr=Dr[ur],On=jr.sortKey,Ln=jr.symbolInstanceStart,xn=jr.symbolInstanceEnd;U.push({sortKey:On,symbolInstanceStart:Ln,symbolInstanceEnd:xn,parameters:Le})}else U.push({symbolInstanceStart:0,symbolInstanceEnd:zt.symbolInstances.length,parameters:Le})}},_o.prototype.attemptAnchorPlacement=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie,Fe,He,Ge){var Ae=[Ie.textOffset0,Ie.textOffset1],Oe=vs(U,Y,ft,Ae,zt),Le=this.collisionIndex.placeCollisionBox(As(tt,Oe.x,Oe.y,Qt,ne,this.transform.angle),Ne,Ft,$t,he.predicate);if(Ge){var ur=this.collisionIndex.placeCollisionBox(As(Ge,Oe.x,Oe.y,Qt,ne,this.transform.angle),Ne,Ft,$t,he.predicate);if(ur.box.length===0)return}if(Le.box.length>0){var Dr;return this.prevPlacement&&this.prevPlacement.variableOffsets[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID]&&this.prevPlacement.placements[Ie.crossTileID].text&&(Dr=this.prevPlacement.variableOffsets[Ie.crossTileID].anchor),this.variableOffsets[Ie.crossTileID]={textOffset:Ae,width:Y,height:ft,anchor:U,textBoxScale:zt,prevAnchor:Dr},this.markUsedJustification(Fe,U,Ie,He),Fe.allowVerticalPlacement&&(this.markUsedOrientation(Fe,He,Ie),this.placedOrientations[Ie.crossTileID]=He),{shift:Oe,placedGlyphBoxes:Le}}},_o.prototype.placeLayerBucketPart=function(U,tt,Y){var ft=this,zt=U.parameters,Qt=zt.bucket,ne=zt.layout,Ft=zt.posMatrix,$t=zt.textLabelPlaneMatrix,he=zt.labelToScreenMatrix,Ne=zt.textPixelRatio,Ie=zt.holdingForFade,Fe=zt.collisionBoxArray,He=zt.partiallyEvaluatedTextSize,Ge=zt.collisionGroup,Ae=ne.get("text-optional"),Oe=ne.get("icon-optional"),Le=ne.get("text-allow-overlap"),ur=ne.get("icon-allow-overlap"),Dr=ne.get("text-rotation-alignment")==="map",jr=ne.get("text-pitch-alignment")==="map",On=ne.get("icon-text-fit")!=="none",Ln=ne.get("symbol-z-order")==="viewport-y",xn=Le&&(ur||!Qt.hasIconData()||Oe),Wn=ur&&(Le||!Qt.hasTextData()||Ae);!Qt.collisionArrays&&Fe&&Qt.deserializeCollisionBoxes(Fe);var Dn=function(si,Li){if(!tt[si.crossTileID]){if(Ie){ft.placements[si.crossTileID]=new uo(!1,!1,!1);return}var to=!1,ls=!1,ms=!0,Ko=null,gs={box:null,offscreen:null},Pl={box:null,offscreen:null},mo=null,Xs=null,tc=null,kc=0,lh=0,gh=0;Li.textFeatureIndex?kc=Li.textFeatureIndex:si.useRuntimeCollisionCircles&&(kc=si.featureIndex),Li.verticalTextFeatureIndex&&(lh=Li.verticalTextFeatureIndex);var Zf=Li.textBox;if(Zf){var Kf=function(ec){var Qc=t.WritingMode.horizontal;if(Qt.allowVerticalPlacement&&!ec&&ft.prevPlacement){var Ol=ft.prevPlacement.placedOrientations[si.crossTileID];Ol&&(ft.placedOrientations[si.crossTileID]=Ol,Qc=Ol,ft.markUsedOrientation(Qt,Qc,si))}return Qc},_h=function(ec,Qc){if(Qt.allowVerticalPlacement&&si.numVerticalGlyphVertices>0&&Li.verticalTextBox)for(var Ol=0,Ap=Qt.writingModes;Ol<Ap.length;Ol+=1){var Yp=Ap[Ol];if(Yp===t.WritingMode.vertical?(gs=Qc(),Pl=gs):gs=ec(),gs&&gs.box&&gs.box.length)break}else gs=ec()};if(ne.get("text-variable-anchor")){var Sf=ne.get("text-variable-anchor");if(ft.prevPlacement&&ft.prevPlacement.variableOffsets[si.crossTileID]){var Yf=ft.prevPlacement.variableOffsets[si.crossTileID];Sf.indexOf(Yf.anchor)>0&&(Sf=Sf.filter(function(ec){return ec!==Yf.anchor}),Sf.unshift(Yf.anchor))}var yf=function(ec,Qc,Ol){for(var Ap=ec.x2-ec.x1,Yp=ec.y2-ec.y1,C0=si.textBoxScale,Ul=On&&!ur?Qc:null,Gh={box:[],offscreen:!1},I0=Le?Sf.length*2:Sf.length,Mp=0;Mp<I0;++Mp){var wh=Sf[Mp%Sf.length],Zm=Mp>=Sf.length,Xp=ft.attemptAnchorPlacement(wh,ec,Ap,Yp,C0,Dr,jr,Ne,Ft,Ge,Zm,si,Qt,Ol,Ul);if(Xp&&(Gh=Xp.placedGlyphBoxes,Gh&&Gh.box&&Gh.box.length)){to=!0,Ko=Xp.shift;break}}return Gh},Ch=function(){return yf(Zf,Li.iconBox,t.WritingMode.horizontal)},ip=function(){var ec=Li.verticalTextBox,Qc=gs&&gs.box&&gs.box.length;return Qt.allowVerticalPlacement&&!Qc&&si.numVerticalGlyphVertices>0&&ec?yf(ec,Li.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}};_h(Ch,ip),gs&&(to=gs.box,ms=gs.offscreen);var Xf=Kf(gs&&gs.box);if(!to&&ft.prevPlacement){var $f=ft.prevPlacement.variableOffsets[si.crossTileID];$f&&(ft.variableOffsets[si.crossTileID]=$f,ft.markUsedJustification(Qt,$f.anchor,si,Xf))}}else{var Ef=function(ec,Qc){var Ol=ft.collisionIndex.placeCollisionBox(ec,Le,Ne,Ft,Ge.predicate);return Ol&&Ol.box&&Ol.box.length&&(ft.markUsedOrientation(Qt,Qc,si),ft.placedOrientations[si.crossTileID]=Qc),Ol},op=function(){return Ef(Zf,t.WritingMode.horizontal)},wp=function(){var ec=Li.verticalTextBox;return Qt.allowVerticalPlacement&&si.numVerticalGlyphVertices>0&&ec?Ef(ec,t.WritingMode.vertical):{box:null,offscreen:null}};_h(op,wp),Kf(gs&&gs.box&&gs.box.length)}}if(mo=gs,to=mo&&mo.box&&mo.box.length>0,ms=mo&&mo.offscreen,si.useRuntimeCollisionCircles){var sp=Qt.text.placedSymbolArray.get(si.centerJustifiedTextSymbolIndex),$c=t.evaluateSizeForFeature(Qt.textSizeData,He,sp),Wh=ne.get("text-padding"),Tp=si.collisionCircleDiameter;Xs=ft.collisionIndex.placeCollisionCircles(Le,sp,Qt.lineVertexArray,Qt.glyphOffsetArray,$c,Ft,$t,he,Y,jr,Ge.predicate,Tp,Wh),to=Le||Xs.circles.length>0&&!Xs.collisionDetected,ms=ms&&Xs.offscreen}if(Li.iconFeatureIndex&&(gh=Li.iconFeatureIndex),Li.iconBox){var Jc=function(ec){var Qc=On&&Ko?As(ec,Ko.x,Ko.y,Dr,jr,ft.transform.angle):ec;return ft.collisionIndex.placeCollisionBox(Qc,ur,Ne,Ft,Ge.predicate)};Pl&&Pl.box&&Pl.box.length&&Li.verticalIconBox?(tc=Jc(Li.verticalIconBox),ls=tc.box.length>0):(tc=Jc(Li.iconBox),ls=tc.box.length>0),ms=ms&&tc.offscreen}var lp=Ae||si.numHorizontalGlyphVertices===0&&si.numVerticalGlyphVertices===0,Zp=Oe||si.numIconVertices===0;if(!lp&&!Zp?ls=to=ls&&to:Zp?lp||(ls=ls&&to):to=ls&&to,to&&mo&&mo.box&&(Pl&&Pl.box&&lh?ft.collisionIndex.insertCollisionBox(mo.box,ne.get("text-ignore-placement"),Qt.bucketInstanceId,lh,Ge.ID):ft.collisionIndex.insertCollisionBox(mo.box,ne.get("text-ignore-placement"),Qt.bucketInstanceId,kc,Ge.ID)),ls&&tc&&ft.collisionIndex.insertCollisionBox(tc.box,ne.get("icon-ignore-placement"),Qt.bucketInstanceId,gh,Ge.ID),Xs&&(to&&ft.collisionIndex.insertCollisionCircles(Xs.circles,ne.get("text-ignore-placement"),Qt.bucketInstanceId,kc,Ge.ID),Y)){var Kp=Qt.bucketInstanceId,bh=ft.collisionCircleArrays[Kp];bh===void 0&&(bh=ft.collisionCircleArrays[Kp]=new yi);for(var kp=0;kp<Xs.circles.length;kp+=4)bh.circles.push(Xs.circles[kp+0]),bh.circles.push(Xs.circles[kp+1]),bh.circles.push(Xs.circles[kp+2]),bh.circles.push(Xs.collisionDetected?1:0)}ft.placements[si.crossTileID]=new uo(to||xn,ls||Wn,ms||Qt.justReloaded),tt[si.crossTileID]=!0}};if(Ln)for(var la=Qt.getSortedSymbolIndexes(this.transform.angle),qn=la.length-1;qn>=0;--qn){var Gn=la[qn];Dn(Qt.symbolInstances.get(Gn),Qt.collisionArrays[Gn])}else for(var ma=U.symbolInstanceStart;ma<U.symbolInstanceEnd;ma++)Dn(Qt.symbolInstances.get(ma),Qt.collisionArrays[ma]);if(Y&&Qt.bucketInstanceId in this.collisionCircleArrays){var ti=this.collisionCircleArrays[Qt.bucketInstanceId];t.invert(ti.invProjMatrix,Ft),ti.viewportMatrix=this.collisionIndex.getViewportMatrix()}Qt.justReloaded=!1},_o.prototype.markUsedJustification=function(U,tt,Y,ft){var zt={left:Y.leftJustifiedTextSymbolIndex,center:Y.centerJustifiedTextSymbolIndex,right:Y.rightJustifiedTextSymbolIndex},Qt;ft===t.WritingMode.vertical?Qt=Y.verticalPlacedTextSymbolIndex:Qt=zt[t.getAnchorJustification(tt)];for(var ne=[Y.leftJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.rightJustifiedTextSymbolIndex,Y.verticalPlacedTextSymbolIndex],Ft=0,$t=ne;Ft<$t.length;Ft+=1){var he=$t[Ft];he>=0&&(Qt>=0&&he!==Qt?U.text.placedSymbolArray.get(he).crossTileID=0:U.text.placedSymbolArray.get(he).crossTileID=Y.crossTileID)}},_o.prototype.markUsedOrientation=function(U,tt,Y){for(var ft=tt===t.WritingMode.horizontal||tt===t.WritingMode.horizontalOnly?tt:0,zt=tt===t.WritingMode.vertical?tt:0,Qt=[Y.leftJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.rightJustifiedTextSymbolIndex],ne=0,Ft=Qt;ne<Ft.length;ne+=1){var $t=Ft[ne];U.text.placedSymbolArray.get($t).placedOrientation=ft}Y.verticalPlacedTextSymbolIndex&&(U.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).placedOrientation=zt)},_o.prototype.commit=function(U){this.commitTime=U,this.zoomAtLastRecencyCheck=this.transform.zoom;var tt=this.prevPlacement,Y=!1;this.prevZoomAdjustment=tt?tt.zoomAdjustment(this.transform.zoom):0;var ft=tt?tt.symbolFadeChange(U):1,zt=tt?tt.opacities:{},Qt=tt?tt.variableOffsets:{},ne=tt?tt.placedOrientations:{};for(var Ft in this.placements){var $t=this.placements[Ft],he=zt[Ft];he?(this.opacities[Ft]=new Gi(he,ft,$t.text,$t.icon),Y=Y||$t.text!==he.text.placed||$t.icon!==he.icon.placed):(this.opacities[Ft]=new Gi(null,ft,$t.text,$t.icon,$t.skipFade),Y=Y||$t.text||$t.icon)}for(var Ne in zt){var Ie=zt[Ne];if(!this.opacities[Ne]){var Fe=new Gi(Ie,ft,!1,!1);Fe.isHidden()||(this.opacities[Ne]=Fe,Y=Y||Ie.text.placed||Ie.icon.placed)}}for(var He in Qt)!this.variableOffsets[He]&&this.opacities[He]&&!this.opacities[He].isHidden()&&(this.variableOffsets[He]=Qt[He]);for(var Ge in ne)!this.placedOrientations[Ge]&&this.opacities[Ge]&&!this.opacities[Ge].isHidden()&&(this.placedOrientations[Ge]=ne[Ge]);Y?this.lastPlacementChangeTime=U:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=tt?tt.lastPlacementChangeTime:U)},_o.prototype.updateLayerOpacities=function(U,tt){for(var Y={},ft=0,zt=tt;ft<zt.length;ft+=1){var Qt=zt[ft],ne=Qt.getBucket(U);ne&&Qt.latestFeatureIndex&&U.id===ne.layerIds[0]&&this.updateBucketOpacities(ne,Y,Qt.collisionBoxArray)}},_o.prototype.updateBucketOpacities=function(U,tt,Y){var ft=this;U.hasTextData()&&U.text.opacityVertexArray.clear(),U.hasIconData()&&U.icon.opacityVertexArray.clear(),U.hasIconCollisionBoxData()&&U.iconCollisionBox.collisionVertexArray.clear(),U.hasTextCollisionBoxData()&&U.textCollisionBox.collisionVertexArray.clear();var zt=U.layers[0].layout,Qt=new Gi(null,0,!1,!1,!0),ne=zt.get("text-allow-overlap"),Ft=zt.get("icon-allow-overlap"),$t=zt.get("text-variable-anchor"),he=zt.get("text-rotation-alignment")==="map",Ne=zt.get("text-pitch-alignment")==="map",Ie=zt.get("icon-text-fit")!=="none",Fe=new Gi(null,0,ne&&(Ft||!U.hasIconData()||zt.get("icon-optional")),Ft&&(ne||!U.hasTextData()||zt.get("text-optional")),!0);!U.collisionArrays&&Y&&(U.hasIconCollisionBoxData()||U.hasTextCollisionBoxData())&&U.deserializeCollisionBoxes(Y);for(var He=function(Le,ur,Dr){for(var jr=0;jr<ur/4;jr++)Le.opacityVertexArray.emplaceBack(Dr)},Ge=function(Le){var ur=U.symbolInstances.get(Le),Dr=ur.numHorizontalGlyphVertices,jr=ur.numVerticalGlyphVertices,On=ur.crossTileID,Ln=tt[On],xn=ft.opacities[On];Ln?xn=Qt:xn||(xn=Fe,ft.opacities[On]=xn),tt[On]=!0;var Wn=Dr>0||jr>0,Dn=ur.numIconVertices>0,la=ft.placedOrientations[ur.crossTileID],qn=la===t.WritingMode.vertical,Gn=la===t.WritingMode.horizontal||la===t.WritingMode.horizontalOnly;if(Wn){var ma=al(xn.text),ti=qn?ii:ma;He(U.text,Dr,ti);var si=Gn?ii:ma;He(U.text,jr,si);var Li=xn.text.isHidden();[ur.rightJustifiedTextSymbolIndex,ur.centerJustifiedTextSymbolIndex,ur.leftJustifiedTextSymbolIndex].forEach(function(gh){gh>=0&&(U.text.placedSymbolArray.get(gh).hidden=Li||qn?1:0)}),ur.verticalPlacedTextSymbolIndex>=0&&(U.text.placedSymbolArray.get(ur.verticalPlacedTextSymbolIndex).hidden=Li||Gn?1:0);var to=ft.variableOffsets[ur.crossTileID];to&&ft.markUsedJustification(U,to.anchor,ur,la);var ls=ft.placedOrientations[ur.crossTileID];ls&&(ft.markUsedJustification(U,"left",ur,ls),ft.markUsedOrientation(U,ls,ur))}if(Dn){var ms=al(xn.icon),Ko=!(Ie&&ur.verticalPlacedIconSymbolIndex&&qn);if(ur.placedIconSymbolIndex>=0){var gs=Ko?ms:ii;He(U.icon,ur.numIconVertices,gs),U.icon.placedSymbolArray.get(ur.placedIconSymbolIndex).hidden=xn.icon.isHidden()}if(ur.verticalPlacedIconSymbolIndex>=0){var Pl=Ko?ii:ms;He(U.icon,ur.numVerticalIconVertices,Pl),U.icon.placedSymbolArray.get(ur.verticalPlacedIconSymbolIndex).hidden=xn.icon.isHidden()}}if(U.hasIconCollisionBoxData()||U.hasTextCollisionBoxData()){var mo=U.collisionArrays[Le];if(mo){var Xs=new t.Point(0,0);if(mo.textBox||mo.verticalTextBox){var tc=!0;if($t){var kc=ft.variableOffsets[On];kc?(Xs=vs(kc.anchor,kc.width,kc.height,kc.textOffset,kc.textBoxScale),he&&Xs._rotate(Ne?ft.transform.angle:-ft.transform.angle)):tc=!1}mo.textBox&&Da(U.textCollisionBox.collisionVertexArray,xn.text.placed,!tc||qn,Xs.x,Xs.y),mo.verticalTextBox&&Da(U.textCollisionBox.collisionVertexArray,xn.text.placed,!tc||Gn,Xs.x,Xs.y)}var lh=!!(!Gn&&mo.verticalIconBox);mo.iconBox&&Da(U.iconCollisionBox.collisionVertexArray,xn.icon.placed,lh,Ie?Xs.x:0,Ie?Xs.y:0),mo.verticalIconBox&&Da(U.iconCollisionBox.collisionVertexArray,xn.icon.placed,!lh,Ie?Xs.x:0,Ie?Xs.y:0)}}},Ae=0;Ae<U.symbolInstances.length;Ae++)Ge(Ae);if(U.sortFeatures(this.transform.angle),this.retainedQueryData[U.bucketInstanceId]&&(this.retainedQueryData[U.bucketInstanceId].featureSortOrder=U.featureSortOrder),U.hasTextData()&&U.text.opacityVertexBuffer&&U.text.opacityVertexBuffer.updateData(U.text.opacityVertexArray),U.hasIconData()&&U.icon.opacityVertexBuffer&&U.icon.opacityVertexBuffer.updateData(U.icon.opacityVertexArray),U.hasIconCollisionBoxData()&&U.iconCollisionBox.collisionVertexBuffer&&U.iconCollisionBox.collisionVertexBuffer.updateData(U.iconCollisionBox.collisionVertexArray),U.hasTextCollisionBoxData()&&U.textCollisionBox.collisionVertexBuffer&&U.textCollisionBox.collisionVertexBuffer.updateData(U.textCollisionBox.collisionVertexArray),U.bucketInstanceId in this.collisionCircleArrays){var Oe=this.collisionCircleArrays[U.bucketInstanceId];U.placementInvProjMatrix=Oe.invProjMatrix,U.placementViewportMatrix=Oe.viewportMatrix,U.collisionCircleArray=Oe.circles,delete this.collisionCircleArrays[U.bucketInstanceId]}},_o.prototype.symbolFadeChange=function(U){return this.fadeDuration===0?1:(U-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},_o.prototype.zoomAdjustment=function(U){return Math.max(0,(this.transform.zoom-U)/1.5)},_o.prototype.hasTransitions=function(U){return this.stale||U-this.lastPlacementChangeTime<this.fadeDuration},_o.prototype.stillRecent=function(U,tt){var Y=this.zoomAtLastRecencyCheck===tt?1-this.zoomAdjustment(tt):1;return this.zoomAtLastRecencyCheck=tt,this.commitTime+this.fadeDuration*Y>U},_o.prototype.setStale=function(){this.stale=!0};function Da(U,tt,Y,ft,zt){U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0),U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0),U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0),U.emplaceBack(tt?1:0,Y?1:0,ft||0,zt||0)}var li=Math.pow(2,25),wo=Math.pow(2,24),Ms=Math.pow(2,17),Di=Math.pow(2,16),_s=Math.pow(2,9),No=Math.pow(2,8),is=Math.pow(2,1);function al(U){if(U.opacity===0&&!U.placed)return 0;if(U.opacity===1&&U.placed)return 4294967295;var tt=U.placed?1:0,Y=Math.floor(U.opacity*127);return Y*li+tt*wo+Y*Ms+tt*Di+Y*_s+tt*No+Y*is+tt}var ii=0,io=function(U){this._sortAcrossTiles=U.layout.get("symbol-z-order")!=="viewport-y"&&U.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};io.prototype.continuePlacement=function(U,tt,Y,ft,zt){for(var Qt=this._bucketParts;this._currentTileIndex<U.length;){var ne=U[this._currentTileIndex];if(tt.getBucketParts(Qt,ft,ne,this._sortAcrossTiles),this._currentTileIndex++,zt())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,Qt.sort(function($t,he){return $t.sortKey-he.sortKey}));this._currentPartIndex<Qt.length;){var Ft=Qt[this._currentPartIndex];if(tt.placeLayerBucketPart(Ft,this._seenCrossTileIDs,Y),this._currentPartIndex++,zt())return!0}return!1};var co=function(U,tt,Y,ft,zt,Qt,ne){this.placement=new _o(U,zt,Qt,ne),this._currentPlacementIndex=tt.length-1,this._forceFullPlacement=Y,this._showCollisionBoxes=ft,this._done=!1};co.prototype.isDone=function(){return this._done},co.prototype.continuePlacement=function(U,tt,Y){for(var ft=this,zt=t.browser.now(),Qt=function(){var Ne=t.browser.now()-zt;return ft._forceFullPlacement?!1:Ne>2};this._currentPlacementIndex>=0;){var ne=U[this._currentPlacementIndex],Ft=tt[ne],$t=this.placement.collisionIndex.transform.zoom;if(Ft.type==="symbol"&&(!Ft.minzoom||Ft.minzoom<=$t)&&(!Ft.maxzoom||Ft.maxzoom>$t)){this._inProgressLayer||(this._inProgressLayer=new io(Ft));var he=this._inProgressLayer.continuePlacement(Y[Ft.source],this.placement,this._showCollisionBoxes,Ft,Qt);if(he)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},co.prototype.commit=function(U){return this.placement.commit(U),this.placement};var Is=512/t.EXTENT/2,Wo=function(U,tt,Y){this.tileID=U,this.indexedSymbolInstances={},this.bucketInstanceId=Y;for(var ft=0;ft<tt.length;ft++){var zt=tt.get(ft),Qt=zt.key;this.indexedSymbolInstances[Qt]||(this.indexedSymbolInstances[Qt]=[]),this.indexedSymbolInstances[Qt].push({crossTileID:zt.crossTileID,coord:this.getScaledCoordinates(zt,U)})}};Wo.prototype.getScaledCoordinates=function(U,tt){var Y=tt.canonical.z-this.tileID.canonical.z,ft=Is/Math.pow(2,Y);return{x:Math.floor((tt.canonical.x*t.EXTENT+U.anchorX)*ft),y:Math.floor((tt.canonical.y*t.EXTENT+U.anchorY)*ft)}},Wo.prototype.findMatches=function(U,tt,Y){for(var ft=this.tileID.canonical.z<tt.canonical.z?1:Math.pow(2,this.tileID.canonical.z-tt.canonical.z),zt=0;zt<U.length;zt++){var Qt=U.get(zt);if(!Qt.crossTileID){var ne=this.indexedSymbolInstances[Qt.key];if(ne)for(var Ft=this.getScaledCoordinates(Qt,tt),$t=0,he=ne;$t<he.length;$t+=1){var Ne=he[$t];if(Math.abs(Ne.coord.x-Ft.x)<=ft&&Math.abs(Ne.coord.y-Ft.y)<=ft&&!Y[Ne.crossTileID]){Y[Ne.crossTileID]=!0,Qt.crossTileID=Ne.crossTileID;break}}}}};var Bi=function(){this.maxCrossTileID=0};Bi.prototype.generate=function(){return++this.maxCrossTileID};var $s=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};$s.prototype.handleWrapJump=function(U){var tt=Math.round((U-this.lng)/360);if(tt!==0)for(var Y in this.indexes){var ft=this.indexes[Y],zt={};for(var Qt in ft){var ne=ft[Qt];ne.tileID=ne.tileID.unwrapTo(ne.tileID.wrap+tt),zt[ne.tileID.key]=ne}this.indexes[Y]=zt}this.lng=U},$s.prototype.addBucket=function(U,tt,Y){if(this.indexes[U.overscaledZ]&&this.indexes[U.overscaledZ][U.key]){if(this.indexes[U.overscaledZ][U.key].bucketInstanceId===tt.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(U.overscaledZ,this.indexes[U.overscaledZ][U.key])}for(var ft=0;ft<tt.symbolInstances.length;ft++){var zt=tt.symbolInstances.get(ft);zt.crossTileID=0}this.usedCrossTileIDs[U.overscaledZ]||(this.usedCrossTileIDs[U.overscaledZ]={});var Qt=this.usedCrossTileIDs[U.overscaledZ];for(var ne in this.indexes){var Ft=this.indexes[ne];if(Number(ne)>U.overscaledZ)for(var $t in Ft){var he=Ft[$t];he.tileID.isChildOf(U)&&he.findMatches(tt.symbolInstances,U,Qt)}else{var Ne=U.scaledTo(Number(ne)),Ie=Ft[Ne.key];Ie&&Ie.findMatches(tt.symbolInstances,U,Qt)}}for(var Fe=0;Fe<tt.symbolInstances.length;Fe++){var He=tt.symbolInstances.get(Fe);He.crossTileID||(He.crossTileID=Y.generate(),Qt[He.crossTileID]=!0)}return this.indexes[U.overscaledZ]===void 0&&(this.indexes[U.overscaledZ]={}),this.indexes[U.overscaledZ][U.key]=new Wo(U,tt.symbolInstances,tt.bucketInstanceId),!0},$s.prototype.removeBucketCrossTileIDs=function(U,tt){for(var Y in tt.indexedSymbolInstances)for(var ft=0,zt=tt.indexedSymbolInstances[Y];ft<zt.length;ft+=1){var Qt=zt[ft];delete this.usedCrossTileIDs[U][Qt.crossTileID]}},$s.prototype.removeStaleBuckets=function(U){var tt=!1;for(var Y in this.indexes){var ft=this.indexes[Y];for(var zt in ft)U[ft[zt].bucketInstanceId]||(this.removeBucketCrossTileIDs(Y,ft[zt]),delete ft[zt],tt=!0)}return tt};var fl=function(){this.layerIndexes={},this.crossTileIDs=new Bi,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};fl.prototype.addLayer=function(U,tt,Y){var ft=this.layerIndexes[U.id];ft===void 0&&(ft=this.layerIndexes[U.id]=new $s);var zt=!1,Qt={};ft.handleWrapJump(Y);for(var ne=0,Ft=tt;ne<Ft.length;ne+=1){var $t=Ft[ne],he=$t.getBucket(U);!he||U.id!==he.layerIds[0]||(he.bucketInstanceId||(he.bucketInstanceId=++this.maxBucketInstanceId),ft.addBucket($t.tileID,he,this.crossTileIDs)&&(zt=!0),Qt[he.bucketInstanceId]=!0)}return ft.removeStaleBuckets(Qt)&&(zt=!0),zt},fl.prototype.pruneUnusedLayers=function(U){var tt={};U.forEach(function(ft){tt[ft]=!0});for(var Y in this.layerIndexes)tt[Y]||delete this.layerIndexes[Y]};var Jo=function(U,tt){return t.emitValidationErrors(U,tt&&tt.filter(function(Y){return Y.identifier!=="source.canvas"}))},us=t.pick(Tr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ss=t.pick(Tr,["setCenter","setZoom","setBearing","setPitch"]),Ls=br(),yl=function(U){function tt(Y,ft){var zt=this;ft===void 0&&(ft={}),U.call(this),this.map=Y,this.dispatcher=new R(Fa(),this),this.imageManager=new x,this.imageManager.setEventedParent(this),this.glyphManager=new b(Y._requestManager,ft.localIdeographFontFamily),this.lineAtlas=new B(256,512),this.crossTileSymbolIndex=new fl,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 Qt=this;this._rtlTextPluginCallback=tt.registerForPluginStateChange(function(ne){var Ft={pluginStatus:ne.pluginStatus,pluginURL:ne.pluginURL};Qt.dispatcher.broadcast("syncRTLPluginState",Ft,function($t,he){if(t.triggerPluginCompletionEvent($t),he){var Ne=he.every(function(Fe){return Fe});if(Ne)for(var Ie in Qt.sourceCaches)Qt.sourceCaches[Ie].reload()}})}),this.on("data",function(ne){if(!(ne.dataType!=="source"||ne.sourceDataType!=="metadata")){var Ft=zt.sourceCaches[ne.sourceId];if(Ft){var $t=Ft.getSource();if(!(!$t||!$t.vectorLayerIds))for(var he in zt._layers){var Ne=zt._layers[he];Ne.source===$t.id&&zt._validateLayer(Ne)}}}})}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.loadURL=function(Y,ft){var zt=this;ft===void 0&&(ft={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var Qt=typeof ft.validate=="boolean"?ft.validate:!t.isMapboxURL(Y);Y=this.map._requestManager.normalizeStyleURL(Y,ft.accessToken);var ne=this.map._requestManager.transformRequest(Y,t.ResourceType.Style);this._request=t.getJSON(ne,function(Ft,$t){zt._request=null,Ft?zt.fire(new t.ErrorEvent(Ft)):$t&&zt._load($t,Qt)})},tt.prototype.loadJSON=function(Y,ft){var zt=this;ft===void 0&&(ft={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){zt._request=null,zt._load(Y,ft.validate!==!1)})},tt.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ls,!1)},tt.prototype._load=function(Y,ft){if(!(ft&&Jo(this,t.validateStyle(Y)))){this._loaded=!0,this.stylesheet=Y;for(var zt in Y.sources)this.addSource(zt,Y.sources[zt],{validate:!1});Y.sprite?this._loadSprite(Y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Y.glyphs);var Qt=dr(this.stylesheet.layers);this._order=Qt.map(function(he){return he.id}),this._layers={},this._serializedLayers={};for(var ne=0,Ft=Qt;ne<Ft.length;ne+=1){var $t=Ft[ne];$t=t.createStyleLayer($t),$t.setEventedParent(this,{layer:{id:$t.id}}),this._layers[$t.id]=$t,this._serializedLayers[$t.id]=$t.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new D(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},tt.prototype._loadSprite=function(Y){var ft=this;this._spriteRequest=m(Y,this.map._requestManager,function(zt,Qt){if(ft._spriteRequest=null,zt)ft.fire(new t.ErrorEvent(zt));else if(Qt)for(var ne in Qt)ft.imageManager.addImage(ne,Qt[ne]);ft.imageManager.setLoaded(!0),ft._availableImages=ft.imageManager.listImages(),ft.dispatcher.broadcast("setImages",ft._availableImages),ft.fire(new t.Event("data",{dataType:"style"}))})},tt.prototype._validateLayer=function(Y){var ft=this.sourceCaches[Y.source];if(ft){var zt=Y.sourceLayer;if(zt){var Qt=ft.getSource();(Qt.type==="geojson"||Qt.vectorLayerIds&&Qt.vectorLayerIds.indexOf(zt)===-1)&&this.fire(new t.ErrorEvent(new Error('Source layer "'+zt+'" does not exist on source "'+Qt.id+'" as specified by style layer "'+Y.id+'"')))}}},tt.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var Y in this.sourceCaches)if(!this.sourceCaches[Y].loaded())return!1;return!!this.imageManager.isLoaded()},tt.prototype._serializeLayers=function(Y){for(var ft=[],zt=0,Qt=Y;zt<Qt.length;zt+=1){var ne=Qt[zt],Ft=this._layers[ne];Ft.type!=="custom"&&ft.push(Ft.serialize())}return ft},tt.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var Y in this.sourceCaches)if(this.sourceCaches[Y].hasTransition())return!0;for(var ft in this._layers)if(this._layers[ft].hasTransition())return!0;return!1},tt.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},tt.prototype.update=function(Y){if(this._loaded){var ft=this._changed;if(this._changed){var zt=Object.keys(this._updatedLayers),Qt=Object.keys(this._removedLayers);(zt.length||Qt.length)&&this._updateWorkerLayers(zt,Qt);for(var ne in this._updatedSources){var Ft=this._updatedSources[ne];Ft==="reload"?this._reloadSource(ne):Ft==="clear"&&this._clearSource(ne)}this._updateTilesForChangedImages();for(var $t in this._updatedPaintProps)this._layers[$t].updateTransitions(Y);this.light.updateTransitions(Y),this._resetUpdates()}var he={};for(var Ne in this.sourceCaches){var Ie=this.sourceCaches[Ne];he[Ne]=Ie.used,Ie.used=!1}for(var Fe=0,He=this._order;Fe<He.length;Fe+=1){var Ge=He[Fe],Ae=this._layers[Ge];Ae.recalculate(Y,this._availableImages),!Ae.isHidden(Y.zoom)&&Ae.source&&(this.sourceCaches[Ae.source].used=!0)}for(var Oe in he){var Le=this.sourceCaches[Oe];he[Oe]!==Le.used&&Le.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Oe}))}this.light.recalculate(Y),this.z=Y.zoom,ft&&this.fire(new t.Event("data",{dataType:"style"}))}},tt.prototype._updateTilesForChangedImages=function(){var Y=Object.keys(this._changedImages);if(Y.length){for(var ft in this.sourceCaches)this.sourceCaches[ft].reloadTilesForDependencies(["icons","patterns"],Y);this._changedImages={}}},tt.prototype._updateWorkerLayers=function(Y,ft){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(Y),removedIds:ft})},tt.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},tt.prototype.setState=function(Y){var ft=this;if(this._checkLoaded(),Jo(this,t.validateStyle(Y)))return!1;Y=t.clone$1(Y),Y.layers=dr(Y.layers);var zt=wn(this.serialize(),Y).filter(function(ne){return!(ne.command in Ss)});if(zt.length===0)return!1;var Qt=zt.filter(function(ne){return!(ne.command in us)});if(Qt.length>0)throw new Error("Unimplemented: "+Qt.map(function(ne){return ne.command}).join(", ")+".");return zt.forEach(function(ne){ne.command!=="setTransition"&&ft[ne.command].apply(ft,ne.args)}),this.stylesheet=Y,!0},tt.prototype.addImage=function(Y,ft){if(this.getImage(Y))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(Y,ft),this._afterImageUpdated(Y)},tt.prototype.updateImage=function(Y,ft){this.imageManager.updateImage(Y,ft)},tt.prototype.getImage=function(Y){return this.imageManager.getImage(Y)},tt.prototype.removeImage=function(Y){if(!this.getImage(Y))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(Y),this._afterImageUpdated(Y)},tt.prototype._afterImageUpdated=function(Y){this._availableImages=this.imageManager.listImages(),this._changedImages[Y]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},tt.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},tt.prototype.addSource=function(Y,ft,zt){var Qt=this;if(zt===void 0&&(zt={}),this._checkLoaded(),this.sourceCaches[Y]!==void 0)throw new Error("There is already a source with this ID");if(!ft.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(ft).join(", ")+".");var ne=["vector","raster","geojson","video","image"],Ft=ne.indexOf(ft.type)>=0;if(!(Ft&&this._validate(t.validateStyle.source,"sources."+Y,ft,null,zt))){this.map&&this.map._collectResourceTiming&&(ft.collectResourceTiming=!0);var $t=this.sourceCaches[Y]=new Yr(Y,ft,this.dispatcher);$t.style=this,$t.setEventedParent(this,function(){return{isSourceLoaded:Qt.loaded(),source:$t.serialize(),sourceId:Y}}),$t.onAdd(this.map),this._changed=!0}},tt.prototype.removeSource=function(Y){if(this._checkLoaded(),this.sourceCaches[Y]===void 0)throw new Error("There is no source with this ID");for(var ft in this._layers)if(this._layers[ft].source===Y)return this.fire(new t.ErrorEvent(new Error('Source "'+Y+'" cannot be removed while layer "'+ft+'" is using it.')));var zt=this.sourceCaches[Y];delete this.sourceCaches[Y],delete this._updatedSources[Y],zt.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:Y})),zt.setEventedParent(null),zt.clearTiles(),zt.onRemove&&zt.onRemove(this.map),this._changed=!0},tt.prototype.setGeoJSONSourceData=function(Y,ft){this._checkLoaded();var zt=this.sourceCaches[Y].getSource();zt.setData(ft),this._changed=!0},tt.prototype.getSource=function(Y){return this.sourceCaches[Y]&&this.sourceCaches[Y].getSource()},tt.prototype.addLayer=function(Y,ft,zt){zt===void 0&&(zt={}),this._checkLoaded();var Qt=Y.id;if(this.getLayer(Qt)){this.fire(new t.ErrorEvent(new Error('Layer with id "'+Qt+'" already exists on this map')));return}var ne;if(Y.type==="custom"){if(Jo(this,t.validateCustomStyleLayer(Y)))return;ne=t.createStyleLayer(Y)}else{if(typeof Y.source=="object"&&(this.addSource(Qt,Y.source),Y=t.clone$1(Y),Y=t.extend(Y,{source:Qt})),this._validate(t.validateStyle.layer,"layers."+Qt,Y,{arrayIndex:-1},zt))return;ne=t.createStyleLayer(Y),this._validateLayer(ne),ne.setEventedParent(this,{layer:{id:Qt}}),this._serializedLayers[ne.id]=ne.serialize()}var Ft=ft?this._order.indexOf(ft):this._order.length;if(ft&&Ft===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+ft+'" does not exist on this map.')));return}if(this._order.splice(Ft,0,Qt),this._layerOrderChanged=!0,this._layers[Qt]=ne,this._removedLayers[Qt]&&ne.source&&ne.type!=="custom"){var $t=this._removedLayers[Qt];delete this._removedLayers[Qt],$t.type!==ne.type?this._updatedSources[ne.source]="clear":(this._updatedSources[ne.source]="reload",this.sourceCaches[ne.source].pause())}this._updateLayer(ne),ne.onAdd&&ne.onAdd(this.map)},tt.prototype.moveLayer=function(Y,ft){this._checkLoaded(),this._changed=!0;var zt=this._layers[Y];if(!zt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be moved.")));return}if(Y!==ft){var Qt=this._order.indexOf(Y);this._order.splice(Qt,1);var ne=ft?this._order.indexOf(ft):this._order.length;if(ft&&ne===-1){this.fire(new t.ErrorEvent(new Error('Layer with id "'+ft+'" does not exist on this map.')));return}this._order.splice(ne,0,Y),this._layerOrderChanged=!0}},tt.prototype.removeLayer=function(Y){this._checkLoaded();var ft=this._layers[Y];if(!ft){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be removed.")));return}ft.setEventedParent(null);var zt=this._order.indexOf(Y);this._order.splice(zt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[Y]=ft,delete this._layers[Y],delete this._serializedLayers[Y],delete this._updatedLayers[Y],delete this._updatedPaintProps[Y],ft.onRemove&&ft.onRemove(this.map)},tt.prototype.getLayer=function(Y){return this._layers[Y]},tt.prototype.hasLayer=function(Y){return Y in this._layers},tt.prototype.setLayerZoomRange=function(Y,ft,zt){this._checkLoaded();var Qt=this.getLayer(Y);if(!Qt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot have zoom extent.")));return}Qt.minzoom===ft&&Qt.maxzoom===zt||(ft!=null&&(Qt.minzoom=ft),zt!=null&&(Qt.maxzoom=zt),this._updateLayer(Qt))},tt.prototype.setFilter=function(Y,ft,zt){zt===void 0&&(zt={}),this._checkLoaded();var Qt=this.getLayer(Y);if(!Qt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be filtered.")));return}if(!t.deepEqual(Qt.filter,ft)){if(ft==null){Qt.filter=void 0,this._updateLayer(Qt);return}this._validate(t.validateStyle.filter,"layers."+Qt.id+".filter",ft,null,zt)||(Qt.filter=t.clone$1(ft),this._updateLayer(Qt))}},tt.prototype.getFilter=function(Y){return t.clone$1(this.getLayer(Y).filter)},tt.prototype.setLayoutProperty=function(Y,ft,zt,Qt){Qt===void 0&&(Qt={}),this._checkLoaded();var ne=this.getLayer(Y);if(!ne){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be styled.")));return}t.deepEqual(ne.getLayoutProperty(ft),zt)||(ne.setLayoutProperty(ft,zt,Qt),this._updateLayer(ne))},tt.prototype.getLayoutProperty=function(Y,ft){var zt=this.getLayer(Y);if(!zt){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style.")));return}return zt.getLayoutProperty(ft)},tt.prototype.setPaintProperty=function(Y,ft,zt,Qt){Qt===void 0&&(Qt={}),this._checkLoaded();var ne=this.getLayer(Y);if(!ne){this.fire(new t.ErrorEvent(new Error("The layer '"+Y+"' does not exist in the map's style and cannot be styled.")));return}if(!t.deepEqual(ne.getPaintProperty(ft),zt)){var Ft=ne.setPaintProperty(ft,zt,Qt);Ft&&this._updateLayer(ne),this._changed=!0,this._updatedPaintProps[Y]=!0}},tt.prototype.getPaintProperty=function(Y,ft){return this.getLayer(Y).getPaintProperty(ft)},tt.prototype.setFeatureState=function(Y,ft){this._checkLoaded();var zt=Y.source,Qt=Y.sourceLayer,ne=this.sourceCaches[zt];if(ne===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+zt+"' does not exist in the map's style.")));return}var Ft=ne.getSource().type;if(Ft==="geojson"&&Qt){this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Ft==="vector"&&!Qt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}Y.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),ne.setFeatureState(Qt,Y.id,ft)},tt.prototype.removeFeatureState=function(Y,ft){this._checkLoaded();var zt=Y.source,Qt=this.sourceCaches[zt];if(Qt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+zt+"' does not exist in the map's style.")));return}var ne=Qt.getSource().type,Ft=ne==="vector"?Y.sourceLayer:void 0;if(ne==="vector"&&!Ft){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(ft&&typeof Y.id!="string"&&typeof Y.id!="number"){this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Qt.removeFeatureState(Ft,Y.id,ft)},tt.prototype.getFeatureState=function(Y){this._checkLoaded();var ft=Y.source,zt=Y.sourceLayer,Qt=this.sourceCaches[ft];if(Qt===void 0){this.fire(new t.ErrorEvent(new Error("The source '"+ft+"' does not exist in the map's style.")));return}var ne=Qt.getSource().type;if(ne==="vector"&&!zt){this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return Y.id===void 0&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),Qt.getFeatureState(zt,Y.id)},tt.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},tt.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(Y){return Y.serialize()}),layers:this._serializeLayers(this._order)},function(Y){return Y!==void 0})},tt.prototype._updateLayer=function(Y){this._updatedLayers[Y.id]=!0,Y.source&&!this._updatedSources[Y.source]&&this.sourceCaches[Y.source].getSource().type!=="raster"&&(this._updatedSources[Y.source]="reload",this.sourceCaches[Y.source].pause()),this._changed=!0},tt.prototype._flattenAndSortRenderedFeatures=function(Y){for(var ft=this,zt=function(Gn){return ft._layers[Gn].type==="fill-extrusion"},Qt={},ne=[],Ft=this._order.length-1;Ft>=0;Ft--){var $t=this._order[Ft];if(zt($t)){Qt[$t]=Ft;for(var he=0,Ne=Y;he<Ne.length;he+=1){var Ie=Ne[he],Fe=Ie[$t];if(Fe)for(var He=0,Ge=Fe;He<Ge.length;He+=1){var Ae=Ge[He];ne.push(Ae)}}}}ne.sort(function(Gn,ma){return ma.intersectionZ-Gn.intersectionZ});for(var Oe=[],Le=this._order.length-1;Le>=0;Le--){var ur=this._order[Le];if(zt(ur))for(var Dr=ne.length-1;Dr>=0;Dr--){var jr=ne[Dr].feature;if(Qt[jr.layer.id]<Le)break;Oe.push(jr),ne.pop()}else for(var On=0,Ln=Y;On<Ln.length;On+=1){var xn=Ln[On],Wn=xn[ur];if(Wn)for(var Dn=0,la=Wn;Dn<la.length;Dn+=1){var qn=la[Dn];Oe.push(qn.feature)}}}return Oe},tt.prototype.queryRenderedFeatures=function(Y,ft,zt){ft&&ft.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",ft.filter,null,ft);var Qt={};if(ft&&ft.layers){if(!Array.isArray(ft.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var ne=0,Ft=ft.layers;ne<Ft.length;ne+=1){var $t=Ft[ne],he=this._layers[$t];if(!he)return this.fire(new t.ErrorEvent(new Error("The layer '"+$t+"' does not exist in the map's style and cannot be queried for features."))),[];Qt[he.source]=!0}}var Ne=[];ft.availableImages=this._availableImages;for(var Ie in this.sourceCaches)ft.layers&&!Qt[Ie]||Ne.push(nt(this.sourceCaches[Ie],this._layers,this._serializedLayers,Y,ft,zt));return this.placement&&Ne.push(dt(this._layers,this._serializedLayers,this.sourceCaches,Y,ft,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ne)},tt.prototype.querySourceFeatures=function(Y,ft){ft&&ft.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",ft.filter,null,ft);var zt=this.sourceCaches[Y];return zt?Tt(zt,ft):[]},tt.prototype.addSourceType=function(Y,ft,zt){if(tt.getSourceType(Y))return zt(new Error('A source type called "'+Y+'" already exists.'));if(tt.setSourceType(Y,ft),!ft.workerSourceURL)return zt(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:Y,url:ft.workerSourceURL},zt)},tt.prototype.getLight=function(){return this.light.getLight()},tt.prototype.setLight=function(Y,ft){ft===void 0&&(ft={}),this._checkLoaded();var zt=this.light.getLight(),Qt=!1;for(var ne in Y)if(!t.deepEqual(Y[ne],zt[ne])){Qt=!0;break}if(Qt){var Ft={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(Y,ft),this.light.updateTransitions(Ft)}},tt.prototype._validate=function(Y,ft,zt,Qt,ne){return ne===void 0&&(ne={}),ne&&ne.validate===!1?!1:Jo(this,Y.call(t.validateStyle,t.extend({key:ft,style:this.serialize(),value:zt,styleSpec:t.styleSpec},Qt)))},tt.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 Y in this._layers){var ft=this._layers[Y];ft.setEventedParent(null)}for(var zt in this.sourceCaches)this.sourceCaches[zt].clearTiles(),this.sourceCaches[zt].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},tt.prototype._clearSource=function(Y){this.sourceCaches[Y].clearTiles()},tt.prototype._reloadSource=function(Y){this.sourceCaches[Y].resume(),this.sourceCaches[Y].reload()},tt.prototype._updateSources=function(Y){for(var ft in this.sourceCaches)this.sourceCaches[ft].update(Y)},tt.prototype._generateCollisionBoxes=function(){for(var Y in this.sourceCaches)this._reloadSource(Y)},tt.prototype._updatePlacement=function(Y,ft,zt,Qt,ne){ne===void 0&&(ne=!1);for(var Ft=!1,$t=!1,he={},Ne=0,Ie=this._order;Ne<Ie.length;Ne+=1){var Fe=Ie[Ne],He=this._layers[Fe];if(He.type==="symbol"){if(!he[He.source]){var Ge=this.sourceCaches[He.source];he[He.source]=Ge.getRenderableIds(!0).map(function(On){return Ge.getTileByID(On)}).sort(function(On,Ln){return Ln.tileID.overscaledZ-On.tileID.overscaledZ||(On.tileID.isLessThan(Ln.tileID)?-1:1)})}var Ae=this.crossTileSymbolIndex.addLayer(He,he[He.source],Y.center.lng);Ft=Ft||Ae}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),ne=ne||this._layerOrderChanged||zt===0,(ne||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),Y.zoom))&&(this.pauseablePlacement=new co(Y,this._order,ne,ft,zt,Qt,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,he),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),$t=!0),Ft&&this.pauseablePlacement.placement.setStale()),$t||Ft)for(var Oe=0,Le=this._order;Oe<Le.length;Oe+=1){var ur=Le[Oe],Dr=this._layers[ur];Dr.type==="symbol"&&this.placement.updateLayerOpacities(Dr,he[Dr.source])}var jr=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now());return jr},tt.prototype._releaseSymbolFadeTiles=function(){for(var Y in this.sourceCaches)this.sourceCaches[Y].releaseSymbolFadeTiles()},tt.prototype.getImages=function(Y,ft,zt){this.imageManager.getImages(ft.icons,zt),this._updateTilesForChangedImages();var Qt=this.sourceCaches[ft.source];Qt&&Qt.setDependencies(ft.tileID.key,ft.type,ft.icons)},tt.prototype.getGlyphs=function(Y,ft,zt){this.glyphManager.getGlyphs(ft.stacks,zt)},tt.prototype.getResource=function(Y,ft,zt){return t.makeRequest(ft,zt)},tt}(t.Evented);yl.getSourceType=ut,yl.setSourceType=J,yl.registerForPluginStateChange=t.registerForPluginStateChange;var bu=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),au=`#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;}`,Ec=`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
}`,xc="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",cs=`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
}`,Gl="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);}",zc=`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
}`,Al=`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);}`,xl="void main() {gl_FragColor=vec4(1.0);}",Ml="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",hu=`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
}`,Fs=`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;}`,_l=`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
}`,Fo="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;}",bs="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;}}",Iu="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;}",Nl="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;}",Hu="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);}",qs="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);}",of="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);}",Oo=`#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
}`,vf=`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);}`,os=`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
}`,Fi=`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;}`,nc=`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
}`,pu=`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;}`,ml=`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
}`,Lc=`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);}`,qu=`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;}`,bl=`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
}`,Yc=`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;}`,Fc=`#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
}`,mc="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;}",Wu=`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;}",Ic=`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
}`,du=`
#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);}`,Bc=`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
}`,Pu=`
#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);}`,wu=`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
}`,wl=`
#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;}`,Ju=`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
}`,Pc=`
#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);}`,Es=`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
}`,_c="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;}",sf=`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
}`,Rc=`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));}`,gc=`#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
}`,Nc=`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);}`,Zl=`#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
}`,jc=`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);}`,rl=Vs(au,fu),Kl=Vs(Ec,xc),Gu=Vs(cs,Gl),Bs=Vs(zc,Al),Ou=Vs(xl,Ml),Rl=Vs(hu,Fs),Yl=Vs(_l,Fo),Ws=Vs(bs,Iu),ac=Vs(Nl,Hu),Tu=Vs(qs,of),Zu=Vs(Oo,vf),bc=Vs(os,Fi),lf=Vs(nc,pu),Mf=Vs(ml,Lc),ic=Vs(qu,dc),wc=Vs(bl,Yc),Fl=Vs(Fc,mc),oc=Vs(Wu,Cc),iu=Vs(Ic,du),sc=Vs(Bc,Pu),Tc=Vs(wu,wl),ku=Vs(Ju,Pc),Gs=Vs(Es,_c),Du=Vs(sf,Rc),Xl=Vs(gc,Nc),Xc=Vs(Zl,jc);function Vs(U,tt){var Y=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,ft=tt.match(/attribute ([\w]+) ([\w]+)/g),zt=U.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Qt=tt.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ne=Qt?Qt.concat(zt):zt,Ft={};return U=U.replace(Y,function($t,he,Ne,Ie,Fe){return Ft[Fe]=!0,he==="define"?`
#ifndef HAS_UNIFORM_u_`+Fe+`
varying `+Ne+" "+Ie+" "+Fe+`;
#else
uniform `+Ne+" "+Ie+" u_"+Fe+`;
#endif
`:`
#ifdef HAS_UNIFORM_u_`+Fe+`
`+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`;
#endif
`}),tt=tt.replace(Y,function($t,he,Ne,Ie,Fe){var He=Ie==="float"?"vec2":"vec4",Ge=Fe.match(/color/)?"color":He;return Ft[Fe]?he==="define"?`
#ifndef HAS_UNIFORM_u_`+Fe+`
uniform lowp float u_`+Fe+`_t;
attribute `+Ne+" "+He+" a_"+Fe+`;
varying `+Ne+" "+Ie+" "+Fe+`;
#else
uniform `+Ne+" "+Ie+" u_"+Fe+`;
#endif
`:Ge==="vec4"?`
#ifndef HAS_UNIFORM_u_`+Fe+`
`+Fe+" = a_"+Fe+`;
#else
`+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+Fe+`
`+Fe+" = unpack_mix_"+Ge+"(a_"+Fe+", u_"+Fe+`_t);
#else
`+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`;
#endif
`:he==="define"?`
#ifndef HAS_UNIFORM_u_`+Fe+`
uniform lowp float u_`+Fe+`_t;
attribute `+Ne+" "+He+" a_"+Fe+`;
#else
uniform `+Ne+" "+Ie+" u_"+Fe+`;
#endif
`:Ge==="vec4"?`
#ifndef HAS_UNIFORM_u_`+Fe+`
`+Ne+" "+Ie+" "+Fe+" = a_"+Fe+`;
#else
`+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`;
#endif
`:`
#ifndef HAS_UNIFORM_u_`+Fe+`
`+Ne+" "+Ie+" "+Fe+" = unpack_mix_"+Ge+"(a_"+Fe+", u_"+Fe+`_t);
#else
`+Ne+" "+Ie+" "+Fe+" = u_"+Fe+`;
#endif
`}),{fragmentSource:U,vertexSource:tt,staticAttributes:ft,staticUniforms:ne}}var vc=Object.freeze({__proto__:null,prelude:rl,background:Kl,backgroundPattern:Gu,circle:Bs,clippingMask:Ou,heatmap:Rl,heatmapTexture:Yl,collisionBox:Ws,collisionCircle:ac,debug:Tu,fill:Zu,fillOutline:bc,fillOutlinePattern:lf,fillPattern:Mf,fillExtrusion:ic,fillExtrusionPattern:wc,hillshadePrepare:Fl,hillshade:oc,line:iu,lineGradient:sc,linePattern:Tc,lineSDF:ku,raster:Gs,symbolIcon:Du,symbolSDF:Xl,symbolTextAndIcon:Xc}),Ku=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Ku.prototype.bind=function(U,tt,Y,ft,zt,Qt,ne,Ft){this.context=U;for(var $t=this.boundPaintVertexBuffers.length!==ft.length,he=0;!$t&&he<ft.length;he++)this.boundPaintVertexBuffers[he]!==ft[he]&&($t=!0);var Ne=!this.vao||this.boundProgram!==tt||this.boundLayoutVertexBuffer!==Y||$t||this.boundIndexBuffer!==zt||this.boundVertexOffset!==Qt||this.boundDynamicVertexBuffer!==ne||this.boundDynamicVertexBuffer2!==Ft;!U.extVertexArrayObject||Ne?this.freshBind(tt,Y,ft,zt,Qt,ne,Ft):(U.bindVertexArrayOES.set(this.vao),ne&&ne.bind(),zt&&zt.dynamicDraw&&zt.bind(),Ft&&Ft.bind())},Ku.prototype.freshBind=function(U,tt,Y,ft,zt,Qt,ne){var Ft,$t=U.numAttributes,he=this.context,Ne=he.gl;if(he.extVertexArrayObject)this.vao&&this.destroy(),this.vao=he.extVertexArrayObject.createVertexArrayOES(),he.bindVertexArrayOES.set(this.vao),Ft=0,this.boundProgram=U,this.boundLayoutVertexBuffer=tt,this.boundPaintVertexBuffers=Y,this.boundIndexBuffer=ft,this.boundVertexOffset=zt,this.boundDynamicVertexBuffer=Qt,this.boundDynamicVertexBuffer2=ne;else{Ft=he.currentNumAttributes||0;for(var Ie=$t;Ie<Ft;Ie++)Ne.disableVertexAttribArray(Ie)}tt.enableAttributes(Ne,U);for(var Fe=0,He=Y;Fe<He.length;Fe+=1){var Ge=He[Fe];Ge.enableAttributes(Ne,U)}Qt&&Qt.enableAttributes(Ne,U),ne&&ne.enableAttributes(Ne,U),tt.bind(),tt.setVertexAttribPointers(Ne,U,zt);for(var Ae=0,Oe=Y;Ae<Oe.length;Ae+=1){var Le=Oe[Ae];Le.bind(),Le.setVertexAttribPointers(Ne,U,zt)}Qt&&(Qt.bind(),Qt.setVertexAttribPointers(Ne,U,zt)),ft&&ft.bind(),ne&&(ne.bind(),ne.setVertexAttribPointers(Ne,U,zt)),he.currentNumAttributes=$t},Ku.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function ou(U){for(var tt=[],Y=0;Y<U.length;Y++)if(U[Y]!==null){var ft=U[Y].split(" ");tt.push(ft.pop())}return tt}var Qu=function(U,tt,Y,ft,zt,Qt){var ne=U.gl;this.program=ne.createProgram();for(var Ft=ou(Y.staticAttributes),$t=ft?ft.getBinderAttributes():[],he=Ft.concat($t),Ne=Y.staticUniforms?ou(Y.staticUniforms):[],Ie=ft?ft.getBinderUniforms():[],Fe=Ne.concat(Ie),He=[],Ge=0,Ae=Fe;Ge<Ae.length;Ge+=1){var Oe=Ae[Ge];He.indexOf(Oe)<0&&He.push(Oe)}var Le=ft?ft.defines():[];Qt&&Le.push("#define OVERDRAW_INSPECTOR;");var ur=Le.concat(rl.fragmentSource,Y.fragmentSource).join(`
`),Dr=Le.concat(rl.vertexSource,Y.vertexSource).join(`
`),jr=ne.createShader(ne.FRAGMENT_SHADER);if(ne.isContextLost()){this.failedToCreate=!0;return}ne.shaderSource(jr,ur),ne.compileShader(jr),ne.attachShader(this.program,jr);var On=ne.createShader(ne.VERTEX_SHADER);if(ne.isContextLost()){this.failedToCreate=!0;return}ne.shaderSource(On,Dr),ne.compileShader(On),ne.attachShader(this.program,On),this.attributes={};var Ln={};this.numAttributes=he.length;for(var xn=0;xn<this.numAttributes;xn++)he[xn]&&(ne.bindAttribLocation(this.program,xn,he[xn]),this.attributes[he[xn]]=xn);ne.linkProgram(this.program),ne.deleteShader(On),ne.deleteShader(jr);for(var Wn=0;Wn<He.length;Wn++){var Dn=He[Wn];if(Dn&&!Ln[Dn]){var la=ne.getUniformLocation(this.program,Dn);la&&(Ln[Dn]=la)}}this.fixedUniforms=zt(U,Ln),this.binderUniforms=ft?ft.getUniforms(U,Ln):[]};Qu.prototype.draw=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie,Fe,He,Ge,Ae){var Oe,Le=U.gl;if(!this.failedToCreate){U.program.set(this.program),U.setDepthMode(Y),U.setStencilMode(ft),U.setColorMode(zt),U.setCullFace(Qt);for(var ur in this.fixedUniforms)this.fixedUniforms[ur].set(ne[ur]);He&&He.setUniforms(U,this.binderUniforms,Ie,{zoom:Fe});for(var Dr=(Oe={},Oe[Le.LINES]=2,Oe[Le.TRIANGLES]=3,Oe[Le.LINE_STRIP]=1,Oe)[tt],jr=0,On=Ne.get();jr<On.length;jr+=1){var Ln=On[jr],xn=Ln.vaos||(Ln.vaos={}),Wn=xn[Ft]||(xn[Ft]=new Ku);Wn.bind(U,this,$t,He?He.getPaintVertexBuffers():[],he,Ln.vertexOffset,Ge,Ae),Le.drawElements(tt,Ln.primitiveLength*Dr,Le.UNSIGNED_SHORT,Ln.primitiveOffset*Dr*2)}}};function Yu(U,tt,Y){var ft=1/Po(Y,1,tt.transform.tileZoom),zt=Math.pow(2,Y.tileID.overscaledZ),Qt=Y.tileSize*Math.pow(2,tt.transform.tileZoom)/zt,ne=Qt*(Y.tileID.canonical.x+Y.tileID.wrap*zt),Ft=Qt*Y.tileID.canonical.y;return{u_image:0,u_texsize:Y.imageAtlasTexture.size,u_scale:[ft,U.fromScale,U.toScale],u_fade:U.t,u_pixel_coord_upper:[ne>>16,Ft>>16],u_pixel_coord_lower:[ne&65535,Ft&65535]}}function yc(U,tt,Y,ft){var zt=Y.imageManager.getPattern(U.from.toString()),Qt=Y.imageManager.getPattern(U.to.toString()),ne=Y.imageManager.getPixelSize(),Ft=ne.width,$t=ne.height,he=Math.pow(2,ft.tileID.overscaledZ),Ne=ft.tileSize*Math.pow(2,Y.transform.tileZoom)/he,Ie=Ne*(ft.tileID.canonical.x+ft.tileID.wrap*he),Fe=Ne*ft.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:zt.tl,u_pattern_br_a:zt.br,u_pattern_tl_b:Qt.tl,u_pattern_br_b:Qt.br,u_texsize:[Ft,$t],u_mix:tt.t,u_pattern_size_a:zt.displaySize,u_pattern_size_b:Qt.displaySize,u_scale_a:tt.fromScale,u_scale_b:tt.toScale,u_tile_units_to_pixels:1/Po(ft,1,Y.transform.tileZoom),u_pixel_coord_upper:[Ie>>16,Fe>>16],u_pixel_coord_lower:[Ie&65535,Fe&65535]}}var uf=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_lightpos:new t.Uniform3f(U,tt.u_lightpos),u_lightintensity:new t.Uniform1f(U,tt.u_lightintensity),u_lightcolor:new t.Uniform3f(U,tt.u_lightcolor),u_vertical_gradient:new t.Uniform1f(U,tt.u_vertical_gradient),u_opacity:new t.Uniform1f(U,tt.u_opacity)}},zl=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_lightpos:new t.Uniform3f(U,tt.u_lightpos),u_lightintensity:new t.Uniform1f(U,tt.u_lightintensity),u_lightcolor:new t.Uniform3f(U,tt.u_lightcolor),u_vertical_gradient:new t.Uniform1f(U,tt.u_vertical_gradient),u_height_factor:new t.Uniform1f(U,tt.u_height_factor),u_image:new t.Uniform1i(U,tt.u_image),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade),u_opacity:new t.Uniform1f(U,tt.u_opacity)}},Uc=function(U,tt,Y,ft){var zt=tt.style.light,Qt=zt.properties.get("position"),ne=[Qt.x,Qt.y,Qt.z],Ft=t.create$1();zt.properties.get("anchor")==="viewport"&&t.fromRotation(Ft,-tt.transform.angle),t.transformMat3(ne,ne,Ft);var $t=zt.properties.get("color");return{u_matrix:U,u_lightpos:ne,u_lightintensity:zt.properties.get("intensity"),u_lightcolor:[$t.r,$t.g,$t.b],u_vertical_gradient:+Y,u_opacity:ft}},su=function(U,tt,Y,ft,zt,Qt,ne){return t.extend(Uc(U,tt,Y,ft),Yu(Qt,tt,ne),{u_height_factor:-Math.pow(2,zt.overscaledZ)/ne.tileSize/8})},Fu=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},Au=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_image:new t.Uniform1i(U,tt.u_image),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade)}},il=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_world:new t.Uniform2f(U,tt.u_world)}},Cs=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_world:new t.Uniform2f(U,tt.u_world),u_image:new t.Uniform1i(U,tt.u_image),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade)}},Mu=function(U){return{u_matrix:U}},lc=function(U,tt,Y,ft){return t.extend(Mu(U),Yu(Y,tt,ft))},Su=function(U,tt){return{u_matrix:U,u_world:tt}},Oc=function(U,tt,Y,ft,zt){return t.extend(lc(U,tt,Y,ft),{u_world:zt})},Xe=function(U,tt){return{u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(U,tt.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(U,tt.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},yr=function(U,tt,Y,ft){var zt=U.transform,Qt,ne;if(ft.paint.get("circle-pitch-alignment")==="map"){var Ft=Po(Y,1,zt.zoom);Qt=!0,ne=[Ft,Ft]}else Qt=!1,ne=zt.pixelsToGLUnits;return{u_camera_to_center_distance:zt.cameraToCenterDistance,u_scale_with_map:+(ft.paint.get("circle-pitch-scale")==="map"),u_matrix:U.translatePosMatrix(tt.posMatrix,Y,ft.paint.get("circle-translate"),ft.paint.get("circle-translate-anchor")),u_pitch_with_map:+Qt,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:ne}},Kr=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(U,tt.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(U,tt.u_extrude_scale),u_overscale_factor:new t.Uniform1f(U,tt.u_overscale_factor)}},Rr=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_inv_matrix:new t.UniformMatrix4f(U,tt.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(U,tt.u_viewport_size)}},mn=function(U,tt,Y){var ft=Po(Y,1,tt.zoom),zt=Math.pow(2,tt.zoom-Y.tileID.overscaledZ),Qt=Y.tileID.overscaleFactor();return{u_matrix:U,u_camera_to_center_distance:tt.cameraToCenterDistance,u_pixels_to_tile_units:ft,u_extrude_scale:[tt.pixelsToGLUnits[0]/(ft*zt),tt.pixelsToGLUnits[1]/(ft*zt)],u_overscale_factor:Qt}},Pn=function(U,tt,Y){return{u_matrix:U,u_inv_matrix:tt,u_camera_to_center_distance:Y.cameraToCenterDistance,u_viewport_size:[Y.width,Y.height]}},ha=function(U,tt){return{u_color:new t.UniformColor(U,tt.u_color),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_overlay:new t.Uniform1i(U,tt.u_overlay),u_overlay_scale:new t.Uniform1f(U,tt.u_overlay_scale)}},Ta=function(U,tt,Y){return Y===void 0&&(Y=1),{u_matrix:U,u_color:tt,u_overlay:0,u_overlay_scale:Y}},Ua=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},Ya=function(U){return{u_matrix:U}},va=function(U,tt){return{u_extrude_scale:new t.Uniform1f(U,tt.u_extrude_scale),u_intensity:new t.Uniform1f(U,tt.u_intensity),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix)}},Ba=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_world:new t.Uniform2f(U,tt.u_world),u_image:new t.Uniform1i(U,tt.u_image),u_color_ramp:new t.Uniform1i(U,tt.u_color_ramp),u_opacity:new t.Uniform1f(U,tt.u_opacity)}},za=function(U,tt,Y,ft){return{u_matrix:U,u_extrude_scale:Po(tt,1,Y),u_intensity:ft}},ca=function(U,tt,Y,ft){var zt=t.create();t.ortho(zt,0,U.width,U.height,0,0,1);var Qt=U.context.gl;return{u_matrix:zt,u_world:[Qt.drawingBufferWidth,Qt.drawingBufferHeight],u_image:Y,u_color_ramp:ft,u_opacity:tt.paint.get("heatmap-opacity")}},ei=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_image:new t.Uniform1i(U,tt.u_image),u_latrange:new t.Uniform2f(U,tt.u_latrange),u_light:new t.Uniform2f(U,tt.u_light),u_shadow:new t.UniformColor(U,tt.u_shadow),u_highlight:new t.UniformColor(U,tt.u_highlight),u_accent:new t.UniformColor(U,tt.u_accent)}},Vi=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_image:new t.Uniform1i(U,tt.u_image),u_dimension:new t.Uniform2f(U,tt.u_dimension),u_zoom:new t.Uniform1f(U,tt.u_zoom),u_unpack:new t.Uniform4f(U,tt.u_unpack)}},Oi=function(U,tt,Y){var ft=Y.paint.get("hillshade-shadow-color"),zt=Y.paint.get("hillshade-highlight-color"),Qt=Y.paint.get("hillshade-accent-color"),ne=Y.paint.get("hillshade-illumination-direction")*(Math.PI/180);Y.paint.get("hillshade-illumination-anchor")==="viewport"&&(ne-=U.transform.angle);var Ft=!U.options.moving;return{u_matrix:U.transform.calculatePosMatrix(tt.tileID.toUnwrapped(),Ft),u_image:0,u_latrange:Xi(U,tt.tileID),u_light:[Y.paint.get("hillshade-exaggeration"),ne],u_shadow:ft,u_highlight:zt,u_accent:Qt}},Wi=function(U,tt){var Y=tt.stride,ft=t.create();return t.ortho(ft,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(ft,ft,[0,-t.EXTENT,0]),{u_matrix:ft,u_image:1,u_dimension:[Y,Y],u_zoom:U.overscaledZ,u_unpack:tt.getUnpackVector()}};function Xi(U,tt){var Y=Math.pow(2,tt.canonical.z),ft=tt.canonical.y;return[new t.MercatorCoordinate(0,ft/Y).toLngLat().lat,new t.MercatorCoordinate(0,(ft+1)/Y).toLngLat().lat]}var ni=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels)}},Za=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels),u_image:new t.Uniform1i(U,tt.u_image),u_image_height:new t.Uniform1f(U,tt.u_image_height)}},$i=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_image:new t.Uniform1i(U,tt.u_image),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels),u_scale:new t.Uniform3f(U,tt.u_scale),u_fade:new t.Uniform1f(U,tt.u_fade)}},Do=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_ratio:new t.Uniform1f(U,tt.u_ratio),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(U,tt.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(U,tt.u_patternscale_a),u_patternscale_b:new t.Uniform2f(U,tt.u_patternscale_b),u_sdfgamma:new t.Uniform1f(U,tt.u_sdfgamma),u_image:new t.Uniform1i(U,tt.u_image),u_tex_y_a:new t.Uniform1f(U,tt.u_tex_y_a),u_tex_y_b:new t.Uniform1f(U,tt.u_tex_y_b),u_mix:new t.Uniform1f(U,tt.u_mix)}},ss=function(U,tt,Y){var ft=U.transform;return{u_matrix:ll(U,tt,Y),u_ratio:1/Po(tt,1,ft.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/ft.pixelsToGLUnits[0],1/ft.pixelsToGLUnits[1]]}},Ps=function(U,tt,Y,ft){return t.extend(ss(U,tt,Y),{u_image:0,u_image_height:ft})},ys=function(U,tt,Y,ft){var zt=U.transform,Qt=Yo(tt,zt);return{u_matrix:ll(U,tt,Y),u_texsize:tt.imageAtlasTexture.size,u_ratio:1/Po(tt,1,zt.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[Qt,ft.fromScale,ft.toScale],u_fade:ft.t,u_units_to_pixels:[1/zt.pixelsToGLUnits[0],1/zt.pixelsToGLUnits[1]]}},Os=function(U,tt,Y,ft,zt){var Qt=U.transform,ne=U.lineAtlas,Ft=Yo(tt,Qt),$t=Y.layout.get("line-cap")==="round",he=ne.getDash(ft.from,$t),Ne=ne.getDash(ft.to,$t),Ie=he.width*zt.fromScale,Fe=Ne.width*zt.toScale;return t.extend(ss(U,tt,Y),{u_patternscale_a:[Ft/Ie,-he.height/2],u_patternscale_b:[Ft/Fe,-Ne.height/2],u_sdfgamma:ne.width/(Math.min(Ie,Fe)*256*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:he.y,u_tex_y_b:Ne.y,u_mix:zt.t})};function Yo(U,tt){return 1/Po(U,1,tt.tileZoom)}function ll(U,tt,Y){return U.translatePosMatrix(tt.tileID.posMatrix,tt,Y.paint.get("line-translate"),Y.paint.get("line-translate-anchor"))}var el=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_tl_parent:new t.Uniform2f(U,tt.u_tl_parent),u_scale_parent:new t.Uniform1f(U,tt.u_scale_parent),u_buffer_scale:new t.Uniform1f(U,tt.u_buffer_scale),u_fade_t:new t.Uniform1f(U,tt.u_fade_t),u_opacity:new t.Uniform1f(U,tt.u_opacity),u_image0:new t.Uniform1i(U,tt.u_image0),u_image1:new t.Uniform1i(U,tt.u_image1),u_brightness_low:new t.Uniform1f(U,tt.u_brightness_low),u_brightness_high:new t.Uniform1f(U,tt.u_brightness_high),u_saturation_factor:new t.Uniform1f(U,tt.u_saturation_factor),u_contrast_factor:new t.Uniform1f(U,tt.u_contrast_factor),u_spin_weights:new t.Uniform3f(U,tt.u_spin_weights)}},Rs=function(U,tt,Y,ft,zt){return{u_matrix:U,u_tl_parent:tt,u_scale_parent:Y,u_buffer_scale:1,u_fade_t:ft.mix,u_opacity:ft.opacity*zt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:zt.paint.get("raster-brightness-min"),u_brightness_high:zt.paint.get("raster-brightness-max"),u_saturation_factor:ws(zt.paint.get("raster-saturation")),u_contrast_factor:so(zt.paint.get("raster-contrast")),u_spin_weights:bi(zt.paint.get("raster-hue-rotate"))}};function bi(U){U*=Math.PI/180;var tt=Math.sin(U),Y=Math.cos(U);return[(2*Y+1)/3,(-Math.sqrt(3)*tt-Y+1)/3,(Math.sqrt(3)*tt-Y+1)/3]}function so(U){return U>0?1/(1-U):1+U}function ws(U){return U>0?1-1/(1.001-U):-U}var fs=function(U,tt){return{u_is_size_zoom_constant:new t.Uniform1i(U,tt.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(U,tt.u_is_size_feature_constant),u_size_t:new t.Uniform1f(U,tt.u_size_t),u_size:new t.Uniform1f(U,tt.u_size),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pitch:new t.Uniform1f(U,tt.u_pitch),u_rotate_symbol:new t.Uniform1i(U,tt.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(U,tt.u_aspect_ratio),u_fade_change:new t.Uniform1f(U,tt.u_fade_change),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(U,tt.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(U,tt.u_coord_matrix),u_is_text:new t.Uniform1i(U,tt.u_is_text),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_texture:new t.Uniform1i(U,tt.u_texture)}},Ll=function(U,tt){return{u_is_size_zoom_constant:new t.Uniform1i(U,tt.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(U,tt.u_is_size_feature_constant),u_size_t:new t.Uniform1f(U,tt.u_size_t),u_size:new t.Uniform1f(U,tt.u_size),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pitch:new t.Uniform1f(U,tt.u_pitch),u_rotate_symbol:new t.Uniform1i(U,tt.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(U,tt.u_aspect_ratio),u_fade_change:new t.Uniform1f(U,tt.u_fade_change),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(U,tt.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(U,tt.u_coord_matrix),u_is_text:new t.Uniform1i(U,tt.u_is_text),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_texture:new t.Uniform1i(U,tt.u_texture),u_gamma_scale:new t.Uniform1f(U,tt.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(U,tt.u_is_halo)}},$l=function(U,tt){return{u_is_size_zoom_constant:new t.Uniform1i(U,tt.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(U,tt.u_is_size_feature_constant),u_size_t:new t.Uniform1f(U,tt.u_size_t),u_size:new t.Uniform1f(U,tt.u_size),u_camera_to_center_distance:new t.Uniform1f(U,tt.u_camera_to_center_distance),u_pitch:new t.Uniform1f(U,tt.u_pitch),u_rotate_symbol:new t.Uniform1i(U,tt.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(U,tt.u_aspect_ratio),u_fade_change:new t.Uniform1f(U,tt.u_fade_change),u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(U,tt.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(U,tt.u_coord_matrix),u_is_text:new t.Uniform1i(U,tt.u_is_text),u_pitch_with_map:new t.Uniform1i(U,tt.u_pitch_with_map),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_texsize_icon:new t.Uniform2f(U,tt.u_texsize_icon),u_texture:new t.Uniform1i(U,tt.u_texture),u_texture_icon:new t.Uniform1i(U,tt.u_texture_icon),u_gamma_scale:new t.Uniform1f(U,tt.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(U,tt.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(U,tt.u_is_halo)}},jl=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he){var Ne=zt.transform;return{u_is_size_zoom_constant:+(U==="constant"||U==="source"),u_is_size_feature_constant:+(U==="constant"||U==="camera"),u_size_t:tt?tt.uSizeT:0,u_size:tt?tt.uSize:0,u_camera_to_center_distance:Ne.cameraToCenterDistance,u_pitch:Ne.pitch/360*2*Math.PI,u_rotate_symbol:+Y,u_aspect_ratio:Ne.width/Ne.height,u_fade_change:zt.options.fadeDuration?zt.symbolFadeChange:1,u_matrix:Qt,u_label_plane_matrix:ne,u_coord_matrix:Ft,u_is_text:+$t,u_pitch_with_map:+ft,u_texsize:he,u_texture:0}},Bu=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne){var Ie=zt.transform;return t.extend(jl(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he),{u_gamma_scale:ft?Math.cos(Ie._pitch)*Ie.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:1})},Jl=function(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he){return t.extend(Bu(U,tt,Y,ft,zt,Qt,ne,Ft,!0,$t),{u_texsize_icon:he,u_texture_icon:1})},Ru=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_opacity:new t.Uniform1f(U,tt.u_opacity),u_color:new t.UniformColor(U,tt.u_color)}},nl=function(U,tt){return{u_matrix:new t.UniformMatrix4f(U,tt.u_matrix),u_opacity:new t.Uniform1f(U,tt.u_opacity),u_image:new t.Uniform1i(U,tt.u_image),u_pattern_tl_a:new t.Uniform2f(U,tt.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(U,tt.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(U,tt.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(U,tt.u_pattern_br_b),u_texsize:new t.Uniform2f(U,tt.u_texsize),u_mix:new t.Uniform1f(U,tt.u_mix),u_pattern_size_a:new t.Uniform2f(U,tt.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(U,tt.u_pattern_size_b),u_scale_a:new t.Uniform1f(U,tt.u_scale_a),u_scale_b:new t.Uniform1f(U,tt.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(U,tt.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(U,tt.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(U,tt.u_tile_units_to_pixels)}},Nu=function(U,tt,Y){return{u_matrix:U,u_opacity:tt,u_color:Y}},Ui=function(U,tt,Y,ft,zt,Qt){return t.extend(yc(ft,Qt,Y,zt),{u_matrix:U,u_opacity:tt})},fo={fillExtrusion:uf,fillExtrusionPattern:zl,fill:Fu,fillPattern:Au,fillOutline:il,fillOutlinePattern:Cs,circle:Xe,collisionBox:Kr,collisionCircle:Rr,debug:ha,clippingMask:Ua,heatmap:va,heatmapTexture:Ba,hillshade:ei,hillshadePrepare:Vi,line:ni,lineGradient:Za,linePattern:$i,lineSDF:Do,raster:el,symbolIcon:fs,symbolSDF:Ll,symbolTextAndIcon:$l,background:Ru,backgroundPattern:nl},Ql;function ul(U,tt,Y,ft,zt,Qt,ne){for(var Ft=U.context,$t=Ft.gl,he=U.useProgram("collisionBox"),Ne=[],Ie=0,Fe=0,He=0;He<ft.length;He++){var Ge=ft[He],Ae=tt.getTile(Ge),Oe=Ae.getBucket(Y);if(Oe){var Le=Ge.posMatrix;(zt[0]!==0||zt[1]!==0)&&(Le=U.translatePosMatrix(Ge.posMatrix,Ae,zt,Qt));var ur=ne?Oe.textCollisionBox:Oe.iconCollisionBox,Dr=Oe.collisionCircleArray;if(Dr.length>0){var jr=t.create(),On=Le;t.mul(jr,Oe.placementInvProjMatrix,U.transform.glCoordMatrix),t.mul(jr,jr,Oe.placementViewportMatrix),Ne.push({circleArray:Dr,circleOffset:Fe,transform:On,invTransform:jr}),Ie+=Dr.length/4,Fe=Ie}ur&&he.draw(Ft,$t.LINES,bn.disabled,gn.disabled,U.colorModeForRenderPass(),zr.disabled,mn(Le,U.transform,Ae),Y.id,ur.layoutVertexBuffer,ur.indexBuffer,ur.segments,null,U.transform.zoom,null,null,ur.collisionVertexBuffer)}}if(!(!ne||!Ne.length)){var Ln=U.useProgram("collisionCircle"),xn=new t.StructArrayLayout2f1f2i16;xn.resize(Ie*4),xn._trim();for(var Wn=0,Dn=0,la=Ne;Dn<la.length;Dn+=1)for(var qn=la[Dn],Gn=0;Gn<qn.circleArray.length/4;Gn++){var ma=Gn*4,ti=qn.circleArray[ma+0],si=qn.circleArray[ma+1],Li=qn.circleArray[ma+2],to=qn.circleArray[ma+3];xn.emplace(Wn++,ti,si,Li,to,0),xn.emplace(Wn++,ti,si,Li,to,1),xn.emplace(Wn++,ti,si,Li,to,2),xn.emplace(Wn++,ti,si,Li,to,3)}(!Ql||Ql.length<Ie*2)&&(Ql=Dc(Ie));for(var ls=Ft.createIndexBuffer(Ql,!0),ms=Ft.createVertexBuffer(xn,t.collisionCircleLayout.members,!0),Ko=0,gs=Ne;Ko<gs.length;Ko+=1){var Pl=gs[Ko],mo=Pn(Pl.transform,Pl.invTransform,U.transform);Ln.draw(Ft,$t.TRIANGLES,bn.disabled,gn.disabled,U.colorModeForRenderPass(),zr.disabled,mo,Y.id,ms,ls,t.SegmentVector.simpleSegment(0,Pl.circleOffset*2,Pl.circleArray.length,Pl.circleArray.length/2),null,U.transform.zoom,null,null,null)}ms.destroy(),ls.destroy()}}function Dc(U){var tt=U*2,Y=new t.StructArrayLayout3ui6;Y.resize(tt),Y._trim();for(var ft=0;ft<tt;ft++){var zt=ft*6;Y.uint16[zt+0]=ft*4+0,Y.uint16[zt+1]=ft*4+1,Y.uint16[zt+2]=ft*4+2,Y.uint16[zt+3]=ft*4+2,Y.uint16[zt+4]=ft*4+3,Y.uint16[zt+5]=ft*4+0}return Y}var Pt=t.identity(new Float32Array(16));function z(U,tt,Y,ft,zt){if(U.renderPass==="translucent"){var Qt=gn.disabled,ne=U.colorModeForRenderPass(),Ft=Y.layout.get("text-variable-anchor");Ft&&xt(ft,U,Y,tt,Y.layout.get("text-rotation-alignment"),Y.layout.get("text-pitch-alignment"),zt),Y.paint.get("icon-opacity").constantOr(1)!==0&&le(U,tt,Y,ft,!1,Y.paint.get("icon-translate"),Y.paint.get("icon-translate-anchor"),Y.layout.get("icon-rotation-alignment"),Y.layout.get("icon-pitch-alignment"),Y.layout.get("icon-keep-upright"),Qt,ne),Y.paint.get("text-opacity").constantOr(1)!==0&&le(U,tt,Y,ft,!0,Y.paint.get("text-translate"),Y.paint.get("text-translate-anchor"),Y.layout.get("text-rotation-alignment"),Y.layout.get("text-pitch-alignment"),Y.layout.get("text-keep-upright"),Qt,ne),tt.map.showCollisionBoxes&&(ul(U,tt,Y,ft,Y.paint.get("text-translate"),Y.paint.get("text-translate-anchor"),!0),ul(U,tt,Y,ft,Y.paint.get("icon-translate"),Y.paint.get("icon-translate-anchor"),!1))}}function at(U,tt,Y,ft,zt,Qt){var ne=t.getAnchorAlignment(U),Ft=ne.horizontalAlign,$t=ne.verticalAlign,he=-(Ft-.5)*tt,Ne=-($t-.5)*Y,Ie=t.evaluateVariableOffset(U,ft);return new t.Point((he/zt+Ie[0])*Qt,(Ne/zt+Ie[1])*Qt)}function xt(U,tt,Y,ft,zt,Qt,ne){for(var Ft=tt.transform,$t=zt==="map",he=Qt==="map",Ne=0,Ie=U;Ne<Ie.length;Ne+=1){var Fe=Ie[Ne],He=ft.getTile(Fe),Ge=He.getBucket(Y);if(!(!Ge||!Ge.text||!Ge.text.segments.get().length)){var Ae=Ge.textSizeData,Oe=t.evaluateSizeForZoom(Ae,Ft.zoom),Le=Po(He,1,tt.transform.zoom),ur=vn(Fe.posMatrix,he,$t,tt.transform,Le),Dr=Y.layout.get("icon-text-fit")!=="none"&&Ge.hasIconData();if(Oe){var jr=Math.pow(2,Ft.zoom-He.tileID.overscaledZ);kt(Ge,$t,he,ne,t.symbolSize,Ft,ur,Fe.posMatrix,jr,Oe,Dr)}}}}function kt(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne){var Ie=U.text.placedSymbolArray,Fe=U.text.dynamicLayoutVertexArray,He=U.icon.dynamicLayoutVertexArray,Ge={};Fe.clear();for(var Ae=0;Ae<Ie.length;Ae++){var Oe=Ie.get(Ae),Le=U.allowVerticalPlacement&&!Oe.placedOrientation,ur=!Oe.hidden&&Oe.crossTileID&&!Le?ft[Oe.crossTileID]:null;if(!ur)Ci(Oe.numGlyphs,Fe);else{var Dr=new t.Point(Oe.anchorX,Oe.anchorY),jr=Qn(Dr,Y?Ft:ne),On=Qa(Qt.cameraToCenterDistance,jr.signedDistanceFromCamera),Ln=zt.evaluateSizeForFeature(U.textSizeData,he,Oe)*On/t.ONE_EM;Y&&(Ln*=U.tilePixelRatio/$t);for(var xn=ur.width,Wn=ur.height,Dn=ur.anchor,la=ur.textOffset,qn=ur.textBoxScale,Gn=at(Dn,xn,Wn,la,qn,Ln),ma=Y?Qn(Dr.add(Gn),ne).point:jr.point.add(tt?Gn.rotate(-Qt.angle):Gn),ti=U.allowVerticalPlacement&&Oe.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,si=0;si<Oe.numGlyphs;si++)t.addDynamicAttributes(Fe,ma,ti);Ne&&Oe.associatedIconIndex>=0&&(Ge[Oe.associatedIconIndex]={shiftedAnchor:ma,angle:ti})}}if(Ne){He.clear();for(var Li=U.icon.placedSymbolArray,to=0;to<Li.length;to++){var ls=Li.get(to);if(ls.hidden)Ci(ls.numGlyphs,He);else{var ms=Ge[to];if(!ms)Ci(ls.numGlyphs,He);else for(var Ko=0;Ko<ls.numGlyphs;Ko++)t.addDynamicAttributes(He,ms.shiftedAnchor,ms.angle)}}U.icon.dynamicLayoutVertexBuffer.updateData(He)}U.text.dynamicLayoutVertexBuffer.updateData(Fe)}function Lt(U,tt,Y){return Y.iconsInText&&tt?"symbolTextAndIcon":U?"symbolSDF":"symbolIcon"}function le(U,tt,Y,ft,zt,Qt,ne,Ft,$t,he,Ne,Ie){for(var Fe=U.context,He=Fe.gl,Ge=U.transform,Ae=Ft==="map",Oe=$t==="map",Le=Ae&&Y.layout.get("symbol-placement")!=="point",ur=Ae&&!Oe&&!Le,Dr=Y.layout.get("symbol-sort-key").constantOr(1)!==void 0,jr=!1,On=U.depthModeForSublayer(0,bn.ReadOnly),Ln=Y.layout.get("text-variable-anchor"),xn=[],Wn=0,Dn=ft;Wn<Dn.length;Wn+=1){var la=Dn[Wn],qn=tt.getTile(la),Gn=qn.getBucket(Y);if(Gn){var ma=zt?Gn.text:Gn.icon;if(!(!ma||!ma.segments.get().length)){var ti=ma.programConfigurations.get(Y.id),si=zt||Gn.sdfIcons,Li=zt?Gn.textSizeData:Gn.iconSizeData,to=Oe||Ge.pitch!==0,ls=U.useProgram(Lt(si,zt,Gn),ti),ms=t.evaluateSizeForZoom(Li,Ge.zoom),Ko=void 0,gs=[0,0],Pl=void 0,mo=void 0,Xs=null,tc=void 0;if(zt){if(Pl=qn.glyphAtlasTexture,mo=He.LINEAR,Ko=qn.glyphAtlasTexture.size,Gn.iconsInText){gs=qn.imageAtlasTexture.size,Xs=qn.imageAtlasTexture;var kc=Li.kind==="composite"||Li.kind==="camera";tc=to||U.options.rotating||U.options.zooming||kc?He.LINEAR:He.NEAREST}}else{var lh=Y.layout.get("icon-size").constantOr(0)!==1||Gn.iconsNeedLinear;Pl=qn.imageAtlasTexture,mo=si||U.options.rotating||U.options.zooming||lh||to?He.LINEAR:He.NEAREST,Ko=qn.imageAtlasTexture.size}var gh=Po(qn,1,U.transform.zoom),Zf=vn(la.posMatrix,Oe,Ae,U.transform,gh),Kf=Oa(la.posMatrix,Oe,Ae,U.transform,gh),_h=Ln&&Gn.hasTextData(),Sf=Y.layout.get("icon-text-fit")!=="none"&&_h&&Gn.hasIconData();Le&&wi(Gn,la.posMatrix,U,zt,Zf,Kf,Oe,he);var Yf=U.translatePosMatrix(la.posMatrix,qn,Qt,ne),yf=Le||zt&&Ln||Sf?Pt:Zf,Ch=U.translatePosMatrix(Kf,qn,Qt,ne,!0),ip=si&&Y.paint.get(zt?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Xf=void 0;si?Gn.iconsInText?Xf=Jl(Li.kind,ms,ur,Oe,U,Yf,yf,Ch,Ko,gs):Xf=Bu(Li.kind,ms,ur,Oe,U,Yf,yf,Ch,zt,Ko):Xf=jl(Li.kind,ms,ur,Oe,U,Yf,yf,Ch,zt,Ko);var $f={program:ls,buffers:ma,uniformValues:Xf,atlasTexture:Pl,atlasTextureIcon:Xs,atlasInterpolation:mo,atlasInterpolationIcon:tc,isSDF:si,hasHalo:ip};if(Dr&&Gn.canOverlap){jr=!0;for(var Ef=ma.segments.get(),op=0,wp=Ef;op<wp.length;op+=1){var sp=wp[op];xn.push({segments:new t.SegmentVector([sp]),sortKey:sp.sortKey,state:$f})}}else xn.push({segments:ma.segments,sortKey:0,state:$f})}}}jr&&xn.sort(function(Zp,Kp){return Zp.sortKey-Kp.sortKey});for(var $c=0,Wh=xn;$c<Wh.length;$c+=1){var Tp=Wh[$c],Jc=Tp.state;if(Fe.activeTexture.set(He.TEXTURE0),Jc.atlasTexture.bind(Jc.atlasInterpolation,He.CLAMP_TO_EDGE),Jc.atlasTextureIcon&&(Fe.activeTexture.set(He.TEXTURE1),Jc.atlasTextureIcon&&Jc.atlasTextureIcon.bind(Jc.atlasInterpolationIcon,He.CLAMP_TO_EDGE)),Jc.isSDF){var lp=Jc.uniformValues;Jc.hasHalo&&(lp.u_is_halo=1,xe(Jc.buffers,Tp.segments,Y,U,Jc.program,On,Ne,Ie,lp)),lp.u_is_halo=0}xe(Jc.buffers,Tp.segments,Y,U,Jc.program,On,Ne,Ie,Jc.uniformValues)}}function xe(U,tt,Y,ft,zt,Qt,ne,Ft,$t){var he=ft.context,Ne=he.gl;zt.draw(he,Ne.TRIANGLES,Qt,ne,Ft,zr.disabled,$t,Y.id,U.layoutVertexBuffer,U.indexBuffer,tt,Y.paint,ft.transform.zoom,U.programConfigurations.get(Y.id),U.dynamicLayoutVertexBuffer,U.opacityVertexBuffer)}function Pe(U,tt,Y,ft){if(U.renderPass==="translucent"){var zt=Y.paint.get("circle-opacity"),Qt=Y.paint.get("circle-stroke-width"),ne=Y.paint.get("circle-stroke-opacity"),Ft=Y.layout.get("circle-sort-key").constantOr(1)!==void 0;if(!(zt.constantOr(1)===0&&(Qt.constantOr(1)===0||ne.constantOr(1)===0))){for(var $t=U.context,he=$t.gl,Ne=U.depthModeForSublayer(0,bn.ReadOnly),Ie=gn.disabled,Fe=U.colorModeForRenderPass(),He=[],Ge=0;Ge<ft.length;Ge++){var Ae=ft[Ge],Oe=tt.getTile(Ae),Le=Oe.getBucket(Y);if(Le){var ur=Le.programConfigurations.get(Y.id),Dr=U.useProgram("circle",ur),jr=Le.layoutVertexBuffer,On=Le.indexBuffer,Ln=yr(U,Ae,Oe,Y),xn={programConfiguration:ur,program:Dr,layoutVertexBuffer:jr,indexBuffer:On,uniformValues:Ln};if(Ft)for(var Wn=Le.segments.get(),Dn=0,la=Wn;Dn<la.length;Dn+=1){var qn=la[Dn];He.push({segments:new t.SegmentVector([qn]),sortKey:qn.sortKey,state:xn})}else He.push({segments:Le.segments,sortKey:0,state:xn})}}Ft&&He.sort(function(Pl,mo){return Pl.sortKey-mo.sortKey});for(var Gn=0,ma=He;Gn<ma.length;Gn+=1){var ti=ma[Gn],si=ti.state,Li=si.programConfiguration,to=si.program,ls=si.layoutVertexBuffer,ms=si.indexBuffer,Ko=si.uniformValues,gs=ti.segments;to.draw($t,he.TRIANGLES,Ne,Ie,Fe,zr.disabled,Ko,Y.id,ls,ms,gs,Y.paint,U.transform.zoom,Li)}}}}function $e(U,tt,Y,ft){if(Y.paint.get("heatmap-opacity")!==0)if(U.renderPass==="offscreen"){var zt=U.context,Qt=zt.gl,ne=gn.disabled,Ft=new Re([Qt.ONE,Qt.ONE],t.Color.transparent,[!0,!0,!0,!0]);hr(zt,U,Y),zt.clear({color:t.Color.transparent});for(var $t=0;$t<ft.length;$t++){var he=ft[$t];if(!tt.hasRenderableParent(he)){var Ne=tt.getTile(he),Ie=Ne.getBucket(Y);if(Ie){var Fe=Ie.programConfigurations.get(Y.id),He=U.useProgram("heatmap",Fe),Ge=U.transform,Ae=Ge.zoom;He.draw(zt,Qt.TRIANGLES,bn.disabled,ne,Ft,zr.disabled,za(he.posMatrix,Ne,Ae,Y.paint.get("heatmap-intensity")),Y.id,Ie.layoutVertexBuffer,Ie.indexBuffer,Ie.segments,Y.paint,U.transform.zoom,Fe)}}}zt.viewport.set([0,0,U.width,U.height])}else U.renderPass==="translucent"&&(U.context.setColorMode(U.colorModeForRenderPass()),Br(U,Y))}function hr(U,tt,Y){var ft=U.gl;U.activeTexture.set(ft.TEXTURE1),U.viewport.set([0,0,tt.width/4,tt.height/4]);var zt=Y.heatmapFbo;if(zt)ft.bindTexture(ft.TEXTURE_2D,zt.colorAttachment.get()),U.bindFramebuffer.set(zt.framebuffer);else{var Qt=ft.createTexture();ft.bindTexture(ft.TEXTURE_2D,Qt),ft.texParameteri(ft.TEXTURE_2D,ft.TEXTURE_WRAP_S,ft.CLAMP_TO_EDGE),ft.texParameteri(ft.TEXTURE_2D,ft.TEXTURE_WRAP_T,ft.CLAMP_TO_EDGE),ft.texParameteri(ft.TEXTURE_2D,ft.TEXTURE_MIN_FILTER,ft.LINEAR),ft.texParameteri(ft.TEXTURE_2D,ft.TEXTURE_MAG_FILTER,ft.LINEAR),zt=Y.heatmapFbo=U.createFramebuffer(tt.width/4,tt.height/4,!1),pr(U,tt,Qt,zt)}}function pr(U,tt,Y,ft){var zt=U.gl,Qt=U.extRenderToTextureHalfFloat?U.extTextureHalfFloat.HALF_FLOAT_OES:zt.UNSIGNED_BYTE;zt.texImage2D(zt.TEXTURE_2D,0,zt.RGBA,tt.width/4,tt.height/4,0,zt.RGBA,Qt,null),ft.colorAttachment.set(Y)}function Br(U,tt){var Y=U.context,ft=Y.gl,zt=tt.heatmapFbo;if(zt){Y.activeTexture.set(ft.TEXTURE0),ft.bindTexture(ft.TEXTURE_2D,zt.colorAttachment.get()),Y.activeTexture.set(ft.TEXTURE1);var Qt=tt.colorRampTexture;Qt||(Qt=tt.colorRampTexture=new t.Texture(Y,tt.colorRamp,ft.RGBA)),Qt.bind(ft.LINEAR,ft.CLAMP_TO_EDGE),U.useProgram("heatmapTexture").draw(Y,ft.TRIANGLES,bn.disabled,gn.disabled,U.colorModeForRenderPass(),zr.disabled,ca(U,tt,0,1),tt.id,U.viewportBuffer,U.quadTriangleIndexBuffer,U.viewportSegments,tt.paint,U.transform.zoom)}}function Jr(U,tt,Y,ft){if(U.renderPass==="translucent"){var zt=Y.paint.get("line-opacity"),Qt=Y.paint.get("line-width");if(!(zt.constantOr(1)===0||Qt.constantOr(1)===0))for(var ne=U.depthModeForSublayer(0,bn.ReadOnly),Ft=U.colorModeForRenderPass(),$t=Y.paint.get("line-dasharray"),he=Y.paint.get("line-pattern"),Ne=he.constantOr(1),Ie=Y.paint.get("line-gradient"),Fe=Y.getCrossfadeParameters(),He=Ne?"linePattern":$t?"lineSDF":Ie?"lineGradient":"line",Ge=U.context,Ae=Ge.gl,Oe=!0,Le=0,ur=ft;Le<ur.length;Le+=1){var Dr=ur[Le],jr=tt.getTile(Dr);if(!(Ne&&!jr.patternsLoaded())){var On=jr.getBucket(Y);if(On){var Ln=On.programConfigurations.get(Y.id),xn=U.context.program.get(),Wn=U.useProgram(He,Ln),Dn=Oe||Wn.program!==xn,la=he.constantOr(null);if(la&&jr.imageAtlas){var qn=jr.imageAtlas,Gn=qn.patternPositions[la.to.toString()],ma=qn.patternPositions[la.from.toString()];Gn&&ma&&Ln.setConstantPatternPositions(Gn,ma)}var ti=Ne?ys(U,jr,Y,Fe):$t?Os(U,jr,Y,$t,Fe):Ie?Ps(U,jr,Y,On.lineClipsArray.length):ss(U,jr,Y);if(Ne)Ge.activeTexture.set(Ae.TEXTURE0),jr.imageAtlasTexture.bind(Ae.LINEAR,Ae.CLAMP_TO_EDGE),Ln.updatePaintBuffers(Fe);else if($t&&(Dn||U.lineAtlas.dirty))Ge.activeTexture.set(Ae.TEXTURE0),U.lineAtlas.bind(Ge);else if(Ie){var si=On.gradients[Y.id],Li=si.texture;if(Y.gradientVersion!==si.version){var to=256;if(Y.stepInterpolant){var ls=tt.getSource().maxzoom,ms=Dr.canonical.z===ls?Math.ceil(1<<U.transform.maxZoom-Dr.canonical.z):1,Ko=On.maxLineLength/t.EXTENT,gs=1024,Pl=Ko*gs*ms;to=t.clamp(t.nextPowerOfTwo(Pl),256,Ge.maxTextureSize)}si.gradient=t.renderColorRamp({expression:Y.gradientExpression(),evaluationKey:"lineProgress",resolution:to,image:si.gradient||void 0,clips:On.lineClipsArray}),si.texture?si.texture.update(si.gradient):si.texture=new t.Texture(Ge,si.gradient,Ae.RGBA),si.version=Y.gradientVersion,Li=si.texture}Ge.activeTexture.set(Ae.TEXTURE0),Li.bind(Y.stepInterpolant?Ae.NEAREST:Ae.LINEAR,Ae.CLAMP_TO_EDGE)}Wn.draw(Ge,Ae.TRIANGLES,ne,U.stencilModeForClipping(Dr),Ft,zr.disabled,ti,Y.id,On.layoutVertexBuffer,On.indexBuffer,On.segments,Y.paint,U.transform.zoom,Ln,On.layoutVertexBuffer2),Oe=!1}}}}}function Rt(U,tt,Y,ft){var zt=Y.paint.get("fill-color"),Qt=Y.paint.get("fill-opacity");if(Qt.constantOr(1)!==0){var ne=U.colorModeForRenderPass(),Ft=Y.paint.get("fill-pattern"),$t=U.opaquePassEnabledForLayer()&&!Ft.constantOr(1)&&zt.constantOr(t.Color.transparent).a===1&&Qt.constantOr(0)===1?"opaque":"translucent";if(U.renderPass===$t){var he=U.depthModeForSublayer(1,U.renderPass==="opaque"?bn.ReadWrite:bn.ReadOnly);Gt(U,tt,Y,ft,he,ne,!1)}if(U.renderPass==="translucent"&&Y.paint.get("fill-antialias")){var Ne=U.depthModeForSublayer(Y.getPaintProperty("fill-outline-color")?2:0,bn.ReadOnly);Gt(U,tt,Y,ft,Ne,ne,!0)}}}function Gt(U,tt,Y,ft,zt,Qt,ne){var Ft=U.context.gl,$t=Y.paint.get("fill-pattern"),he=$t&&$t.constantOr(1),Ne=Y.getCrossfadeParameters(),Ie,Fe,He,Ge,Ae;ne?(Fe=he&&!Y.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Ie=Ft.LINES):(Fe=he?"fillPattern":"fill",Ie=Ft.TRIANGLES);for(var Oe=0,Le=ft;Oe<Le.length;Oe+=1){var ur=Le[Oe],Dr=tt.getTile(ur);if(!(he&&!Dr.patternsLoaded())){var jr=Dr.getBucket(Y);if(jr){var On=jr.programConfigurations.get(Y.id),Ln=U.useProgram(Fe,On);he&&(U.context.activeTexture.set(Ft.TEXTURE0),Dr.imageAtlasTexture.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),On.updatePaintBuffers(Ne));var xn=$t.constantOr(null);if(xn&&Dr.imageAtlas){var Wn=Dr.imageAtlas,Dn=Wn.patternPositions[xn.to.toString()],la=Wn.patternPositions[xn.from.toString()];Dn&&la&&On.setConstantPatternPositions(Dn,la)}var qn=U.translatePosMatrix(ur.posMatrix,Dr,Y.paint.get("fill-translate"),Y.paint.get("fill-translate-anchor"));if(!ne)Ge=jr.indexBuffer,Ae=jr.segments,He=he?lc(qn,U,Ne,Dr):Mu(qn);else{Ge=jr.indexBuffer2,Ae=jr.segments2;var Gn=[Ft.drawingBufferWidth,Ft.drawingBufferHeight];He=Fe==="fillOutlinePattern"&&he?Oc(qn,U,Ne,Dr,Gn):Su(qn,Gn)}Ln.draw(U.context,Ie,zt,U.stencilModeForClipping(ur),Qt,zr.disabled,He,Y.id,jr.layoutVertexBuffer,Ge,Ae,Y.paint,U.transform.zoom,On)}}}}function ae(U,tt,Y,ft){var zt=Y.paint.get("fill-extrusion-opacity");if(zt!==0&&U.renderPass==="translucent"){var Qt=new bn(U.context.gl.LEQUAL,bn.ReadWrite,U.depthRangeFor3D);if(zt===1&&!Y.paint.get("fill-extrusion-pattern").constantOr(1)){var ne=U.colorModeForRenderPass();ce(U,tt,Y,ft,Qt,gn.disabled,ne)}else ce(U,tt,Y,ft,Qt,gn.disabled,Re.disabled),ce(U,tt,Y,ft,Qt,U.stencilModeFor3D(),U.colorModeForRenderPass())}}function ce(U,tt,Y,ft,zt,Qt,ne){for(var Ft=U.context,$t=Ft.gl,he=Y.paint.get("fill-extrusion-pattern"),Ne=he.constantOr(1),Ie=Y.getCrossfadeParameters(),Fe=Y.paint.get("fill-extrusion-opacity"),He=0,Ge=ft;He<Ge.length;He+=1){var Ae=Ge[He],Oe=tt.getTile(Ae),Le=Oe.getBucket(Y);if(Le){var ur=Le.programConfigurations.get(Y.id),Dr=U.useProgram(Ne?"fillExtrusionPattern":"fillExtrusion",ur);Ne&&(U.context.activeTexture.set($t.TEXTURE0),Oe.imageAtlasTexture.bind($t.LINEAR,$t.CLAMP_TO_EDGE),ur.updatePaintBuffers(Ie));var jr=he.constantOr(null);if(jr&&Oe.imageAtlas){var On=Oe.imageAtlas,Ln=On.patternPositions[jr.to.toString()],xn=On.patternPositions[jr.from.toString()];Ln&&xn&&ur.setConstantPatternPositions(Ln,xn)}var Wn=U.translatePosMatrix(Ae.posMatrix,Oe,Y.paint.get("fill-extrusion-translate"),Y.paint.get("fill-extrusion-translate-anchor")),Dn=Y.paint.get("fill-extrusion-vertical-gradient"),la=Ne?su(Wn,U,Dn,Fe,Ae,Ie,Oe):Uc(Wn,U,Dn,Fe);Dr.draw(Ft,Ft.gl.TRIANGLES,zt,Qt,ne,zr.backCCW,la,Y.id,Le.layoutVertexBuffer,Le.indexBuffer,Le.segments,Y.paint,U.transform.zoom,ur)}}}function Te(U,tt,Y,ft){if(!(U.renderPass!=="offscreen"&&U.renderPass!=="translucent")){for(var zt=U.context,Qt=U.depthModeForSublayer(0,bn.ReadOnly),ne=U.colorModeForRenderPass(),Ft=U.renderPass==="translucent"?U.stencilConfigForOverlap(ft):[{},ft],$t=Ft[0],he=Ft[1],Ne=0,Ie=he;Ne<Ie.length;Ne+=1){var Fe=Ie[Ne],He=tt.getTile(Fe);He.needsHillshadePrepare&&U.renderPass==="offscreen"?ze(U,He,Y,Qt,gn.disabled,ne):U.renderPass==="translucent"&&ye(U,He,Y,Qt,$t[Fe.overscaledZ],ne)}zt.viewport.set([0,0,U.width,U.height])}}function ye(U,tt,Y,ft,zt,Qt){var ne=U.context,Ft=ne.gl,$t=tt.fbo;if($t){var he=U.useProgram("hillshade");ne.activeTexture.set(Ft.TEXTURE0),Ft.bindTexture(Ft.TEXTURE_2D,$t.colorAttachment.get());var Ne=Oi(U,tt,Y);he.draw(ne,Ft.TRIANGLES,ft,zt,Qt,zr.disabled,Ne,Y.id,U.rasterBoundsBuffer,U.quadTriangleIndexBuffer,U.rasterBoundsSegments)}}function ze(U,tt,Y,ft,zt,Qt){var ne=U.context,Ft=ne.gl,$t=tt.dem;if($t&&$t.data){var he=$t.dim,Ne=$t.stride,Ie=$t.getPixels();if(ne.activeTexture.set(Ft.TEXTURE1),ne.pixelStoreUnpackPremultiplyAlpha.set(!1),tt.demTexture=tt.demTexture||U.getTileTexture(Ne),tt.demTexture){var Fe=tt.demTexture;Fe.update(Ie,{premultiply:!1}),Fe.bind(Ft.NEAREST,Ft.CLAMP_TO_EDGE)}else tt.demTexture=new t.Texture(ne,Ie,Ft.RGBA,{premultiply:!1}),tt.demTexture.bind(Ft.NEAREST,Ft.CLAMP_TO_EDGE);ne.activeTexture.set(Ft.TEXTURE0);var He=tt.fbo;if(!He){var Ge=new t.Texture(ne,{width:he,height:he,data:null},Ft.RGBA);Ge.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),He=tt.fbo=ne.createFramebuffer(he,he,!0),He.colorAttachment.set(Ge.texture)}ne.bindFramebuffer.set(He.framebuffer),ne.viewport.set([0,0,he,he]),U.useProgram("hillshadePrepare").draw(ne,Ft.TRIANGLES,ft,zt,Qt,zr.disabled,Wi(tt.tileID,$t),Y.id,U.rasterBoundsBuffer,U.quadTriangleIndexBuffer,U.rasterBoundsSegments),tt.needsHillshadePrepare=!1}}function rr(U,tt,Y,ft){if(U.renderPass==="translucent"&&Y.paint.get("raster-opacity")!==0&&ft.length)for(var zt=U.context,Qt=zt.gl,ne=tt.getSource(),Ft=U.useProgram("raster"),$t=U.colorModeForRenderPass(),he=ne instanceof st?[{},ft]:U.stencilConfigForOverlap(ft),Ne=he[0],Ie=he[1],Fe=Ie[Ie.length-1].overscaledZ,He=!U.options.moving,Ge=0,Ae=Ie;Ge<Ae.length;Ge+=1){var Oe=Ae[Ge],Le=U.depthModeForSublayer(Oe.overscaledZ-Fe,Y.paint.get("raster-opacity")===1?bn.ReadWrite:bn.ReadOnly,Qt.LESS),ur=tt.getTile(Oe),Dr=U.transform.calculatePosMatrix(Oe.toUnwrapped(),He);ur.registerFadeDuration(Y.paint.get("raster-fade-duration"));var jr=tt.findLoadedParent(Oe,0),On=fr(ur,jr,tt,Y,U.transform),Ln=void 0,xn=void 0,Wn=Y.paint.get("raster-resampling")==="nearest"?Qt.NEAREST:Qt.LINEAR;zt.activeTexture.set(Qt.TEXTURE0),ur.texture.bind(Wn,Qt.CLAMP_TO_EDGE,Qt.LINEAR_MIPMAP_NEAREST),zt.activeTexture.set(Qt.TEXTURE1),jr?(jr.texture.bind(Wn,Qt.CLAMP_TO_EDGE,Qt.LINEAR_MIPMAP_NEAREST),Ln=Math.pow(2,jr.tileID.overscaledZ-ur.tileID.overscaledZ),xn=[ur.tileID.canonical.x*Ln%1,ur.tileID.canonical.y*Ln%1]):ur.texture.bind(Wn,Qt.CLAMP_TO_EDGE,Qt.LINEAR_MIPMAP_NEAREST);var Dn=Rs(Dr,xn||[0,0],Ln||1,On,Y);ne instanceof st?Ft.draw(zt,Qt.TRIANGLES,Le,gn.disabled,$t,zr.disabled,Dn,Y.id,ne.boundsBuffer,U.quadTriangleIndexBuffer,ne.boundsSegments):Ft.draw(zt,Qt.TRIANGLES,Le,Ne[Oe.overscaledZ],$t,zr.disabled,Dn,Y.id,U.rasterBoundsBuffer,U.quadTriangleIndexBuffer,U.rasterBoundsSegments)}}function fr(U,tt,Y,ft,zt){var Qt=ft.paint.get("raster-fade-duration");if(Qt>0){var ne=t.browser.now(),Ft=(ne-U.timeAdded)/Qt,$t=tt?(ne-tt.timeAdded)/Qt:-1,he=Y.getSource(),Ne=zt.coveringZoomLevel({tileSize:he.tileSize,roundZoom:he.roundZoom}),Ie=!tt||Math.abs(tt.tileID.overscaledZ-Ne)>Math.abs(U.tileID.overscaledZ-Ne),Fe=Ie&&U.refreshedUponExpiration?1:t.clamp(Ie?Ft:1-$t,0,1);return U.refreshedUponExpiration&&Ft>=1&&(U.refreshedUponExpiration=!1),tt?{opacity:1,mix:1-Fe}:{opacity:Fe,mix:0}}else return{opacity:1,mix:0}}function gr(U,tt,Y){var ft=Y.paint.get("background-color"),zt=Y.paint.get("background-opacity");if(zt!==0){var Qt=U.context,ne=Qt.gl,Ft=U.transform,$t=Ft.tileSize,he=Y.paint.get("background-pattern");if(!U.isPatternMissing(he)){var Ne=!he&&ft.a===1&&zt===1&&U.opaquePassEnabledForLayer()?"opaque":"translucent";if(U.renderPass===Ne){var Ie=gn.disabled,Fe=U.depthModeForSublayer(0,Ne==="opaque"?bn.ReadWrite:bn.ReadOnly),He=U.colorModeForRenderPass(),Ge=U.useProgram(he?"backgroundPattern":"background"),Ae=Ft.coveringTiles({tileSize:$t});he&&(Qt.activeTexture.set(ne.TEXTURE0),U.imageManager.bind(U.context));for(var Oe=Y.getCrossfadeParameters(),Le=0,ur=Ae;Le<ur.length;Le+=1){var Dr=ur[Le],jr=U.transform.calculatePosMatrix(Dr.toUnwrapped()),On=he?Ui(jr,zt,U,he,{tileID:Dr,tileSize:$t},Oe):Nu(jr,zt,ft);Ge.draw(Qt,ne.TRIANGLES,Fe,Ie,He,zr.disabled,On,Y.id,U.tileExtentBuffer,U.quadTriangleIndexBuffer,U.tileExtentSegments)}}}}}var Lr=new t.Color(1,0,0,1),Hr=new t.Color(0,1,0,1),nn=new t.Color(0,0,1,1),cn=new t.Color(1,0,1,1),Mn=new t.Color(0,1,1,1);function Jn(U){var tt=U.transform.padding,Y=3;xa(U,U.transform.height-(tt.top||0),Y,Lr),xa(U,tt.bottom||0,Y,Hr),La(U,tt.left||0,Y,nn),La(U,U.transform.width-(tt.right||0),Y,cn);var ft=U.transform.centerPoint;_a(U,ft.x,U.transform.height-ft.y,Mn)}function _a(U,tt,Y,ft){var zt=20,Qt=2;ai(U,tt-Qt/2,Y-zt/2,Qt,zt,ft),ai(U,tt-zt/2,Y-Qt/2,zt,Qt,ft)}function xa(U,tt,Y,ft){ai(U,0,tt+Y/2,U.transform.width,Y,ft)}function La(U,tt,Y,ft){ai(U,tt-Y/2,0,Y,U.transform.height,ft)}function ai(U,tt,Y,ft,zt,Qt){var ne=U.context,Ft=ne.gl;Ft.enable(Ft.SCISSOR_TEST),Ft.scissor(tt*t.browser.devicePixelRatio,Y*t.browser.devicePixelRatio,ft*t.browser.devicePixelRatio,zt*t.browser.devicePixelRatio),ne.clear({color:Qt}),Ft.disable(Ft.SCISSOR_TEST)}function Ai(U,tt,Y){for(var ft=0;ft<Y.length;ft++)mi(U,tt,Y[ft])}function mi(U,tt,Y){var ft=U.context,zt=ft.gl,Qt=Y.posMatrix,ne=U.useProgram("debug"),Ft=bn.disabled,$t=gn.disabled,he=U.colorModeForRenderPass(),Ne="$debug";ft.activeTexture.set(zt.TEXTURE0),U.emptyTexture.bind(zt.LINEAR,zt.CLAMP_TO_EDGE),ne.draw(ft,zt.LINE_STRIP,Ft,$t,he,zr.disabled,Ta(Qt,t.Color.red),Ne,U.debugBuffer,U.tileBorderIndexBuffer,U.debugSegments);var Ie=tt.getTileByID(Y.key).latestRawTileData,Fe=Ie&&Ie.byteLength||0,He=Math.floor(Fe/1024),Ge=tt.getTile(Y).tileSize,Ae=512/Math.min(Ge,512)*(Y.overscaledZ/U.transform.zoom)*.5,Oe=Y.canonical.toString();Y.overscaledZ!==Y.canonical.z&&(Oe+=" => "+Y.overscaledZ);var Le=Oe+" "+He+"kb";Yi(U,Le),ne.draw(ft,zt.TRIANGLES,Ft,$t,Re.alphaBlended,zr.disabled,Ta(Qt,t.Color.transparent,Ae),Ne,U.debugBuffer,U.quadTriangleIndexBuffer,U.debugSegments)}function Yi(U,tt){U.initDebugOverlayCanvas();var Y=U.debugOverlayCanvas,ft=U.context.gl,zt=U.debugOverlayCanvas.getContext("2d");zt.clearRect(0,0,Y.width,Y.height),zt.shadowColor="white",zt.shadowBlur=2,zt.lineWidth=1.5,zt.strokeStyle="white",zt.textBaseline="top",zt.font="bold 36px Open Sans, sans-serif",zt.fillText(tt,5,5),zt.strokeText(tt,5,5),U.debugOverlayTexture.update(Y),U.debugOverlayTexture.bind(ft.LINEAR,ft.CLAMP_TO_EDGE)}function Go(U,tt,Y){var ft=U.context,zt=Y.implementation;if(U.renderPass==="offscreen"){var Qt=zt.prerender;Qt&&(U.setCustomLayerDefaults(),ft.setColorMode(U.colorModeForRenderPass()),Qt.call(zt,ft.gl,U.transform.customLayerMatrix()),ft.setDirty(),U.setBaseState())}else if(U.renderPass==="translucent"){U.setCustomLayerDefaults(),ft.setColorMode(U.colorModeForRenderPass()),ft.setStencilMode(gn.disabled);var ne=zt.renderingMode==="3d"?new bn(U.context.gl.LEQUAL,bn.ReadWrite,U.depthRangeFor3D):U.depthModeForSublayer(0,bn.ReadOnly);ft.setDepthMode(ne),zt.render(ft.gl,U.transform.customLayerMatrix()),ft.setDirty(),U.setBaseState(),ft.bindFramebuffer.set(null)}}var Xo={symbol:z,circle:Pe,heatmap:$e,line:Jr,fill:Rt,"fill-extrusion":ae,hillshade:Te,raster:rr,background:gr,debug:Ai,custom:Go},po=function(U,tt){this.context=new tn(U),this.transform=tt,this._tileTextures={},this.setup(),this.numSublayers=Yr.maxUnderzooming+Yr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fl,this.gpuTimers={}};po.prototype.resize=function(U,tt){if(this.width=U*t.browser.devicePixelRatio,this.height=tt*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var Y=0,ft=this.style._order;Y<ft.length;Y+=1){var zt=ft[Y];this.style._layers[zt].resize()}},po.prototype.setup=function(){var U=this.context,tt=new t.StructArrayLayout2i4;tt.emplaceBack(0,0),tt.emplaceBack(t.EXTENT,0),tt.emplaceBack(0,t.EXTENT),tt.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=U.createVertexBuffer(tt,bu.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var Y=new t.StructArrayLayout2i4;Y.emplaceBack(0,0),Y.emplaceBack(t.EXTENT,0),Y.emplaceBack(0,t.EXTENT),Y.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=U.createVertexBuffer(Y,bu.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var ft=new t.StructArrayLayout4i8;ft.emplaceBack(0,0,0,0),ft.emplaceBack(t.EXTENT,0,t.EXTENT,0),ft.emplaceBack(0,t.EXTENT,0,t.EXTENT),ft.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=U.createVertexBuffer(ft,ct.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var zt=new t.StructArrayLayout2i4;zt.emplaceBack(0,0),zt.emplaceBack(1,0),zt.emplaceBack(0,1),zt.emplaceBack(1,1),this.viewportBuffer=U.createVertexBuffer(zt,bu.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var Qt=new t.StructArrayLayout1ui2;Qt.emplaceBack(0),Qt.emplaceBack(1),Qt.emplaceBack(3),Qt.emplaceBack(2),Qt.emplaceBack(0),this.tileBorderIndexBuffer=U.createIndexBuffer(Qt);var ne=new t.StructArrayLayout3ui6;ne.emplaceBack(0,1,2),ne.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=U.createIndexBuffer(ne),this.emptyTexture=new t.Texture(U,{width:1,height:1,data:new Uint8Array([0,0,0,0])},U.gl.RGBA);var Ft=this.context.gl;this.stencilClearMode=new gn({func:Ft.ALWAYS,mask:0},0,255,Ft.ZERO,Ft.ZERO,Ft.ZERO)},po.prototype.clearStencil=function(){var U=this.context,tt=U.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var Y=t.create();t.ortho(Y,0,this.width,this.height,0,0,1),t.scale(Y,Y,[tt.drawingBufferWidth,tt.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(U,tt.TRIANGLES,bn.disabled,this.stencilClearMode,Re.disabled,zr.disabled,Ya(Y),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},po.prototype._renderTileClippingMasks=function(U,tt){if(!(this.currentStencilSource===U.source||!U.isTileClipped()||!tt||!tt.length)){this.currentStencilSource=U.source;var Y=this.context,ft=Y.gl;this.nextStencilID+tt.length>256&&this.clearStencil(),Y.setColorMode(Re.disabled),Y.setDepthMode(bn.disabled);var zt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var Qt=0,ne=tt;Qt<ne.length;Qt+=1){var Ft=ne[Qt],$t=this._tileClippingMaskIDs[Ft.key]=this.nextStencilID++;zt.draw(Y,ft.TRIANGLES,bn.disabled,new gn({func:ft.ALWAYS,mask:0},$t,255,ft.KEEP,ft.KEEP,ft.REPLACE),Re.disabled,zr.disabled,Ya(Ft.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},po.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var U=this.nextStencilID++,tt=this.context.gl;return new gn({func:tt.NOTEQUAL,mask:255},U,255,tt.KEEP,tt.KEEP,tt.REPLACE)},po.prototype.stencilModeForClipping=function(U){var tt=this.context.gl;return new gn({func:tt.EQUAL,mask:255},this._tileClippingMaskIDs[U.key],0,tt.KEEP,tt.KEEP,tt.REPLACE)},po.prototype.stencilConfigForOverlap=function(U){var tt,Y=this.context.gl,ft=U.sort(function($t,he){return he.overscaledZ-$t.overscaledZ}),zt=ft[ft.length-1].overscaledZ,Qt=ft[0].overscaledZ-zt+1;if(Qt>1){this.currentStencilSource=void 0,this.nextStencilID+Qt>256&&this.clearStencil();for(var ne={},Ft=0;Ft<Qt;Ft++)ne[Ft+zt]=new gn({func:Y.GEQUAL,mask:255},Ft+this.nextStencilID,255,Y.KEEP,Y.KEEP,Y.REPLACE);return this.nextStencilID+=Qt,[ne,ft]}return[(tt={},tt[zt]=gn.disabled,tt),ft]},po.prototype.colorModeForRenderPass=function(){var U=this.context.gl;if(this._showOverdrawInspector){var tt=8,Y=1/tt;return new Re([U.CONSTANT_COLOR,U.ONE],new t.Color(Y,Y,Y,0),[!0,!0,!0,!0])}else return this.renderPass==="opaque"?Re.unblended:Re.alphaBlended},po.prototype.depthModeForSublayer=function(U,tt,Y){if(!this.opaquePassEnabledForLayer())return bn.disabled;var ft=1-((1+this.currentLayer)*this.numSublayers+U)*this.depthEpsilon;return new bn(Y||this.context.gl.LEQUAL,tt,[ft,ft])},po.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},po.prototype.render=function(U,tt){var Y=this;this.style=U,this.options=tt,this.lineAtlas=U.lineAtlas,this.imageManager=U.imageManager,this.glyphManager=U.glyphManager,this.symbolFadeChange=U.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var ft=this.style._order,zt=this.style.sourceCaches;for(var Qt in zt){var ne=zt[Qt];ne.used&&ne.prepare(this.context)}var Ft={},$t={},he={};for(var Ne in zt){var Ie=zt[Ne];Ft[Ne]=Ie.getVisibleCoordinates(),$t[Ne]=Ft[Ne].slice().reverse(),he[Ne]=Ie.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var Fe=0;Fe<ft.length;Fe++){var He=ft[Fe];if(this.style._layers[He].is3D()){this.opaquePassCutoff=Fe;break}}this.renderPass="offscreen";for(var Ge=0,Ae=ft;Ge<Ae.length;Ge+=1){var Oe=Ae[Ge],Le=this.style._layers[Oe];if(!(!Le.hasOffscreenPass()||Le.isHidden(this.transform.zoom))){var ur=$t[Le.source];Le.type!=="custom"&&!ur.length||this.renderLayer(this,zt[Le.source],Le,ur)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:tt.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=tt.showOverdrawInspector,this.depthRangeFor3D=[0,1-(U._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=ft.length-1;this.currentLayer>=0;this.currentLayer--){var Dr=this.style._layers[ft[this.currentLayer]],jr=zt[Dr.source],On=Ft[Dr.source];this._renderTileClippingMasks(Dr,On),this.renderLayer(this,jr,Dr,On)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<ft.length;this.currentLayer++){var Ln=this.style._layers[ft[this.currentLayer]],xn=zt[Ln.source],Wn=(Ln.type==="symbol"?he:$t)[Ln.source];this._renderTileClippingMasks(Ln,Ft[Ln.source]),this.renderLayer(this,xn,Ln,Wn)}if(this.options.showTileBoundaries){var Dn,la,qn=t.values(this.style._layers);qn.forEach(function(Gn){Gn.source&&!Gn.isHidden(Y.transform.zoom)&&(Gn.source!==(la&&la.id)&&(la=Y.style.sourceCaches[Gn.source]),(!Dn||Dn.getSource().maxzoom<la.getSource().maxzoom)&&(Dn=la))}),Dn&&Xo.debug(this,Dn,Dn.getVisibleCoordinates())}this.options.showPadding&&Jn(this),this.context.setDefault()},po.prototype.renderLayer=function(U,tt,Y,ft){Y.isHidden(this.transform.zoom)||Y.type!=="background"&&Y.type!=="custom"&&!ft.length||(this.id=Y.id,this.gpuTimingStart(Y),Xo[Y.type](U,tt,Y,ft,this.style.placement.variableOffsets),this.gpuTimingEnd())},po.prototype.gpuTimingStart=function(U){if(this.options.gpuTiming){var tt=this.context.extTimerQuery,Y=this.gpuTimers[U.id];Y||(Y=this.gpuTimers[U.id]={calls:0,cpuTime:0,query:tt.createQueryEXT()}),Y.calls++,tt.beginQueryEXT(tt.TIME_ELAPSED_EXT,Y.query)}},po.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var U=this.context.extTimerQuery;U.endQueryEXT(U.TIME_ELAPSED_EXT)}},po.prototype.collectGpuTimers=function(){var U=this.gpuTimers;return this.gpuTimers={},U},po.prototype.queryGpuTimers=function(U){var tt={};for(var Y in U){var ft=U[Y],zt=this.context.extTimerQuery,Qt=zt.getQueryObjectEXT(ft.query,zt.QUERY_RESULT_EXT)/(1e3*1e3);zt.deleteQueryEXT(ft.query),tt[Y]=Qt}return tt},po.prototype.translatePosMatrix=function(U,tt,Y,ft,zt){if(!Y[0]&&!Y[1])return U;var Qt=zt?ft==="map"?this.transform.angle:0:ft==="viewport"?-this.transform.angle:0;if(Qt){var ne=Math.sin(Qt),Ft=Math.cos(Qt);Y=[Y[0]*Ft-Y[1]*ne,Y[0]*ne+Y[1]*Ft]}var $t=[zt?Y[0]:Po(tt,Y[0],this.transform.zoom),zt?Y[1]:Po(tt,Y[1],this.transform.zoom),0],he=new Float32Array(16);return t.translate(he,U,$t),he},po.prototype.saveTileTexture=function(U){var tt=this._tileTextures[U.size[0]];tt?tt.push(U):this._tileTextures[U.size[0]]=[U]},po.prototype.getTileTexture=function(U){var tt=this._tileTextures[U];return tt&&tt.length>0?tt.pop():null},po.prototype.isPatternMissing=function(U){if(!U)return!1;if(!U.from||!U.to)return!0;var tt=this.imageManager.getPattern(U.from.toString()),Y=this.imageManager.getPattern(U.to.toString());return!tt||!Y},po.prototype.useProgram=function(U,tt){this.cache=this.cache||{};var Y=""+U+(tt?tt.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[Y]||(this.cache[Y]=new Qu(this.context,U,vc[U],tt,fo[U],this._showOverdrawInspector)),this.cache[Y]},po.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()},po.prototype.setBaseState=function(){var U=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(U.FUNC_ADD)},po.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var U=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,U.RGBA)}},po.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Qo=function(U,tt){this.points=U,this.planes=tt};Qo.fromInvProjectionMatrix=function(U,tt,Y){var ft=[[-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]],zt=Math.pow(2,Y),Qt=ft.map(function($t){return t.transformMat4([],$t,U)}).map(function($t){return t.scale$1([],$t,1/$t[3]/tt*zt)}),ne=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Ft=ne.map(function($t){var he=t.sub([],Qt[$t[0]],Qt[$t[1]]),Ne=t.sub([],Qt[$t[2]],Qt[$t[1]]),Ie=t.normalize([],t.cross([],he,Ne)),Fe=-t.dot(Ie,Qt[$t[1]]);return Ie.concat(Fe)});return new Qo(Qt,Ft)};var Js=function(U,tt){this.min=U,this.max=tt,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Js.prototype.quadrant=function(U){for(var tt=[U%2===0,U<2],Y=t.clone$2(this.min),ft=t.clone$2(this.max),zt=0;zt<tt.length;zt++)Y[zt]=tt[zt]?this.min[zt]:this.center[zt],ft[zt]=tt[zt]?this.center[zt]:this.max[zt];return ft[2]=this.max[2],new Js(Y,ft)},Js.prototype.distanceX=function(U){var tt=Math.max(Math.min(this.max[0],U[0]),this.min[0]);return tt-U[0]},Js.prototype.distanceY=function(U){var tt=Math.max(Math.min(this.max[1],U[1]),this.min[1]);return tt-U[1]},Js.prototype.intersects=function(U){for(var tt=[[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]],Y=!0,ft=0;ft<U.planes.length;ft++){for(var zt=U.planes[ft],Qt=0,ne=0;ne<tt.length;ne++)Qt+=t.dot$1(zt,tt[ne])>=0;if(Qt===0)return 0;Qt!==tt.length&&(Y=!1)}if(Y)return 2;for(var Ft=0;Ft<3;Ft++){for(var $t=Number.MAX_VALUE,he=-Number.MAX_VALUE,Ne=0;Ne<U.points.length;Ne++){var Ie=U.points[Ne][Ft]-this.min[Ft];$t=Math.min($t,Ie),he=Math.max(he,Ie)}if(he<0||$t>this.max[Ft]-this.min[Ft])return 0}return 1};var Us=function(U,tt,Y,ft){if(U===void 0&&(U=0),tt===void 0&&(tt=0),Y===void 0&&(Y=0),ft===void 0&&(ft=0),isNaN(U)||U<0||isNaN(tt)||tt<0||isNaN(Y)||Y<0||isNaN(ft)||ft<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=U,this.bottom=tt,this.left=Y,this.right=ft};Us.prototype.interpolate=function(U,tt,Y){return tt.top!=null&&U.top!=null&&(this.top=t.number(U.top,tt.top,Y)),tt.bottom!=null&&U.bottom!=null&&(this.bottom=t.number(U.bottom,tt.bottom,Y)),tt.left!=null&&U.left!=null&&(this.left=t.number(U.left,tt.left,Y)),tt.right!=null&&U.right!=null&&(this.right=t.number(U.right,tt.right,Y)),this},Us.prototype.getCenter=function(U,tt){var Y=t.clamp((this.left+U-this.right)/2,0,U),ft=t.clamp((this.top+tt-this.bottom)/2,0,tt);return new t.Point(Y,ft)},Us.prototype.equals=function(U){return this.top===U.top&&this.bottom===U.bottom&&this.left===U.left&&this.right===U.right},Us.prototype.clone=function(){return new Us(this.top,this.bottom,this.left,this.right)},Us.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var To=function(U,tt,Y,ft,zt){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=zt===void 0?!0:zt,this._minZoom=U||0,this._maxZoom=tt||22,this._minPitch=Y??0,this._maxPitch=ft??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 Us,this._posMatrixCache={},this._alignedPosMatrixCache={}},ko={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}};To.prototype.clone=function(){var U=new To(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return U.tileSize=this.tileSize,U.latRange=this.latRange,U.width=this.width,U.height=this.height,U._center=this._center,U.zoom=this.zoom,U.angle=this.angle,U._fov=this._fov,U._pitch=this._pitch,U._unmodified=this._unmodified,U._edgeInsets=this._edgeInsets.clone(),U._calcMatrices(),U},ko.minZoom.get=function(){return this._minZoom},ko.minZoom.set=function(U){this._minZoom!==U&&(this._minZoom=U,this.zoom=Math.max(this.zoom,U))},ko.maxZoom.get=function(){return this._maxZoom},ko.maxZoom.set=function(U){this._maxZoom!==U&&(this._maxZoom=U,this.zoom=Math.min(this.zoom,U))},ko.minPitch.get=function(){return this._minPitch},ko.minPitch.set=function(U){this._minPitch!==U&&(this._minPitch=U,this.pitch=Math.max(this.pitch,U))},ko.maxPitch.get=function(){return this._maxPitch},ko.maxPitch.set=function(U){this._maxPitch!==U&&(this._maxPitch=U,this.pitch=Math.min(this.pitch,U))},ko.renderWorldCopies.get=function(){return this._renderWorldCopies},ko.renderWorldCopies.set=function(U){U===void 0?U=!0:U===null&&(U=!1),this._renderWorldCopies=U},ko.worldSize.get=function(){return this.tileSize*this.scale},ko.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ko.size.get=function(){return new t.Point(this.width,this.height)},ko.bearing.get=function(){return-this.angle/Math.PI*180},ko.bearing.set=function(U){var tt=-t.wrap(U,-180,180)*Math.PI/180;this.angle!==tt&&(this._unmodified=!1,this.angle=tt,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},ko.pitch.get=function(){return this._pitch/Math.PI*180},ko.pitch.set=function(U){var tt=t.clamp(U,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==tt&&(this._unmodified=!1,this._pitch=tt,this._calcMatrices())},ko.fov.get=function(){return this._fov/Math.PI*180},ko.fov.set=function(U){U=Math.max(.01,Math.min(60,U)),this._fov!==U&&(this._unmodified=!1,this._fov=U/180*Math.PI,this._calcMatrices())},ko.zoom.get=function(){return this._zoom},ko.zoom.set=function(U){var tt=Math.min(Math.max(U,this.minZoom),this.maxZoom);this._zoom!==tt&&(this._unmodified=!1,this._zoom=tt,this.scale=this.zoomScale(tt),this.tileZoom=Math.floor(tt),this.zoomFraction=tt-this.tileZoom,this._constrain(),this._calcMatrices())},ko.center.get=function(){return this._center},ko.center.set=function(U){U.lat===this._center.lat&&U.lng===this._center.lng||(this._unmodified=!1,this._center=U,this._constrain(),this._calcMatrices())},ko.padding.get=function(){return this._edgeInsets.toJSON()},ko.padding.set=function(U){this._edgeInsets.equals(U)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,U,1),this._calcMatrices())},ko.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},To.prototype.isPaddingEqual=function(U){return this._edgeInsets.equals(U)},To.prototype.interpolatePadding=function(U,tt,Y){this._unmodified=!1,this._edgeInsets.interpolate(U,tt,Y),this._constrain(),this._calcMatrices()},To.prototype.coveringZoomLevel=function(U){var tt=(U.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/U.tileSize));return Math.max(0,tt)},To.prototype.getVisibleUnwrappedCoordinates=function(U){var tt=[new t.UnwrappedTileID(0,U)];if(this._renderWorldCopies)for(var Y=this.pointCoordinate(new t.Point(0,0)),ft=this.pointCoordinate(new t.Point(this.width,0)),zt=this.pointCoordinate(new t.Point(this.width,this.height)),Qt=this.pointCoordinate(new t.Point(0,this.height)),ne=Math.floor(Math.min(Y.x,ft.x,zt.x,Qt.x)),Ft=Math.floor(Math.max(Y.x,ft.x,zt.x,Qt.x)),$t=1,he=ne-$t;he<=Ft+$t;he++)he!==0&&tt.push(new t.UnwrappedTileID(he,U));return tt},To.prototype.coveringTiles=function(U){var tt=this.coveringZoomLevel(U),Y=tt;if(U.minzoom!==void 0&&tt<U.minzoom)return[];U.maxzoom!==void 0&&tt>U.maxzoom&&(tt=U.maxzoom);var ft=t.MercatorCoordinate.fromLngLat(this.center),zt=Math.pow(2,tt),Qt=[zt*ft.x,zt*ft.y,0],ne=Qo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,tt),Ft=U.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Ft=tt);var $t=3,he=function(qn){return{aabb:new Js([qn*zt,0,0],[(qn+1)*zt,zt,0]),zoom:0,x:0,y:0,wrap:qn,fullyVisible:!1}},Ne=[],Ie=[],Fe=tt,He=U.reparseOverscaled?Y:tt;if(this._renderWorldCopies)for(var Ge=1;Ge<=3;Ge++)Ne.push(he(-Ge)),Ne.push(he(Ge));for(Ne.push(he(0));Ne.length>0;){var Ae=Ne.pop(),Oe=Ae.x,Le=Ae.y,ur=Ae.fullyVisible;if(!ur){var Dr=Ae.aabb.intersects(ne);if(Dr===0)continue;ur=Dr===2}var jr=Ae.aabb.distanceX(Qt),On=Ae.aabb.distanceY(Qt),Ln=Math.max(Math.abs(jr),Math.abs(On)),xn=$t+(1<<Fe-Ae.zoom)-2;if(Ae.zoom===Fe||Ln>xn&&Ae.zoom>=Ft){Ie.push({tileID:new t.OverscaledTileID(Ae.zoom===Fe?He:Ae.zoom,Ae.wrap,Ae.zoom,Oe,Le),distanceSq:t.sqrLen([Qt[0]-.5-Oe,Qt[1]-.5-Le])});continue}for(var Wn=0;Wn<4;Wn++){var Dn=(Oe<<1)+Wn%2,la=(Le<<1)+(Wn>>1);Ne.push({aabb:Ae.aabb.quadrant(Wn),zoom:Ae.zoom+1,x:Dn,y:la,wrap:Ae.wrap,fullyVisible:ur})}}return Ie.sort(function(qn,Gn){return qn.distanceSq-Gn.distanceSq}).map(function(qn){return qn.tileID})},To.prototype.resize=function(U,tt){this.width=U,this.height=tt,this.pixelsToGLUnits=[2/U,-2/tt],this._constrain(),this._calcMatrices()},ko.unmodified.get=function(){return this._unmodified},To.prototype.zoomScale=function(U){return Math.pow(2,U)},To.prototype.scaleZoom=function(U){return Math.log(U)/Math.LN2},To.prototype.project=function(U){var tt=t.clamp(U.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(U.lng)*this.worldSize,t.mercatorYfromLat(tt)*this.worldSize)},To.prototype.unproject=function(U){return new t.MercatorCoordinate(U.x/this.worldSize,U.y/this.worldSize).toLngLat()},ko.point.get=function(){return this.project(this.center)},To.prototype.setLocationAtPoint=function(U,tt){var Y=this.pointCoordinate(tt),ft=this.pointCoordinate(this.centerPoint),zt=this.locationCoordinate(U),Qt=new t.MercatorCoordinate(zt.x-(Y.x-ft.x),zt.y-(Y.y-ft.y));this.center=this.coordinateLocation(Qt),this._renderWorldCopies&&(this.center=this.center.wrap())},To.prototype.locationPoint=function(U){return this.coordinatePoint(this.locationCoordinate(U))},To.prototype.pointLocation=function(U){return this.coordinateLocation(this.pointCoordinate(U))},To.prototype.locationCoordinate=function(U){return t.MercatorCoordinate.fromLngLat(U)},To.prototype.coordinateLocation=function(U){return U.toLngLat()},To.prototype.pointCoordinate=function(U){var tt=0,Y=[U.x,U.y,0,1],ft=[U.x,U.y,1,1];t.transformMat4(Y,Y,this.pixelMatrixInverse),t.transformMat4(ft,ft,this.pixelMatrixInverse);var zt=Y[3],Qt=ft[3],ne=Y[0]/zt,Ft=ft[0]/Qt,$t=Y[1]/zt,he=ft[1]/Qt,Ne=Y[2]/zt,Ie=ft[2]/Qt,Fe=Ne===Ie?0:(tt-Ne)/(Ie-Ne);return new t.MercatorCoordinate(t.number(ne,Ft,Fe)/this.worldSize,t.number($t,he,Fe)/this.worldSize)},To.prototype.coordinatePoint=function(U){var tt=[U.x*this.worldSize,U.y*this.worldSize,0,1];return t.transformMat4(tt,tt,this.pixelMatrix),new t.Point(tt[0]/tt[3],tt[1]/tt[3])},To.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)))},To.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]])},To.prototype.setMaxBounds=function(U){U?(this.lngRange=[U.getWest(),U.getEast()],this.latRange=[U.getSouth(),U.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},To.prototype.calculatePosMatrix=function(U,tt){tt===void 0&&(tt=!1);var Y=U.key,ft=tt?this._alignedPosMatrixCache:this._posMatrixCache;if(ft[Y])return ft[Y];var zt=U.canonical,Qt=this.worldSize/this.zoomScale(zt.z),ne=zt.x+Math.pow(2,zt.z)*U.wrap,Ft=t.identity(new Float64Array(16));return t.translate(Ft,Ft,[ne*Qt,zt.y*Qt,0]),t.scale(Ft,Ft,[Qt/t.EXTENT,Qt/t.EXTENT,1]),t.multiply(Ft,tt?this.alignedProjMatrix:this.projMatrix,Ft),ft[Y]=new Float32Array(Ft),ft[Y]},To.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},To.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var U=-90,tt=90,Y=-180,ft=180,zt,Qt,ne,Ft,$t=this.size,he=this._unmodified;if(this.latRange){var Ne=this.latRange;U=t.mercatorYfromLat(Ne[1])*this.worldSize,tt=t.mercatorYfromLat(Ne[0])*this.worldSize,zt=tt-U<$t.y?$t.y/(tt-U):0}if(this.lngRange){var Ie=this.lngRange;Y=t.mercatorXfromLng(Ie[0])*this.worldSize,ft=t.mercatorXfromLng(Ie[1])*this.worldSize,Qt=ft-Y<$t.x?$t.x/(ft-Y):0}var Fe=this.point,He=Math.max(Qt||0,zt||0);if(He){this.center=this.unproject(new t.Point(Qt?(ft+Y)/2:Fe.x,zt?(tt+U)/2:Fe.y)),this.zoom+=this.scaleZoom(He),this._unmodified=he,this._constraining=!1;return}if(this.latRange){var Ge=Fe.y,Ae=$t.y/2;Ge-Ae<U&&(Ft=U+Ae),Ge+Ae>tt&&(Ft=tt-Ae)}if(this.lngRange){var Oe=Fe.x,Le=$t.x/2;Oe-Le<Y&&(ne=Y+Le),Oe+Le>ft&&(ne=ft-Le)}(ne!==void 0||Ft!==void 0)&&(this.center=this.unproject(new t.Point(ne!==void 0?ne:Fe.x,Ft!==void 0?Ft:Fe.y))),this._unmodified=he,this._constraining=!1}},To.prototype._calcMatrices=function(){if(this.height){var U=this._fov/2,tt=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(U)*this.height;var Y=Math.PI/2+this._pitch,ft=this._fov*(.5+tt.y/this.height),zt=Math.sin(ft)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-Y-ft,.01,Math.PI-.01)),Qt=this.point,ne=Qt.x,Ft=Qt.y,$t=Math.cos(Math.PI/2-this._pitch)*zt+this.cameraToCenterDistance,he=$t*1.01,Ne=this.height/50,Ie=new Float64Array(16);t.perspective(Ie,this._fov,this.width/this.height,Ne,he),Ie[8]=-tt.x*2/this.width,Ie[9]=tt.y*2/this.height,t.scale(Ie,Ie,[1,-1,1]),t.translate(Ie,Ie,[0,0,-this.cameraToCenterDistance]),t.rotateX(Ie,Ie,this._pitch),t.rotateZ(Ie,Ie,this.angle),t.translate(Ie,Ie,[-ne,-Ft,0]),this.mercatorMatrix=t.scale([],Ie,[this.worldSize,this.worldSize,this.worldSize]),t.scale(Ie,Ie,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Ie,this.invProjMatrix=t.invert([],this.projMatrix);var Fe=this.width%2/2,He=this.height%2/2,Ge=Math.cos(this.angle),Ae=Math.sin(this.angle),Oe=ne-Math.round(ne)+Ge*Fe+Ae*He,Le=Ft-Math.round(Ft)+Ge*He+Ae*Fe,ur=new Float64Array(Ie);if(t.translate(ur,ur,[Oe>.5?Oe-1:Oe,Le>.5?Le-1:Le,0]),this.alignedProjMatrix=ur,Ie=t.create(),t.scale(Ie,Ie,[this.width/2,-this.height/2,1]),t.translate(Ie,Ie,[1,-1,0]),this.labelPlaneMatrix=Ie,Ie=t.create(),t.scale(Ie,Ie,[1,-1,1]),t.translate(Ie,Ie,[-1,-1,0]),t.scale(Ie,Ie,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ie,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Ie=t.invert(new Float64Array(16),this.pixelMatrix),!Ie)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ie,this._posMatrixCache={},this._alignedPosMatrixCache={}}},To.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var U=this.pointCoordinate(new t.Point(0,0)),tt=[U.x*this.worldSize,U.y*this.worldSize,0,1],Y=t.transformMat4(tt,tt,this.pixelMatrix);return Y[3]/this.cameraToCenterDistance},To.prototype.getCameraPoint=function(){var U=this._pitch,tt=Math.tan(U)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,tt))},To.prototype.getCameraQueryGeometry=function(U){var tt=this.getCameraPoint();if(U.length===1)return[U[0],tt];for(var Y=tt.x,ft=tt.y,zt=tt.x,Qt=tt.y,ne=0,Ft=U;ne<Ft.length;ne+=1){var $t=Ft[ne];Y=Math.min(Y,$t.x),ft=Math.min(ft,$t.y),zt=Math.max(zt,$t.x),Qt=Math.max(Qt,$t.y)}return[new t.Point(Y,ft),new t.Point(zt,ft),new t.Point(zt,Qt),new t.Point(Y,Qt),new t.Point(Y,ft)]},Object.defineProperties(To.prototype,ko);function hl(U,tt){var Y=!1,ft=null,zt=function(){ft=null,Y&&(U(),ft=setTimeout(zt,tt),Y=!1)};return function(){return Y=!0,ft||zt(),ft}}var Sl=function(U){this._hashName=U&&encodeURIComponent(U),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=hl(this._updateHashUnthrottled.bind(this),30*1e3/100)};Sl.prototype.addTo=function(U){return this._map=U,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Sl.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Sl.prototype.getHashString=function(U){var tt=this._map.getCenter(),Y=Math.round(this._map.getZoom()*100)/100,ft=Math.ceil((Y*Math.LN2+Math.log(512/360/.5))/Math.LN10),zt=Math.pow(10,ft),Qt=Math.round(tt.lng*zt)/zt,ne=Math.round(tt.lat*zt)/zt,Ft=this._map.getBearing(),$t=this._map.getPitch(),he="";if(U?he+="/"+Qt+"/"+ne+"/"+Y:he+=Y+"/"+ne+"/"+Qt,(Ft||$t)&&(he+="/"+Math.round(Ft*10)/10),$t&&(he+="/"+Math.round($t)),this._hashName){var Ne=this._hashName,Ie=!1,Fe=t.window.location.hash.slice(1).split("&").map(function(He){var Ge=He.split("=")[0];return Ge===Ne?(Ie=!0,Ge+"="+he):He}).filter(function(He){return He});return Ie||Fe.push(Ne+"="+he),"#"+Fe.join("&")}return"#"+he},Sl.prototype._getCurrentHash=function(){var U=this,tt=t.window.location.hash.replace("#","");if(this._hashName){var Y;return tt.split("&").map(function(ft){return ft.split("=")}).forEach(function(ft){ft[0]===U._hashName&&(Y=ft)}),(Y&&Y[1]||"").split("/")}return tt.split("/")},Sl.prototype._onHashChange=function(){var U=this._getCurrentHash();if(U.length>=3&&!U.some(function(Y){return isNaN(Y)})){var tt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(U[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+U[2],+U[1]],zoom:+U[0],bearing:tt,pitch:+(U[4]||0)}),!0}return!1},Sl.prototype._updateHashUnthrottled=function(){var U=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,U)}catch{}};var tu={linearity:.3,easing:t.bezier(0,0,.3,1)},gt=t.extend({deceleration:2500,maxSpeed:1400},tu),Et=t.extend({deceleration:20,maxSpeed:1400},tu),Xt=t.extend({deceleration:1e3,maxSpeed:360},tu),fe=t.extend({deceleration:1e3,maxSpeed:90},tu),me=function(U){this._map=U,this.clear()};me.prototype.clear=function(){this._inertiaBuffer=[]},me.prototype.record=function(U){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:U})},me.prototype._drainInertiaBuffer=function(){for(var U=this._inertiaBuffer,tt=t.browser.now(),Y=160;U.length>0&&tt-U[0].time>Y;)U.shift()},me.prototype._onMoveEnd=function(U){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var tt={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},Y=0,ft=this._inertiaBuffer;Y<ft.length;Y+=1){var zt=ft[Y],Qt=zt.settings;tt.zoom+=Qt.zoomDelta||0,tt.bearing+=Qt.bearingDelta||0,tt.pitch+=Qt.pitchDelta||0,Qt.panDelta&&tt.pan._add(Qt.panDelta),Qt.around&&(tt.around=Qt.around),Qt.pinchAround&&(tt.pinchAround=Qt.pinchAround)}var ne=this._inertiaBuffer[this._inertiaBuffer.length-1],Ft=ne.time-this._inertiaBuffer[0].time,$t={};if(tt.pan.mag()){var he=Ve(tt.pan.mag(),Ft,t.extend({},gt,U||{}));$t.offset=tt.pan.mult(he.amount/tt.pan.mag()),$t.center=this._map.transform.center,we($t,he)}if(tt.zoom){var Ne=Ve(tt.zoom,Ft,Et);$t.zoom=this._map.transform.zoom+Ne.amount,we($t,Ne)}if(tt.bearing){var Ie=Ve(tt.bearing,Ft,Xt);$t.bearing=this._map.transform.bearing+t.clamp(Ie.amount,-179,179),we($t,Ie)}if(tt.pitch){var Fe=Ve(tt.pitch,Ft,fe);$t.pitch=this._map.transform.pitch+Fe.amount,we($t,Fe)}if($t.zoom||$t.bearing){var He=tt.pinchAround===void 0?tt.around:tt.pinchAround;$t.around=He?this._map.unproject(He):this._map.getCenter()}return this.clear(),t.extend($t,{noMoveStart:!0})}};function we(U,tt){(!U.duration||U.duration<tt.duration)&&(U.duration=tt.duration,U.easing=tt.easing)}function Ve(U,tt,Y){var ft=Y.maxSpeed,zt=Y.linearity,Qt=Y.deceleration,ne=t.clamp(U*zt/(tt/1e3),-ft,ft),Ft=Math.abs(ne)/(Qt*zt);return{easing:Y.easing,duration:Ft*1e3,amount:ne*(Ft/2)}}var je=function(U){function tt(ft,zt,Qt,ne){ne===void 0&&(ne={});var Ft=r.mousePos(zt.getCanvasContainer(),Qt),$t=zt.unproject(Ft);U.call(this,ft,t.extend({point:Ft,lngLat:$t,originalEvent:Qt},ne)),this._defaultPrevented=!1,this.target=zt}U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt;var Y={defaultPrevented:{configurable:!0}};return tt.prototype.preventDefault=function(){this._defaultPrevented=!0},Y.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(tt.prototype,Y),tt}(t.Event),or=function(U){function tt(ft,zt,Qt){var ne=ft==="touchend"?Qt.changedTouches:Qt.touches,Ft=r.touchPos(zt.getCanvasContainer(),ne),$t=Ft.map(function(Ie){return zt.unproject(Ie)}),he=Ft.reduce(function(Ie,Fe,He,Ge){return Ie.add(Fe.div(Ge.length))},new t.Point(0,0)),Ne=zt.unproject(he);U.call(this,ft,{points:Ft,point:he,lngLats:$t,lngLat:Ne,originalEvent:Qt}),this._defaultPrevented=!1}U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt;var Y={defaultPrevented:{configurable:!0}};return tt.prototype.preventDefault=function(){this._defaultPrevented=!0},Y.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(tt.prototype,Y),tt}(t.Event),Cr=function(U){function tt(ft,zt,Qt){U.call(this,ft,{originalEvent:Qt}),this._defaultPrevented=!1}U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt;var Y={defaultPrevented:{configurable:!0}};return tt.prototype.preventDefault=function(){this._defaultPrevented=!0},Y.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(tt.prototype,Y),tt}(t.Event),Sr=function(U,tt){this._map=U,this._clickTolerance=tt.clickTolerance};Sr.prototype.reset=function(){delete this._mousedownPos},Sr.prototype.wheel=function(U){return this._firePreventable(new Cr(U.type,this._map,U))},Sr.prototype.mousedown=function(U,tt){return this._mousedownPos=tt,this._firePreventable(new je(U.type,this._map,U))},Sr.prototype.mouseup=function(U){this._map.fire(new je(U.type,this._map,U))},Sr.prototype.click=function(U,tt){this._mousedownPos&&this._mousedownPos.dist(tt)>=this._clickTolerance||this._map.fire(new je(U.type,this._map,U))},Sr.prototype.dblclick=function(U){return this._firePreventable(new je(U.type,this._map,U))},Sr.prototype.mouseover=function(U){this._map.fire(new je(U.type,this._map,U))},Sr.prototype.mouseout=function(U){this._map.fire(new je(U.type,this._map,U))},Sr.prototype.touchstart=function(U){return this._firePreventable(new or(U.type,this._map,U))},Sr.prototype.touchmove=function(U){this._map.fire(new or(U.type,this._map,U))},Sr.prototype.touchend=function(U){this._map.fire(new or(U.type,this._map,U))},Sr.prototype.touchcancel=function(U){this._map.fire(new or(U.type,this._map,U))},Sr.prototype._firePreventable=function(U){if(this._map.fire(U),U.defaultPrevented)return{}},Sr.prototype.isEnabled=function(){return!0},Sr.prototype.isActive=function(){return!1},Sr.prototype.enable=function(){},Sr.prototype.disable=function(){};var Wr=function(U){this._map=U};Wr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Wr.prototype.mousemove=function(U){this._map.fire(new je(U.type,this._map,U))},Wr.prototype.mousedown=function(){this._delayContextMenu=!0},Wr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new je("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Wr.prototype.contextmenu=function(U){this._delayContextMenu?this._contextMenuEvent=U:this._map.fire(new je(U.type,this._map,U)),this._map.listens("contextmenu")&&U.preventDefault()},Wr.prototype.isEnabled=function(){return!0},Wr.prototype.isActive=function(){return!1},Wr.prototype.enable=function(){},Wr.prototype.disable=function(){};var an=function(U,tt){this._map=U,this._el=U.getCanvasContainer(),this._container=U.getContainer(),this._clickTolerance=tt.clickTolerance||1};an.prototype.isEnabled=function(){return!!this._enabled},an.prototype.isActive=function(){return!!this._active},an.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},an.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},an.prototype.mousedown=function(U,tt){this.isEnabled()&&U.shiftKey&&U.button===0&&(r.disableDrag(),this._startPos=this._lastPos=tt,this._active=!0)},an.prototype.mousemoveWindow=function(U,tt){if(this._active){var Y=tt;if(!(this._lastPos.equals(Y)||!this._box&&Y.dist(this._startPos)<this._clickTolerance)){var ft=this._startPos;this._lastPos=Y,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",U));var zt=Math.min(ft.x,Y.x),Qt=Math.max(ft.x,Y.x),ne=Math.min(ft.y,Y.y),Ft=Math.max(ft.y,Y.y);r.setTransform(this._box,"translate("+zt+"px,"+ne+"px)"),this._box.style.width=Qt-zt+"px",this._box.style.height=Ft-ne+"px"}}},an.prototype.mouseupWindow=function(U,tt){var Y=this;if(this._active&&U.button===0){var ft=this._startPos,zt=tt;if(this.reset(),r.suppressClick(),ft.x===zt.x&&ft.y===zt.y)this._fireEvent("boxzoomcancel",U);else return this._map.fire(new t.Event("boxzoomend",{originalEvent:U})),{cameraAnimation:function(Qt){return Qt.fitScreenCoordinates(ft,zt,Y._map.getBearing(),{linear:!0})}}}},an.prototype.keydown=function(U){this._active&&U.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",U))},an.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},an.prototype._fireEvent=function(U,tt){return this._map.fire(new t.Event(U,{originalEvent:tt}))};function on(U,tt){for(var Y={},ft=0;ft<U.length;ft++)Y[U[ft].identifier]=tt[ft];return Y}function ta(U){for(var tt=new t.Point(0,0),Y=0,ft=U;Y<ft.length;Y+=1){var zt=ft[Y];tt._add(zt)}return tt.div(U.length)}var hn=500,Bn=500,Hn=30,Yn=function(U){this.reset(),this.numTouches=U.numTouches};Yn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Yn.prototype.touchstart=function(U,tt,Y){(this.centroid||Y.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=U.timeStamp),Y.length===this.numTouches&&(this.centroid=ta(tt),this.touches=on(Y,tt)))},Yn.prototype.touchmove=function(U,tt,Y){if(!(this.aborted||!this.centroid)){var ft=on(Y,tt);for(var zt in this.touches){var Qt=this.touches[zt],ne=ft[zt];(!ne||ne.dist(Qt)>Hn)&&(this.aborted=!0)}}},Yn.prototype.touchend=function(U,tt,Y){if((!this.centroid||U.timeStamp-this.startTime>Bn)&&(this.aborted=!0),Y.length===0){var ft=!this.aborted&&this.centroid;if(this.reset(),ft)return ft}};var na=function(U){this.singleTap=new Yn(U),this.numTaps=U.numTaps,this.reset()};na.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},na.prototype.touchstart=function(U,tt,Y){this.singleTap.touchstart(U,tt,Y)},na.prototype.touchmove=function(U,tt,Y){this.singleTap.touchmove(U,tt,Y)},na.prototype.touchend=function(U,tt,Y){var ft=this.singleTap.touchend(U,tt,Y);if(ft){var zt=U.timeStamp-this.lastTime<hn,Qt=!this.lastTap||this.lastTap.dist(ft)<Hn;if((!zt||!Qt)&&this.reset(),this.count++,this.lastTime=U.timeStamp,this.lastTap=ft,this.count===this.numTaps)return this.reset(),ft}};var _n=function(){this._zoomIn=new na({numTouches:1,numTaps:2}),this._zoomOut=new na({numTouches:2,numTaps:1}),this.reset()};_n.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},_n.prototype.touchstart=function(U,tt,Y){this._zoomIn.touchstart(U,tt,Y),this._zoomOut.touchstart(U,tt,Y)},_n.prototype.touchmove=function(U,tt,Y){this._zoomIn.touchmove(U,tt,Y),this._zoomOut.touchmove(U,tt,Y)},_n.prototype.touchend=function(U,tt,Y){var ft=this,zt=this._zoomIn.touchend(U,tt,Y),Qt=this._zoomOut.touchend(U,tt,Y);if(zt)return this._active=!0,U.preventDefault(),setTimeout(function(){return ft.reset()},0),{cameraAnimation:function(ne){return ne.easeTo({duration:300,zoom:ne.getZoom()+1,around:ne.unproject(zt)},{originalEvent:U})}};if(Qt)return this._active=!0,U.preventDefault(),setTimeout(function(){return ft.reset()},0),{cameraAnimation:function(ne){return ne.easeTo({duration:300,zoom:ne.getZoom()-1,around:ne.unproject(Qt)},{originalEvent:U})}}},_n.prototype.touchcancel=function(){this.reset()},_n.prototype.enable=function(){this._enabled=!0},_n.prototype.disable=function(){this._enabled=!1,this.reset()},_n.prototype.isEnabled=function(){return this._enabled},_n.prototype.isActive=function(){return this._active};var Ha=0,Wa=2,ri={};ri[Ha]=1,ri[Wa]=2;function xi(U,tt){var Y=ri[tt];return U.buttons===void 0||(U.buttons&Y)!==Y}var ki=function(U){this.reset(),this._clickTolerance=U.clickTolerance||1};ki.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},ki.prototype._correctButton=function(U,tt){return!1},ki.prototype._move=function(U,tt){return{}},ki.prototype.mousedown=function(U,tt){if(!this._lastPoint){var Y=r.mouseButton(U);this._correctButton(U,Y)&&(this._lastPoint=tt,this._eventButton=Y)}},ki.prototype.mousemoveWindow=function(U,tt){var Y=this._lastPoint;if(Y){if(U.preventDefault(),xi(U,this._eventButton)){this.reset();return}if(!(!this._moved&&tt.dist(Y)<this._clickTolerance))return this._moved=!0,this._lastPoint=tt,this._move(Y,tt)}},ki.prototype.mouseupWindow=function(U){if(this._lastPoint){var tt=r.mouseButton(U);tt===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())}},ki.prototype.enable=function(){this._enabled=!0},ki.prototype.disable=function(){this._enabled=!1,this.reset()},ki.prototype.isEnabled=function(){return this._enabled},ki.prototype.isActive=function(){return this._active};var zi=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.mousedown=function(Y,ft){U.prototype.mousedown.call(this,Y,ft),this._lastPoint&&(this._active=!0)},tt.prototype._correctButton=function(Y,ft){return ft===Ha&&!Y.ctrlKey},tt.prototype._move=function(Y,ft){return{around:ft,panDelta:ft.sub(Y)}},tt}(ki),jo=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype._correctButton=function(Y,ft){return ft===Ha&&Y.ctrlKey||ft===Wa},tt.prototype._move=function(Y,ft){var zt=.8,Qt=(ft.x-Y.x)*zt;if(Qt)return this._active=!0,{bearingDelta:Qt}},tt.prototype.contextmenu=function(Y){Y.preventDefault()},tt}(ki),Ii=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype._correctButton=function(Y,ft){return ft===Ha&&Y.ctrlKey||ft===Wa},tt.prototype._move=function(Y,ft){var zt=-.5,Qt=(ft.y-Y.y)*zt;if(Qt)return this._active=!0,{pitchDelta:Qt}},tt.prototype.contextmenu=function(Y){Y.preventDefault()},tt}(ki),Ji=function(U){this._minTouches=1,this._clickTolerance=U.clickTolerance||1,this.reset()};Ji.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Ji.prototype.touchstart=function(U,tt,Y){return this._calculateTransform(U,tt,Y)},Ji.prototype.touchmove=function(U,tt,Y){if(!(!this._active||Y.length<this._minTouches))return U.preventDefault(),this._calculateTransform(U,tt,Y)},Ji.prototype.touchend=function(U,tt,Y){this._calculateTransform(U,tt,Y),this._active&&Y.length<this._minTouches&&this.reset()},Ji.prototype.touchcancel=function(){this.reset()},Ji.prototype._calculateTransform=function(U,tt,Y){Y.length>0&&(this._active=!0);var ft=on(Y,tt),zt=new t.Point(0,0),Qt=new t.Point(0,0),ne=0;for(var Ft in ft){var $t=ft[Ft],he=this._touches[Ft];he&&(zt._add($t),Qt._add($t.sub(he)),ne++,ft[Ft]=$t)}if(this._touches=ft,!(ne<this._minTouches||!Qt.mag())){var Ne=Qt.div(ne);if(this._sum._add(Ne),!(this._sum.mag()<this._clickTolerance)){var Ie=zt.div(ne);return{around:Ie,panDelta:Ne}}}},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 es=function(){this.reset()};es.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},es.prototype._start=function(U){},es.prototype._move=function(U,tt,Y){return{}},es.prototype.touchstart=function(U,tt,Y){this._firstTwoTouches||Y.length<2||(this._firstTwoTouches=[Y[0].identifier,Y[1].identifier],this._start([tt[0],tt[1]]))},es.prototype.touchmove=function(U,tt,Y){if(this._firstTwoTouches){U.preventDefault();var ft=this._firstTwoTouches,zt=ft[0],Qt=ft[1],ne=pl(Y,tt,zt),Ft=pl(Y,tt,Qt);if(!(!ne||!Ft)){var $t=this._aroundCenter?null:ne.add(Ft).div(2);return this._move([ne,Ft],$t,U)}}},es.prototype.touchend=function(U,tt,Y){if(this._firstTwoTouches){var ft=this._firstTwoTouches,zt=ft[0],Qt=ft[1],ne=pl(Y,tt,zt),Ft=pl(Y,tt,Qt);ne&&Ft||(this._active&&r.suppressClick(),this.reset())}},es.prototype.touchcancel=function(){this.reset()},es.prototype.enable=function(U){this._enabled=!0,this._aroundCenter=!!U&&U.around==="center"},es.prototype.disable=function(){this._enabled=!1,this.reset()},es.prototype.isEnabled=function(){return this._enabled},es.prototype.isActive=function(){return this._active};function pl(U,tt,Y){for(var ft=0;ft<U.length;ft++)if(U[ft].identifier===Y)return tt[ft]}var Ns=.1;function fi(U,tt){return Math.log(U/tt)/Math.LN2}var Ao=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.reset=function(){U.prototype.reset.call(this),delete this._distance,delete this._startDistance},tt.prototype._start=function(Y){this._startDistance=this._distance=Y[0].dist(Y[1])},tt.prototype._move=function(Y,ft){var zt=this._distance;if(this._distance=Y[0].dist(Y[1]),!(!this._active&&Math.abs(fi(this._distance,this._startDistance))<Ns))return this._active=!0,{zoomDelta:fi(this._distance,zt),pinchAround:ft}},tt}(es),Bo=25;function Ds(U,tt){return U.angleWith(tt)*180/Math.PI}var Ts=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.reset=function(){U.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},tt.prototype._start=function(Y){this._startVector=this._vector=Y[0].sub(Y[1]),this._minDiameter=Y[0].dist(Y[1])},tt.prototype._move=function(Y,ft){var zt=this._vector;if(this._vector=Y[0].sub(Y[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Ds(this._vector,zt),pinchAround:ft}},tt.prototype._isBelowThreshold=function(Y){this._minDiameter=Math.min(this._minDiameter,Y.mag());var ft=Math.PI*this._minDiameter,zt=Bo/ft*360,Qt=Ds(Y,this._startVector);return Math.abs(Qt)<zt},tt}(es);function lu(U){return Math.abs(U.y)>Math.abs(U.x)}var ps=100,zs=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.reset=function(){U.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},tt.prototype._start=function(Y){this._lastPoints=Y,lu(Y[0].sub(Y[1]))&&(this._valid=!1)},tt.prototype._move=function(Y,ft,zt){var Qt=Y[0].sub(this._lastPoints[0]),ne=Y[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(Qt,ne,zt.timeStamp),!!this._valid){this._lastPoints=Y,this._active=!0;var Ft=(Qt.y+ne.y)/2,$t=-.5;return{pitchDelta:Ft*$t}}},tt.prototype.gestureBeginsVertically=function(Y,ft,zt){if(this._valid!==void 0)return this._valid;var Qt=2,ne=Y.mag()>=Qt,Ft=ft.mag()>=Qt;if(!(!ne&&!Ft)){if(!ne||!Ft)return this._firstMove===void 0&&(this._firstMove=zt),zt-this._firstMove<ps?void 0:!1;var $t=Y.y>0==ft.y>0;return lu(Y)&&lu(ft)&&$t}},tt}(es),Eu={panStep:100,bearingStep:15,pitchStep:10},ie=function(){var U=Eu;this._panStep=U.panStep,this._bearingStep=U.bearingStep,this._pitchStep=U.pitchStep,this._rotationDisabled=!1};ie.prototype.reset=function(){this._active=!1},ie.prototype.keydown=function(U){var tt=this;if(!(U.altKey||U.ctrlKey||U.metaKey)){var Y=0,ft=0,zt=0,Qt=0,ne=0;switch(U.keyCode){case 61:case 107:case 171:case 187:Y=1;break;case 189:case 109:case 173:Y=-1;break;case 37:U.shiftKey?ft=-1:(U.preventDefault(),Qt=-1);break;case 39:U.shiftKey?ft=1:(U.preventDefault(),Qt=1);break;case 38:U.shiftKey?zt=1:(U.preventDefault(),ne=-1);break;case 40:U.shiftKey?zt=-1:(U.preventDefault(),ne=1);break;default:return}return this._rotationDisabled&&(ft=0,zt=0),{cameraAnimation:function(Ft){var $t=Ft.getZoom();Ft.easeTo({duration:300,easeId:"keyboardHandler",easing:nr,zoom:Y?Math.round($t)+Y*(U.shiftKey?2:1):$t,bearing:Ft.getBearing()+ft*tt._bearingStep,pitch:Ft.getPitch()+zt*tt._pitchStep,offset:[-Qt*tt._panStep,-ne*tt._panStep],center:Ft.getCenter()},{originalEvent:U})}}}},ie.prototype.enable=function(){this._enabled=!0},ie.prototype.disable=function(){this._enabled=!1,this.reset()},ie.prototype.isEnabled=function(){return this._enabled},ie.prototype.isActive=function(){return this._active},ie.prototype.disableRotation=function(){this._rotationDisabled=!0},ie.prototype.enableRotation=function(){this._rotationDisabled=!1};function nr(U){return U*(2-U)}var cr=4.000244140625,sn=1/100,zn=1/450,Tn=2,qr=function(U,tt){this._map=U,this._el=U.getCanvasContainer(),this._handler=tt,this._delta=0,this._defaultZoomRate=sn,this._wheelZoomRate=zn,t.bindAll(["_onTimeout"],this)};qr.prototype.setZoomRate=function(U){this._defaultZoomRate=U},qr.prototype.setWheelZoomRate=function(U){this._wheelZoomRate=U},qr.prototype.isEnabled=function(){return!!this._enabled},qr.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},qr.prototype.isZooming=function(){return!!this._zooming},qr.prototype.enable=function(U){this.isEnabled()||(this._enabled=!0,this._aroundCenter=U&&U.around==="center")},qr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},qr.prototype.wheel=function(U){if(this.isEnabled()){var tt=U.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?U.deltaY*40:U.deltaY,Y=t.browser.now(),ft=Y-(this._lastWheelEventTime||0);this._lastWheelEventTime=Y,tt!==0&&tt%cr===0?this._type="wheel":tt!==0&&Math.abs(tt)<4?this._type="trackpad":ft>400?(this._type=null,this._lastValue=tt,this._timeout=setTimeout(this._onTimeout,40,U)):this._type||(this._type=Math.abs(ft*tt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,tt+=this._lastValue)),U.shiftKey&&tt&&(tt=tt/4),this._type&&(this._lastWheelEvent=U,this._delta-=tt,this._active||this._start(U)),U.preventDefault()}},qr.prototype._onTimeout=function(U){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(U)},qr.prototype._start=function(U){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 tt=r.mousePos(this._el,U);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(tt)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},qr.prototype.renderFrame=function(){var U=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var tt=this._map.transform;if(this._delta!==0){var Y=this._type==="wheel"&&Math.abs(this._delta)>cr?this._wheelZoomRate:this._defaultZoomRate,ft=Tn/(1+Math.exp(-Math.abs(this._delta*Y)));this._delta<0&&ft!==0&&(ft=1/ft);var zt=typeof this._targetZoom=="number"?tt.zoomScale(this._targetZoom):tt.scale;this._targetZoom=Math.min(tt.maxZoom,Math.max(tt.minZoom,tt.scaleZoom(zt*ft))),this._type==="wheel"&&(this._startZoom=tt.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var Qt=typeof this._targetZoom=="number"?this._targetZoom:tt.zoom,ne=this._startZoom,Ft=this._easing,$t=!1,he;if(this._type==="wheel"&&ne&&Ft){var Ne=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),Ie=Ft(Ne);he=t.number(ne,Qt,Ie),Ne<1?this._frameId||(this._frameId=!0):$t=!0}else he=Qt,$t=!0;return this._active=!0,$t&&(this._active=!1,this._finishTimeout=setTimeout(function(){U._zooming=!1,U._handler._triggerRenderFrame(),delete U._targetZoom,delete U._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!$t,zoomDelta:he-tt.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},qr.prototype._smoothOutEasing=function(U){var tt=t.ease;if(this._prevEase){var Y=this._prevEase,ft=(t.browser.now()-Y.start)/Y.duration,zt=Y.easing(ft+.01)-Y.easing(ft),Qt=.27/Math.sqrt(zt*zt+1e-4)*.01,ne=Math.sqrt(.27*.27-Qt*Qt);tt=t.bezier(Qt,ne,.25,1)}return this._prevEase={start:t.browser.now(),duration:U,easing:tt},tt},qr.prototype.reset=function(){this._active=!1};var Sn=function(U,tt){this._clickZoom=U,this._tapZoom=tt};Sn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Sn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Sn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Sn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var sa=function(){this.reset()};sa.prototype.reset=function(){this._active=!1},sa.prototype.dblclick=function(U,tt){return U.preventDefault(),{cameraAnimation:function(Y){Y.easeTo({duration:300,zoom:Y.getZoom()+(U.shiftKey?-1:1),around:Y.unproject(tt)},{originalEvent:U})}}},sa.prototype.enable=function(){this._enabled=!0},sa.prototype.disable=function(){this._enabled=!1,this.reset()},sa.prototype.isEnabled=function(){return this._enabled},sa.prototype.isActive=function(){return this._active};var ea=function(){this._tap=new na({numTouches:1,numTaps:1}),this.reset()};ea.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ea.prototype.touchstart=function(U,tt,Y){this._swipePoint||(this._tapTime&&U.timeStamp-this._tapTime>hn&&this.reset(),this._tapTime?Y.length>0&&(this._swipePoint=tt[0],this._swipeTouch=Y[0].identifier):this._tap.touchstart(U,tt,Y))},ea.prototype.touchmove=function(U,tt,Y){if(!this._tapTime)this._tap.touchmove(U,tt,Y);else if(this._swipePoint){if(Y[0].identifier!==this._swipeTouch)return;var ft=tt[0],zt=ft.y-this._swipePoint.y;return this._swipePoint=ft,U.preventDefault(),this._active=!0,{zoomDelta:zt/128}}},ea.prototype.touchend=function(U,tt,Y){if(this._tapTime)this._swipePoint&&Y.length===0&&this.reset();else{var ft=this._tap.touchend(U,tt,Y);ft&&(this._tapTime=U.timeStamp)}},ea.prototype.touchcancel=function(){this.reset()},ea.prototype.enable=function(){this._enabled=!0},ea.prototype.disable=function(){this._enabled=!1,this.reset()},ea.prototype.isEnabled=function(){return this._enabled},ea.prototype.isActive=function(){return this._active};var ka=function(U,tt,Y){this._el=U,this._mousePan=tt,this._touchPan=Y};ka.prototype.enable=function(U){this._inertiaOptions=U||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ka.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ka.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ka.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Ka=function(U,tt,Y){this._pitchWithRotate=U.pitchWithRotate,this._mouseRotate=tt,this._mousePitch=Y};Ka.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Ka.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Ka.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Ka.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Va=function(U,tt,Y,ft){this._el=U,this._touchZoom=tt,this._touchRotate=Y,this._tapDragZoom=ft,this._rotationDisabled=!1,this._enabled=!0};Va.prototype.enable=function(U){this._touchZoom.enable(U),this._rotationDisabled||this._touchRotate.enable(U),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Va.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Va.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Va.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Va.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Va.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var fa=function(U){return U.zoom||U.drag||U.pitch||U.rotate},Un=function(U){function tt(){U.apply(this,arguments)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt}(t.Event);function Nr(U){return U.panDelta&&U.panDelta.mag()||U.zoomDelta||U.bearingDelta||U.pitchDelta}var fn=function(U,tt){this._map=U,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new me(U),this._bearingSnap=tt.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(tt),t.bindAll(["handleEvent","handleWindowEvent"],this);var Y=this._el;this._listeners=[[Y,"touchstart",{passive:!0}],[Y,"touchmove",{passive:!1}],[Y,"touchend",void 0],[Y,"touchcancel",void 0],[Y,"mousedown",void 0],[Y,"mousemove",void 0],[Y,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[Y,"mouseover",void 0],[Y,"mouseout",void 0],[Y,"dblclick",void 0],[Y,"click",void 0],[Y,"keydown",{capture:!1}],[Y,"keyup",void 0],[Y,"wheel",{passive:!1}],[Y,"contextmenu",void 0],[t.window,"blur",void 0]];for(var ft=0,zt=this._listeners;ft<zt.length;ft+=1){var Qt=zt[ft],ne=Qt[0],Ft=Qt[1],$t=Qt[2];r.addEventListener(ne,Ft,ne===t.window.document?this.handleWindowEvent:this.handleEvent,$t)}};fn.prototype.destroy=function(){for(var U=0,tt=this._listeners;U<tt.length;U+=1){var Y=tt[U],ft=Y[0],zt=Y[1],Qt=Y[2];r.removeEventListener(ft,zt,ft===t.window.document?this.handleWindowEvent:this.handleEvent,Qt)}},fn.prototype._addDefaultHandlers=function(U){var tt=this._map,Y=tt.getCanvasContainer();this._add("mapEvent",new Sr(tt,U));var ft=tt.boxZoom=new an(tt,U);this._add("boxZoom",ft);var zt=new _n,Qt=new sa;tt.doubleClickZoom=new Sn(Qt,zt),this._add("tapZoom",zt),this._add("clickZoom",Qt);var ne=new ea;this._add("tapDragZoom",ne);var Ft=tt.touchPitch=new zs;this._add("touchPitch",Ft);var $t=new jo(U),he=new Ii(U);tt.dragRotate=new Ka(U,$t,he),this._add("mouseRotate",$t,["mousePitch"]),this._add("mousePitch",he,["mouseRotate"]);var Ne=new zi(U),Ie=new Ji(U);tt.dragPan=new ka(Y,Ne,Ie),this._add("mousePan",Ne),this._add("touchPan",Ie,["touchZoom","touchRotate"]);var Fe=new Ts,He=new Ao;tt.touchZoomRotate=new Va(Y,He,Fe,ne),this._add("touchRotate",Fe,["touchPan","touchZoom"]),this._add("touchZoom",He,["touchPan","touchRotate"]);var Ge=tt.scrollZoom=new qr(tt,this);this._add("scrollZoom",Ge,["mousePan"]);var Ae=tt.keyboard=new ie;this._add("keyboard",Ae),this._add("blockableMapEvent",new Wr(tt));for(var Oe=0,Le=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];Oe<Le.length;Oe+=1){var ur=Le[Oe];U.interactive&&U[ur]&&tt[ur].enable(U[ur])}},fn.prototype._add=function(U,tt,Y){this._handlers.push({handlerName:U,handler:tt,allowed:Y}),this._handlersById[U]=tt},fn.prototype.stop=function(U){if(!this._updatingCamera){for(var tt=0,Y=this._handlers;tt<Y.length;tt+=1){var ft=Y[tt],zt=ft.handler;zt.reset()}this._inertia.clear(),this._fireEvents({},{},U),this._changes=[]}},fn.prototype.isActive=function(){for(var U=0,tt=this._handlers;U<tt.length;U+=1){var Y=tt[U],ft=Y.handler;if(ft.isActive())return!0}return!1},fn.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},fn.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},fn.prototype.isMoving=function(){return!!fa(this._eventsInProgress)||this.isZooming()},fn.prototype._blockedByActive=function(U,tt,Y){for(var ft in U)if(ft!==Y&&(!tt||tt.indexOf(ft)<0))return!0;return!1},fn.prototype.handleWindowEvent=function(U){this.handleEvent(U,U.type+"Window")},fn.prototype._getMapTouches=function(U){for(var tt=[],Y=0,ft=U;Y<ft.length;Y+=1){var zt=ft[Y],Qt=zt.target;this._el.contains(Qt)&&tt.push(zt)}return tt},fn.prototype.handleEvent=function(U,tt){if(U.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;for(var Y=U.type==="renderFrame"?void 0:U,ft={needsRenderFrame:!1},zt={},Qt={},ne=U.touches?this._getMapTouches(U.touches):void 0,Ft=ne?r.touchPos(this._el,ne):r.mousePos(this._el,U),$t=0,he=this._handlers;$t<he.length;$t+=1){var Ne=he[$t],Ie=Ne.handlerName,Fe=Ne.handler,He=Ne.allowed;if(Fe.isEnabled()){var Ge=void 0;this._blockedByActive(Qt,He,Ie)?Fe.reset():Fe[tt||U.type]&&(Ge=Fe[tt||U.type](U,Ft,ne),this.mergeHandlerResult(ft,zt,Ge,Ie,Y),Ge&&Ge.needsRenderFrame&&this._triggerRenderFrame()),(Ge||Fe.isActive())&&(Qt[Ie]=Fe)}}var Ae={};for(var Oe in this._previousActiveHandlers)Qt[Oe]||(Ae[Oe]=Y);this._previousActiveHandlers=Qt,(Object.keys(Ae).length||Nr(ft))&&(this._changes.push([ft,zt,Ae]),this._triggerRenderFrame()),(Object.keys(Qt).length||Nr(ft))&&this._map._stop(!0),this._updatingCamera=!1;var Le=ft.cameraAnimation;Le&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Le(this._map))},fn.prototype.mergeHandlerResult=function(U,tt,Y,ft,zt){if(Y){t.extend(U,Y);var Qt={handlerName:ft,originalEvent:Y.originalEvent||zt};Y.zoomDelta!==void 0&&(tt.zoom=Qt),Y.panDelta!==void 0&&(tt.drag=Qt),Y.pitchDelta!==void 0&&(tt.pitch=Qt),Y.bearingDelta!==void 0&&(tt.rotate=Qt)}},fn.prototype._applyChanges=function(){for(var U={},tt={},Y={},ft=0,zt=this._changes;ft<zt.length;ft+=1){var Qt=zt[ft],ne=Qt[0],Ft=Qt[1],$t=Qt[2];ne.panDelta&&(U.panDelta=(U.panDelta||new t.Point(0,0))._add(ne.panDelta)),ne.zoomDelta&&(U.zoomDelta=(U.zoomDelta||0)+ne.zoomDelta),ne.bearingDelta&&(U.bearingDelta=(U.bearingDelta||0)+ne.bearingDelta),ne.pitchDelta&&(U.pitchDelta=(U.pitchDelta||0)+ne.pitchDelta),ne.around!==void 0&&(U.around=ne.around),ne.pinchAround!==void 0&&(U.pinchAround=ne.pinchAround),ne.noInertia&&(U.noInertia=ne.noInertia),t.extend(tt,Ft),t.extend(Y,$t)}this._updateMapTransform(U,tt,Y),this._changes=[]},fn.prototype._updateMapTransform=function(U,tt,Y){var ft=this._map,zt=ft.transform;if(!Nr(U))return this._fireEvents(tt,Y,!0);var Qt=U.panDelta,ne=U.zoomDelta,Ft=U.bearingDelta,$t=U.pitchDelta,he=U.around,Ne=U.pinchAround;Ne!==void 0&&(he=Ne),ft._stop(!0),he=he||ft.transform.centerPoint;var Ie=zt.pointLocation(Qt?he.sub(Qt):he);Ft&&(zt.bearing+=Ft),$t&&(zt.pitch+=$t),ne&&(zt.zoom+=ne),zt.setLocationAtPoint(Ie,he),this._map._update(),U.noInertia||this._inertia.record(U),this._fireEvents(tt,Y,!0)},fn.prototype._fireEvents=function(U,tt,Y){var ft=this,zt=fa(this._eventsInProgress),Qt=fa(U),ne={};for(var Ft in U){var $t=U[Ft],he=$t.originalEvent;this._eventsInProgress[Ft]||(ne[Ft+"start"]=he),this._eventsInProgress[Ft]=U[Ft]}!zt&&Qt&&this._fireEvent("movestart",Qt.originalEvent);for(var Ne in ne)this._fireEvent(Ne,ne[Ne]);Qt&&this._fireEvent("move",Qt.originalEvent);for(var Ie in U){var Fe=U[Ie],He=Fe.originalEvent;this._fireEvent(Ie,He)}var Ge={},Ae;for(var Oe in this._eventsInProgress){var Le=this._eventsInProgress[Oe],ur=Le.handlerName,Dr=Le.originalEvent;this._handlersById[ur].isActive()||(delete this._eventsInProgress[Oe],Ae=tt[ur]||Dr,Ge[Oe+"end"]=Ae)}for(var jr in Ge)this._fireEvent(jr,Ge[jr]);var On=fa(this._eventsInProgress);if(Y&&(zt||Qt)&&!On){this._updatingCamera=!0;var Ln=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),xn=function(Wn){return Wn!==0&&-ft._bearingSnap<Wn&&Wn<ft._bearingSnap};Ln?(xn(Ln.bearing||this._map.getBearing())&&(Ln.bearing=0),this._map.easeTo(Ln,{originalEvent:Ae})):(this._map.fire(new t.Event("moveend",{originalEvent:Ae})),xn(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},fn.prototype._fireEvent=function(U,tt){this._map.fire(new t.Event(U,tt?{originalEvent:tt}:{}))},fn.prototype._requestFrame=function(){var U=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(tt){delete U._frameId,U.handleEvent(new Un("renderFrame",{timeStamp:tt})),U._applyChanges()})},fn.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Xn=function(U){function tt(Y,ft){U.call(this),this._moving=!1,this._zooming=!1,this.transform=Y,this._bearingSnap=ft.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},tt.prototype.setCenter=function(Y,ft){return this.jumpTo({center:Y},ft)},tt.prototype.panBy=function(Y,ft,zt){return Y=t.Point.convert(Y).mult(-1),this.panTo(this.transform.center,t.extend({offset:Y},ft),zt)},tt.prototype.panTo=function(Y,ft,zt){return this.easeTo(t.extend({center:Y},ft),zt)},tt.prototype.getZoom=function(){return this.transform.zoom},tt.prototype.setZoom=function(Y,ft){return this.jumpTo({zoom:Y},ft),this},tt.prototype.zoomTo=function(Y,ft,zt){return this.easeTo(t.extend({zoom:Y},ft),zt)},tt.prototype.zoomIn=function(Y,ft){return this.zoomTo(this.getZoom()+1,Y,ft),this},tt.prototype.zoomOut=function(Y,ft){return this.zoomTo(this.getZoom()-1,Y,ft),this},tt.prototype.getBearing=function(){return this.transform.bearing},tt.prototype.setBearing=function(Y,ft){return this.jumpTo({bearing:Y},ft),this},tt.prototype.getPadding=function(){return this.transform.padding},tt.prototype.setPadding=function(Y,ft){return this.jumpTo({padding:Y},ft),this},tt.prototype.rotateTo=function(Y,ft,zt){return this.easeTo(t.extend({bearing:Y},ft),zt)},tt.prototype.resetNorth=function(Y,ft){return this.rotateTo(0,t.extend({duration:1e3},Y),ft),this},tt.prototype.resetNorthPitch=function(Y,ft){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},Y),ft),this},tt.prototype.snapToNorth=function(Y,ft){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(Y,ft):this},tt.prototype.getPitch=function(){return this.transform.pitch},tt.prototype.setPitch=function(Y,ft){return this.jumpTo({pitch:Y},ft),this},tt.prototype.cameraForBounds=function(Y,ft){Y=t.LngLatBounds.convert(Y);var zt=ft&&ft.bearing||0;return this._cameraForBoxAndBearing(Y.getNorthWest(),Y.getSouthEast(),zt,ft)},tt.prototype._cameraForBoxAndBearing=function(Y,ft,zt,Qt){var ne={top:0,bottom:0,right:0,left:0};if(Qt=t.extend({padding:ne,offset:[0,0],maxZoom:this.transform.maxZoom},Qt),typeof Qt.padding=="number"){var Ft=Qt.padding;Qt.padding={top:Ft,bottom:Ft,right:Ft,left:Ft}}Qt.padding=t.extend(ne,Qt.padding);var $t=this.transform,he=$t.padding,Ne=$t.project(t.LngLat.convert(Y)),Ie=$t.project(t.LngLat.convert(ft)),Fe=Ne.rotate(-zt*Math.PI/180),He=Ie.rotate(-zt*Math.PI/180),Ge=new t.Point(Math.max(Fe.x,He.x),Math.max(Fe.y,He.y)),Ae=new t.Point(Math.min(Fe.x,He.x),Math.min(Fe.y,He.y)),Oe=Ge.sub(Ae),Le=($t.width-(he.left+he.right+Qt.padding.left+Qt.padding.right))/Oe.x,ur=($t.height-(he.top+he.bottom+Qt.padding.top+Qt.padding.bottom))/Oe.y;if(ur<0||Le<0){t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");return}var Dr=Math.min($t.scaleZoom($t.scale*Math.min(Le,ur)),Qt.maxZoom),jr=typeof Qt.offset.x=="number"?new t.Point(Qt.offset.x,Qt.offset.y):t.Point.convert(Qt.offset),On=(Qt.padding.left-Qt.padding.right)/2,Ln=(Qt.padding.top-Qt.padding.bottom)/2,xn=new t.Point(On,Ln),Wn=xn.rotate(zt*Math.PI/180),Dn=jr.add(Wn),la=Dn.mult($t.scale/$t.zoomScale(Dr)),qn=$t.unproject(Ne.add(Ie).div(2).sub(la));return{center:qn,zoom:Dr,bearing:zt}},tt.prototype.fitBounds=function(Y,ft,zt){return this._fitInternal(this.cameraForBounds(Y,ft),ft,zt)},tt.prototype.fitScreenCoordinates=function(Y,ft,zt,Qt,ne){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(Y)),this.transform.pointLocation(t.Point.convert(ft)),zt,Qt),Qt,ne)},tt.prototype._fitInternal=function(Y,ft,zt){return Y?(ft=t.extend(Y,ft),delete ft.padding,ft.linear?this.easeTo(ft,zt):this.flyTo(ft,zt)):this},tt.prototype.jumpTo=function(Y,ft){this.stop();var zt=this.transform,Qt=!1,ne=!1,Ft=!1;return"zoom"in Y&&zt.zoom!==+Y.zoom&&(Qt=!0,zt.zoom=+Y.zoom),Y.center!==void 0&&(zt.center=t.LngLat.convert(Y.center)),"bearing"in Y&&zt.bearing!==+Y.bearing&&(ne=!0,zt.bearing=+Y.bearing),"pitch"in Y&&zt.pitch!==+Y.pitch&&(Ft=!0,zt.pitch=+Y.pitch),Y.padding!=null&&!zt.isPaddingEqual(Y.padding)&&(zt.padding=Y.padding),this.fire(new t.Event("movestart",ft)).fire(new t.Event("move",ft)),Qt&&this.fire(new t.Event("zoomstart",ft)).fire(new t.Event("zoom",ft)).fire(new t.Event("zoomend",ft)),ne&&this.fire(new t.Event("rotatestart",ft)).fire(new t.Event("rotate",ft)).fire(new t.Event("rotateend",ft)),Ft&&this.fire(new t.Event("pitchstart",ft)).fire(new t.Event("pitch",ft)).fire(new t.Event("pitchend",ft)),this.fire(new t.Event("moveend",ft))},tt.prototype.easeTo=function(Y,ft){var zt=this;this._stop(!1,Y.easeId),Y=t.extend({offset:[0,0],duration:500,easing:t.ease},Y),(Y.animate===!1||!Y.essential&&t.browser.prefersReducedMotion)&&(Y.duration=0);var Qt=this.transform,ne=this.getZoom(),Ft=this.getBearing(),$t=this.getPitch(),he=this.getPadding(),Ne="zoom"in Y?+Y.zoom:ne,Ie="bearing"in Y?this._normalizeBearing(Y.bearing,Ft):Ft,Fe="pitch"in Y?+Y.pitch:$t,He="padding"in Y?Y.padding:Qt.padding,Ge=t.Point.convert(Y.offset),Ae=Qt.centerPoint.add(Ge),Oe=Qt.pointLocation(Ae),Le=t.LngLat.convert(Y.center||Oe);this._normalizeCenter(Le);var ur=Qt.project(Oe),Dr=Qt.project(Le).sub(ur),jr=Qt.zoomScale(Ne-ne),On,Ln;Y.around&&(On=t.LngLat.convert(Y.around),Ln=Qt.locationPoint(On));var xn={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Ne!==ne,this._rotating=this._rotating||Ft!==Ie,this._pitching=this._pitching||Fe!==$t,this._padding=!Qt.isPaddingEqual(He),this._easeId=Y.easeId,this._prepareEase(ft,Y.noMoveStart,xn),this._ease(function(Wn){if(zt._zooming&&(Qt.zoom=t.number(ne,Ne,Wn)),zt._rotating&&(Qt.bearing=t.number(Ft,Ie,Wn)),zt._pitching&&(Qt.pitch=t.number($t,Fe,Wn)),zt._padding&&(Qt.interpolatePadding(he,He,Wn),Ae=Qt.centerPoint.add(Ge)),On)Qt.setLocationAtPoint(On,Ln);else{var Dn=Qt.zoomScale(Qt.zoom-ne),la=Ne>ne?Math.min(2,jr):Math.max(.5,jr),qn=Math.pow(la,1-Wn),Gn=Qt.unproject(ur.add(Dr.mult(Wn*qn)).mult(Dn));Qt.setLocationAtPoint(Qt.renderWorldCopies?Gn.wrap():Gn,Ae)}zt._fireMoveEvents(ft)},function(Wn){zt._afterEase(ft,Wn)},Y),this},tt.prototype._prepareEase=function(Y,ft,zt){zt===void 0&&(zt={}),this._moving=!0,!ft&&!zt.moving&&this.fire(new t.Event("movestart",Y)),this._zooming&&!zt.zooming&&this.fire(new t.Event("zoomstart",Y)),this._rotating&&!zt.rotating&&this.fire(new t.Event("rotatestart",Y)),this._pitching&&!zt.pitching&&this.fire(new t.Event("pitchstart",Y))},tt.prototype._fireMoveEvents=function(Y){this.fire(new t.Event("move",Y)),this._zooming&&this.fire(new t.Event("zoom",Y)),this._rotating&&this.fire(new t.Event("rotate",Y)),this._pitching&&this.fire(new t.Event("pitch",Y))},tt.prototype._afterEase=function(Y,ft){if(!(this._easeId&&ft&&this._easeId===ft)){delete this._easeId;var zt=this._zooming,Qt=this._rotating,ne=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,zt&&this.fire(new t.Event("zoomend",Y)),Qt&&this.fire(new t.Event("rotateend",Y)),ne&&this.fire(new t.Event("pitchend",Y)),this.fire(new t.Event("moveend",Y))}},tt.prototype.flyTo=function(Y,ft){var zt=this;if(!Y.essential&&t.browser.prefersReducedMotion){var Qt=t.pick(Y,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Qt,ft)}this.stop(),Y=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},Y);var ne=this.transform,Ft=this.getZoom(),$t=this.getBearing(),he=this.getPitch(),Ne=this.getPadding(),Ie="zoom"in Y?t.clamp(+Y.zoom,ne.minZoom,ne.maxZoom):Ft,Fe="bearing"in Y?this._normalizeBearing(Y.bearing,$t):$t,He="pitch"in Y?+Y.pitch:he,Ge="padding"in Y?Y.padding:ne.padding,Ae=ne.zoomScale(Ie-Ft),Oe=t.Point.convert(Y.offset),Le=ne.centerPoint.add(Oe),ur=ne.pointLocation(Le),Dr=t.LngLat.convert(Y.center||ur);this._normalizeCenter(Dr);var jr=ne.project(ur),On=ne.project(Dr).sub(jr),Ln=Y.curve,xn=Math.max(ne.width,ne.height),Wn=xn/Ae,Dn=On.mag();if("minZoom"in Y){var la=t.clamp(Math.min(Y.minZoom,Ft,Ie),ne.minZoom,ne.maxZoom),qn=xn/ne.zoomScale(la-Ft);Ln=Math.sqrt(qn/Dn*2)}var Gn=Ln*Ln;function ma(mo){var Xs=(Wn*Wn-xn*xn+(mo?-1:1)*Gn*Gn*Dn*Dn)/(2*(mo?Wn:xn)*Gn*Dn);return Math.log(Math.sqrt(Xs*Xs+1)-Xs)}function ti(mo){return(Math.exp(mo)-Math.exp(-mo))/2}function si(mo){return(Math.exp(mo)+Math.exp(-mo))/2}function Li(mo){return ti(mo)/si(mo)}var to=ma(0),ls=function(mo){return si(to)/si(to+Ln*mo)},ms=function(mo){return xn*((si(to)*Li(to+Ln*mo)-ti(to))/Gn)/Dn},Ko=(ma(1)-to)/Ln;if(Math.abs(Dn)<1e-6||!isFinite(Ko)){if(Math.abs(xn-Wn)<1e-6)return this.easeTo(Y,ft);var gs=Wn<xn?-1:1;Ko=Math.abs(Math.log(Wn/xn))/Ln,ms=function(){return 0},ls=function(mo){return Math.exp(gs*Ln*mo)}}if("duration"in Y)Y.duration=+Y.duration;else{var Pl="screenSpeed"in Y?+Y.screenSpeed/Ln:+Y.speed;Y.duration=1e3*Ko/Pl}return Y.maxDuration&&Y.duration>Y.maxDuration&&(Y.duration=0),this._zooming=!0,this._rotating=$t!==Fe,this._pitching=He!==he,this._padding=!ne.isPaddingEqual(Ge),this._prepareEase(ft,!1),this._ease(function(mo){var Xs=mo*Ko,tc=1/ls(Xs);ne.zoom=mo===1?Ie:Ft+ne.scaleZoom(tc),zt._rotating&&(ne.bearing=t.number($t,Fe,mo)),zt._pitching&&(ne.pitch=t.number(he,He,mo)),zt._padding&&(ne.interpolatePadding(Ne,Ge,mo),Le=ne.centerPoint.add(Oe));var kc=mo===1?Dr:ne.unproject(jr.add(On.mult(ms(Xs))).mult(tc));ne.setLocationAtPoint(ne.renderWorldCopies?kc.wrap():kc,Le),zt._fireMoveEvents(ft)},function(){return zt._afterEase(ft)},Y),this},tt.prototype.isEasing=function(){return!!this._easeFrameId},tt.prototype.stop=function(){return this._stop()},tt.prototype._stop=function(Y,ft){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var zt=this._onEaseEnd;delete this._onEaseEnd,zt.call(this,ft)}if(!Y){var Qt=this.handlers;Qt&&Qt.stop(!1)}return this},tt.prototype._ease=function(Y,ft,zt){zt.animate===!1||zt.duration===0?(Y(1),ft()):(this._easeStart=t.browser.now(),this._easeOptions=zt,this._onEaseFrame=Y,this._onEaseEnd=ft,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},tt.prototype._renderFrameCallback=function(){var Y=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Y)),Y<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},tt.prototype._normalizeBearing=function(Y,ft){Y=t.wrap(Y,-180,180);var zt=Math.abs(Y-ft);return Math.abs(Y-360-ft)<zt&&(Y-=360),Math.abs(Y+360-ft)<zt&&(Y+=360),Y},tt.prototype._normalizeCenter=function(Y){var ft=this.transform;if(!(!ft.renderWorldCopies||ft.lngRange)){var zt=Y.lng-ft.center.lng;Y.lng+=zt>180?-360:zt<-180?360:0}},tt}(t.Evented),jn=function(U){U===void 0&&(U={}),this.options=U,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};jn.prototype.getDefaultPosition=function(){return"bottom-right"},jn.prototype.onAdd=function(U){var tt=this.options&&this.options.compact;return this._map=U,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"),tt&&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),tt===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},jn.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},jn.prototype._setElementTitle=function(U,tt){var Y=this._map._getUIString("AttributionControl."+tt);U.title=Y,U.setAttribute("aria-label",Y)},jn.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"))},jn.prototype._updateEditLink=function(){var U=this._editLink;U||(U=this._editLink=this._container.querySelector(".mapbox-improve-map"));var tt=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(U){var Y=tt.reduce(function(ft,zt,Qt){return zt.value&&(ft+=zt.key+"="+zt.value+(Qt<tt.length-1?"&":"")),ft},"?");U.href=t.config.FEEDBACK_URL+"/"+Y+(this._map._hash?this._map._hash.getHashString(!0):""),U.rel="noopener nofollow",this._setElementTitle(U,"MapFeedback")}},jn.prototype._updateData=function(U){U&&(U.sourceDataType==="metadata"||U.sourceDataType==="visibility"||U.dataType==="style")&&(this._updateAttributions(),this._updateEditLink())},jn.prototype._updateAttributions=function(){if(this._map.style){var U=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?U=U.concat(this.options.customAttribution.map(function(Ft){return typeof Ft!="string"?"":Ft})):typeof this.options.customAttribution=="string"&&U.push(this.options.customAttribution)),this._map.style.stylesheet){var tt=this._map.style.stylesheet;this.styleOwner=tt.owner,this.styleId=tt.id}var Y=this._map.style.sourceCaches;for(var ft in Y){var zt=Y[ft];if(zt.used){var Qt=zt.getSource();Qt.attribution&&U.indexOf(Qt.attribution)<0&&U.push(Qt.attribution)}}U.sort(function(Ft,$t){return Ft.length-$t.length}),U=U.filter(function(Ft,$t){for(var he=$t+1;he<U.length;he++)if(U[he].indexOf(Ft)>=0)return!1;return!0});var ne=U.join(" | ");ne!==this._attribHTML&&(this._attribHTML=ne,U.length?(this._innerContainer.innerHTML=ne,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},jn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var kn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};kn.prototype.onAdd=function(U){this._map=U,this._container=r.create("div","mapboxgl-ctrl");var tt=r.create("a","mapboxgl-ctrl-logo");return tt.target="_blank",tt.rel="noopener nofollow",tt.href="https://www.mapbox.com/",tt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),tt.setAttribute("rel","noopener nofollow"),this._container.appendChild(tt),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},kn.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},kn.prototype.getDefaultPosition=function(){return"bottom-left"},kn.prototype._updateLogo=function(U){(!U||U.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},kn.prototype._logoRequired=function(){if(this._map.style){var U=this._map.style.sourceCaches;for(var tt in U){var Y=U[tt].getSource();if(Y.mapbox_logo)return!0}return!1}},kn.prototype._updateCompact=function(){var U=this._container.children;if(U.length){var tt=U[0];this._map.getCanvasContainer().offsetWidth<250?tt.classList.add("mapboxgl-compact"):tt.classList.remove("mapboxgl-compact")}};var Ia=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ia.prototype.add=function(U){var tt=++this._id,Y=this._queue;return Y.push({callback:U,id:tt,cancelled:!1}),tt},Ia.prototype.remove=function(U){for(var tt=this._currentlyRunning,Y=tt?this._queue.concat(tt):this._queue,ft=0,zt=Y;ft<zt.length;ft+=1){var Qt=zt[ft];if(Qt.id===U){Qt.cancelled=!0;return}}},Ia.prototype.run=function(U){U===void 0&&(U=0);var tt=this._currentlyRunning=this._queue;this._queue=[];for(var Y=0,ft=tt;Y<ft.length;Y+=1){var zt=ft[Y];if(!zt.cancelled&&(zt.callback(U),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ia.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var ya={"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"},qa=t.window.HTMLImageElement,Rn=t.window.HTMLElement,An=t.window.ImageBitmap,Pa=-2,ba=22,aa=0,oa=60,Sa={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:Pa,maxZoom:ba,minPitch:aa,maxPitch:oa,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},_i=function(U){function tt(ft){var zt=this;if(ft=t.extend({},Sa,ft),ft.minZoom!=null&&ft.maxZoom!=null&&ft.minZoom>ft.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(ft.minPitch!=null&&ft.maxPitch!=null&&ft.minPitch>ft.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(ft.minPitch!=null&&ft.minPitch<aa)throw new Error("minPitch must be greater than or equal to "+aa);if(ft.maxPitch!=null&&ft.maxPitch>oa)throw new Error("maxPitch must be less than or equal to "+oa);var Qt=new To(ft.minZoom,ft.maxZoom,ft.minPitch,ft.maxPitch,ft.renderWorldCopies);if(U.call(this,Qt,ft),this._interactive=ft.interactive,this._maxTileCacheSize=ft.maxTileCacheSize,this._failIfMajorPerformanceCaveat=ft.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=ft.preserveDrawingBuffer,this._antialias=ft.antialias,this._trackResize=ft.trackResize,this._bearingSnap=ft.bearingSnap,this._refreshExpiredTiles=ft.refreshExpiredTiles,this._fadeDuration=ft.fadeDuration,this._crossSourceCollisions=ft.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=ft.collectResourceTiming,this._renderTaskQueue=new Ia,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},ya,ft.locale),this._clickTolerance=ft.clickTolerance,this._requestManager=new t.RequestManager(ft.transformRequest,ft.accessToken),typeof ft.container=="string"){if(this._container=t.window.document.getElementById(ft.container),!this._container)throw new Error("Container '"+ft.container+"' not found.")}else if(ft.container instanceof Rn)this._container=ft.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(ft.maxBounds&&this.setMaxBounds(ft.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 zt._update(!1)}),this.on("moveend",function(){return zt._update(!1)}),this.on("zoom",function(){return zt._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 fn(this,ft);var ne=typeof ft.hash=="string"&&ft.hash||void 0;this._hash=ft.hash&&new Sl(ne).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:ft.center,zoom:ft.zoom,bearing:ft.bearing,pitch:ft.pitch}),ft.bounds&&(this.resize(),this.fitBounds(ft.bounds,t.extend({},ft.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=ft.localIdeographFontFamily,ft.style&&this.setStyle(ft.style,{localIdeographFontFamily:ft.localIdeographFontFamily}),ft.attributionControl&&this.addControl(new jn({customAttribution:ft.customAttribution})),this.addControl(new kn,ft.logoPosition),this.on("style.load",function(){zt.transform.unmodified&&zt.jumpTo(zt.style.stylesheet)}),this.on("data",function(Ft){zt._update(Ft.dataType==="style"),zt.fire(new t.Event(Ft.dataType+"data",Ft))}),this.on("dataloading",function(Ft){zt.fire(new t.Event(Ft.dataType+"dataloading",Ft))})}U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt;var Y={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return tt.prototype._getMapId=function(){return this._mapId},tt.prototype.addControl=function(ft,zt){if(zt===void 0&&(ft.getDefaultPosition?zt=ft.getDefaultPosition():zt="top-right"),!ft||!ft.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 Qt=ft.onAdd(this);this._controls.push(ft);var ne=this._controlPositions[zt];return zt.indexOf("bottom")!==-1?ne.insertBefore(Qt,ne.firstChild):ne.appendChild(Qt),this},tt.prototype.removeControl=function(ft){if(!ft||!ft.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 zt=this._controls.indexOf(ft);return zt>-1&&this._controls.splice(zt,1),ft.onRemove(this),this},tt.prototype.hasControl=function(ft){return this._controls.indexOf(ft)>-1},tt.prototype.resize=function(ft){var zt=this._containerDimensions(),Qt=zt[0],ne=zt[1];this._resizeCanvas(Qt,ne),this.transform.resize(Qt,ne),this.painter.resize(Qt,ne);var Ft=!this._moving;return Ft&&(this.stop(),this.fire(new t.Event("movestart",ft)).fire(new t.Event("move",ft))),this.fire(new t.Event("resize",ft)),Ft&&this.fire(new t.Event("moveend",ft)),this},tt.prototype.getBounds=function(){return this.transform.getBounds()},tt.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},tt.prototype.setMaxBounds=function(ft){return this.transform.setMaxBounds(t.LngLatBounds.convert(ft)),this._update()},tt.prototype.setMinZoom=function(ft){if(ft=ft??Pa,ft>=Pa&&ft<=this.transform.maxZoom)return this.transform.minZoom=ft,this._update(),this.getZoom()<ft&&this.setZoom(ft),this;throw new Error("minZoom must be between "+Pa+" and the current maxZoom, inclusive")},tt.prototype.getMinZoom=function(){return this.transform.minZoom},tt.prototype.setMaxZoom=function(ft){if(ft=ft??ba,ft>=this.transform.minZoom)return this.transform.maxZoom=ft,this._update(),this.getZoom()>ft&&this.setZoom(ft),this;throw new Error("maxZoom must be greater than the current minZoom")},tt.prototype.getMaxZoom=function(){return this.transform.maxZoom},tt.prototype.setMinPitch=function(ft){if(ft=ft??aa,ft<aa)throw new Error("minPitch must be greater than or equal to "+aa);if(ft>=aa&&ft<=this.transform.maxPitch)return this.transform.minPitch=ft,this._update(),this.getPitch()<ft&&this.setPitch(ft),this;throw new Error("minPitch must be between "+aa+" and the current maxPitch, inclusive")},tt.prototype.getMinPitch=function(){return this.transform.minPitch},tt.prototype.setMaxPitch=function(ft){if(ft=ft??oa,ft>oa)throw new Error("maxPitch must be less than or equal to "+oa);if(ft>=this.transform.minPitch)return this.transform.maxPitch=ft,this._update(),this.getPitch()>ft&&this.setPitch(ft),this;throw new Error("maxPitch must be greater than the current minPitch")},tt.prototype.getMaxPitch=function(){return this.transform.maxPitch},tt.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},tt.prototype.setRenderWorldCopies=function(ft){return this.transform.renderWorldCopies=ft,this._update()},tt.prototype.project=function(ft){return this.transform.locationPoint(t.LngLat.convert(ft))},tt.prototype.unproject=function(ft){return this.transform.pointLocation(t.Point.convert(ft))},tt.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},tt.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},tt.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},tt.prototype._createDelegatedListener=function(ft,zt,Qt){var ne=this,Ft;if(ft==="mouseenter"||ft==="mouseover"){var $t=!1,he=function(Ae){var Oe=ne.getLayer(zt)?ne.queryRenderedFeatures(Ae.point,{layers:[zt]}):[];Oe.length?$t||($t=!0,Qt.call(ne,new je(ft,ne,Ae.originalEvent,{features:Oe}))):$t=!1},Ne=function(){$t=!1};return{layer:zt,listener:Qt,delegates:{mousemove:he,mouseout:Ne}}}else if(ft==="mouseleave"||ft==="mouseout"){var Ie=!1,Fe=function(Ae){var Oe=ne.getLayer(zt)?ne.queryRenderedFeatures(Ae.point,{layers:[zt]}):[];Oe.length?Ie=!0:Ie&&(Ie=!1,Qt.call(ne,new je(ft,ne,Ae.originalEvent)))},He=function(Ae){Ie&&(Ie=!1,Qt.call(ne,new je(ft,ne,Ae.originalEvent)))};return{layer:zt,listener:Qt,delegates:{mousemove:Fe,mouseout:He}}}else{var Ge=function(Ae){var Oe=ne.getLayer(zt)?ne.queryRenderedFeatures(Ae.point,{layers:[zt]}):[];Oe.length&&(Ae.features=Oe,Qt.call(ne,Ae),delete Ae.features)};return{layer:zt,listener:Qt,delegates:(Ft={},Ft[ft]=Ge,Ft)}}},tt.prototype.on=function(ft,zt,Qt){if(Qt===void 0)return U.prototype.on.call(this,ft,zt);var ne=this._createDelegatedListener(ft,zt,Qt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[ft]=this._delegatedListeners[ft]||[],this._delegatedListeners[ft].push(ne);for(var Ft in ne.delegates)this.on(Ft,ne.delegates[Ft]);return this},tt.prototype.once=function(ft,zt,Qt){if(Qt===void 0)return U.prototype.once.call(this,ft,zt);var ne=this._createDelegatedListener(ft,zt,Qt);for(var Ft in ne.delegates)this.once(Ft,ne.delegates[Ft]);return this},tt.prototype.off=function(ft,zt,Qt){var ne=this;if(Qt===void 0)return U.prototype.off.call(this,ft,zt);var Ft=function($t){for(var he=$t[ft],Ne=0;Ne<he.length;Ne++){var Ie=he[Ne];if(Ie.layer===zt&&Ie.listener===Qt){for(var Fe in Ie.delegates)ne.off(Fe,Ie.delegates[Fe]);return he.splice(Ne,1),ne}}};return this._delegatedListeners&&this._delegatedListeners[ft]&&Ft(this._delegatedListeners),this},tt.prototype.queryRenderedFeatures=function(ft,zt){if(!this.style)return[];zt===void 0&&ft!==void 0&&!(ft instanceof t.Point)&&!Array.isArray(ft)&&(zt=ft,ft=void 0),zt=zt||{},ft=ft||[[0,0],[this.transform.width,this.transform.height]];var Qt;if(ft instanceof t.Point||typeof ft[0]=="number")Qt=[t.Point.convert(ft)];else{var ne=t.Point.convert(ft[0]),Ft=t.Point.convert(ft[1]);Qt=[ne,new t.Point(Ft.x,ne.y),Ft,new t.Point(ne.x,Ft.y),ne]}return this.style.queryRenderedFeatures(Qt,zt,this.transform)},tt.prototype.querySourceFeatures=function(ft,zt){return this.style.querySourceFeatures(ft,zt)},tt.prototype.setStyle=function(ft,zt){return zt=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},zt),zt.diff!==!1&&zt.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&ft?(this._diffStyle(ft,zt),this):(this._localIdeographFontFamily=zt.localIdeographFontFamily,this._updateStyle(ft,zt))},tt.prototype._getUIString=function(ft){var zt=this._locale[ft];if(zt==null)throw new Error("Missing UI string '"+ft+"'");return zt},tt.prototype._updateStyle=function(ft,zt){if(this.style&&(this.style.setEventedParent(null),this.style._remove()),ft)this.style=new yl(this,zt||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof ft=="string"?this.style.loadURL(ft):this.style.loadJSON(ft),this},tt.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new yl(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},tt.prototype._diffStyle=function(ft,zt){var Qt=this;if(typeof ft=="string"){var ne=this._requestManager.normalizeStyleURL(ft),Ft=this._requestManager.transformRequest(ne,t.ResourceType.Style);t.getJSON(Ft,function($t,he){$t?Qt.fire(new t.ErrorEvent($t)):he&&Qt._updateDiff(he,zt)})}else typeof ft=="object"&&this._updateDiff(ft,zt)},tt.prototype._updateDiff=function(ft,zt){try{this.style.setState(ft)&&this._update(!0)}catch(Qt){t.warnOnce("Unable to perform style diff: "+(Qt.message||Qt.error||Qt)+". Rebuilding the style from scratch."),this._updateStyle(ft,zt)}},tt.prototype.getStyle=function(){if(this.style)return this.style.serialize()},tt.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},tt.prototype.addSource=function(ft,zt){return this._lazyInitEmptyStyle(),this.style.addSource(ft,zt),this._update(!0)},tt.prototype.isSourceLoaded=function(ft){var zt=this.style&&this.style.sourceCaches[ft];if(zt===void 0){this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+ft+"'")));return}return zt.loaded()},tt.prototype.areTilesLoaded=function(){var ft=this.style&&this.style.sourceCaches;for(var zt in ft){var Qt=ft[zt],ne=Qt._tiles;for(var Ft in ne){var $t=ne[Ft];if(!($t.state==="loaded"||$t.state==="errored"))return!1}}return!0},tt.prototype.addSourceType=function(ft,zt,Qt){return this._lazyInitEmptyStyle(),this.style.addSourceType(ft,zt,Qt)},tt.prototype.removeSource=function(ft){return this.style.removeSource(ft),this._update(!0)},tt.prototype.getSource=function(ft){return this.style.getSource(ft)},tt.prototype.addImage=function(ft,zt,Qt){Qt===void 0&&(Qt={});var ne=Qt.pixelRatio;ne===void 0&&(ne=1);var Ft=Qt.sdf;Ft===void 0&&(Ft=!1);var $t=Qt.stretchX,he=Qt.stretchY,Ne=Qt.content;this._lazyInitEmptyStyle();var Ie=0;if(zt instanceof qa||An&&zt instanceof An){var Fe=t.browser.getImageData(zt),He=Fe.width,Ge=Fe.height,Ae=Fe.data;this.style.addImage(ft,{data:new t.RGBAImage({width:He,height:Ge},Ae),pixelRatio:ne,stretchX:$t,stretchY:he,content:Ne,sdf:Ft,version:Ie})}else{if(zt.width===void 0||zt.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 Oe=zt.width,Le=zt.height,ur=zt.data,Dr=zt;this.style.addImage(ft,{data:new t.RGBAImage({width:Oe,height:Le},new Uint8Array(ur)),pixelRatio:ne,stretchX:$t,stretchY:he,content:Ne,sdf:Ft,version:Ie,userImage:Dr}),Dr.onAdd&&Dr.onAdd(this,ft)}},tt.prototype.updateImage=function(ft,zt){var Qt=this.style.getImage(ft);if(!Qt)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 ne=zt instanceof qa||An&&zt instanceof An?t.browser.getImageData(zt):zt,Ft=ne.width,$t=ne.height,he=ne.data;if(Ft===void 0||$t===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(Ft!==Qt.data.width||$t!==Qt.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 Ne=!(zt instanceof qa||An&&zt instanceof An);Qt.data.replace(he,Ne),this.style.updateImage(ft,Qt)},tt.prototype.hasImage=function(ft){return ft?!!this.style.getImage(ft):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},tt.prototype.removeImage=function(ft){this.style.removeImage(ft)},tt.prototype.loadImage=function(ft,zt){t.getImage(this._requestManager.transformRequest(ft,t.ResourceType.Image),zt)},tt.prototype.listImages=function(){return this.style.listImages()},tt.prototype.addLayer=function(ft,zt){return this._lazyInitEmptyStyle(),this.style.addLayer(ft,zt),this._update(!0)},tt.prototype.moveLayer=function(ft,zt){return this.style.moveLayer(ft,zt),this._update(!0)},tt.prototype.removeLayer=function(ft){return this.style.removeLayer(ft),this._update(!0)},tt.prototype.getLayer=function(ft){return this.style.getLayer(ft)},tt.prototype.setLayerZoomRange=function(ft,zt,Qt){return this.style.setLayerZoomRange(ft,zt,Qt),this._update(!0)},tt.prototype.setFilter=function(ft,zt,Qt){return Qt===void 0&&(Qt={}),this.style.setFilter(ft,zt,Qt),this._update(!0)},tt.prototype.getFilter=function(ft){return this.style.getFilter(ft)},tt.prototype.setPaintProperty=function(ft,zt,Qt,ne){return ne===void 0&&(ne={}),this.style.setPaintProperty(ft,zt,Qt,ne),this._update(!0)},tt.prototype.getPaintProperty=function(ft,zt){return this.style.getPaintProperty(ft,zt)},tt.prototype.setLayoutProperty=function(ft,zt,Qt,ne){return ne===void 0&&(ne={}),this.style.setLayoutProperty(ft,zt,Qt,ne),this._update(!0)},tt.prototype.getLayoutProperty=function(ft,zt){return this.style.getLayoutProperty(ft,zt)},tt.prototype.setLight=function(ft,zt){return zt===void 0&&(zt={}),this._lazyInitEmptyStyle(),this.style.setLight(ft,zt),this._update(!0)},tt.prototype.getLight=function(){return this.style.getLight()},tt.prototype.setFeatureState=function(ft,zt){return this.style.setFeatureState(ft,zt),this._update()},tt.prototype.removeFeatureState=function(ft,zt){return this.style.removeFeatureState(ft,zt),this._update()},tt.prototype.getFeatureState=function(ft){return this.style.getFeatureState(ft)},tt.prototype.getContainer=function(){return this._container},tt.prototype.getCanvasContainer=function(){return this._canvasContainer},tt.prototype.getCanvas=function(){return this._canvas},tt.prototype._containerDimensions=function(){var ft=0,zt=0;return this._container&&(ft=this._container.clientWidth||400,zt=this._container.clientHeight||300),[ft,zt]},tt.prototype._detectMissingCSS=function(){var ft=t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color");ft!=="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/.")},tt.prototype._setupContainer=function(){var ft=this._container;ft.classList.add("mapboxgl-map");var zt=this._missingCSSCanary=r.create("div","mapboxgl-canary",ft);zt.style.visibility="hidden",this._detectMissingCSS();var Qt=this._canvasContainer=r.create("div","mapboxgl-canvas-container",ft);this._interactive&&Qt.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",Qt),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 ne=this._containerDimensions();this._resizeCanvas(ne[0],ne[1]);var Ft=this._controlContainer=r.create("div","mapboxgl-control-container",ft),$t=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(he){$t[he]=r.create("div","mapboxgl-ctrl-"+he,Ft)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},tt.prototype._resizeCanvas=function(ft,zt){var Qt=t.browser.devicePixelRatio||1;this._canvas.width=Qt*ft,this._canvas.height=Qt*zt,this._canvas.style.width=ft+"px",this._canvas.style.height=zt+"px"},tt.prototype._setupPainter=function(){var ft=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),zt=this._canvas.getContext("webgl",ft)||this._canvas.getContext("experimental-webgl",ft);if(!zt){this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")));return}this.painter=new po(zt,this.transform),t.webpSupported.testSupport(zt)},tt.prototype._contextLost=function(ft){ft.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:ft}))},tt.prototype._contextRestored=function(ft){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:ft}))},tt.prototype._onMapScroll=function(ft){if(ft.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},tt.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},tt.prototype._update=function(ft){return this.style?(this._styleDirty=this._styleDirty||ft,this._sourcesDirty=!0,this.triggerRepaint(),this):this},tt.prototype._requestRenderFrame=function(ft){return this._update(),this._renderTaskQueue.add(ft)},tt.prototype._cancelRenderFrame=function(ft){this._renderTaskQueue.remove(ft)},tt.prototype._render=function(ft){var zt=this,Qt,ne=0,Ft=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(Qt=Ft.createQueryEXT(),Ft.beginQueryEXT(Ft.TIME_ELAPSED_EXT,Qt),ne=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(ft),!this._removed){var $t=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var he=this.transform.zoom,Ne=t.browser.now();this.style.zoomHistory.update(he,Ne);var Ie=new t.EvaluationParameters(he,{now:Ne,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Fe=Ie.crossFadingFactor();(Fe!==1||Fe!==this._crossFadingFactor)&&($t=!0,this._crossFadingFactor=Fe),this.style.update(Ie)}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()||$t)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var He=t.browser.now()-ne;Ft.endQueryEXT(Ft.TIME_ELAPSED_EXT,Qt),setTimeout(function(){var Oe=Ft.getQueryObjectEXT(Qt,Ft.QUERY_RESULT_EXT)/1e6;Ft.deleteQueryEXT(Qt),zt.fire(new t.Event("gpu-timing-frame",{cpuTime:He,gpuTime:Oe}))},50)}if(this.listens("gpu-timing-layer")){var Ge=this.painter.collectGpuTimers();setTimeout(function(){var Oe=zt.painter.queryGpuTimers(Ge);zt.fire(new t.Event("gpu-timing-layer",{layerTimes:Oe}))},50)}var Ae=this._sourcesDirty||this._styleDirty||this._placementDirty;return Ae||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this._loaded&&!this._fullyLoaded&&!Ae&&(this._fullyLoaded=!0),this}},tt.prototype.remove=function(){this._hash&&this._hash.remove();for(var ft=0,zt=this._controls;ft<zt.length;ft+=1){var Qt=zt[ft];Qt.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 ne=this.painter.context.gl.getExtension("WEBGL_lose_context");ne&&ne.loseContext&&ne.loseContext(),pi(this._canvasContainer),pi(this._controlContainer),pi(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},tt.prototype.triggerRepaint=function(){var ft=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(zt){ft._frame=null,ft._render(zt)}))},tt.prototype._onWindowOnline=function(){this._update()},tt.prototype._onWindowResize=function(ft){this._trackResize&&this.resize({originalEvent:ft})._update()},Y.showTileBoundaries.get=function(){return!!this._showTileBoundaries},Y.showTileBoundaries.set=function(ft){this._showTileBoundaries!==ft&&(this._showTileBoundaries=ft,this._update())},Y.showPadding.get=function(){return!!this._showPadding},Y.showPadding.set=function(ft){this._showPadding!==ft&&(this._showPadding=ft,this._update())},Y.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},Y.showCollisionBoxes.set=function(ft){this._showCollisionBoxes!==ft&&(this._showCollisionBoxes=ft,ft?this.style._generateCollisionBoxes():this._update())},Y.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},Y.showOverdrawInspector.set=function(ft){this._showOverdrawInspector!==ft&&(this._showOverdrawInspector=ft,this._update())},Y.repaint.get=function(){return!!this._repaint},Y.repaint.set=function(ft){this._repaint!==ft&&(this._repaint=ft,this.triggerRepaint())},Y.vertices.get=function(){return!!this._vertices},Y.vertices.set=function(ft){this._vertices=ft,this._update()},tt.prototype._setCacheLimits=function(ft,zt){t.setCacheLimits(ft,zt)},Y.version.get=function(){return t.version},Object.defineProperties(tt.prototype,Y),tt}(Xn);function pi(U){U.parentNode&&U.parentNode.removeChild(U)}var Ma={showCompass:!0,showZoom:!0,visualizePitch:!1},Na=function(U){var tt=this;this.options=t.extend({},Ma,U),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(Y){return Y.preventDefault()}),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(Y){return tt._map.zoomIn({},{originalEvent:Y})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(Y){return tt._map.zoomOut({},{originalEvent:Y})}),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(Y){tt.options.visualizePitch?tt._map.resetNorthPitch({},{originalEvent:Y}):tt._map.resetNorth({},{originalEvent:Y})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Na.prototype._updateZoomButtons=function(){var U=this._map.getZoom(),tt=U===this._map.getMaxZoom(),Y=U===this._map.getMinZoom();this._zoomInButton.disabled=tt,this._zoomOutButton.disabled=Y,this._zoomInButton.setAttribute("aria-disabled",tt.toString()),this._zoomOutButton.setAttribute("aria-disabled",Y.toString())},Na.prototype._rotateCompassArrow=function(){var U=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=U},Na.prototype.onAdd=function(U){return this._map=U,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 ui(this._map,this._compass,this.options.visualizePitch)),this._container},Na.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},Na.prototype._createButton=function(U,tt){var Y=r.create("button",U,this._container);return Y.type="button",Y.addEventListener("click",tt),Y},Na.prototype._setButtonTitle=function(U,tt){var Y=this._map._getUIString("NavigationControl."+tt);U.title=Y,U.setAttribute("aria-label",Y)};var ui=function(U,tt,Y){Y===void 0&&(Y=!1),this._clickTolerance=10,this.element=tt,this.mouseRotate=new jo({clickTolerance:U.dragRotate._mouseRotate._clickTolerance}),this.map=U,Y&&(this.mousePitch=new Ii({clickTolerance:U.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(tt,"mousedown",this.mousedown),r.addEventListener(tt,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(tt,"touchmove",this.touchmove),r.addEventListener(tt,"touchend",this.touchend),r.addEventListener(tt,"touchcancel",this.reset)};ui.prototype.down=function(U,tt){this.mouseRotate.mousedown(U,tt),this.mousePitch&&this.mousePitch.mousedown(U,tt),r.disableDrag()},ui.prototype.move=function(U,tt){var Y=this.map,ft=this.mouseRotate.mousemoveWindow(U,tt);if(ft&&ft.bearingDelta&&Y.setBearing(Y.getBearing()+ft.bearingDelta),this.mousePitch){var zt=this.mousePitch.mousemoveWindow(U,tt);zt&&zt.pitchDelta&&Y.setPitch(Y.getPitch()+zt.pitchDelta)}},ui.prototype.off=function(){var U=this.element;r.removeEventListener(U,"mousedown",this.mousedown),r.removeEventListener(U,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(U,"touchmove",this.touchmove),r.removeEventListener(U,"touchend",this.touchend),r.removeEventListener(U,"touchcancel",this.reset),this.offTemp()},ui.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},ui.prototype.mousedown=function(U){this.down(t.extend({},U,{ctrlKey:!0,preventDefault:function(){return U.preventDefault()}}),r.mousePos(this.element,U)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},ui.prototype.mousemove=function(U){this.move(U,r.mousePos(this.element,U))},ui.prototype.mouseup=function(U){this.mouseRotate.mouseupWindow(U),this.mousePitch&&this.mousePitch.mouseupWindow(U),this.offTemp()},ui.prototype.touchstart=function(U){U.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,U.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return U.preventDefault()}},this._startPos))},ui.prototype.touchmove=function(U){U.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,U.targetTouches)[0],this.move({preventDefault:function(){return U.preventDefault()}},this._lastPos))},ui.prototype.touchend=function(U){U.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ui.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};function gi(U,tt,Y){if(U=new t.LngLat(U.lng,U.lat),tt){var ft=new t.LngLat(U.lng-360,U.lat),zt=new t.LngLat(U.lng+360,U.lat),Qt=Y.locationPoint(U).distSqr(tt);Y.locationPoint(ft).distSqr(tt)<Qt?U=ft:Y.locationPoint(zt).distSqr(tt)<Qt&&(U=zt)}for(;Math.abs(U.lng-Y.center.lng)>180;){var ne=Y.locationPoint(U);if(ne.x>=0&&ne.y>=0&&ne.x<=Y.width&&ne.y<=Y.height)break;U.lng>Y.center.lng?U.lng-=360:U.lng+=360}return U}var Ri={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 ds(U,tt,Y){var ft=U.classList;for(var zt in Ri)ft.remove("mapboxgl-"+Y+"-anchor-"+zt);ft.add("mapboxgl-"+Y+"-anchor-"+tt)}var rs=function(U){function tt(Y,ft){if(U.call(this),(Y instanceof t.window.HTMLElement||ft)&&(Y=t.extend({element:Y},ft)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=Y&&Y.anchor||"center",this._color=Y&&Y.color||"#3FB1CE",this._scale=Y&&Y.scale||1,this._draggable=Y&&Y.draggable||!1,this._clickTolerance=Y&&Y.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=Y&&Y.rotation||0,this._rotationAlignment=Y&&Y.rotationAlignment||"auto",this._pitchAlignment=Y&&Y.pitchAlignment&&Y.pitchAlignment!=="auto"?Y.pitchAlignment:this._rotationAlignment,!Y||!Y.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var zt=r.createNS("http://www.w3.org/2000/svg","svg"),Qt=41,ne=27;zt.setAttributeNS(null,"display","block"),zt.setAttributeNS(null,"height",Qt+"px"),zt.setAttributeNS(null,"width",ne+"px"),zt.setAttributeNS(null,"viewBox","0 0 "+ne+" "+Qt);var Ft=r.createNS("http://www.w3.org/2000/svg","g");Ft.setAttributeNS(null,"stroke","none"),Ft.setAttributeNS(null,"stroke-width","1"),Ft.setAttributeNS(null,"fill","none"),Ft.setAttributeNS(null,"fill-rule","evenodd");var $t=r.createNS("http://www.w3.org/2000/svg","g");$t.setAttributeNS(null,"fill-rule","nonzero");var he=r.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(3.0, 29.0)"),he.setAttributeNS(null,"fill","#000000");for(var Ne=[{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"}],Ie=0,Fe=Ne;Ie<Fe.length;Ie+=1){var He=Fe[Ie],Ge=r.createNS("http://www.w3.org/2000/svg","ellipse");Ge.setAttributeNS(null,"opacity","0.04"),Ge.setAttributeNS(null,"cx","10.5"),Ge.setAttributeNS(null,"cy","5.80029008"),Ge.setAttributeNS(null,"rx",He.rx),Ge.setAttributeNS(null,"ry",He.ry),he.appendChild(Ge)}var Ae=r.createNS("http://www.w3.org/2000/svg","g");Ae.setAttributeNS(null,"fill",this._color);var Oe=r.createNS("http://www.w3.org/2000/svg","path");Oe.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"),Ae.appendChild(Oe);var Le=r.createNS("http://www.w3.org/2000/svg","g");Le.setAttributeNS(null,"opacity","0.25"),Le.setAttributeNS(null,"fill","#000000");var ur=r.createNS("http://www.w3.org/2000/svg","path");ur.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"),Le.appendChild(ur);var Dr=r.createNS("http://www.w3.org/2000/svg","g");Dr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Dr.setAttributeNS(null,"fill","#FFFFFF");var jr=r.createNS("http://www.w3.org/2000/svg","g");jr.setAttributeNS(null,"transform","translate(8.0, 8.0)");var On=r.createNS("http://www.w3.org/2000/svg","circle");On.setAttributeNS(null,"fill","#000000"),On.setAttributeNS(null,"opacity","0.25"),On.setAttributeNS(null,"cx","5.5"),On.setAttributeNS(null,"cy","5.5"),On.setAttributeNS(null,"r","5.4999962");var Ln=r.createNS("http://www.w3.org/2000/svg","circle");Ln.setAttributeNS(null,"fill","#FFFFFF"),Ln.setAttributeNS(null,"cx","5.5"),Ln.setAttributeNS(null,"cy","5.5"),Ln.setAttributeNS(null,"r","5.4999962"),jr.appendChild(On),jr.appendChild(Ln),$t.appendChild(he),$t.appendChild(Ae),$t.appendChild(Le),$t.appendChild(Dr),$t.appendChild(jr),zt.appendChild($t),zt.setAttributeNS(null,"height",Qt*this._scale+"px"),zt.setAttributeNS(null,"width",ne*this._scale+"px"),this._element.appendChild(zt),this._offset=t.Point.convert(Y&&Y.offset||[0,-14])}else this._element=Y.element,this._offset=t.Point.convert(Y&&Y.offset||[0,0]);this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(xn){xn.preventDefault()}),this._element.addEventListener("mousedown",function(xn){xn.preventDefault()}),ds(this._element,this._anchor,"marker"),this._popup=null}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.addTo=function(Y){return this.remove(),this._map=Y,Y.getCanvasContainer().appendChild(this._element),Y.on("move",this._update),Y.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},tt.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},tt.prototype.getLngLat=function(){return this._lngLat},tt.prototype.setLngLat=function(Y){return this._lngLat=t.LngLat.convert(Y),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},tt.prototype.getElement=function(){return this._element},tt.prototype.setPopup=function(Y){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),Y){if(!("offset"in Y.options)){var ft=38.1,zt=13.5,Qt=Math.sqrt(Math.pow(zt,2)/2);Y.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-ft],"bottom-left":[Qt,(ft-zt+Qt)*-1],"bottom-right":[-Qt,(ft-zt+Qt)*-1],left:[zt,(ft-zt)*-1],right:[-zt,(ft-zt)*-1]}:this._offset}this._popup=Y,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},tt.prototype._onKeyPress=function(Y){var ft=Y.code,zt=Y.charCode||Y.keyCode;(ft==="Space"||ft==="Enter"||zt===32||zt===13)&&this.togglePopup()},tt.prototype._onMapClick=function(Y){var ft=Y.originalEvent.target,zt=this._element;this._popup&&(ft===zt||zt.contains(ft))&&this.togglePopup()},tt.prototype.getPopup=function(){return this._popup},tt.prototype.togglePopup=function(){var Y=this._popup;if(Y)Y.isOpen()?Y.remove():Y.addTo(this._map);else return this;return this},tt.prototype._update=function(Y){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=gi(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var ft="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?ft="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(ft="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var zt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?zt="rotateX(0deg)":this._pitchAlignment==="map"&&(zt="rotateX("+this._map.getPitch()+"deg)"),(!Y||Y.type==="moveend")&&(this._pos=this._pos.round()),r.setTransform(this._element,Ri[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+zt+" "+ft)}},tt.prototype.getOffset=function(){return this._offset},tt.prototype.setOffset=function(Y){return this._offset=t.Point.convert(Y),this._update(),this},tt.prototype._onMove=function(Y){if(!this._isDragging){var ft=this._clickTolerance||this._map._clickTolerance;this._isDragging=Y.point.dist(this._pointerdownPos)>=ft}this._isDragging&&(this._pos=Y.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")))},tt.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"},tt.prototype._addDragHandler=function(Y){this._element.contains(Y.originalEvent.target)&&(Y.preventDefault(),this._positionDelta=Y.point.sub(this._pos).add(this._offset),this._pointerdownPos=Y.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))},tt.prototype.setDraggable=function(Y){return this._draggable=!!Y,this._map&&(Y?(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},tt.prototype.isDraggable=function(){return this._draggable},tt.prototype.setRotation=function(Y){return this._rotation=Y||0,this._update(),this},tt.prototype.getRotation=function(){return this._rotation},tt.prototype.setRotationAlignment=function(Y){return this._rotationAlignment=Y||"auto",this._update(),this},tt.prototype.getRotationAlignment=function(){return this._rotationAlignment},tt.prototype.setPitchAlignment=function(Y){return this._pitchAlignment=Y&&Y!=="auto"?Y:this._rotationAlignment,this._update(),this},tt.prototype.getPitchAlignment=function(){return this._pitchAlignment},tt}(t.Evented),Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Zs;function Zo(U){Zs!==void 0?U(Zs):t.window.navigator.permissions!==void 0?t.window.navigator.permissions.query({name:"geolocation"}).then(function(tt){Zs=tt.state!=="denied",U(Zs)}):(Zs=!!t.window.navigator.geolocation,U(Zs))}var Qs=0,El=!1,Cl=function(U){function tt(Y){U.call(this),this.options=t.extend({},Zi,Y),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.onAdd=function(Y){return this._map=Y,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Zo(this._setupUI),this._container},tt.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,Qs=0,El=!1},tt.prototype._isOutOfMapMaxBounds=function(Y){var ft=this._map.getMaxBounds(),zt=Y.coords;return ft&&(zt.longitude<ft.getWest()||zt.longitude>ft.getEast()||zt.latitude<ft.getSouth()||zt.latitude>ft.getNorth())},tt.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}},tt.prototype._onSuccess=function(Y){if(this._map){if(this._isOutOfMapMaxBounds(Y)){this._setErrorState(),this.fire(new t.Event("outofmaxbounds",Y)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=Y,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(Y),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(Y),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",Y)),this._finish()}},tt.prototype._updateCamera=function(Y){var ft=new t.LngLat(Y.coords.longitude,Y.coords.latitude),zt=Y.coords.accuracy,Qt=this._map.getBearing(),ne=t.extend({bearing:Qt},this.options.fitBoundsOptions);this._map.fitBounds(ft.toBounds(zt),ne,{geolocateSource:!0})},tt.prototype._updateMarker=function(Y){if(Y){var ft=new t.LngLat(Y.coords.longitude,Y.coords.latitude);this._accuracyCircleMarker.setLngLat(ft).addTo(this._map),this._userLocationDotMarker.setLngLat(ft).addTo(this._map),this._accuracy=Y.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},tt.prototype._updateCircleRadius=function(){var Y=this._map._container.clientHeight/2,ft=this._map.unproject([0,Y]),zt=this._map.unproject([1,Y]),Qt=ft.distanceTo(zt),ne=Math.ceil(2*this._accuracy/Qt);this._circleElement.style.width=ne+"px",this._circleElement.style.height=ne+"px"},tt.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},tt.prototype._onError=function(Y){if(this._map){if(this.options.trackUserLocation)if(Y.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 ft=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ft,this._geolocateButton.setAttribute("aria-label",ft),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(Y.code===3&&El)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",Y)),this._finish()}},tt.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},tt.prototype._setupUI=function(Y){var ft=this;if(this._container.addEventListener("contextmenu",function(ne){return ne.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",Y===!1){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var zt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=zt,this._geolocateButton.setAttribute("aria-label",zt)}else{var Qt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=Qt,this._geolocateButton.setAttribute("aria-label",Qt)}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 rs(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rs({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(ne){var Ft=ne.originalEvent&&ne.originalEvent.type==="resize";!ne.geolocateSource&&ft._watchState==="ACTIVE_LOCK"&&!Ft&&(ft._watchState="BACKGROUND",ft._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),ft._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),ft.fire(new t.Event("trackuserlocationend")))})},tt.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":Qs--,El=!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"),Qs++;var Y;Qs>1?(Y={maximumAge:6e5,timeout:0},El=!0):(Y=this.options.positionOptions,El=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Y)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},tt.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)},tt}(t.Evented),Hs={maxWidth:100,unit:"metric"},js=function(U){this.options=t.extend({},Hs,U),t.bindAll(["_onMove","setUnit"],this)};js.prototype.getDefaultPosition=function(){return"bottom-left"},js.prototype._onMove=function(){Ks(this._map,this._container,this.options)},js.prototype.onAdd=function(U){return this._map=U,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",U.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},js.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},js.prototype.setUnit=function(U){this.options.unit=U,Ks(this._map,this._container,this.options)};function Ks(U,tt,Y){var ft=Y&&Y.maxWidth||100,zt=U._container.clientHeight/2,Qt=U.unproject([0,zt]),ne=U.unproject([ft,zt]),Ft=Qt.distanceTo(ne);if(Y&&Y.unit==="imperial"){var $t=3.2808*Ft;if($t>5280){var he=$t/5280;Mi(tt,ft,he,U._getUIString("ScaleControl.Miles"))}else Mi(tt,ft,$t,U._getUIString("ScaleControl.Feet"))}else if(Y&&Y.unit==="nautical"){var Ne=Ft/1852;Mi(tt,ft,Ne,U._getUIString("ScaleControl.NauticalMiles"))}else Ft>=1e3?Mi(tt,ft,Ft/1e3,U._getUIString("ScaleControl.Kilometers")):Mi(tt,ft,Ft,U._getUIString("ScaleControl.Meters"))}function Mi(U,tt,Y,ft){var zt=Uo(Y),Qt=zt/Y;U.style.width=tt*Qt+"px",U.innerHTML=zt+"&nbsp;"+ft}function Ys(U){var tt=Math.pow(10,Math.ceil(-Math.log(U)/Math.LN10));return Math.round(U*tt)/tt}function Uo(U){var tt=Math.pow(10,(""+Math.floor(U)).length-1),Y=U/tt;return Y=Y>=10?10:Y>=5?5:Y>=3?3:Y>=2?2:Y>=1?1:Ys(Y),tt*Y}var tl=function(U){this._fullscreen=!1,U&&U.container&&(U.container instanceof t.window.HTMLElement?this._container=U.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")};tl.prototype.onAdd=function(U){return this._map=U,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},tl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},tl.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},tl.prototype._setupUI=function(){var U=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",U).setAttribute("aria-hidden",!0),U.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},tl.prototype._updateTitle=function(){var U=this._getTitle();this._fullscreenButton.setAttribute("aria-label",U),this._fullscreenButton.title=U},tl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},tl.prototype._isFullscreen=function(){return this._fullscreen},tl.prototype._changeIcon=function(){var U=t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement;U===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},tl.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 Il={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},vi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),lo=function(U){function tt(Y){U.call(this),this.options=t.extend(Object.create(Il),Y),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return U&&(tt.__proto__=U),tt.prototype=Object.create(U&&U.prototype),tt.prototype.constructor=tt,tt.prototype.addTo=function(Y){return this._map&&this.remove(),this._map=Y,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},tt.prototype.isOpen=function(){return!!this._map},tt.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},tt.prototype.getLngLat=function(){return this._lngLat},tt.prototype.setLngLat=function(Y){return this._lngLat=t.LngLat.convert(Y),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},tt.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},tt.prototype.getElement=function(){return this._container},tt.prototype.setText=function(Y){return this.setDOMContent(t.window.document.createTextNode(Y))},tt.prototype.setHTML=function(Y){var ft=t.window.document.createDocumentFragment(),zt=t.window.document.createElement("body"),Qt;for(zt.innerHTML=Y;Qt=zt.firstChild,!!Qt;)ft.appendChild(Qt);return this.setDOMContent(ft)},tt.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},tt.prototype.setMaxWidth=function(Y){return this.options.maxWidth=Y,this._update(),this},tt.prototype.setDOMContent=function(Y){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(Y),this._createCloseButton(),this._update(),this._focusFirstElement(),this},tt.prototype.addClassName=function(Y){this._container&&this._container.classList.add(Y)},tt.prototype.removeClassName=function(Y){this._container&&this._container.classList.remove(Y)},tt.prototype.setOffset=function(Y){return this.options.offset=Y,this._update(),this},tt.prototype.toggleClassName=function(Y){if(this._container)return this._container.classList.toggle(Y)},tt.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="&#215;",this._closeButton.addEventListener("click",this._onClose))},tt.prototype._onMouseUp=function(Y){this._update(Y.point)},tt.prototype._onMouseMove=function(Y){this._update(Y.point)},tt.prototype._onDrag=function(Y){this._update(Y.point)},tt.prototype._update=function(Y){var ft=this,zt=this._lngLat||this._trackPointer;if(!(!this._map||!zt||!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(Fe){return ft._container.classList.add(Fe)}),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=gi(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!Y))){var Qt=this._pos=this._trackPointer&&Y?Y:this._map.project(this._lngLat),ne=this.options.anchor,Ft=ns(this.options.offset);if(!ne){var $t=this._container.offsetWidth,he=this._container.offsetHeight,Ne;Qt.y+Ft.bottom.y<he?Ne=["top"]:Qt.y>this._map.transform.height-he?Ne=["bottom"]:Ne=[],Qt.x<$t/2?Ne.push("left"):Qt.x>this._map.transform.width-$t/2&&Ne.push("right"),Ne.length===0?ne="bottom":ne=Ne.join("-")}var Ie=Qt.add(Ft[ne]).round();r.setTransform(this._container,Ri[ne]+" translate("+Ie.x+"px,"+Ie.y+"px)"),ds(this._container,ne,"popup")}},tt.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var Y=this._container.querySelector(vi);Y&&Y.focus()}},tt.prototype._onClose=function(){this.remove()},tt}(t.Evented);function ns(U){if(U)if(typeof U=="number"){var tt=Math.round(Math.sqrt(.5*Math.pow(U,2)));return{center:new t.Point(0,0),top:new t.Point(0,U),"top-left":new t.Point(tt,tt),"top-right":new t.Point(-tt,tt),bottom:new t.Point(0,-U),"bottom-left":new t.Point(tt,-tt),"bottom-right":new t.Point(-tt,-tt),left:new t.Point(U,0),right:new t.Point(-U,0)}}else if(U instanceof t.Point||Array.isArray(U)){var Y=t.Point.convert(U);return{center:Y,top:Y,"top-left":Y,"top-right":Y,bottom:Y,"bottom-left":Y,"bottom-right":Y,left:Y,right:Y}}else return{center:t.Point.convert(U.center||[0,0]),top:t.Point.convert(U.top||[0,0]),"top-left":t.Point.convert(U["top-left"]||[0,0]),"top-right":t.Point.convert(U["top-right"]||[0,0]),bottom:t.Point.convert(U.bottom||[0,0]),"bottom-left":t.Point.convert(U["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(U["bottom-right"]||[0,0]),left:t.Point.convert(U.left||[0,0]),right:t.Point.convert(U.right||[0,0])};else return ns(new t.Point(0,0))}var $o={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:_i,NavigationControl:Na,GeolocateControl:Cl,AttributionControl:jn,ScaleControl:js,FullscreenControl:tl,Popup:lo,Marker:rs,Style:yl,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:Ga,clearPrewarmedResources:ve,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(U){t.config.ACCESS_TOKEN=U},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(U){t.config.API_URL=U},get workerCount(){return $n.workerCount},set workerCount(U){$n.workerCount=U},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(U){t.config.MAX_PARALLEL_IMAGE_REQUESTS=U},clearStorage:function(U){t.clearTileCache(U)},workerUrl:""};return $o}),E})}),tz=Vt((Z,V)=>{var u=Xr(),d=Dl().sanitizeHTML,E=k5(),A=Gp();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 f=a[s].id;if(typeof f=="string"&&f.indexOf(A.traceLayerPrefix)===0){o=f;break}}return o},e.updateLayer=function(o){var a=this.subplot,s=i(o),f=this.lookupBelow(),v=this.findFollowingMapboxLayerId(f);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=f},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 u.isPlainObject(a)||typeof a=="string"&&a.length>0}function i(o){var a={},s={};switch(o.type){case"circle":u.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":u.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":u.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var f=o.symbol,v=E(f.textposition,f.iconsize);u.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":f.placement}),u.extendFlat(s,{"icon-color":o.color,"text-color":f.textfont.color,"text-opacity":o.opacity});break;case"raster":u.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,f={type:a},v;return a==="geojson"?v="data":a==="vector"?v=typeof s=="string"?"url":"tiles":a==="raster"?(v="tiles",f.tileSize=256):a==="image"&&(v="url",f.coordinates=o.coordinates),f[v]=s,o.sourceattribution&&(f.attribution=d(o.sourceattribution)),f}V.exports=function(o,a,s){var f=new t(o,a);return f.update(s),f}}),ez=Vt((Z,V)=>{var u=A5(),d=Xr(),E=jd(),A=ji(),t=yo(),e=ih(),r=hc(),i=Jh(),n=i.drawMode,o=i.selectMode,a=Sc().prepSelect,s=Sc().clearOutline,f=Sc().clearSelectionsCache,v=Sc().selectOnClick,g=Gp(),m=tz();function w(M,T){this.id=T,this.gd=M;var c=M._fullLayout,h=M._context;this.container=c._glcontainer.node(),this.isStatic=h.staticPlot,this.uid=c._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(c),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=w.prototype;l.plot=function(M,T,c){var h=this,b=T[h.id];h.map&&b.accesstoken!==h.accessToken&&(h.map.remove(),h.map=null,h.styleObj=null,h.traceHash={},h.layerList=[]);var _;h.map?_=new Promise(function(P,L){h.updateMap(M,T,P,L)}):_=new Promise(function(P,L){h.createMap(M,T,P,L)}),c.push(_)},l.createMap=function(M,T,c,h){var b=this,_=T[b.id],P=b.styleObj=y(_.style,T);b.accessToken=_.accesstoken;var L=_.bounds,D=L?[[L.west,L.south],[L.east,L.north]]:null,B=b.map=new u.Map({container:b.div,style:P.style,center:k(_.center),zoom:_.zoom,bearing:_.bearing,pitch:_.pitch,maxBounds:D,interactive:!b.isStatic,preserveDrawingBuffer:b.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new u.AttributionControl({compact:!0}));B._canvas.style.left="0px",B._canvas.style.top="0px",b.rejectOnError(h),b.isStatic||b.initFx(M,T);var R=[];R.push(new Promise(function(I){B.once("load",I)})),R=R.concat(E.fetchTraceGeoData(M)),Promise.all(R).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.updateMap=function(M,T,c,h){var b=this,_=b.map,P=T[this.id];b.rejectOnError(h);var L=[],D=y(P.style,T);JSON.stringify(b.styleObj)!==JSON.stringify(D)&&(b.styleObj=D,_.setStyle(D.style),b.traceHash={},L.push(new Promise(function(B){_.once("styledata",B)}))),L=L.concat(E.fetchTraceGeoData(M)),Promise.all(L).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.fillBelowLookup=function(M,T){var c=T[this.id],h=c.layers,b,_,P=this.belowLookup={},L=!1;for(b=0;b<M.length;b++){var D=M[b][0].trace,B=D._module;typeof D.below=="string"?_=D.below:B.getBelow&&(_=B.getBelow(D,this)),_===""&&(L=!0),P["trace-"+D.uid]=_||""}for(b=0;b<h.length;b++){var R=h[b];typeof R.below=="string"?_=R.below:L?_="traces":_="",P["layout-"+b]=_}var I={},F,N;for(F in P)_=P[F],I[_]?I[_].push(F):I[_]=[F];for(_ in I){var j=I[_];if(j.length>1)for(b=0;b<j.length;b++)F=j[b],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 T=this.traceHash,c,h,b,_,P=M.slice().sort(function(I,F){return x[I[0].trace.type]-x[F[0].trace.type]});for(b=0;b<P.length;b++){var L=P[b];h=L[0].trace,c=T[h.uid];var D=!1;c&&(c.type===h.type?(c.update(L),D=!0):c.dispose()),!D&&h._module&&(T[h.uid]=h._module.plot(this,L))}var B=Object.keys(T);t:for(b=0;b<B.length;b++){var R=B[b];for(_=0;_<M.length;_++)if(h=M[_][0].trace,R===h.uid)continue t;c=T[R],c.dispose(),delete T[R]}},l.updateLayout=function(M){var T=this.map,c=M[this.id];!this.dragging&&!this.wheeling&&(T.setCenter(k(c.center)),T.setZoom(c.zoom),T.setBearing(c.bearing),T.setPitch(c.pitch)),this.updateLayers(M),this.updateFramework(M),this.updateFx(M),this.map.resize(),this.gd._context._scrollZoom.mapbox?T.scrollZoom.enable():T.scrollZoom.disable()},l.resolveOnRender=function(M){var T=this.map;T.on("render",function c(){T.loaded()&&(T.off("render",c),setTimeout(M,10))})},l.rejectOnError=function(M){var T=this.map;function c(){M(new Error(g.mapOnErrorMsg))}T.once("error",c),T.once("style.error",c),T.once("source.error",c),T.once("tile.error",c),T.once("layer.error",c)},l.createFramework=function(M){var T=this,c=T.div=document.createElement("div");c.id=T.uid,c.style.position="absolute",T.container.appendChild(c),T.xaxis={_id:"x",c2p:function(h){return T.project(h).x}},T.yaxis={_id:"y",c2p:function(h){return T.project(h).y}},T.updateFramework(M),T.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},t.setConvert(T.mockAxis,M)},l.initFx=function(M,T){var c=this,h=c.gd,b=c.map;b.on("moveend",function(L){if(c.map){var D=h._fullLayout;if(L.originalEvent||c.wheeling){var B=D[c.id];A.call("_storeDirectGUIEdit",h.layout,D._preGUI,c.getViewEdits(B));var R=c.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,h.emit("plotly_relayout",c.getViewEditsWithDerived(R))}L.originalEvent&&L.originalEvent.type==="mouseup"?c.dragging=!1:c.wheeling&&(c.wheeling=!1),D._rehover&&D._rehover()}}),b.on("wheel",function(){c.wheeling=!0}),b.on("mousemove",function(L){var D=c.div.getBoundingClientRect(),B=[L.originalEvent.offsetX,L.originalEvent.offsetY];L.target.getBoundingClientRect=function(){return D},c.xaxis.p2c=function(){return b.unproject(B).lng},c.yaxis.p2c=function(){return b.unproject(B).lat},h._fullLayout._rehover=function(){h._fullLayout._hoversubplot===c.id&&h._fullLayout[c.id]&&r.hover(h,L,c.id)},r.hover(h,L,c.id),h._fullLayout._hoversubplot=c.id});function _(){r.loneUnhover(T._hoverlayer)}b.on("dragstart",function(){c.dragging=!0,_()}),b.on("zoomstart",_),b.on("mouseout",function(){h._fullLayout._hoversubplot=null});function P(){var L=c.getView();h.emit("plotly_relayouting",c.getViewEditsWithDerived(L))}b.on("drag",P),b.on("zoom",P),b.on("dblclick",function(){var L=h._fullLayout[c.id];A.call("_storeDirectGUIEdit",h.layout,h._fullLayout._preGUI,c.getViewEdits(L));var D=c.viewInitial;b.setCenter(k(D.center)),b.setZoom(D.zoom),b.setBearing(D.bearing),b.setPitch(D.pitch);var B=c.getView();L._input.center=L.center=B.center,L._input.zoom=L.zoom=B.zoom,L._input.bearing=L.bearing=B.bearing,L._input.pitch=L.pitch=B.pitch,h.emit("plotly_doubleclick",null),h.emit("plotly_relayout",c.getViewEditsWithDerived(B))}),c.clearOutline=function(){f(c.dragOptions),s(c.dragOptions.gd)},c.onClickInPanFn=function(L){return function(D){var B=h._fullLayout.clickmode;B.indexOf("select")>-1&&v(D.originalEvent,h,[c.xaxis],[c.yaxis],c.id,L),B.indexOf("event")>-1&&r.click(h,D.originalEvent)}}},l.updateFx=function(M){var T=this,c=T.map,h=T.gd;if(T.isStatic)return;function b(D){var B=T.map.unproject(D);return[B.lng,B.lat]}var _=M.dragmode,P;P=function(D,B){if(B.isRect){var R=D.range={};R[T.id]=[b([B.xmin,B.ymin]),b([B.xmax,B.ymax])]}else{var I=D.lassoPoints={};I[T.id]=B.map(b)}};var L=T.dragOptions;T.dragOptions=d.extendDeep(L||{},{dragmode:M.dragmode,element:T.div,gd:h,plotinfo:{id:T.id,domain:M[T.id].domain,xaxis:T.xaxis,yaxis:T.yaxis,fillRangeItems:P},xaxes:[T.xaxis],yaxes:[T.yaxis],subplot:T.id}),c.off("click",T.onClickInPanHandler),o(_)||n(_)?(c.dragPan.disable(),c.on("zoomstart",T.clearOutline),T.dragOptions.prepFn=function(D,B,R){a(D,B,R,T.dragOptions,_)},e.init(T.dragOptions)):(c.dragPan.enable(),c.off("zoomstart",T.clearOutline),T.div.onmousedown=null,T.div.ontouchstart=null,T.div.removeEventListener("touchstart",T.div._ontouchstart),T.onClickInPanHandler=T.onClickInPanFn(T.dragOptions),c.on("click",T.onClickInPanHandler))},l.updateFramework=function(M){var T=M[this.id].domain,c=M._size,h=this.div.style;h.width=c.w*(T.x[1]-T.x[0])+"px",h.height=c.h*(T.y[1]-T.y[0])+"px",h.left=c.l+T.x[0]*c.w+"px",h.top=c.t+(1-T.y[1])*c.h+"px",this.xaxis._offset=c.l+T.x[0]*c.w,this.xaxis._length=c.w*(T.x[1]-T.x[0]),this.yaxis._offset=c.t+(1-T.y[1])*c.h,this.yaxis._length=c.h*(T.y[1]-T.y[0])},l.updateLayers=function(M){var T=M[this.id],c=T.layers,h=this.layerList,b;if(c.length!==h.length){for(b=0;b<h.length;b++)h[b].dispose();for(h=this.layerList=[],b=0;b<c.length;b++)h.push(m(this,b,c[b]))}else for(b=0;b<c.length;b++)h[b].update(c[b])},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,T,c){for(var h in c)this.map[T](M,h,c[h])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(M,T){var c=this.map;if(typeof T=="string"){if(T===""){c.addLayer(M,T);return}for(var h=this.getMapLayers(),b=0;b<h.length;b++)if(T===h[b].id){c.addLayer(M,T);return}d.warn(["Trying to add layer with *below* value",T,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}c.addLayer(M)},l.project=function(M){return this.map.project(new u.LngLat(M[0],M[1]))},l.getView=function(){var M=this.map,T=M.getCenter(),c=T.lng,h=T.lat,b={lon:c,lat:h},_=M.getCanvas(),P=parseInt(_.style.width),L=parseInt(_.style.height);return{center:b,zoom:M.getZoom(),bearing:M.getBearing(),pitch:M.getPitch(),_derived:{coordinates:[M.unproject([0,0]).toArray(),M.unproject([P,0]).toArray(),M.unproject([P,L]).toArray(),M.unproject([0,L]).toArray()]}}},l.getViewEdits=function(M){for(var T=this.id,c=["center","zoom","bearing","pitch"],h={},b=0;b<c.length;b++){var _=c[b];h[T+"."+_]=M[_]}return h},l.getViewEditsWithDerived=function(M){var T=this.id,c=this.getViewEdits(M);return c[T+"._derived"]=M._derived,c};function y(M,T){var c={};if(d.isPlainObject(M))c.id=M.id,c.style=M;else if(typeof M=="string")if(c.id=M,g.styleValuesMapbox.indexOf(M)!==-1)c.style=S(M);else if(g.stylesNonMapbox[M]){c.style=g.stylesNonMapbox[M];var h=c.style.sources["plotly-"+M],b=h?h.tiles:void 0;b&&b[0]&&b[0].slice(-9)==="?api_key="&&(b[0]+=T._mapboxAccessToken)}else c.style=M;else c.id=g.styleValueDflt,c.style=S(g.styleValueDflt);return c.transition={duration:0,delay:0},c}function S(M){return g.styleUrlPrefix+M+"-"+g.styleUrlSuffix}function k(M){return[M.lon,M.lat]}V.exports=w}),rz=Vt((Z,V)=>{var u=Xr(),d=zd(),E=Wf(),A=Pv();V.exports=function(r,i,n){d(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"),f=n("bounds.south"),v=n("bounds.north");(a===void 0||s===void 0||f===void 0||v===void 0)&&delete i.bounds,E(r,i,{name:"layers",handleItemDefaults:e}),i._input=r}function e(r,i){function n(g,m){return u.coerce(r,i,A.layers,g,m)}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 f;s&&(f="raster");var v=n("type",f);s&&v!=="raster"&&(v=i.type="raster",u.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"),u.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),Gx=Vt(Z=>{var V=A5(),u=Xr(),d=u.strTranslate,E=u.strScale,A=If().getSubplotCalcData,t=Eh(),e=Ni(),r=Eo(),i=Dl(),n=ez(),o="mapbox",a=Z.constants=Gp();Z.name=o,Z.attr="subplot",Z.idRoot=o,Z.idRegex=Z.attrRegex=u.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(" ");Z.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},Z.layoutAttributes=Pv(),Z.supplyLayoutDefaults=rz();var f=!0;Z.plot=function(m){f&&(f=!1,u.warn(s));var w=m._fullLayout,l=m.calcdata,x=w._subplots[o];if(V.version!==a.requiredVersion)throw new Error(a.wrongVersionErrorMsg);var y=v(m,x);V.accessToken=y;for(var S=0;S<x.length;S++){var k=x[S],M=A(l,o,k),T=w[k],c=T._subplot;c||(c=new n(m,k),w[k]._subplot=c),c.viewInitial||(c.viewInitial={center:u.extendFlat({},T.center),zoom:T.zoom,bearing:T.bearing,pitch:T.pitch}),c.plot(M,w,m._promises)}},Z.clean=function(m,w,l,x){for(var y=x._subplots[o]||[],S=0;S<y.length;S++){var k=y[S];!w[k]&&x[k]._subplot&&x[k]._subplot.destroy()}},Z.toSVG=function(m){for(var w=m._fullLayout,l=w._subplots[o],x=w._size,y=0;y<l.length;y++){var S=w[l[y]],k=S.domain,M=S._subplot,T=M.toImage("png"),c=w._glimages.append("svg:image");c.attr({xmlns:t.svg,"xlink:href":T,x:x.l+x.w*k.x[0],y:x.t+x.h*(1-k.y[1]),width:x.w*(k.x[1]-k.x[0]),height:x.h*(k.y[1]-k.y[0]),preserveAspectRatio:"none"});var h=e.select(S._subplot.div),b=h.select(".mapboxgl-ctrl-logo").node().offsetParent===null;if(!b){var _=w._glimages.append("g");_.attr("transform",d(x.l+x.w*k.x[0]+10,x.t+x.h*(1-k.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 P=h.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),L=w._glimages.append("g"),D=L.append("text");D.text(P).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":P});var B=r.bBox(D.node()),R=x.w*(k.x[1]-k.x[0]);if(B.width>R/2){var I=P.split("|").join("<br>");D.text(I).attr("data-unformatted",I).call(i.convertToTspans,m),B=r.bBox(D.node())}D.attr("transform",d(-3,-B.height+8)),L.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*k.x[1],x.t+x.h*(1-k.y[0])];L.attr("transform",d(N[0],N[1])+E(F))}};function v(m,w){var l=m._fullLayout,x=m._context;if(x.mapboxAccessToken==="")return"";for(var y=[],S=[],k=!1,M=!1,T=0;T<w.length;T++){var c=l[w[T]],h=c.accesstoken;g(c.style)&&(h?u.pushUnique(y,h):(g(c._input.style)&&(u.error("Uses Mapbox map style, but did not set an access token."),k=!0),M=!0)),h&&u.pushUnique(S,h)}if(M){var b=k?a.noAccessTokenErrorMsg:a.missingStyleErrorMsg;throw u.error(b),new Error(b)}return y.length?(y.length>1&&u.warn(a.multipleTokensErrorMsg),y[0]):(S.length&&u.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function g(m){return typeof m=="string"&&(a.styleValuesMapbox.indexOf(m)!==-1||m.indexOf("mapbox://")===0||m.indexOf("stamen")===0)}Z.updateFx=function(m){for(var w=m._fullLayout,l=w._subplots[o],x=0;x<l.length;x++){var y=w[l[x]]._subplot;y.updateFx(w)}}}),nz=Vt((Z,V)=>{V.exports={attributes:qx(),supplyDefaults:Y9(),colorbar:Gf(),formatLabels:T5(),calc:kx(),plot:$9(),hoverPoints:Wx().hoverPoints,eventData:J9(),selectPoints:Q9(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.update(d)}},moduleType:"trace",name:"scattermapbox",basePlotModule:Gx(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),az=Vt((Z,V)=>{V.exports=nz()}),M5=Vt((Z,V)=>{var u=qm(),d=Wl(),{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Tl(),e=So().extendFlat;V.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},u.featureidkey,{}),below:{valType:"string",editType:"plot"},text:u.text,hovertext:u.hovertext,marker:{line:{color:e({},u.marker.line.color,{editType:"plot"}),width:e({},u.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},u.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},u.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},u.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:u.hoverinfo,hovertemplate:E({},{keys:["properties"]}),hovertemplatefallback:A(),showlegend:e({},t.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),iz=Vt((Z,V)=>{var u=Xr(),d=gf(),E=M5();V.exports=function(A,t,e,r){function i(f,v){return u.coerce(A,t,E,f,v)}var n=i("locations"),o=i("z"),a=i("geojson");if(!u.isArrayOrTypedArray(n)||!n.length||!u.isArrayOrTypedArray(o)||!o.length||!(typeof a=="string"&&a!==""||u.isPlainObject(a))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,o.length),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback");var s=i("marker.line.width");s&&i("marker.line.color"),i("marker.opacity"),d(A,t,r,i,{prefix:"",cLetter:"z"}),u.coerceSelectionMarkerOpacity(t,i)}}),S5=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=xu(),A=Eo(),t=Nd().makeBlank,e=jd();function r(n){var o=n[0].trace,a=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},f={layout:{visibility:"none"},paint:{}},v=o._opts={fill:s,line:f,geojson:t()};if(!a)return v;var g=e.extractTraceFeature(n);if(!g)return v;var m=E.makeColorScaleFuncFromTrace(o),w=o.marker,l=w.line||{},x;d.isArrayOrTypedArray(w.opacity)&&(x=function(b){var _=b.mo;return u(_)?+d.constrain(_,0,1):0});var y;d.isArrayOrTypedArray(l.color)&&(y=function(b){return b.mlc});var S;d.isArrayOrTypedArray(l.width)&&(S=function(b){return b.mlw});for(var k=0;k<n.length;k++){var M=n[k],T=M.fOut;if(T){var c=T.properties;c.fc=m(M.z),x&&(c.mo=x(M)),y&&(c.mlc=y(M)),S&&(c.mlw=S(M)),M.ct=c.ct,M._polygons=e.feature2polygons(T)}}var h=x?{type:"identity",property:"mo"}:w.opacity;return d.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":h}),d.extendFlat(f.paint,{"line-color":y?{type:"identity",property:"mlc"}:l.color,"line-width":S?{type:"identity",property:"mlw"}:l.width,"line-opacity":h}),s.layout.visibility="visible",f.layout.visibility="visible",v.geojson={type:"FeatureCollection",features:g},i(n),v}function i(n){var o=n[0].trace,a=o._opts,s;if(o.selectedpoints){for(var f=A.makeSelectedPointStyleFns(o),v=0;v<n.length;v++){var g=n[v];g.fOut&&(g.fOut.properties.mo2=f.selectedOpacityFn(g))}s={type:"identity",property:"mo2"}}else s=d.isArrayOrTypedArray(o.marker.opacity)?{type:"identity",property:"mo"}:o.marker.opacity;return d.extendFlat(a.fill.paint,{"fill-opacity":s}),d.extendFlat(a.line.paint,{"line-opacity":s}),a}V.exports={convert:r,convertOnSelect:i}}),oz=Vt((Z,V)=>{var u=S5().convert,d=S5().convertOnSelect,E=Gp().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(u(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(d(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],f=a[1],v=e[s];r.setOptions(f,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&r.setOptions(f,"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],f=s[0],v=e[f];i.addLayer({type:f,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=u(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}}),sz=Vt((Z,V)=>{V.exports={attributes:M5(),supplyDefaults:iz(),colorbar:Ed(),calc:Ex(),plot:oz(),hoverPoints:Lx(),eventData:Cx(),selectPoints:Ix(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.updateOnSelect(d)}},getBelow:function(u,d){for(var E=d.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:Gx(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}),lz=Vt((Z,V)=>{V.exports=sz()}),E5=Vt((Z,V)=>{var u=Wl(),{hovertemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Tl(),t=qx(),e=So().extendFlat;V.exports=e({lon:t.lon,lat:t.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:t.text,hovertext:t.hovertext,hoverinfo:e({},A.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:d(),hovertemplatefallback:E(),showlegend:e({},A.showlegend,{dflt:!1})},u("",{cLetter:"z",editTypeOverride:"calc"}))}),uz=Vt((Z,V)=>{var u=Xr(),d=gf(),E=E5();V.exports=function(A,t,e,r){function i(s,f){return u.coerce(A,t,E,s,f)}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"),i("hovertemplatefallback"),d(A,t,r,i,{prefix:"",cLetter:"z"})}}),cz=Vt((Z,V)=>{var u=Lo(),d=Xr().isArrayOrTypedArray,E=ks().BADNUM,A=ah(),t=Xr()._;V.exports=function(e,r){for(var i=r._length,n=new Array(i),o=r.z,a=d(o)&&o.length,s=0;s<i;s++){var f=n[s]={},v=r.lon[s],g=r.lat[s];if(f.lonlat=u(v)&&u(g)?[+v,+g]:[E,E],a){var m=o[s];f.z=u(m)?m: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}}),fz=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=Pi(),A=xu(),t=ks().BADNUM,e=Nd().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=[],f,v=i.z,g=i.radius,m=d.isArrayOrTypedArray(v)&&v.length,w=d.isArrayOrTypedArray(g);for(f=0;f<r.length;f++){var l=r[f],x=l.lonlat;if(x[0]!==t){var y={};if(m){var S=l.z;y.z=S!==t?S:0}w&&(y.r=u(g[f])&&g[f]>0?+g[f]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:y})}}var k=A.extractOpts(i),M=k.reversescale?A.flipScale(k.colorscale):k.colorscale,T=M[0][1],c=E.opacity(T)<1?T:E.addOpacity(T,0),h=["interpolate",["linear"],["heatmap-density"],0,c];for(f=1;f<M.length;f++)h.push(M[f][0],M[f][1]);var b=["interpolate",["linear"],["get","z"],k.min,0,k.max,1];return d.extendFlat(a.heatmap.paint,{"heatmap-weight":m?b:1/(k.max-k.min),"heatmap-color":h,"heatmap-radius":w?{type:"identity",property:"r"}:i.radius,"heatmap-opacity":i.opacity}),a.geojson={type:"FeatureCollection",features:s},a.heatmap.layout.visibility="visible",a}}),hz=Vt((Z,V)=>{var u=fz(),d=Gp().traceLayerPrefix;function E(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",d+e+"-heatmap"]],this.below=null}var A=E.prototype;A.update=function(t){var e=this.subplot,r=this.layerList,i=u(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],f=a[1],v=i[s];e.setOptions(f,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&e.setOptions(f,"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],f=t[s];r.addLayer({type:s,id:a[1],source:n,layout:f.layout,paint:f.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=u(e),a=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),i._addLayers(o,a),i}}),pz=Vt((Z,V)=>{var u=yo(),d=Wx().hoverPoints,E=Wx().getExtraText;V.exports=function(A,t,e){var r=d(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=u.tickText(s,s.c2l(a.z),"hover").text}return i.extraText=E(o,a,n[0].t.labels),[i]}}}),dz=Vt((Z,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u.z=d.z,u}}),mz=Vt((Z,V)=>{V.exports={attributes:E5(),supplyDefaults:uz(),colorbar:Ed(),formatLabels:T5(),calc:cz(),plot:hz(),hoverPoints:pz(),eventData:dz(),getBelow:function(u,d){for(var E=d.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:Gx(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}),gz=Vt((Z,V)=>{V.exports=mz()}),vz=Vt((Z,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 &copy; <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"}}),yz=Vt((Z,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 &copy; <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"}}]}}),qd=Vt((Z,V)=>{var u=bd(),d=vz(),E=yz(),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":d,"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=u(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."}}),Ov=Vt((Z,V)=>{var u=Xr(),d=Pi().defaultLine,E=Vu().attributes,A=yu(),t=pc().textposition,e=Cu().overrideAll,r=cl().templatedArray,i=qd(),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:[u.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:d},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:d}},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:u.extendFlat({},t,{arrayOk:!1})}})},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}),Zx=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Qh(),t=M0(),e=pc(),r=Ov(),i=Tl(),n=Wl(),o=So().extendFlat,a=Cu().overrideAll,s=Ov(),f=t.line,v=t.marker;V.exports=a({lon:t.lon,lat:t.lat,cluster:{enabled:{valType:"boolean"},maxzoom:o({},s.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:o({},v.opacity,{dflt:1})},mode:o({},e.mode,{dflt:"markers"}),text:o({},e.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:o({},e.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:e.connectgaps,marker:o({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:v.opacity,size:v.size,sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode},n("marker")),fill:t.fill,fillcolor:A(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:u(),hovertemplatefallback:E()},"calc","nested")}),z5=Vt((Z,V)=>{var u=["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(d){return u.indexOf(d)!==-1}}}),xz=Vt((Z,V)=>{var u=Xr(),d=nu(),E=zh(),A=Bh(),t=Rh(),e=ep(),r=Zx(),i=z5().isSupportedFont;V.exports=function(o,a,s,f){function v(h,b){return u.coerce(o,a,r,h,b)}function g(h,b){return u.coerce2(o,a,r,h,b)}var m=n(o,a,v);if(!m){a.visible=!1;return}if(v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("mode"),v("below"),d.hasMarkers(a)){E(o,a,s,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var w=a.marker;w.symbol!=="circle"&&(u.isArrayOrTypedArray(w.size)&&(w.size=w.size[0]),u.isArrayOrTypedArray(w.color)&&(w.color=w.color[0]))}d.hasLines(a)&&(A(o,a,s,f,v,{noDash:!0}),v("connectgaps"));var l=g("cluster.maxzoom"),x=g("cluster.step"),y=g("cluster.color",a.marker&&a.marker.color||s),S=g("cluster.size"),k=g("cluster.opacity"),M=l!==!1||x!==!1||y!==!1||S!==!1||k!==!1,T=v("cluster.enabled",M);if(T||d.hasText(a)){var c=f.font.family;t(o,a,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:i(c)?c:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),a.fill!=="none"&&e(o,a,s,v),u.coerceSelectionMarkerOpacity(a,v)};function n(o,a,s){var f=s("lon")||[],v=s("lat")||[],g=Math.min(f.length,v.length);return a._length=g,g}}),L5=Vt((Z,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot,r=e.mockAxis,i=d.lonlat;return t.lonLabel=u.tickText(r,r.c2l(i[0]),!0).text,t.latLabel=u.tickText(r,r.c2l(i[1]),!0).text,t}}),C5=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E){var A=d.split(" "),t=A[0],e=A[1],r=u.isArrayOrTypedArray(E)?u.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}}}),_z=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=ks().BADNUM,A=Nd(),t=xu(),e=Eo(),r=ym(),i=nu(),n=z5().isSupportedFont,o=C5(),a=dh().appendArrayPointValue,s=Dl().NEWLINES,f=Dl().BR_TAG_ALL;V.exports=function(k,M){var T=M[0].trace,c=T.visible===!0&&T._length!==0,h=T.fill!=="none",b=i.hasLines(T),_=i.hasMarkers(T),P=i.hasText(T),L=_&&T.marker.symbol==="circle",D=_&&T.marker.symbol!=="circle",B=T.cluster&&T.cluster.enabled,R=v("fill"),I=v("line"),F=v("circle"),N=v("symbol"),j={fill:R,line:I,circle:F,symbol:N};if(!c)return j;var G;if((h||b)&&(G=A.calcTraceToLineCoords(M)),h&&(R.geojson=A.makePolygon(G),R.layout.visibility="visible",d.extendFlat(R.paint,{"fill-color":T.fillcolor})),b&&(I.geojson=A.makeLine(G),I.layout.visibility="visible",d.extendFlat(I.paint,{"line-width":T.line.width,"line-color":T.line.color,"line-opacity":T.opacity})),L){var rt=g(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":y(T.cluster.color,T.cluster.step),"circle-radius":y(T.cluster.size,T.cluster.step),"circle-opacity":y(T.cluster.opacity,T.cluster.step)}},j.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(T),"text-size":12}}),d.extendFlat(F.paint,{"circle-color":rt.mcc,"circle-radius":rt.mrc,"circle-opacity":rt.mo})}if(L&&B&&(F.filter=["!",["has","point_count"]]),(D||P)&&(N.geojson=m(M,k),d.extendFlat(N.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),D&&(d.extendFlat(N.layout,{"icon-size":T.marker.size/10}),"angle"in T.marker&&T.marker.angle!=="auto"&&d.extendFlat(N.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),N.layout["icon-allow-overlap"]=T.marker.allowoverlap,d.extendFlat(N.paint,{"icon-opacity":T.opacity*T.marker.opacity,"icon-color":T.marker.color})),P)){var ct=(T.marker||{}).size,st=o(T.textposition,ct);d.extendFlat(N.layout,{"text-size":T.textfont.size,"text-anchor":st.anchor,"text-offset":st.offset,"text-font":S(T)}),d.extendFlat(N.paint,{"text-color":T.textfont.color,"text-opacity":T.opacity})}return j};function v(k){return{type:k,geojson:A.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(k){var M=k[0].trace,T=M.marker,c=M.selectedpoints,h=d.isArrayOrTypedArray(T.color),b=d.isArrayOrTypedArray(T.size),_=d.isArrayOrTypedArray(T.opacity),P;function L(st){return M.opacity*st}function D(st){return st/2}var B;h&&(t.hasColorscale(M,"marker")?B=t.makeColorScaleFuncFromTrace(T):B=d.identity);var R;b&&(R=r(M));var I;_&&(I=function(st){var et=u(st)?+d.constrain(st,0,1):0;return L(et)});var F=[];for(P=0;P<k.length;P++){var N=k[P],j=N.lonlat;if(!x(j)){var G={};B&&(G.mcc=N.mcc=B(N.mc)),R&&(G.mrc=N.mrc=R(N.ms)),I&&(G.mo=I(N.mo)),c&&(G.selected=N.selected||0),F.push({type:"Feature",id:P+1,geometry:{type:"Point",coordinates:j},properties:G})}}var rt;if(c)for(rt=e.makeSelectedPointStyleFns(M),P=0;P<F.length;P++){var ct=F[P].properties;rt.selectedOpacityFn&&(ct.mo=L(rt.selectedOpacityFn(ct))),rt.selectedColorFn&&(ct.mcc=rt.selectedColorFn(ct)),rt.selectedSizeFn&&(ct.mrc=rt.selectedSizeFn(ct))}return{geojson:{type:"FeatureCollection",features:F},mcc:h||rt&&rt.selectedColorFn?{type:"identity",property:"mcc"}:T.color,mrc:b||rt&&rt.selectedSizeFn?{type:"identity",property:"mrc"}:D(T.size),mo:_||rt&&rt.selectedOpacityFn?{type:"identity",property:"mo"}:L(T.opacity)}}function m(k,M){for(var T=M._fullLayout,c=k[0].trace,h=c.marker||{},b=h.symbol,_=h.angle,P=b!=="circle"?w(b):l,L=_!=="auto"?w(_,!0):l,D=i.hasText(c)?w(c.text):l,B=[],R=0;R<k.length;R++){var I=k[R];if(!x(I.lonlat)){var F=c.texttemplate,N;if(F){var j=Array.isArray(F)?F[R]||"":F,G=c._module.formatLabels(I,c,T),rt={};a(rt,c,I.i),N=d.texttemplateString({data:[rt,I,c._meta],fallback:c.texttemplatefallback,labels:G,locale:T._d3locale,template:j})}else N=D(R);N&&(N=N.replace(s,"").replace(f,`
`)),B.push({type:"Feature",geometry:{type:"Point",coordinates:I.lonlat},properties:{symbol:P(R),angle:L(R),text:N}})}}return{type:"FeatureCollection",features:B}}function w(k,M){return d.isArrayOrTypedArray(k)?M?function(T){return u(k[T])?+k[T]:0}:function(T){return k[T]}:k?function(){return k}:l}function l(){return""}function x(k){return k[0]===E}function y(k,M){var T;if(d.isArrayOrTypedArray(k)&&d.isArrayOrTypedArray(M)){T=["step",["get","point_count"],k[0]];for(var c=1;c<k.length;c++)T.push(M[c-1],k[c])}else T=k;return T}function S(k){var M=k.textfont,T=M.family,c=M.style,h=M.weight,b=T.split(" "),_=b[b.length-1]==="Italic";_&&b.pop(),_=_||c==="italic";var P=b.join(" ");h==="bold"&&b.indexOf("Bold")===-1?P+=" Bold":h<=1e3&&(b[0]==="Metropolis"?(P="Metropolis",h>850?P+=" Black":h>750?P+=" Extra Bold":h>650?P+=" Bold":h>550?P+=" Semi Bold":h>450?P+=" Medium":h>350?P+=" Regular":h>250?P+=" Light":h>150?P+=" Extra Light":P+=" Thin"):b.slice(0,2).join(" ")==="Open Sans"?(P="Open Sans",h>750?P+=" Extrabold":h>650?P+=" Bold":h>550?P+=" Semibold":h>350?P+=" Regular":P+=" Light"):b.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(P="Klokantech Noto Sans",b[3]==="CJK"&&(P+=" CJK"),P+=h>500?" Bold":" Regular")),_&&(P+=" Italic"),P==="Open Sans Regular Italic"?P="Open Sans Italic":P==="Open Sans Regular Bold"?P="Open Sans Bold":P==="Open Sans Regular Bold Italic"?P="Open Sans Bold Italic":P==="Klokantech Noto Sans Regular Italic"&&(P="Klokantech Noto Sans Italic"),n(P)||(P=T);var L=P.split(", ");return L}}),bz=Vt((Z,V)=>{var u=Xr(),d=_z(),E=qd().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&&u.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,f=this.subplot.getMapLayers(),v=0;v<f.length;v++)if(f[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=d(n.gd,r),s=n.belowLookup["trace-"+this.uid],f=!!(i.cluster&&i.cluster.enabled),v=!!this.clusterEnabled,g=this;function m(c){c||g.addSource("circle",a.circle,i.cluster);for(var h=A.cluster,b=0;b<h.length;b++){var _=h[b],P=a[_];g.addLayer(_,P,s)}}function w(c){for(var h=A.cluster,b=h.length-1;b>=0;b--){var _=h[b];o.removeLayer(g.layerIds[_])}c||o.removeSource(g.sourceIds.circle)}function l(c){for(var h=A.nonCluster,b=0;b<h.length;b++){var _=h[b],P=a[_];c||g.addSource(_,P),g.addLayer(_,P,s)}}function x(c){for(var h=A.nonCluster,b=h.length-1;b>=0;b--){var _=h[b];o.removeLayer(g.layerIds[_]),c||o.removeSource(g.sourceIds[_])}}function y(c){v?w(c):x(c)}function S(c){f?m(c):l(c)}function k(){for(var c=f?A.cluster:A.nonCluster,h=0;h<c.length;h++){var b=c[h],_=a[b];_&&(n.setOptions(g.layerIds[b],"setLayoutProperty",_.layout),_.layout.visibility==="visible"&&(b!=="cluster"&&g.setSourceData(b,_),n.setOptions(g.layerIds[b],"setPaintProperty",_.paint)))}}var M=this.isHidden,T=i.visible!==!0;T?M||y():M?T||S():v!==f?(y(),S()):(this.below!==s&&(y(!0),S(!0)),k()),this.clusterEnabled=f,this.isHidden=T,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),f=d(r.gd,i),v=s.below=r.belowLookup["trace-"+n.uid],g,m,w;if(o)for(s.addSource("circle",f.circle,n.cluster),g=0;g<A.cluster.length;g++)m=A.cluster[g],w=f[m],s.addLayer(m,w,v);else for(g=0;g<A.nonCluster.length;g++)m=A.nonCluster[g],w=f[m],s.addSource(m,w,n.cluster),s.addLayer(m,w,v);return i[0].trace._glTrace=s,s}}),Kx=Vt((Z,V)=>{var u=hc(),d=Xr(),E=km(),A=d.fillText,t=ks().BADNUM,e=qd().traceLayerPrefix;function r(n,o,a){var s=n.cd,f=s[0].trace,v=n.xa,g=n.ya,m=n.subplot,w=[],l=e+f.uid+"-circle",x=f.cluster&&f.cluster.enabled;if(x){var y=m.map.queryRenderedFeatures(null,{layers:[l]});w=y.map(function(R){return R.id})}var S=o>=0?Math.floor((o+180)/360):Math.ceil((o-180)/360),k=S*360,M=o-k;function T(R){var I=R.lonlat;if(I[0]===t||x&&w.indexOf(R.i+1)===-1)return 1/0;var F=d.modHalf(I[0],360),N=I[1],j=m.project([F,N]),G=j.x-v.c2p([M,N]),rt=j.y-g.c2p([F,a]),ct=Math.max(3,R.mrc||0);return Math.max(Math.sqrt(G*G+rt*rt)-ct,1-3/ct)}if(u.getClosest(s,T,n),n.index!==!1){var c=s[n.index],h=c.lonlat,b=[d.modHalf(h[0],360)+k,h[1]],_=v.c2p(b),P=g.c2p(b),L=c.mrc||1;n.x0=_-L,n.x1=_+L,n.y0=P-L,n.y1=P+L;var D={};D[f.subplot]={_subplot:m};var B=f._module.formatLabels(c,f,D);return n.lonLabel=B.lonLabel,n.latLabel=B.latLabel,n.color=E(f,c),n.extraText=i(f,c,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function i(n,o,a){if(n.hovertemplate)return;var s=o.hi||n.hoverinfo,f=s.split("+"),v=f.indexOf("all")!==-1,g=f.indexOf("lon")!==-1,m=f.indexOf("lat")!==-1,w=o.lonlat,l=[];function x(y){return y+"°"}return v||g&&m?l.push("("+x(w[1])+", "+x(w[0])+")"):g?l.push(a.lon+x(w[0])):m&&l.push(a.lat+x(w[1])),(v||f.indexOf("text")!==-1)&&A(o,n,l),l.join("<br>")}V.exports={hoverPoints:r,getExtraText:i}}),wz=Vt((Z,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u}}),Tz=Vt((Z,V)=>{var u=Xr(),d=nu(),E=ks().BADNUM;V.exports=function(A,t){var e=A.cd,r=A.xaxis,i=A.yaxis,n=[],o=e[0].trace,a;if(!d.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],f=s.lonlat;if(f[0]!==E){var v=[u.modHalf(f[0],360),f[1]],g=[r.c2p(v),i.c2p(v)];t.contains(g,null,a,A)?(n.push({pointNumber:a,lon:f[0],lat:f[1]}),s.selected=1):s.selected=0}}return n}}),kz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?V.exports=d():(u=typeof globalThis<"u"?globalThis:u||self,u.maplibregl=d())})(Z,function(){var u={},d={};function E(t,e,r){if(d[t]=r,t==="index"){var i="var sharedModule = {}; ("+d.shared+")(sharedModule); ("+d.worker+")(sharedModule);",n={};return d.shared(n),d.index(u,n),typeof window<"u"&&u.setWorkerUrl(window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))),u}}E("shared",["exports"],function(t){function e(H,C,$,ht){return new($||($=Promise))(function(Mt,Bt){function jt(Be){try{be(ht.next(Be))}catch(Qe){Bt(Qe)}}function oe(Be){try{be(ht.throw(Be))}catch(Qe){Bt(Qe)}}function be(Be){var Qe;Be.done?Mt(Be.value):(Qe=Be.value,Qe instanceof $?Qe:new $(function(lr){lr(Qe)})).then(jt,oe)}be((ht=ht.apply(H,C||[])).next())})}function r(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}typeof SuppressedError=="function"&&SuppressedError;var i=n;function n(H,C){this.x=H,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(H){return this.clone()._add(H)},sub:function(H){return this.clone()._sub(H)},multByPoint:function(H){return this.clone()._multByPoint(H)},divByPoint:function(H){return this.clone()._divByPoint(H)},mult:function(H){return this.clone()._mult(H)},div:function(H){return this.clone()._div(H)},rotate:function(H){return this.clone()._rotate(H)},rotateAround:function(H,C){return this.clone()._rotateAround(H,C)},matMult:function(H){return this.clone()._matMult(H)},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(H){return this.x===H.x&&this.y===H.y},dist:function(H){return Math.sqrt(this.distSqr(H))},distSqr:function(H){var C=H.x-this.x,$=H.y-this.y;return C*C+$*$},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(H){return Math.atan2(this.y-H.y,this.x-H.x)},angleWith:function(H){return this.angleWithSep(H.x,H.y)},angleWithSep:function(H,C){return Math.atan2(this.x*C-this.y*H,this.x*H+this.y*C)},_matMult:function(H){var C=H[2]*this.x+H[3]*this.y;return this.x=H[0]*this.x+H[1]*this.y,this.y=C,this},_add:function(H){return this.x+=H.x,this.y+=H.y,this},_sub:function(H){return this.x-=H.x,this.y-=H.y,this},_mult:function(H){return this.x*=H,this.y*=H,this},_div:function(H){return this.x/=H,this.y/=H,this},_multByPoint:function(H){return this.x*=H.x,this.y*=H.y,this},_divByPoint:function(H){return this.x/=H.x,this.y/=H.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var H=this.y;return this.y=this.x,this.x=-H,this},_rotate:function(H){var C=Math.cos(H),$=Math.sin(H),ht=$*this.x+C*this.y;return this.x=C*this.x-$*this.y,this.y=ht,this},_rotateAround:function(H,C){var $=Math.cos(H),ht=Math.sin(H),Mt=C.y+ht*(this.x-C.x)+$*(this.y-C.y);return this.x=C.x+$*(this.x-C.x)-ht*(this.y-C.y),this.y=Mt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(H){return H instanceof n?H:Array.isArray(H)?new n(H[0],H[1]):H};var o=r(i),a=s;function s(H,C,$,ht){this.cx=3*H,this.bx=3*($-H)-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=H,this.p1y=C,this.p2x=$,this.p2y=ht}s.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,C){if(C===void 0&&(C=1e-6),H<0)return 0;if(H>1)return 1;for(var $=H,ht=0;ht<8;ht++){var Mt=this.sampleCurveX($)-H;if(Math.abs(Mt)<C)return $;var Bt=this.sampleCurveDerivativeX($);if(Math.abs(Bt)<1e-6)break;$-=Mt/Bt}var jt=0,oe=1;for($=H,ht=0;ht<20&&(Mt=this.sampleCurveX($),!(Math.abs(Mt-H)<C));ht++)H>Mt?jt=$:oe=$,$=.5*(oe-jt)+jt;return $},solve:function(H,C){return this.sampleCurveY(this.solveCurveX(H,C))}};var f=r(a);let v,g;function m(){return v==null&&(v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),v}function w(){if(g==null&&(g=!1,m())){let H=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(H){for(let $=0;$<25;$++){let ht=4*$;H.fillStyle=`rgb(${ht},${ht+1},${ht+2})`,H.fillRect($%5,Math.floor($/5),1,1)}let C=H.getImageData(0,0,5,5).data;for(let $=0;$<100;$++)if($%4!=3&&C[$]!==$){g=!0;break}}}return g||!1}function l(H,C,$,ht){let Mt=new f(H,C,$,ht);return Bt=>Mt.solve(Bt)}let x=l(.25,.1,.25,1);function y(H,C,$){return Math.min($,Math.max(C,H))}function S(H,C,$){let ht=$-C,Mt=((H-C)%ht+ht)%ht+C;return Mt===C?$:Mt}function k(H,...C){for(let $ of C)for(let ht in $)H[ht]=$[ht];return H}let M=1;function T(H,C,$){let ht={};for(let Mt in H)ht[Mt]=C.call(this,H[Mt],Mt,H);return ht}function c(H,C,$){let ht={};for(let Mt in H)C.call(this,H[Mt],Mt,H)&&(ht[Mt]=H[Mt]);return ht}function h(H){return Array.isArray(H)?H.map(h):typeof H=="object"&&H?T(H,h):H}let b={};function _(H){b[H]||(typeof console<"u"&&console.warn(H),b[H]=!0)}function P(H,C,$){return($.y-H.y)*(C.x-H.x)>(C.y-H.y)*($.x-H.x)}function L(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let D=null;function B(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}let R="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function I(H,C,$,ht,Mt){return e(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Bt=new VideoFrame(H,{timestamp:0});try{let jt=Bt?.format;if(!jt||!jt.startsWith("BGR")&&!jt.startsWith("RGB"))throw new Error(`Unrecognized format ${jt}`);let oe=jt.startsWith("BGR"),be=new Uint8ClampedArray(ht*Mt*4);if(yield Bt.copyTo(be,function(Be,Qe,lr,wr,Fr){let Zr=4*Math.max(-Qe,0),en=(Math.max(0,lr)-lr)*wr*4+Zr,yn=4*wr,Vn=Math.max(0,Qe),Ca=Math.max(0,lr);return{rect:{x:Vn,y:Ca,width:Math.min(Be.width,Qe+wr)-Vn,height:Math.min(Be.height,lr+Fr)-Ca},layout:[{offset:en,stride:yn}]}}(H,C,$,ht,Mt)),oe)for(let Be=0;Be<be.length;Be+=4){let Qe=be[Be];be[Be]=be[Be+2],be[Be+2]=Qe}return be}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(H){return rt.REGISTERED_PROTOCOLS[H.substring(0,H.indexOf("://"))]}let st="global-dispatcher";class et extends Error{constructor(C,$,ht,Mt){super(`AJAXError: ${$} (${C}): ${ht}`),this.status=C,this.statusText=$,this.url=ht,this.body=Mt}}let K=()=>L(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ot=function(H,C){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){let ht=ct(H.url);if(ht)return ht(H,C);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:st},C)}if(!(/^file:/.test($=H.url)||/^file:/.test(K())&&!/^\w+:/.test($))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(ht,Mt){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:K(),signal:Mt.signal});ht.type!=="json"||Bt.headers.has("Accept")||Bt.headers.set("Accept","application/json");let jt=yield fetch(Bt);if(!jt.ok){let Be=yield jt.blob();throw new et(jt.status,jt.statusText,ht.url,Be)}let oe;oe=ht.type==="arrayBuffer"||ht.type==="image"?jt.arrayBuffer():ht.type==="json"?jt.json():jt.text();let be=yield oe;if(Mt.signal.aborted)throw G();return{data:be,cacheControl:jt.headers.get("Cache-Control"),expires:jt.headers.get("Expires")}})}(H,C);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:st},C)}var $;return function(ht,Mt){return new Promise((Bt,jt)=>{var oe;let be=new XMLHttpRequest;be.open(ht.method||"GET",ht.url,!0),ht.type!=="arrayBuffer"&&ht.type!=="image"||(be.responseType="arraybuffer");for(let Be in ht.headers)be.setRequestHeader(Be,ht.headers[Be]);ht.type==="json"&&(be.responseType="text",!((oe=ht.headers)===null||oe===void 0)&&oe.Accept||be.setRequestHeader("Accept","application/json")),be.withCredentials=ht.credentials==="include",be.onerror=()=>{jt(new Error(be.statusText))},be.onload=()=>{if(!Mt.signal.aborted)if((be.status>=200&&be.status<300||be.status===0)&&be.response!==null){let Be=be.response;if(ht.type==="json")try{Be=JSON.parse(be.response)}catch(Qe){return void jt(Qe)}Bt({data:Be,cacheControl:be.getResponseHeader("Cache-Control"),expires:be.getResponseHeader("Expires")})}else{let Be=new Blob([be.response],{type:be.getResponseHeader("Content-Type")});jt(new et(be.status,be.statusText,ht.url,Be))}},Mt.signal.addEventListener("abort",()=>{be.abort(),jt(G())}),be.send(ht.body)})}(H,C)};function X(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;let C=new URL(H),$=window.location;return C.protocol===$.protocol&&C.host===$.host}function Q(H,C,$){$[H]&&$[H].indexOf(C)!==-1||($[H]=$[H]||[],$[H].push(C))}function ut(H,C,$){if($&&$[H]){let ht=$[H].indexOf(C);ht!==-1&&$[H].splice(ht,1)}}class J{constructor(C,$={}){k(this,$),this.type=C}}class q extends J{constructor(C,$={}){super("error",k({error:C},$))}}class it{on(C,$){return this._listeners=this._listeners||{},Q(C,$,this._listeners),this}off(C,$){return ut(C,$,this._listeners),ut(C,$,this._oneTimeListeners),this}once(C,$){return $?(this._oneTimeListeners=this._oneTimeListeners||{},Q(C,$,this._oneTimeListeners),this):new Promise(ht=>this.once(C,ht))}fire(C,$){typeof C=="string"&&(C=new J(C,$||{}));let ht=C.type;if(this.listens(ht)){C.target=this;let Mt=this._listeners&&this._listeners[ht]?this._listeners[ht].slice():[];for(let oe of Mt)oe.call(this,C);let Bt=this._oneTimeListeners&&this._oneTimeListeners[ht]?this._oneTimeListeners[ht].slice():[];for(let oe of Bt)ut(ht,oe,this._oneTimeListeners),oe.call(this,C);let jt=this._eventedParent;jt&&(k(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,$){return this._eventedParent=C,this._eventedParentData=$,this}}var nt={$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 Tt(H,C){let $={};for(let ht in H)ht!=="ref"&&($[ht]=H[ht]);return dt.forEach(ht=>{ht in C&&($[ht]=C[ht])}),$}function wt(H,C){if(Array.isArray(H)){if(!Array.isArray(C)||H.length!==C.length)return!1;for(let $=0;$<H.length;$++)if(!wt(H[$],C[$]))return!1;return!0}if(typeof H=="object"&&H!==null&&C!==null){if(typeof C!="object"||Object.keys(H).length!==Object.keys(C).length)return!1;for(let $ in H)if(!wt(H[$],C[$]))return!1;return!0}return H===C}function It(H,C){H.push(C)}function Ct(H,C,$){It($,{command:"addSource",args:[H,C[H]]})}function Nt(H,C,$){It(C,{command:"removeSource",args:[H]}),$[H]=!0}function ee(H,C,$,ht){Nt(H,$,ht),Ct(H,C,$)}function Jt(H,C,$){let ht;for(ht in H[$])if(Object.prototype.hasOwnProperty.call(H[$],ht)&&ht!=="data"&&!wt(H[$][ht],C[$][ht]))return!1;for(ht in C[$])if(Object.prototype.hasOwnProperty.call(C[$],ht)&&ht!=="data"&&!wt(H[$][ht],C[$][ht]))return!1;return!0}function te(H,C,$,ht,Mt,Bt){H=H||{},C=C||{};for(let jt in H)Object.prototype.hasOwnProperty.call(H,jt)&&(wt(H[jt],C[jt])||$.push({command:Bt,args:[ht,jt,C[jt],Mt]}));for(let jt in C)Object.prototype.hasOwnProperty.call(C,jt)&&!Object.prototype.hasOwnProperty.call(H,jt)&&(wt(H[jt],C[jt])||$.push({command:Bt,args:[ht,jt,C[jt],Mt]}))}function Kt(H){return H.id}function mt(H,C){return H[C.id]=C,H}class bt{constructor(C,$,ht,Mt){this.message=(C?`${C}: `:"")+ht,Mt&&(this.identifier=Mt),$!=null&&$.__line__&&(this.line=$.__line__)}}function vt(H,...C){for(let $ of C)for(let ht in $)H[ht]=$[ht];return H}class Ut extends Error{constructor(C,$){super($),this.message=$,this.key=C}}class re{constructor(C,$=[]){this.parent=C,this.bindings={};for(let[ht,Mt]of $)this.bindings[ht]=Mt}concat(C){return new re(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"},ue={kind:"number"},Me={kind:"string"},Ce={kind:"boolean"},We={kind:"color"},qe={kind:"object"},vr={kind:"value"},_r={kind:"collator"},er={kind:"formatted"},Mr={kind:"padding"},Ir={kind:"resolvedImage"},de={kind:"variableAnchorOffsetCollection"};function Dt(H,C){return{kind:"array",itemType:H,N:C}}function qt(H){if(H.kind==="array"){let C=qt(H.itemType);return typeof H.N=="number"?`array<${C}, ${H.N}>`:H.itemType.kind==="value"?"array":`array<${C}>`}return H.kind}let _t=[Zt,ue,Me,Ce,We,er,qe,Dt(vr),Mr,Ir,de];function lt(H,C){if(C.kind==="error")return null;if(H.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!lt(H.itemType,C.itemType))&&(typeof H.N!="number"||H.N===C.N))return null}else{if(H.kind===C.kind)return null;if(H.kind==="value"){for(let $ of _t)if(!lt($,C))return null}}return`Expected ${qt(H)} but found ${qt(C)} instead.`}function yt(H,C){return C.some($=>$.kind===H.kind)}function St(H,C){return C.some($=>$==="null"?H===null:$==="array"?Array.isArray(H):$==="object"?H&&!Array.isArray(H)&&typeof H=="object":$===typeof H)}function Ht(H,C){return H.kind==="array"&&C.kind==="array"?H.itemType.kind===C.itemType.kind&&typeof H.N=="number":H.kind===C.kind}let Yt=.96422,se=.82521,ke=4/29,Ee=6/29,Ue=3*Ee*Ee,ir=Ee*Ee*Ee,ar=Math.PI/180,Ye=180/Math.PI;function Er(H){return(H%=360)<0&&(H+=360),H}function pn([H,C,$,ht]){let Mt,Bt,jt=bn((.2225045*(H=dn(H))+.7168786*(C=dn(C))+.0606169*($=dn($)))/1);H===C&&C===$?Mt=Bt=jt:(Mt=bn((.4360747*H+.3850649*C+.1430804*$)/Yt),Bt=bn((.0139322*H+.0971045*C+.7141733*$)/se));let oe=116*jt-16;return[oe<0?0:oe,500*(Mt-jt),200*(jt-Bt),ht]}function dn(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function bn(H){return H>ir?Math.pow(H,1/3):H/Ue+ke}function Zn([H,C,$,ht]){let Mt=(H+16)/116,Bt=isNaN(C)?Mt:Mt+C/500,jt=isNaN($)?Mt:Mt-$/200;return Mt=1*gn(Mt),Bt=Yt*gn(Bt),jt=se*gn(jt),[En(3.1338561*Bt-1.6168667*Mt-.4906146*jt),En(-.9787684*Bt+1.9161415*Mt+.033454*jt),En(.0719453*Bt-.2289914*Mt+1.4052427*jt),ht]}function En(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function gn(H){return H>Ee?H*H*H:Ue*(H-ke)}function da(H){return parseInt(H.padEnd(2,H),16)/255}function ra(H,C){return Se(C?H/100:H,0,1)}function Se(H,C,$){return Math.min(Math.max(C,H),$)}function Re(H){return!H.some(Number.isNaN)}let Ze={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 tr{constructor(C,$,ht,Mt=1,Bt=!0){this.r=C,this.g=$,this.b=ht,this.a=Mt,Bt||(this.r*=Mt,this.g*=Mt,this.b*=Mt,Mt||this.overwriteGetter("rgb",[C,$,ht,Mt]))}static parse(C){if(C instanceof tr)return C;if(typeof C!="string")return;let $=function(ht){if((ht=ht.toLowerCase().trim())==="transparent")return[0,0,0,0];let Mt=Ze[ht];if(Mt){let[jt,oe,be]=Mt;return[jt/255,oe/255,be/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,oe=1;return[da(ht.slice(oe,oe+=jt)),da(ht.slice(oe,oe+=jt)),da(ht.slice(oe,oe+=jt)),da(ht.slice(oe,oe+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[oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca]=jt,ua=[Qe||" ",Fr||" ",yn].join("");if(ua===" "||ua===" /"||ua===",,"||ua===",,,"){let wa=[Be,wr,en].join(""),Xa=wa==="%%%"?100:wa===""?255:0;if(Xa){let di=[Se(+be/Xa,0,1),Se(+lr/Xa,0,1),Se(+Zr/Xa,0,1),Vn?ra(+Vn,Ca):1];if(Re(di))return di}}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,oe,be,Be,Qe,lr,wr,Fr,Zr]=Bt,en=[be||" ",Qe||" ",wr].join("");if(en===" "||en===" /"||en===",,"||en===",,,"){let yn=[+oe,Se(+Be,0,100),Se(+lr,0,100),Fr?ra(+Fr,Zr):1];if(Re(yn))return function([Vn,Ca,ua,wa]){function Xa(di){let oo=(di+Vn/30)%12,as=Ca*Math.min(ua,1-ua);return ua-as*Math.max(-1,Math.min(oo-3,9-oo,1))}return Vn=Er(Vn),Ca/=100,ua/=100,[Xa(0),Xa(8),Xa(4),wa]}(yn)}}}(C);return $?new tr(...$,!1):void 0}get rgb(){let{r:C,g:$,b:ht,a:Mt}=this,Bt=Mt||1/0;return this.overwriteGetter("rgb",[C/Bt,$/Bt,ht/Bt,Mt])}get hcl(){return this.overwriteGetter("hcl",function(C){let[$,ht,Mt,Bt]=pn(C),jt=Math.sqrt(ht*ht+Mt*Mt);return[Math.round(1e4*jt)?Er(Math.atan2(Mt,ht)*Ye):NaN,jt,$,Bt]}(this.rgb))}get lab(){return this.overwriteGetter("lab",pn(this.rgb))}overwriteGetter(C,$){return Object.defineProperty(this,C,{value:$}),$}toString(){let[C,$,ht,Mt]=this.rgb;return`rgba(${[C,$,ht].map(Bt=>Math.round(255*Bt)).join(",")},${Mt})`}}tr.black=new tr(0,0,0,1),tr.white=new tr(1,1,1,1),tr.transparent=new tr(0,0,0,0),tr.red=new tr(1,0,0,1);class zr{constructor(C,$,ht){this.sensitivity=C?$?"variant":"case":$?"accent":"base",this.locale=ht,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(C,$){return this.collator.compare(C,$)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tn{constructor(C,$,ht,Mt,Bt){this.text=C,this.image=$,this.scale=ht,this.fontStack=Mt,this.textColor=Bt}}class Yr{constructor(C){this.sections=C}static fromString(C){return new Yr([new tn(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 Yr?C:Yr.fromString(C)}toString(){return this.sections.length===0?"":this.sections.map(C=>C.text).join("")}}class $r{constructor(C){this.values=C.slice()}static parse(C){if(C instanceof $r)return C;if(typeof C=="number")return new $r([C,C,C,C]);if(Array.isArray(C)&&!(C.length<1||C.length>4)){for(let $ of C)if(typeof $!="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 $r(C)}}toString(){return JSON.stringify(this.values)}}let In=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Nn{constructor(C){this.values=C.slice()}static parse(C){if(C instanceof Nn)return C;if(Array.isArray(C)&&!(C.length<1)&&C.length%2==0){for(let $=0;$<C.length;$+=2){let ht=C[$],Mt=C[$+1];if(typeof ht!="string"||!In.has(ht)||!Array.isArray(Mt)||Mt.length!==2||typeof Mt[0]!="number"||typeof Mt[1]!="number")return}return new Nn(C)}}toString(){return JSON.stringify(this.values)}}class Kn{constructor(C){this.name=C.name,this.available=C.available}toString(){return this.name}static fromString(C){return C?new Kn({name:C,available:!1}):null}}function $n(H,C,$,ht){return typeof H=="number"&&H>=0&&H<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof $=="number"&&$>=0&&$<=255?ht===void 0||typeof ht=="number"&&ht>=0&&ht<=1?null:`Invalid rgba value [${[H,C,$,ht].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof ht=="number"?[H,C,$,ht]:[H,C,$]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ia(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof tr||H instanceof zr||H instanceof Yr||H instanceof $r||H instanceof Nn||H instanceof Kn)return!0;if(Array.isArray(H)){for(let C of H)if(!ia(C))return!1;return!0}if(typeof H=="object"){for(let C in H)if(!ia(H[C]))return!1;return!0}return!1}function Cn(H){if(H===null)return Zt;if(typeof H=="string")return Me;if(typeof H=="boolean")return Ce;if(typeof H=="number")return ue;if(H instanceof tr)return We;if(H instanceof zr)return _r;if(H instanceof Yr)return er;if(H instanceof $r)return Mr;if(H instanceof Nn)return de;if(H instanceof Kn)return Ir;if(Array.isArray(H)){let C=H.length,$;for(let ht of H){let Mt=Cn(ht);if($){if($===Mt)continue;$=vr;break}$=Mt}return Dt($||vr,C)}return qe}function Fa(H){let C=typeof H;return H===null?"":C==="string"||C==="number"||C==="boolean"?String(H):H instanceof tr||H instanceof Yr||H instanceof $r||H instanceof Nn||H instanceof Kn?H.toString():JSON.stringify(H)}class Ga{constructor(C,$){this.type=C,this.value=$}static parse(C,$){if(C.length!==2)return $.error(`'literal' expression requires exactly one argument, but found ${C.length-1} instead.`);if(!ia(C[1]))return $.error("invalid value");let ht=C[1],Mt=Cn(ht),Bt=$.expectedType;return Mt.kind!=="array"||Mt.N!==0||!Bt||Bt.kind!=="array"||typeof Bt.N=="number"&&Bt.N!==0||(Mt=Bt),new Ga(Mt,ht)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ve{constructor(C){this.name="ExpressionEvaluationError",this.message=C}toJSON(){return this.message}}let ge={string:Me,number:ue,boolean:Ce,object:qe};class dr{constructor(C,$){this.type=C,this.args=$}static parse(C,$){if(C.length<2)return $.error("Expected at least one argument.");let ht,Mt=1,Bt=C[0];if(Bt==="array"){let oe,be;if(C.length>2){let Be=C[1];if(typeof Be!="string"||!(Be in ge)||Be==="object")return $.error('The item type argument of "array" must be one of string, number, boolean',1);oe=ge[Be],Mt++}else oe=vr;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return $.error('The length argument to "array" must be a positive integer literal',2);be=C[2],Mt++}ht=Dt(oe,be)}else{if(!ge[Bt])throw new Error(`Types doesn't contain name = ${Bt}`);ht=ge[Bt]}let jt=[];for(;Mt<C.length;Mt++){let oe=$.parse(C[Mt],Mt,vr);if(!oe)return null;jt.push(oe)}return new dr(ht,jt)}evaluate(C){for(let $=0;$<this.args.length;$++){let ht=this.args[$].evaluate(C);if(!lt(this.type,Cn(ht)))return ht;if($===this.args.length-1)throw new ve(`Expected value to be of type ${qt(this.type)}, but found ${qt(Cn(ht))} instead.`)}throw new Error}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}let br={"to-boolean":Ce,"to-color":We,"to-number":ue,"to-string":Me};class Tr{constructor(C,$){this.type=C,this.args=$}static parse(C,$){if(C.length<2)return $.error("Expected at least one argument.");let ht=C[0];if(!br[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 $.error("Expected one argument.");let Mt=br[ht],Bt=[];for(let jt=1;jt<C.length;jt++){let oe=$.parse(C[jt],jt,vr);if(!oe)return null;Bt.push(oe)}return new Tr(Mt,Bt)}evaluate(C){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(C);case"color":{let $,ht;for(let Mt of this.args){if($=Mt.evaluate(C),ht=null,$ instanceof tr)return $;if(typeof $=="string"){let Bt=C.parseColor($);if(Bt)return Bt}else if(Array.isArray($)&&(ht=$.length<3||$.length>4?`Invalid rbga value ${JSON.stringify($)}: expected an array containing either three or four numeric values.`:$n($[0],$[1],$[2],$[3]),!ht))return new tr($[0]/255,$[1]/255,$[2]/255,$[3])}throw new ve(ht||`Could not parse color from value '${typeof $=="string"?$:JSON.stringify($)}'`)}case"padding":{let $;for(let ht of this.args){$=ht.evaluate(C);let Mt=$r.parse($);if(Mt)return Mt}throw new ve(`Could not parse padding from value '${typeof $=="string"?$:JSON.stringify($)}'`)}case"variableAnchorOffsetCollection":{let $;for(let ht of this.args){$=ht.evaluate(C);let Mt=Nn.parse($);if(Mt)return Mt}throw new ve(`Could not parse variableAnchorOffsetCollection from value '${typeof $=="string"?$:JSON.stringify($)}'`)}case"number":{let $=null;for(let ht of this.args){if($=ht.evaluate(C),$===null)return 0;let Mt=Number($);if(!isNaN(Mt))return Mt}throw new ve(`Could not convert ${JSON.stringify($)} to number.`)}case"formatted":return Yr.fromString(Fa(this.args[0].evaluate(C)));case"resolvedImage":return Kn.fromString(Fa(this.args[0].evaluate(C)));default:return Fa(this.args[0].evaluate(C))}}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}let mr=["Unknown","Point","LineString","Polygon"];class kr{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"?mr[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 $=this._parseColorCache[C];return $||($=this._parseColorCache[C]=tr.parse(C)),$}}class Ur{constructor(C,$,ht=[],Mt,Bt=new re,jt=[]){this.registry=C,this.path=ht,this.key=ht.map(oe=>`[${oe}]`).join(""),this.scope=Bt,this.errors=jt,this.expectedType=Mt,this._isConstant=$}parse(C,$,ht,Mt,Bt={}){return $?this.concat($,ht,Mt)._parse(C,Bt):this._parse(C,Bt)}_parse(C,$){function ht(Mt,Bt,jt){return jt==="assert"?new dr(Bt,[Mt]):jt==="coerce"?new Tr(Bt,[Mt]):Mt}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 Mt=C[0];if(typeof Mt!="string")return this.error(`Expression name must be a string, but found ${typeof Mt} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Bt=this.registry[Mt];if(Bt){let jt=Bt.parse(C,this);if(!jt)return null;if(this.expectedType){let oe=this.expectedType,be=jt.type;if(oe.kind!=="string"&&oe.kind!=="number"&&oe.kind!=="boolean"&&oe.kind!=="object"&&oe.kind!=="array"||be.kind!=="value")if(oe.kind!=="color"&&oe.kind!=="formatted"&&oe.kind!=="resolvedImage"||be.kind!=="value"&&be.kind!=="string")if(oe.kind!=="padding"||be.kind!=="value"&&be.kind!=="number"&&be.kind!=="array")if(oe.kind!=="variableAnchorOffsetCollection"||be.kind!=="value"&&be.kind!=="array"){if(this.checkSubtype(oe,be))return null}else jt=ht(jt,oe,$.typeAnnotation||"coerce");else jt=ht(jt,oe,$.typeAnnotation||"coerce");else jt=ht(jt,oe,$.typeAnnotation||"coerce");else jt=ht(jt,oe,$.typeAnnotation||"assert")}if(!(jt instanceof Ga)&&jt.type.kind!=="resolvedImage"&&this._isConstant(jt)){let oe=new kr;try{jt=new Ga(jt.type,jt.evaluate(oe))}catch(be){return this.error(be.message),null}}return jt}return this.error(`Unknown expression "${Mt}". 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,$,ht){let Mt=typeof C=="number"?this.path.concat(C):this.path,Bt=ht?this.scope.concat(ht):this.scope;return new Ur(this.registry,this._isConstant,Mt,$||null,Bt,this.errors)}error(C,...$){let ht=`${this.key}${$.map(Mt=>`[${Mt}]`).join("")}`;this.errors.push(new Ut(ht,C))}checkSubtype(C,$){let ht=lt(C,$);return ht&&this.error(ht),ht}}class Or{constructor(C,$){this.type=$.type,this.bindings=[].concat(C),this.result=$}evaluate(C){return this.result.evaluate(C)}eachChild(C){for(let $ of this.bindings)C($[1]);C(this.result)}static parse(C,$){if(C.length<4)return $.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 $.error(`Expected string, but found ${typeof jt} instead.`,Bt);if(/[^a-zA-Z0-9_]/.test(jt))return $.error("Variable names must contain only alphanumeric characters or '_'.",Bt);let oe=$.parse(C[Bt+1],Bt+1);if(!oe)return null;ht.push([jt,oe])}let Mt=$.parse(C[C.length-1],C.length-1,$.expectedType,ht);return Mt?new Or(ht,Mt):null}outputDefined(){return this.result.outputDefined()}}class pe{constructor(C,$){this.type=$.type,this.name=C,this.boundExpression=$}static parse(C,$){if(C.length!==2||typeof C[1]!="string")return $.error("'var' expression requires exactly one string literal argument.");let ht=C[1];return $.scope.has(ht)?new pe(ht,$.scope.get(ht)):$.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 Ke{constructor(C,$,ht){this.type=C,this.index=$,this.input=ht}static parse(C,$){if(C.length!==3)return $.error(`Expected 2 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,ue),Mt=$.parse(C[2],2,Dt($.expectedType||vr));return ht&&Mt?new Ke(Mt.type.itemType,ht,Mt):null}evaluate(C){let $=this.index.evaluate(C),ht=this.input.evaluate(C);if($<0)throw new ve(`Array index out of bounds: ${$} < 0.`);if($>=ht.length)throw new ve(`Array index out of bounds: ${$} > ${ht.length-1}.`);if($!==Math.floor($))throw new ve(`Array index must be an integer, but found ${$} instead.`);return ht[$]}eachChild(C){C(this.index),C(this.input)}outputDefined(){return!1}}class xr{constructor(C,$){this.type=Ce,this.needle=C,this.haystack=$}static parse(C,$){if(C.length!==3)return $.error(`Expected 2 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,vr),Mt=$.parse(C[2],2,vr);return ht&&Mt?yt(ht.type,[Ce,Me,ue,Zt,vr])?new xr(ht,Mt):$.error(`Expected first argument to be of type boolean, string, number or null, but found ${qt(ht.type)} instead`):null}evaluate(C){let $=this.needle.evaluate(C),ht=this.haystack.evaluate(C);if(!ht)return!1;if(!St($,["boolean","string","number","null"]))throw new ve(`Expected first argument to be of type boolean, string, number or null, but found ${qt(Cn($))} instead.`);if(!St(ht,["string","array"]))throw new ve(`Expected second argument to be of type array or string, but found ${qt(Cn(ht))} instead.`);return ht.indexOf($)>=0}eachChild(C){C(this.needle),C(this.haystack)}outputDefined(){return!0}}class Gr{constructor(C,$,ht){this.type=ue,this.needle=C,this.haystack=$,this.fromIndex=ht}static parse(C,$){if(C.length<=2||C.length>=5)return $.error(`Expected 3 or 4 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,vr),Mt=$.parse(C[2],2,vr);if(!ht||!Mt)return null;if(!yt(ht.type,[Ce,Me,ue,Zt,vr]))return $.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=$.parse(C[3],3,ue);return Bt?new Gr(ht,Mt,Bt):null}return new Gr(ht,Mt)}evaluate(C){let $=this.needle.evaluate(C),ht=this.haystack.evaluate(C);if(!St($,["boolean","string","number","null"]))throw new ve(`Expected first argument to be of type boolean, string, number or null, but found ${qt(Cn($))} instead.`);let Mt;if(this.fromIndex&&(Mt=this.fromIndex.evaluate(C)),St(ht,["string"])){let Bt=ht.indexOf($,Mt);return Bt===-1?-1:[...ht.slice(0,Bt)].length}if(St(ht,["array"]))return ht.indexOf($,Mt);throw new ve(`Expected second argument to be of type array or string, but found ${qt(Cn(ht))} instead.`)}eachChild(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)}outputDefined(){return!1}}class ln{constructor(C,$,ht,Mt,Bt,jt){this.inputType=C,this.type=$,this.input=ht,this.cases=Mt,this.outputs=Bt,this.otherwise=jt}static parse(C,$){if(C.length<5)return $.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if(C.length%2!=1)return $.error("Expected an even number of arguments.");let ht,Mt;$.expectedType&&$.expectedType.kind!=="value"&&(Mt=$.expectedType);let Bt={},jt=[];for(let Be=2;Be<C.length-1;Be+=2){let Qe=C[Be],lr=C[Be+1];Array.isArray(Qe)||(Qe=[Qe]);let wr=$.concat(Be);if(Qe.length===0)return wr.error("Expected at least one branch label.");for(let Zr of Qe){if(typeof Zr!="number"&&typeof Zr!="string")return wr.error("Branch labels must be numbers or strings.");if(typeof Zr=="number"&&Math.abs(Zr)>Number.MAX_SAFE_INTEGER)return wr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Zr=="number"&&Math.floor(Zr)!==Zr)return wr.error("Numeric branch labels must be integer values.");if(ht){if(wr.checkSubtype(ht,Cn(Zr)))return null}else ht=Cn(Zr);if(Bt[String(Zr)]!==void 0)return wr.error("Branch labels must be unique.");Bt[String(Zr)]=jt.length}let Fr=$.parse(lr,Be,Mt);if(!Fr)return null;Mt=Mt||Fr.type,jt.push(Fr)}let oe=$.parse(C[1],1,vr);if(!oe)return null;let be=$.parse(C[C.length-1],C.length-1,Mt);return be?oe.type.kind!=="value"&&$.concat(1).checkSubtype(ht,oe.type)?null:new ln(ht,Mt,oe,Bt,jt,be):null}evaluate(C){let $=this.input.evaluate(C);return(Cn($)===this.inputType&&this.outputs[this.cases[$]]||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 wn{constructor(C,$,ht){this.type=C,this.branches=$,this.otherwise=ht}static parse(C,$){if(C.length<4)return $.error(`Expected at least 3 arguments, but found only ${C.length-1}.`);if(C.length%2!=0)return $.error("Expected an odd number of arguments.");let ht;$.expectedType&&$.expectedType.kind!=="value"&&(ht=$.expectedType);let Mt=[];for(let jt=1;jt<C.length-1;jt+=2){let oe=$.parse(C[jt],jt,Ce);if(!oe)return null;let be=$.parse(C[jt+1],jt+1,ht);if(!be)return null;Mt.push([oe,be]),ht=ht||be.type}let Bt=$.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 wn(ht,Mt,Bt)}evaluate(C){for(let[$,ht]of this.branches)if($.evaluate(C))return ht.evaluate(C);return this.otherwise.evaluate(C)}eachChild(C){for(let[$,ht]of this.branches)C($),C(ht);C(this.otherwise)}outputDefined(){return this.branches.every(([C,$])=>$.outputDefined())&&this.otherwise.outputDefined()}}class rn{constructor(C,$,ht,Mt){this.type=C,this.input=$,this.beginIndex=ht,this.endIndex=Mt}static parse(C,$){if(C.length<=2||C.length>=5)return $.error(`Expected 3 or 4 arguments, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1,vr),Mt=$.parse(C[2],2,ue);if(!ht||!Mt)return null;if(!yt(ht.type,[Dt(vr),Me,vr]))return $.error(`Expected first argument to be of type array or string, but found ${qt(ht.type)} instead`);if(C.length===4){let Bt=$.parse(C[3],3,ue);return Bt?new rn(ht.type,ht,Mt,Bt):null}return new rn(ht.type,ht,Mt)}evaluate(C){let $=this.input.evaluate(C),ht=this.beginIndex.evaluate(C),Mt;if(this.endIndex&&(Mt=this.endIndex.evaluate(C)),St($,["string"]))return[...$].slice(ht,Mt).join("");if(St($,["array"]))return $.slice(ht,Mt);throw new ve(`Expected first argument to be of type array or string, but found ${qt(Cn($))} instead.`)}eachChild(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)}outputDefined(){return!1}}function Qr(H,C){let $=H.length-1,ht,Mt,Bt=0,jt=$,oe=0;for(;Bt<=jt;)if(oe=Math.floor((Bt+jt)/2),ht=H[oe],Mt=H[oe+1],ht<=C){if(oe===$||C<Mt)return oe;Bt=oe+1}else{if(!(ht>C))throw new ve("Input is not a number.");jt=oe-1}return 0}class vn{constructor(C,$,ht){this.type=C,this.input=$,this.labels=[],this.outputs=[];for(let[Mt,Bt]of ht)this.labels.push(Mt),this.outputs.push(Bt)}static parse(C,$){if(C.length-1<4)return $.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if((C.length-1)%2!=0)return $.error("Expected an even number of arguments.");let ht=$.parse(C[1],1,ue);if(!ht)return null;let Mt=[],Bt=null;$.expectedType&&$.expectedType.kind!=="value"&&(Bt=$.expectedType);for(let jt=1;jt<C.length;jt+=2){let oe=jt===1?-1/0:C[jt],be=C[jt+1],Be=jt,Qe=jt+1;if(typeof oe!="number")return $.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Be);if(Mt.length&&Mt[Mt.length-1][0]>=oe)return $.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Be);let lr=$.parse(be,Qe,Bt);if(!lr)return null;Bt=Bt||lr.type,Mt.push([oe,lr])}return new vn(Bt,ht,Mt)}evaluate(C){let $=this.labels,ht=this.outputs;if($.length===1)return ht[0].evaluate(C);let Mt=this.input.evaluate(C);if(Mt<=$[0])return ht[0].evaluate(C);let Bt=$.length;return Mt>=$[Bt-1]?ht[Bt-1].evaluate(C):ht[Qr($,Mt)].evaluate(C)}eachChild(C){C(this.input);for(let $ of this.outputs)C($)}outputDefined(){return this.outputs.every(C=>C.outputDefined())}}function Oa(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var Qn=Qa;function Qa(H,C,$,ht){this.cx=3*H,this.bx=3*($-H)-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=H,this.p1y=C,this.p2x=$,this.p2y=ht}Qa.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,C){if(C===void 0&&(C=1e-6),H<0)return 0;if(H>1)return 1;for(var $=H,ht=0;ht<8;ht++){var Mt=this.sampleCurveX($)-H;if(Math.abs(Mt)<C)return $;var Bt=this.sampleCurveDerivativeX($);if(Math.abs(Bt)<1e-6)break;$-=Mt/Bt}var jt=0,oe=1;for($=H,ht=0;ht<20&&(Mt=this.sampleCurveX($),!(Math.abs(Mt-H)<C));ht++)H>Mt?jt=$:oe=$,$=.5*(oe-jt)+jt;return $},solve:function(H,C){return this.sampleCurveY(this.solveCurveX(H,C))}};var Ja=Oa(Qn);function wi(H,C,$){return H+$*(C-H)}function ci(H,C,$){return H.map((ht,Mt)=>wi(ht,C[Mt],$))}let Ti={number:wi,color:function(H,C,$,ht="rgb"){switch(ht){case"rgb":{let[Mt,Bt,jt,oe]=ci(H.rgb,C.rgb,$);return new tr(Mt,Bt,jt,oe,!1)}case"hcl":{let[Mt,Bt,jt,oe]=H.hcl,[be,Be,Qe,lr]=C.hcl,wr,Fr;if(isNaN(Mt)||isNaN(be))isNaN(Mt)?isNaN(be)?wr=NaN:(wr=be,jt!==1&&jt!==0||(Fr=Be)):(wr=Mt,Qe!==1&&Qe!==0||(Fr=Bt));else{let Ca=be-Mt;be>Mt&&Ca>180?Ca-=360:be<Mt&&Mt-be>180&&(Ca+=360),wr=Mt+$*Ca}let[Zr,en,yn,Vn]=function([Ca,ua,wa,Xa]){return Ca=isNaN(Ca)?0:Ca*ar,Zn([wa,Math.cos(Ca)*ua,Math.sin(Ca)*ua,Xa])}([wr,Fr??wi(Bt,Be,$),wi(jt,Qe,$),wi(oe,lr,$)]);return new tr(Zr,en,yn,Vn,!1)}case"lab":{let[Mt,Bt,jt,oe]=Zn(ci(H.lab,C.lab,$));return new tr(Mt,Bt,jt,oe,!1)}}},array:ci,padding:function(H,C,$){return new $r(ci(H.values,C.values,$))},variableAnchorOffsetCollection:function(H,C,$){let ht=H.values,Mt=C.values;if(ht.length!==Mt.length)throw new ve(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${C.toString()}`);let Bt=[];for(let jt=0;jt<ht.length;jt+=2){if(ht[jt]!==Mt[jt])throw new ve(`Cannot interpolate values containing mismatched anchors. from[${jt}]: ${ht[jt]}, to[${jt}]: ${Mt[jt]}`);Bt.push(ht[jt]);let[oe,be]=ht[jt+1],[Be,Qe]=Mt[jt+1];Bt.push([wi(oe,Be,$),wi(be,Qe,$)])}return new Nn(Bt)}};class Ra{constructor(C,$,ht,Mt,Bt){this.type=C,this.operator=$,this.interpolation=ht,this.input=Mt,this.labels=[],this.outputs=[];for(let[jt,oe]of Bt)this.labels.push(jt),this.outputs.push(oe)}static interpolationFactor(C,$,ht,Mt){let Bt=0;if(C.name==="exponential")Bt=Qi($,C.base,ht,Mt);else if(C.name==="linear")Bt=Qi($,1,ht,Mt);else if(C.name==="cubic-bezier"){let jt=C.controlPoints;Bt=new Ja(jt[0],jt[1],jt[2],jt[3]).solve(Qi($,1,ht,Mt))}return Bt}static parse(C,$){let[ht,Mt,Bt,...jt]=C;if(!Array.isArray(Mt)||Mt.length===0)return $.error("Expected an interpolation type expression.",1);if(Mt[0]==="linear")Mt={name:"linear"};else if(Mt[0]==="exponential"){let Be=Mt[1];if(typeof Be!="number")return $.error("Exponential interpolation requires a numeric base.",1,1);Mt={name:"exponential",base:Be}}else{if(Mt[0]!=="cubic-bezier")return $.error(`Unknown interpolation type ${String(Mt[0])}`,1,0);{let Be=Mt.slice(1);if(Be.length!==4||Be.some(Qe=>typeof Qe!="number"||Qe<0||Qe>1))return $.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Mt={name:"cubic-bezier",controlPoints:Be}}}if(C.length-1<4)return $.error(`Expected at least 4 arguments, but found only ${C.length-1}.`);if((C.length-1)%2!=0)return $.error("Expected an even number of arguments.");if(Bt=$.parse(Bt,2,ue),!Bt)return null;let oe=[],be=null;ht==="interpolate-hcl"||ht==="interpolate-lab"?be=We:$.expectedType&&$.expectedType.kind!=="value"&&(be=$.expectedType);for(let Be=0;Be<jt.length;Be+=2){let Qe=jt[Be],lr=jt[Be+1],wr=Be+3,Fr=Be+4;if(typeof Qe!="number")return $.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',wr);if(oe.length&&oe[oe.length-1][0]>=Qe)return $.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',wr);let Zr=$.parse(lr,Fr,be);if(!Zr)return null;be=be||Zr.type,oe.push([Qe,Zr])}return Ht(be,ue)||Ht(be,We)||Ht(be,Mr)||Ht(be,de)||Ht(be,Dt(ue))?new Ra(be,ht,Mt,Bt,oe):$.error(`Type ${qt(be)} is not interpolatable.`)}evaluate(C){let $=this.labels,ht=this.outputs;if($.length===1)return ht[0].evaluate(C);let Mt=this.input.evaluate(C);if(Mt<=$[0])return ht[0].evaluate(C);let Bt=$.length;if(Mt>=$[Bt-1])return ht[Bt-1].evaluate(C);let jt=Qr($,Mt),oe=Ra.interpolationFactor(this.interpolation,Mt,$[jt],$[jt+1]),be=ht[jt].evaluate(C),Be=ht[jt+1].evaluate(C);switch(this.operator){case"interpolate":return Ti[this.type.kind](be,Be,oe);case"interpolate-hcl":return Ti.color(be,Be,oe,"hcl");case"interpolate-lab":return Ti.color(be,Be,oe,"lab")}}eachChild(C){C(this.input);for(let $ of this.outputs)C($)}outputDefined(){return this.outputs.every(C=>C.outputDefined())}}function Qi(H,C,$,ht){let Mt=ht-$,Bt=H-$;return Mt===0?0:C===1?Bt/Mt:(Math.pow(C,Bt)-1)/(Math.pow(C,Mt)-1)}class Hi{constructor(C,$){this.type=C,this.args=$}static parse(C,$){if(C.length<2)return $.error("Expectected at least one argument.");let ht=null,Mt=$.expectedType;Mt&&Mt.kind!=="value"&&(ht=Mt);let Bt=[];for(let oe of C.slice(1)){let be=$.parse(oe,1+Bt.length,ht,void 0,{typeAnnotation:"omit"});if(!be)return null;ht=ht||be.type,Bt.push(be)}if(!ht)throw new Error("No output type");let jt=Mt&&Bt.some(oe=>lt(Mt,oe.type));return new Hi(jt?vr:ht,Bt)}evaluate(C){let $,ht=null,Mt=0;for(let Bt of this.args)if(Mt++,ht=Bt.evaluate(C),ht&&ht instanceof Kn&&!ht.available&&($||($=ht.name),ht=null,Mt===this.args.length&&(ht=$)),ht!==null)break;return ht}eachChild(C){this.args.forEach(C)}outputDefined(){return this.args.every(C=>C.outputDefined())}}function Ho(H,C){return H==="=="||H==="!="?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 Ci(H,C,$,ht){return ht.compare(C,$)===0}function zo(H,C,$){let ht=H!=="=="&&H!=="!=";return class D4{constructor(Bt,jt,oe){this.type=Ce,this.lhs=Bt,this.rhs=jt,this.collator=oe,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 oe=Bt[0],be=jt.parse(Bt[1],1,vr);if(!be)return null;if(!Ho(oe,be.type))return jt.concat(1).error(`"${oe}" comparisons are not supported for type '${qt(be.type)}'.`);let Be=jt.parse(Bt[2],2,vr);if(!Be)return null;if(!Ho(oe,Be.type))return jt.concat(2).error(`"${oe}" comparisons are not supported for type '${qt(Be.type)}'.`);if(be.type.kind!==Be.type.kind&&be.type.kind!=="value"&&Be.type.kind!=="value")return jt.error(`Cannot compare types '${qt(be.type)}' and '${qt(Be.type)}'.`);ht&&(be.type.kind==="value"&&Be.type.kind!=="value"?be=new dr(Be.type,[be]):be.type.kind!=="value"&&Be.type.kind==="value"&&(Be=new dr(be.type,[Be])));let Qe=null;if(Bt.length===4){if(be.type.kind!=="string"&&Be.type.kind!=="string"&&be.type.kind!=="value"&&Be.type.kind!=="value")return jt.error("Cannot use collator to compare non-string types.");if(Qe=jt.parse(Bt[3],3,_r),!Qe)return null}return new D4(be,Be,Qe)}evaluate(Bt){let jt=this.lhs.evaluate(Bt),oe=this.rhs.evaluate(Bt);if(ht&&this.hasUntypedArgument){let be=Cn(jt),Be=Cn(oe);if(be.kind!==Be.kind||be.kind!=="string"&&be.kind!=="number")throw new ve(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${be.kind}, ${Be.kind}) instead.`)}if(this.collator&&!ht&&this.hasUntypedArgument){let be=Cn(jt),Be=Cn(oe);if(be.kind!=="string"||Be.kind!=="string")return C(Bt,jt,oe)}return this.collator?$(Bt,jt,oe,this.collator.evaluate(Bt)):C(Bt,jt,oe)}eachChild(Bt){Bt(this.lhs),Bt(this.rhs),this.collator&&Bt(this.collator)}outputDefined(){return!0}}}let qi=zo("==",function(H,C,$){return C===$},Ci),qo=zo("!=",function(H,C,$){return C!==$},function(H,C,$,ht){return!Ci(0,C,$,ht)}),Po=zo("<",function(H,C,$){return C<$},function(H,C,$,ht){return ht.compare(C,$)<0}),hs=zo(">",function(H,C,$){return C>$},function(H,C,$,ht){return ht.compare(C,$)>0}),Gi=zo("<=",function(H,C,$){return C<=$},function(H,C,$,ht){return ht.compare(C,$)<=0}),uo=zo(">=",function(H,C,$){return C>=$},function(H,C,$,ht){return ht.compare(C,$)>=0});class yi{constructor(C,$,ht){this.type=_r,this.locale=ht,this.caseSensitive=C,this.diacriticSensitive=$}static parse(C,$){if(C.length!==2)return $.error("Expected one argument.");let ht=C[1];if(typeof ht!="object"||Array.isArray(ht))return $.error("Collator options argument must be an object.");let Mt=$.parse(ht["case-sensitive"]!==void 0&&ht["case-sensitive"],1,Ce);if(!Mt)return null;let Bt=$.parse(ht["diacritic-sensitive"]!==void 0&&ht["diacritic-sensitive"],1,Ce);if(!Bt)return null;let jt=null;return ht.locale&&(jt=$.parse(ht.locale,1,Me),!jt)?null:new yi(Mt,Bt,jt)}evaluate(C){return new zr(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 ao{constructor(C,$,ht,Mt,Bt){this.type=Me,this.number=C,this.locale=$,this.currency=ht,this.minFractionDigits=Mt,this.maxFractionDigits=Bt}static parse(C,$){if(C.length!==3)return $.error("Expected two arguments.");let ht=$.parse(C[1],1,ue);if(!ht)return null;let Mt=C[2];if(typeof Mt!="object"||Array.isArray(Mt))return $.error("NumberFormat options argument must be an object.");let Bt=null;if(Mt.locale&&(Bt=$.parse(Mt.locale,1,Me),!Bt))return null;let jt=null;if(Mt.currency&&(jt=$.parse(Mt.currency,1,Me),!jt))return null;let oe=null;if(Mt["min-fraction-digits"]&&(oe=$.parse(Mt["min-fraction-digits"],1,ue),!oe))return null;let be=null;return Mt["max-fraction-digits"]&&(be=$.parse(Mt["max-fraction-digits"],1,ue),!be)?null:new ao(ht,Bt,jt,oe,be)}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 ts{constructor(C){this.type=er,this.sections=C}static parse(C,$){if(C.length<2)return $.error("Expected at least one argument.");let ht=C[1];if(!Array.isArray(ht)&&typeof ht=="object")return $.error("First argument must be an image or text section.");let Mt=[],Bt=!1;for(let jt=1;jt<=C.length-1;++jt){let oe=C[jt];if(Bt&&typeof oe=="object"&&!Array.isArray(oe)){Bt=!1;let be=null;if(oe["font-scale"]&&(be=$.parse(oe["font-scale"],1,ue),!be))return null;let Be=null;if(oe["text-font"]&&(Be=$.parse(oe["text-font"],1,Dt(Me)),!Be))return null;let Qe=null;if(oe["text-color"]&&(Qe=$.parse(oe["text-color"],1,We),!Qe))return null;let lr=Mt[Mt.length-1];lr.scale=be,lr.font=Be,lr.textColor=Qe}else{let be=$.parse(C[jt],1,vr);if(!be)return null;let Be=be.type.kind;if(Be!=="string"&&Be!=="value"&&Be!=="null"&&Be!=="resolvedImage")return $.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Bt=!0,Mt.push({content:be,scale:null,font:null,textColor:null})}}return new ts(Mt)}evaluate(C){return new Yr(this.sections.map($=>{let ht=$.content.evaluate(C);return Cn(ht)===Ir?new tn("",ht,null,null,null):new tn(Fa(ht),null,$.scale?$.scale.evaluate(C):null,$.font?$.font.evaluate(C).join(","):null,$.textColor?$.textColor.evaluate(C):null)}))}eachChild(C){for(let $ of this.sections)C($.content),$.scale&&C($.scale),$.font&&C($.font),$.textColor&&C($.textColor)}outputDefined(){return!1}}class vs{constructor(C){this.type=Ir,this.input=C}static parse(C,$){if(C.length!==2)return $.error("Expected two arguments.");let ht=$.parse(C[1],1,Me);return ht?new vs(ht):$.error("No image name provided.")}evaluate(C){let $=this.input.evaluate(C),ht=Kn.fromString($);return ht&&C.availableImages&&(ht.available=C.availableImages.indexOf($)>-1),ht}eachChild(C){C(this.input)}outputDefined(){return!1}}class As{constructor(C){this.type=ue,this.input=C}static parse(C,$){if(C.length!==2)return $.error(`Expected 1 argument, but found ${C.length-1} instead.`);let ht=$.parse(C[1],1);return ht?ht.type.kind!=="array"&&ht.type.kind!=="string"&&ht.type.kind!=="value"?$.error(`Expected argument of type string or array, but found ${qt(ht.type)} instead.`):new As(ht):null}evaluate(C){let $=this.input.evaluate(C);if(typeof $=="string")return[...$].length;if(Array.isArray($))return $.length;throw new ve(`Expected value to be of type string or array, but found ${qt(Cn($))} instead.`)}eachChild(C){C(this.input)}outputDefined(){return!1}}let _o=8192;function Da(H,C){let $=(180+H[0])/360,ht=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,Mt=Math.pow(2,C.z);return[Math.round($*Mt*_o),Math.round(ht*Mt*_o)]}function li(H,C){let $=Math.pow(2,C.z);return[(Mt=(H[0]/_o+C.x)/$,360*Mt-180),(ht=(H[1]/_o+C.y)/$,360/Math.PI*Math.atan(Math.exp((180-360*ht)*Math.PI/180))-90)];var ht,Mt}function wo(H,C){H[0]=Math.min(H[0],C[0]),H[1]=Math.min(H[1],C[1]),H[2]=Math.max(H[2],C[0]),H[3]=Math.max(H[3],C[1])}function Ms(H,C){return!(H[0]<=C[0]||H[2]>=C[2]||H[1]<=C[1]||H[3]>=C[3])}function Di(H,C,$){let ht=H[0]-C[0],Mt=H[1]-C[1],Bt=H[0]-$[0],jt=H[1]-$[1];return ht*jt-Bt*Mt==0&&ht*Bt<=0&&Mt*jt<=0}function _s(H,C,$,ht){return(Mt=[ht[0]-$[0],ht[1]-$[1]])[0]*(Bt=[C[0]-H[0],C[1]-H[1]])[1]-Mt[1]*Bt[0]!=0&&!(!co(H,C,$,ht)||!co($,ht,H,C));var Mt,Bt}function No(H,C,$){for(let ht of $)for(let Mt=0;Mt<ht.length-1;++Mt)if(_s(H,C,ht[Mt],ht[Mt+1]))return!0;return!1}function is(H,C,$=!1){let ht=!1;for(let oe of C)for(let be=0;be<oe.length-1;be++){if(Di(H,oe[be],oe[be+1]))return $;(Bt=oe[be])[1]>(Mt=H)[1]!=(jt=oe[be+1])[1]>Mt[1]&&Mt[0]<(jt[0]-Bt[0])*(Mt[1]-Bt[1])/(jt[1]-Bt[1])+Bt[0]&&(ht=!ht)}var Mt,Bt,jt;return ht}function al(H,C){for(let $ of C)if(is(H,$))return!0;return!1}function ii(H,C){for(let $ of H)if(!is($,C))return!1;for(let $=0;$<H.length-1;++$)if(No(H[$],H[$+1],C))return!1;return!0}function io(H,C){for(let $ of C)if(ii(H,$))return!0;return!1}function co(H,C,$,ht){let Mt=ht[0]-$[0],Bt=ht[1]-$[1],jt=(H[0]-$[0])*Bt-Mt*(H[1]-$[1]),oe=(C[0]-$[0])*Bt-Mt*(C[1]-$[1]);return jt>0&&oe<0||jt<0&&oe>0}function Is(H,C,$){let ht=[];for(let Mt=0;Mt<H.length;Mt++){let Bt=[];for(let jt=0;jt<H[Mt].length;jt++){let oe=Da(H[Mt][jt],$);wo(C,oe),Bt.push(oe)}ht.push(Bt)}return ht}function Wo(H,C,$){let ht=[];for(let Mt=0;Mt<H.length;Mt++){let Bt=Is(H[Mt],C,$);ht.push(Bt)}return ht}function Bi(H,C,$,ht){if(H[0]<$[0]||H[0]>$[2]){let Mt=.5*ht,Bt=H[0]-$[0]>Mt?-ht:$[0]-H[0]>Mt?ht:0;Bt===0&&(Bt=H[0]-$[2]>Mt?-ht:$[2]-H[0]>Mt?ht:0),H[0]+=Bt}wo(C,H)}function $s(H,C,$,ht){let Mt=Math.pow(2,ht.z)*_o,Bt=[ht.x*_o,ht.y*_o],jt=[];for(let oe of H)for(let be of oe){let Be=[be.x+Bt[0],be.y+Bt[1]];Bi(Be,C,$,Mt),jt.push(Be)}return jt}function fl(H,C,$,ht){let Mt=Math.pow(2,ht.z)*_o,Bt=[ht.x*_o,ht.y*_o],jt=[];for(let be of H){let Be=[];for(let Qe of be){let lr=[Qe.x+Bt[0],Qe.y+Bt[1]];wo(C,lr),Be.push(lr)}jt.push(Be)}if(C[2]-C[0]<=Mt/2){(oe=C)[0]=oe[1]=1/0,oe[2]=oe[3]=-1/0;for(let be of jt)for(let Be of be)Bi(Be,C,$,Mt)}var oe;return jt}class Jo{constructor(C,$){this.type=Ce,this.geojson=C,this.geometries=$}static parse(C,$){if(C.length!==2)return $.error(`'within' expression requires exactly one argument, but found ${C.length-1} instead.`);if(ia(C[1])){let ht=C[1];if(ht.type==="FeatureCollection"){let Mt=[];for(let Bt of ht.features){let{type:jt,coordinates:oe}=Bt.geometry;jt==="Polygon"&&Mt.push(oe),jt==="MultiPolygon"&&Mt.push(...oe)}if(Mt.length)return new Jo(ht,{type:"MultiPolygon",coordinates:Mt})}else if(ht.type==="Feature"){let Mt=ht.geometry.type;if(Mt==="Polygon"||Mt==="MultiPolygon")return new Jo(ht,ht.geometry)}else if(ht.type==="Polygon"||ht.type==="MultiPolygon")return new Jo(ht,ht)}return $.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($,ht){let Mt=[1/0,1/0,-1/0,-1/0],Bt=[1/0,1/0,-1/0,-1/0],jt=$.canonicalID();if(ht.type==="Polygon"){let oe=Is(ht.coordinates,Bt,jt),be=$s($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!is(Be,oe))return!1}if(ht.type==="MultiPolygon"){let oe=Wo(ht.coordinates,Bt,jt),be=$s($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!al(Be,oe))return!1}return!0}(C,this.geometries);if(C.geometryType()==="LineString")return function($,ht){let Mt=[1/0,1/0,-1/0,-1/0],Bt=[1/0,1/0,-1/0,-1/0],jt=$.canonicalID();if(ht.type==="Polygon"){let oe=Is(ht.coordinates,Bt,jt),be=fl($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!ii(Be,oe))return!1}if(ht.type==="MultiPolygon"){let oe=Wo(ht.coordinates,Bt,jt),be=fl($.geometry(),Mt,Bt,jt);if(!Ms(Mt,Bt))return!1;for(let Be of be)if(!io(Be,oe))return!1}return!0}(C,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let us=class{constructor(H=[],C=($,ht)=>$<ht?-1:$>ht?1:0){if(this.data=H,this.length=this.data.length,this.compare=C,this.length>0)for(let $=(this.length>>1)-1;$>=0;$--)this._down($)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;let H=this.data[0],C=this.data.pop();return--this.length>0&&(this.data[0]=C,this._down(0)),H}peek(){return this.data[0]}_up(H){let{data:C,compare:$}=this,ht=C[H];for(;H>0;){let Mt=H-1>>1,Bt=C[Mt];if($(ht,Bt)>=0)break;C[H]=Bt,H=Mt}C[H]=ht}_down(H){let{data:C,compare:$}=this,ht=this.length>>1,Mt=C[H];for(;H<ht;){let Bt=1+(H<<1),jt=Bt+1;if(jt<this.length&&$(C[jt],C[Bt])<0&&(Bt=jt),$(C[Bt],Mt)>=0)break;C[H]=C[Bt],H=Bt}C[H]=Mt}};function Ss(H,C,$,ht,Mt){Ls(H,C,$,ht||H.length-1,Mt||bu)}function Ls(H,C,$,ht,Mt){for(;ht>$;){if(ht-$>600){var Bt=ht-$+1,jt=C-$+1,oe=Math.log(Bt),be=.5*Math.exp(2*oe/3),Be=.5*Math.sqrt(oe*be*(Bt-be)/Bt)*(jt-Bt/2<0?-1:1);Ls(H,C,Math.max($,Math.floor(C-jt*be/Bt+Be)),Math.min(ht,Math.floor(C+(Bt-jt)*be/Bt+Be)),Mt)}var Qe=H[C],lr=$,wr=ht;for(yl(H,$,C),Mt(H[ht],Qe)>0&&yl(H,$,ht);lr<wr;){for(yl(H,lr,wr),lr++,wr--;Mt(H[lr],Qe)<0;)lr++;for(;Mt(H[wr],Qe)>0;)wr--}Mt(H[$],Qe)===0?yl(H,$,wr):yl(H,++wr,ht),wr<=C&&($=wr+1),C<=wr&&(ht=wr-1)}}function yl(H,C,$){var ht=H[C];H[C]=H[$],H[$]=ht}function bu(H,C){return H<C?-1:H>C?1:0}function au(H,C){if(H.length<=1)return[H];let $=[],ht,Mt;for(let Bt of H){let jt=Ec(Bt);jt!==0&&(Bt.area=Math.abs(jt),Mt===void 0&&(Mt=jt<0),Mt===jt<0?(ht&&$.push(ht),ht=[Bt]):ht.push(Bt))}if(ht&&$.push(ht),C>1)for(let Bt=0;Bt<$.length;Bt++)$[Bt].length<=C||(Ss($[Bt],C,1,$[Bt].length-1,fu),$[Bt]=$[Bt].slice(0,C));return $}function fu(H,C){return C.area-H.area}function Ec(H){let C=0;for(let $,ht,Mt=0,Bt=H.length,jt=Bt-1;Mt<Bt;jt=Mt++)$=H[Mt],ht=H[jt],C+=(ht.x-$.x)*($.y+ht.y);return C}let xc=1/298.257223563,cs=xc*(2-xc),Gl=Math.PI/180;class zc{constructor(C){let $=6378.137*Gl*1e3,ht=Math.cos(C*Gl),Mt=1/(1-cs*(1-ht*ht)),Bt=Math.sqrt(Mt);this.kx=$*Bt*ht,this.ky=$*Bt*Mt*(1-cs)}distance(C,$){let ht=this.wrap(C[0]-$[0])*this.kx,Mt=(C[1]-$[1])*this.ky;return Math.sqrt(ht*ht+Mt*Mt)}pointOnLine(C,$){let ht,Mt,Bt,jt,oe=1/0;for(let be=0;be<C.length-1;be++){let Be=C[be][0],Qe=C[be][1],lr=this.wrap(C[be+1][0]-Be)*this.kx,wr=(C[be+1][1]-Qe)*this.ky,Fr=0;lr===0&&wr===0||(Fr=(this.wrap($[0]-Be)*this.kx*lr+($[1]-Qe)*this.ky*wr)/(lr*lr+wr*wr),Fr>1?(Be=C[be+1][0],Qe=C[be+1][1]):Fr>0&&(Be+=lr/this.kx*Fr,Qe+=wr/this.ky*Fr)),lr=this.wrap($[0]-Be)*this.kx,wr=($[1]-Qe)*this.ky;let Zr=lr*lr+wr*wr;Zr<oe&&(oe=Zr,ht=Be,Mt=Qe,Bt=be,jt=Fr)}return{point:[ht,Mt],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 Al(H,C){return C[0]-H[0]}function xl(H){return H[1]-H[0]+1}function Ml(H,C){return H[1]>=H[0]&&H[1]<C}function hu(H,C){if(H[0]>H[1])return[null,null];let $=xl(H);if(C){if($===2)return[H,null];let Mt=Math.floor($/2);return[[H[0],H[0]+Mt],[H[0]+Mt,H[1]]]}if($===1)return[H,null];let ht=Math.floor($/2)-1;return[[H[0],H[0]+ht],[H[0]+ht+1,H[1]]]}function Fs(H,C){if(!Ml(C,H.length))return[1/0,1/0,-1/0,-1/0];let $=[1/0,1/0,-1/0,-1/0];for(let ht=C[0];ht<=C[1];++ht)wo($,H[ht]);return $}function _l(H){let C=[1/0,1/0,-1/0,-1/0];for(let $ of H)for(let ht of $)wo(C,ht);return C}function Fo(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function bs(H,C,$){if(!Fo(H)||!Fo(C))return NaN;let ht=0,Mt=0;return H[2]<C[0]&&(ht=C[0]-H[2]),H[0]>C[2]&&(ht=H[0]-C[2]),H[1]>C[3]&&(Mt=H[1]-C[3]),H[3]<C[1]&&(Mt=C[1]-H[3]),$.distance([0,0],[ht,Mt])}function Iu(H,C,$){let ht=$.pointOnLine(C,H);return $.distance(H,ht.point)}function Nl(H,C,$,ht,Mt){let Bt=Math.min(Iu(H,[$,ht],Mt),Iu(C,[$,ht],Mt)),jt=Math.min(Iu($,[H,C],Mt),Iu(ht,[H,C],Mt));return Math.min(Bt,jt)}function Hu(H,C,$,ht,Mt){if(!Ml(C,H.length)||!Ml(ht,$.length))return 1/0;let Bt=1/0;for(let jt=C[0];jt<C[1];++jt){let oe=H[jt],be=H[jt+1];for(let Be=ht[0];Be<ht[1];++Be){let Qe=$[Be],lr=$[Be+1];if(_s(oe,be,Qe,lr))return 0;Bt=Math.min(Bt,Nl(oe,be,Qe,lr,Mt))}}return Bt}function qs(H,C,$,ht,Mt){if(!Ml(C,H.length)||!Ml(ht,$.length))return NaN;let Bt=1/0;for(let jt=C[0];jt<=C[1];++jt)for(let oe=ht[0];oe<=ht[1];++oe)if(Bt=Math.min(Bt,Mt.distance(H[jt],$[oe])),Bt===0)return Bt;return Bt}function of(H,C,$){if(is(H,C,!0))return 0;let ht=1/0;for(let Mt of C){let Bt=Mt[0],jt=Mt[Mt.length-1];if(Bt!==jt&&(ht=Math.min(ht,Iu(H,[jt,Bt],$)),ht===0))return ht;let oe=$.pointOnLine(Mt,H);if(ht=Math.min(ht,$.distance(H,oe.point)),ht===0)return ht}return ht}function Oo(H,C,$,ht){if(!Ml(C,H.length))return NaN;for(let Bt=C[0];Bt<=C[1];++Bt)if(is(H[Bt],$,!0))return 0;let Mt=1/0;for(let Bt=C[0];Bt<C[1];++Bt){let jt=H[Bt],oe=H[Bt+1];for(let be of $)for(let Be=0,Qe=be.length,lr=Qe-1;Be<Qe;lr=Be++){let wr=be[lr],Fr=be[Be];if(_s(jt,oe,wr,Fr))return 0;Mt=Math.min(Mt,Nl(jt,oe,wr,Fr,ht))}}return Mt}function vf(H,C){for(let $ of H)for(let ht of $)if(is(ht,C,!0))return!0;return!1}function os(H,C,$,ht=1/0){let Mt=_l(H),Bt=_l(C);if(ht!==1/0&&bs(Mt,Bt,$)>=ht)return ht;if(Ms(Mt,Bt)){if(vf(H,C))return 0}else if(vf(C,H))return 0;let jt=1/0;for(let oe of H)for(let be=0,Be=oe.length,Qe=Be-1;be<Be;Qe=be++){let lr=oe[Qe],wr=oe[be];for(let Fr of C)for(let Zr=0,en=Fr.length,yn=en-1;Zr<en;yn=Zr++){let Vn=Fr[yn],Ca=Fr[Zr];if(_s(lr,wr,Vn,Ca))return 0;jt=Math.min(jt,Nl(lr,wr,Vn,Ca,$))}}return jt}function Fi(H,C,$,ht,Mt,Bt){if(!Bt)return;let jt=bs(Fs(ht,Bt),Mt,$);jt<C&&H.push([jt,Bt,[0,0]])}function nc(H,C,$,ht,Mt,Bt,jt){if(!Bt||!jt)return;let oe=bs(Fs(ht,Bt),Fs(Mt,jt),$);oe<C&&H.push([oe,Bt,jt])}function pu(H,C,$,ht,Mt=1/0){let Bt=Math.min(ht.distance(H[0],$[0][0]),Mt);if(Bt===0)return Bt;let jt=new us([[0,[0,H.length-1],[0,0]]],Al),oe=_l($);for(;jt.length>0;){let be=jt.pop();if(be[0]>=Bt)continue;let Be=be[1],Qe=C?50:100;if(xl(Be)<=Qe){if(!Ml(Be,H.length))return NaN;if(C){let lr=Oo(H,Be,$,ht);if(isNaN(lr)||lr===0)return lr;Bt=Math.min(Bt,lr)}else for(let lr=Be[0];lr<=Be[1];++lr){let wr=of(H[lr],$,ht);if(Bt=Math.min(Bt,wr),Bt===0)return 0}}else{let lr=hu(Be,C);Fi(jt,Bt,ht,H,oe,lr[0]),Fi(jt,Bt,ht,H,oe,lr[1])}}return Bt}function ml(H,C,$,ht,Mt,Bt=1/0){let jt=Math.min(Bt,Mt.distance(H[0],$[0]));if(jt===0)return jt;let oe=new us([[0,[0,H.length-1],[0,$.length-1]]],Al);for(;oe.length>0;){let be=oe.pop();if(be[0]>=jt)continue;let Be=be[1],Qe=be[2],lr=C?50:100,wr=ht?50:100;if(xl(Be)<=lr&&xl(Qe)<=wr){if(!Ml(Be,H.length)&&Ml(Qe,$.length))return NaN;let Fr;if(C&&ht)Fr=Hu(H,Be,$,Qe,Mt),jt=Math.min(jt,Fr);else if(C&&!ht){let Zr=H.slice(Be[0],Be[1]+1);for(let en=Qe[0];en<=Qe[1];++en)if(Fr=Iu($[en],Zr,Mt),jt=Math.min(jt,Fr),jt===0)return jt}else if(!C&&ht){let Zr=$.slice(Qe[0],Qe[1]+1);for(let en=Be[0];en<=Be[1];++en)if(Fr=Iu(H[en],Zr,Mt),jt=Math.min(jt,Fr),jt===0)return jt}else Fr=qs(H,Be,$,Qe,Mt),jt=Math.min(jt,Fr)}else{let Fr=hu(Be,C),Zr=hu(Qe,ht);nc(oe,jt,Mt,H,$,Fr[0],Zr[0]),nc(oe,jt,Mt,H,$,Fr[0],Zr[1]),nc(oe,jt,Mt,H,$,Fr[1],Zr[0]),nc(oe,jt,Mt,H,$,Fr[1],Zr[1])}}return jt}function Lc(H){return H.type==="MultiPolygon"?H.coordinates.map(C=>({type:"Polygon",coordinates:C})):H.type==="MultiLineString"?H.coordinates.map(C=>({type:"LineString",coordinates:C})):H.type==="MultiPoint"?H.coordinates.map(C=>({type:"Point",coordinates:C})):[H]}class qu{constructor(C,$){this.type=ue,this.geojson=C,this.geometries=$}static parse(C,$){if(C.length!==2)return $.error(`'distance' expression requires exactly one argument, but found ${C.length-1} instead.`);if(ia(C[1])){let ht=C[1];if(ht.type==="FeatureCollection")return new qu(ht,ht.features.map(Mt=>Lc(Mt.geometry)).flat());if(ht.type==="Feature")return new qu(ht,Lc(ht.geometry));if("type"in ht&&"coordinates"in ht)return new qu(ht,Lc(ht))}return $.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($,ht){let Mt=$.geometry(),Bt=Mt.flat().map(be=>li([be.x,be.y],$.canonical));if(Mt.length===0)return NaN;let jt=new zc(Bt[0][1]),oe=1/0;for(let be of ht){switch(be.type){case"Point":oe=Math.min(oe,ml(Bt,!1,[be.coordinates],!1,jt,oe));break;case"LineString":oe=Math.min(oe,ml(Bt,!1,be.coordinates,!0,jt,oe));break;case"Polygon":oe=Math.min(oe,pu(Bt,!1,be.coordinates,jt,oe))}if(oe===0)return oe}return oe}(C,this.geometries);if(C.geometryType()==="LineString")return function($,ht){let Mt=$.geometry(),Bt=Mt.flat().map(be=>li([be.x,be.y],$.canonical));if(Mt.length===0)return NaN;let jt=new zc(Bt[0][1]),oe=1/0;for(let be of ht){switch(be.type){case"Point":oe=Math.min(oe,ml(Bt,!0,[be.coordinates],!1,jt,oe));break;case"LineString":oe=Math.min(oe,ml(Bt,!0,be.coordinates,!0,jt,oe));break;case"Polygon":oe=Math.min(oe,pu(Bt,!0,be.coordinates,jt,oe))}if(oe===0)return oe}return oe}(C,this.geometries);if(C.geometryType()==="Polygon")return function($,ht){let Mt=$.geometry();if(Mt.length===0||Mt[0].length===0)return NaN;let Bt=au(Mt,0).map(be=>be.map(Be=>Be.map(Qe=>li([Qe.x,Qe.y],$.canonical)))),jt=new zc(Bt[0][0][0][1]),oe=1/0;for(let be of ht)for(let Be of Bt){switch(be.type){case"Point":oe=Math.min(oe,pu([be.coordinates],!1,Be,jt,oe));break;case"LineString":oe=Math.min(oe,pu(be.coordinates,!0,Be,jt,oe));break;case"Polygon":oe=Math.min(oe,os(Be,be.coordinates,jt,oe))}if(oe===0)return oe}return oe}(C,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let dc={"==":qi,"!=":qo,">":hs,"<":Po,">=":uo,"<=":Gi,array:dr,at:Ke,boolean:dr,case:wn,coalesce:Hi,collator:yi,format:ts,image:vs,in:xr,"index-of":Gr,interpolate:Ra,"interpolate-hcl":Ra,"interpolate-lab":Ra,length:As,let:Or,literal:Ga,match:ln,number:dr,"number-format":ao,object:dr,slice:rn,step:vn,string:dr,"to-boolean":Tr,"to-color":Tr,"to-number":Tr,"to-string":Tr,var:pe,within:Jo,distance:qu};class bl{constructor(C,$,ht,Mt){this.name=C,this.type=$,this._evaluate=ht,this.args=Mt}evaluate(C){return this._evaluate(C,this.args)}eachChild(C){this.args.forEach(C)}outputDefined(){return!1}static parse(C,$){let ht=C[0],Mt=bl.definitions[ht];if(!Mt)return $.error(`Unknown expression "${ht}". If you wanted a literal array, use ["literal", [...]].`,0);let Bt=Array.isArray(Mt)?Mt[0]:Mt.type,jt=Array.isArray(Mt)?[[Mt[1],Mt[2]]]:Mt.overloads,oe=jt.filter(([Be])=>!Array.isArray(Be)||Be.length===C.length-1),be=null;for(let[Be,Qe]of oe){be=new Ur($.registry,Cc,$.path,null,$.scope);let lr=[],wr=!1;for(let Fr=1;Fr<C.length;Fr++){let Zr=C[Fr],en=Array.isArray(Be)?Be[Fr-1]:Be.type,yn=be.parse(Zr,1+lr.length,en);if(!yn){wr=!0;break}lr.push(yn)}if(!wr)if(Array.isArray(Be)&&Be.length!==lr.length)be.error(`Expected ${Be.length} arguments, but found ${lr.length} instead.`);else{for(let Fr=0;Fr<lr.length;Fr++){let Zr=Array.isArray(Be)?Be[Fr]:Be.type,en=lr[Fr];be.concat(Fr+1).checkSubtype(Zr,en.type)}if(be.errors.length===0)return new bl(ht,Bt,Qe,lr)}}if(oe.length===1)$.errors.push(...be.errors);else{let Be=(oe.length?oe:jt).map(([lr])=>{return wr=lr,Array.isArray(wr)?`(${wr.map(qt).join(", ")})`:`(${qt(wr.type)}...)`;var wr}).join(" | "),Qe=[];for(let lr=1;lr<C.length;lr++){let wr=$.parse(C[lr],1+Qe.length);if(!wr)return null;Qe.push(qt(wr.type))}$.error(`Expected arguments of type ${Be}, but found (${Qe.join(", ")}) instead.`)}return null}static register(C,$){bl.definitions=$;for(let ht in $)C[ht]=bl}}function Yc(H,[C,$,ht,Mt]){C=C.evaluate(H),$=$.evaluate(H),ht=ht.evaluate(H);let Bt=Mt?Mt.evaluate(H):1,jt=$n(C,$,ht,Bt);if(jt)throw new ve(jt);return new tr(C/255,$/255,ht/255,Bt,!1)}function Fc(H,C){return H in C}function mc(H,C){let $=C[H];return $===void 0?null:$}function Wu(H){return{type:H}}function Cc(H){if(H instanceof pe)return Cc(H.boundExpression);if(H instanceof bl&&H.name==="error"||H instanceof yi||H instanceof Jo||H instanceof qu)return!1;let C=H instanceof Tr||H instanceof dr,$=!0;return H.eachChild(ht=>{$=C?$&&Cc(ht):$&&ht instanceof Ga}),!!$&&Ic(H)&&Bc(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ic(H){if(H instanceof bl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof Jo||H instanceof qu)return!1;let C=!0;return H.eachChild($=>{C&&!Ic($)&&(C=!1)}),C}function du(H){if(H instanceof bl&&H.name==="feature-state")return!1;let C=!0;return H.eachChild($=>{C&&!du($)&&(C=!1)}),C}function Bc(H,C){if(H instanceof bl&&C.indexOf(H.name)>=0)return!1;let $=!0;return H.eachChild(ht=>{$&&!Bc(ht,C)&&($=!1)}),$}function Pu(H){return{result:"success",value:H}}function wu(H){return{result:"error",value:H}}function wl(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function Ju(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function Pc(H){return!!H.expression&&H.expression.interpolated}function Es(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function _c(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function sf(H){return H}function Rc(H,C){let $=C.type==="color",ht=H.stops&&typeof H.stops[0][0]=="object",Mt=ht||!(ht||H.property!==void 0),Bt=H.type||(Pc(C)?"exponential":"interval");if($||C.type==="padding"){let Qe=$?tr.parse:$r.parse;(H=vt({},H)).stops&&(H.stops=H.stops.map(lr=>[lr[0],Qe(lr[1])])),H.default=Qe(H.default?H.default:C.default)}if(H.colorSpace&&(jt=H.colorSpace)!=="rgb"&&jt!=="hcl"&&jt!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var jt;let oe,be,Be;if(Bt==="exponential")oe=jc;else if(Bt==="interval")oe=Zl;else if(Bt==="categorical"){oe=Nc,be=Object.create(null);for(let Qe of H.stops)be[Qe[0]]=Qe[1];Be=typeof H.stops[0][0]}else{if(Bt!=="identity")throw new Error(`Unknown function type "${Bt}"`);oe=rl}if(ht){let Qe={},lr=[];for(let Zr=0;Zr<H.stops.length;Zr++){let en=H.stops[Zr],yn=en[0].zoom;Qe[yn]===void 0&&(Qe[yn]={zoom:yn,type:H.type,property:H.property,default:H.default,stops:[]},lr.push(yn)),Qe[yn].stops.push([en[0].value,en[1]])}let wr=[];for(let Zr of lr)wr.push([Qe[Zr].zoom,Rc(Qe[Zr],C)]);let Fr={name:"linear"};return{kind:"composite",interpolationType:Fr,interpolationFactor:Ra.interpolationFactor.bind(void 0,Fr),zoomStops:wr.map(Zr=>Zr[0]),evaluate:({zoom:Zr},en)=>jc({stops:wr,base:H.base},C,Zr).evaluate(Zr,en)}}if(Mt){let Qe=Bt==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:Qe,interpolationFactor:Ra.interpolationFactor.bind(void 0,Qe),zoomStops:H.stops.map(lr=>lr[0]),evaluate:({zoom:lr})=>oe(H,C,lr,be,Be)}}return{kind:"source",evaluate(Qe,lr){let wr=lr&&lr.properties?lr.properties[H.property]:void 0;return wr===void 0?gc(H.default,C.default):oe(H,C,wr,be,Be)}}}function gc(H,C,$){return H!==void 0?H:C!==void 0?C:$!==void 0?$:void 0}function Nc(H,C,$,ht,Mt){return gc(typeof $===Mt?ht[$]:void 0,H.default,C.default)}function Zl(H,C,$){if(Es($)!=="number")return gc(H.default,C.default);let ht=H.stops.length;if(ht===1||$<=H.stops[0][0])return H.stops[0][1];if($>=H.stops[ht-1][0])return H.stops[ht-1][1];let Mt=Qr(H.stops.map(Bt=>Bt[0]),$);return H.stops[Mt][1]}function jc(H,C,$){let ht=H.base!==void 0?H.base:1;if(Es($)!=="number")return gc(H.default,C.default);let Mt=H.stops.length;if(Mt===1||$<=H.stops[0][0])return H.stops[0][1];if($>=H.stops[Mt-1][0])return H.stops[Mt-1][1];let Bt=Qr(H.stops.map(Qe=>Qe[0]),$),jt=function(Qe,lr,wr,Fr){let Zr=Fr-wr,en=Qe-wr;return Zr===0?0:lr===1?en/Zr:(Math.pow(lr,en)-1)/(Math.pow(lr,Zr)-1)}($,ht,H.stops[Bt][0],H.stops[Bt+1][0]),oe=H.stops[Bt][1],be=H.stops[Bt+1][1],Be=Ti[C.type]||sf;return typeof oe.evaluate=="function"?{evaluate(...Qe){let lr=oe.evaluate.apply(void 0,Qe),wr=be.evaluate.apply(void 0,Qe);if(lr!==void 0&&wr!==void 0)return Be(lr,wr,jt,H.colorSpace)}}:Be(oe,be,jt,H.colorSpace)}function rl(H,C,$){switch(C.type){case"color":$=tr.parse($);break;case"formatted":$=Yr.fromString($.toString());break;case"resolvedImage":$=Kn.fromString($.toString());break;case"padding":$=$r.parse($);break;default:Es($)===C.type||C.type==="enum"&&C.values[$]||($=void 0)}return gc($,H.default,C.default)}bl.register(dc,{error:[{kind:"error"},[Me],(H,[C])=>{throw new ve(C.evaluate(H))}],typeof:[Me,[vr],(H,[C])=>qt(Cn(C.evaluate(H)))],"to-rgba":[Dt(ue,4),[We],(H,[C])=>{let[$,ht,Mt,Bt]=C.evaluate(H).rgb;return[255*$,255*ht,255*Mt,Bt]}],rgb:[We,[ue,ue,ue],Yc],rgba:[We,[ue,ue,ue,ue],Yc],has:{type:Ce,overloads:[[[Me],(H,[C])=>Fc(C.evaluate(H),H.properties())],[[Me,qe],(H,[C,$])=>Fc(C.evaluate(H),$.evaluate(H))]]},get:{type:vr,overloads:[[[Me],(H,[C])=>mc(C.evaluate(H),H.properties())],[[Me,qe],(H,[C,$])=>mc(C.evaluate(H),$.evaluate(H))]]},"feature-state":[vr,[Me],(H,[C])=>mc(C.evaluate(H),H.featureState||{})],properties:[qe,[],H=>H.properties()],"geometry-type":[Me,[],H=>H.geometryType()],id:[vr,[],H=>H.id()],zoom:[ue,[],H=>H.globals.zoom],"heatmap-density":[ue,[],H=>H.globals.heatmapDensity||0],"line-progress":[ue,[],H=>H.globals.lineProgress||0],accumulated:[vr,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[ue,Wu(ue),(H,C)=>{let $=0;for(let ht of C)$+=ht.evaluate(H);return $}],"*":[ue,Wu(ue),(H,C)=>{let $=1;for(let ht of C)$*=ht.evaluate(H);return $}],"-":{type:ue,overloads:[[[ue,ue],(H,[C,$])=>C.evaluate(H)-$.evaluate(H)],[[ue],(H,[C])=>-C.evaluate(H)]]},"/":[ue,[ue,ue],(H,[C,$])=>C.evaluate(H)/$.evaluate(H)],"%":[ue,[ue,ue],(H,[C,$])=>C.evaluate(H)%$.evaluate(H)],ln2:[ue,[],()=>Math.LN2],pi:[ue,[],()=>Math.PI],e:[ue,[],()=>Math.E],"^":[ue,[ue,ue],(H,[C,$])=>Math.pow(C.evaluate(H),$.evaluate(H))],sqrt:[ue,[ue],(H,[C])=>Math.sqrt(C.evaluate(H))],log10:[ue,[ue],(H,[C])=>Math.log(C.evaluate(H))/Math.LN10],ln:[ue,[ue],(H,[C])=>Math.log(C.evaluate(H))],log2:[ue,[ue],(H,[C])=>Math.log(C.evaluate(H))/Math.LN2],sin:[ue,[ue],(H,[C])=>Math.sin(C.evaluate(H))],cos:[ue,[ue],(H,[C])=>Math.cos(C.evaluate(H))],tan:[ue,[ue],(H,[C])=>Math.tan(C.evaluate(H))],asin:[ue,[ue],(H,[C])=>Math.asin(C.evaluate(H))],acos:[ue,[ue],(H,[C])=>Math.acos(C.evaluate(H))],atan:[ue,[ue],(H,[C])=>Math.atan(C.evaluate(H))],min:[ue,Wu(ue),(H,C)=>Math.min(...C.map($=>$.evaluate(H)))],max:[ue,Wu(ue),(H,C)=>Math.max(...C.map($=>$.evaluate(H)))],abs:[ue,[ue],(H,[C])=>Math.abs(C.evaluate(H))],round:[ue,[ue],(H,[C])=>{let $=C.evaluate(H);return $<0?-Math.round(-$):Math.round($)}],floor:[ue,[ue],(H,[C])=>Math.floor(C.evaluate(H))],ceil:[ue,[ue],(H,[C])=>Math.ceil(C.evaluate(H))],"filter-==":[Ce,[Me,vr],(H,[C,$])=>H.properties()[C.value]===$.value],"filter-id-==":[Ce,[vr],(H,[C])=>H.id()===C.value],"filter-type-==":[Ce,[Me],(H,[C])=>H.geometryType()===C.value],"filter-<":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht<Mt}],"filter-id-<":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$<ht}],"filter->":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht>Mt}],"filter-id->":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$>ht}],"filter-<=":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht<=Mt}],"filter-id-<=":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$<=ht}],"filter->=":[Ce,[Me,vr],(H,[C,$])=>{let ht=H.properties()[C.value],Mt=$.value;return typeof ht==typeof Mt&&ht>=Mt}],"filter-id->=":[Ce,[vr],(H,[C])=>{let $=H.id(),ht=C.value;return typeof $==typeof ht&&$>=ht}],"filter-has":[Ce,[vr],(H,[C])=>C.value in H.properties()],"filter-has-id":[Ce,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[Ce,[Dt(Me)],(H,[C])=>C.value.indexOf(H.geometryType())>=0],"filter-id-in":[Ce,[Dt(vr)],(H,[C])=>C.value.indexOf(H.id())>=0],"filter-in-small":[Ce,[Me,Dt(vr)],(H,[C,$])=>$.value.indexOf(H.properties()[C.value])>=0],"filter-in-large":[Ce,[Me,Dt(vr)],(H,[C,$])=>function(ht,Mt,Bt,jt){for(;Bt<=jt;){let oe=Bt+jt>>1;if(Mt[oe]===ht)return!0;Mt[oe]>ht?jt=oe-1:Bt=oe+1}return!1}(H.properties()[C.value],$.value,0,$.value.length-1)],all:{type:Ce,overloads:[[[Ce,Ce],(H,[C,$])=>C.evaluate(H)&&$.evaluate(H)],[Wu(Ce),(H,C)=>{for(let $ of C)if(!$.evaluate(H))return!1;return!0}]]},any:{type:Ce,overloads:[[[Ce,Ce],(H,[C,$])=>C.evaluate(H)||$.evaluate(H)],[Wu(Ce),(H,C)=>{for(let $ of C)if($.evaluate(H))return!0;return!1}]]},"!":[Ce,[Ce],(H,[C])=>!C.evaluate(H)],"is-supported-script":[Ce,[Me],(H,[C])=>{let $=H.globals&&H.globals.isSupportedScript;return!$||$(C.evaluate(H))}],upcase:[Me,[Me],(H,[C])=>C.evaluate(H).toUpperCase()],downcase:[Me,[Me],(H,[C])=>C.evaluate(H).toLowerCase()],concat:[Me,Wu(vr),(H,C)=>C.map($=>Fa($.evaluate(H))).join("")],"resolved-locale":[Me,[_r],(H,[C])=>C.evaluate(H).resolvedLocale()]});class Kl{constructor(C,$){var ht;this.expression=C,this._warningHistory={},this._evaluator=new kr,this._defaultValue=$?(ht=$).type==="color"&&_c(ht.default)?new tr(0,0,0,0):ht.type==="color"?tr.parse(ht.default)||null:ht.type==="padding"?$r.parse(ht.default)||null:ht.type==="variableAnchorOffsetCollection"?Nn.parse(ht.default)||null:ht.default===void 0?null:ht.default:null,this._enumValues=$&&$.type==="enum"?$.values:null}evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt){return this._evaluator.globals=C,this._evaluator.feature=$,this._evaluator.featureState=ht,this._evaluator.canonical=Mt,this._evaluator.availableImages=Bt||null,this._evaluator.formattedSection=jt,this.expression.evaluate(this._evaluator)}evaluate(C,$,ht,Mt,Bt,jt){this._evaluator.globals=C,this._evaluator.feature=$||null,this._evaluator.featureState=ht||null,this._evaluator.canonical=Mt,this._evaluator.availableImages=Bt||null,this._evaluator.formattedSection=jt||null;try{let oe=this.expression.evaluate(this._evaluator);if(oe==null||typeof oe=="number"&&oe!=oe)return this._defaultValue;if(this._enumValues&&!(oe in this._enumValues))throw new ve(`Expected value to be one of ${Object.keys(this._enumValues).map(be=>JSON.stringify(be)).join(", ")}, but found ${JSON.stringify(oe)} instead.`);return oe}catch(oe){return this._warningHistory[oe.message]||(this._warningHistory[oe.message]=!0,typeof console<"u"&&console.warn(oe.message)),this._defaultValue}}}function Gu(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in dc}function Bs(H,C){let $=new Ur(dc,Cc,[],C?function(Mt){let Bt={color:We,string:Me,number:ue,enum:Me,boolean:Ce,formatted:er,padding:Mr,resolvedImage:Ir,variableAnchorOffsetCollection:de};return Mt.type==="array"?Dt(Bt[Mt.value]||vr,Mt.length):Bt[Mt.type]}(C):void 0),ht=$.parse(H,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return ht?Pu(new Kl(ht,C)):wu($.errors)}class Ou{constructor(C,$){this.kind=C,this._styleExpression=$,this.isStateDependent=C!=="constant"&&!du($.expression)}evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt)}evaluate(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluate(C,$,ht,Mt,Bt,jt)}}class Rl{constructor(C,$,ht,Mt){this.kind=C,this.zoomStops=ht,this._styleExpression=$,this.isStateDependent=C!=="camera"&&!du($.expression),this.interpolationType=Mt}evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluateWithoutErrorHandling(C,$,ht,Mt,Bt,jt)}evaluate(C,$,ht,Mt,Bt,jt){return this._styleExpression.evaluate(C,$,ht,Mt,Bt,jt)}interpolationFactor(C,$,ht){return this.interpolationType?Ra.interpolationFactor(this.interpolationType,C,$,ht):0}}function Yl(H,C){let $=Bs(H,C);if($.result==="error")return $;let ht=$.value.expression,Mt=Ic(ht);if(!Mt&&!wl(C))return wu([new Ut("","data expressions not supported")]);let Bt=Bc(ht,["zoom"]);if(!Bt&&!Ju(C))return wu([new Ut("","zoom expressions not supported")]);let jt=ac(ht);return jt||Bt?jt instanceof Ut?wu([jt]):jt instanceof Ra&&!Pc(C)?wu([new Ut("",'"interpolate" expressions cannot be used with this property')]):Pu(jt?new Rl(Mt?"camera":"composite",$.value,jt.labels,jt instanceof Ra?jt.interpolation:void 0):new Ou(Mt?"constant":"source",$.value)):wu([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ws{constructor(C,$){this._parameters=C,this._specification=$,vt(this,Rc(this._parameters,this._specification))}static deserialize(C){return new Ws(C._parameters,C._specification)}static serialize(C){return{_parameters:C._parameters,_specification:C._specification}}}function ac(H){let C=null;if(H instanceof Or)C=ac(H.result);else if(H instanceof Hi){for(let $ of H.args)if(C=ac($),C)break}else(H instanceof vn||H instanceof Ra)&&H.input instanceof bl&&H.input.name==="zoom"&&(C=H);return C instanceof Ut||H.eachChild($=>{let ht=ac($);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 Tu(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(let C of H.slice(1))if(!Tu(C)&&typeof C!="boolean")return!1;return!0;default:return!0}}let Zu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function bc(H){if(H==null)return{filter:()=>!0,needGeometry:!1};Tu(H)||(H=ic(H));let C=Bs(H,Zu);if(C.result==="error")throw new Error(C.value.map($=>`${$.key}: ${$.message}`).join(", "));return{filter:($,ht,Mt)=>C.value.evaluate($,ht,{},Mt),needGeometry:Mf(H)}}function lf(H,C){return H<C?-1:H>C?1:0}function Mf(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let C=1;C<H.length;C++)if(Mf(H[C]))return!0;return!1}function ic(H){if(!H)return!0;let C=H[0];return H.length<=1?C!=="any":C==="=="?wc(H[1],H[2],"=="):C==="!="?iu(wc(H[1],H[2],"==")):C==="<"||C===">"||C==="<="||C===">="?wc(H[1],H[2],C):C==="any"?($=H.slice(1),["any"].concat($.map(ic))):C==="all"?["all"].concat(H.slice(1).map(ic)):C==="none"?["all"].concat(H.slice(1).map(ic).map(iu)):C==="in"?Fl(H[1],H.slice(2)):C==="!in"?iu(Fl(H[1],H.slice(2))):C==="has"?oc(H[1]):C!=="!has"||iu(oc(H[1]));var $}function wc(H,C,$){switch(H){case"$type":return[`filter-type-${$}`,C];case"$id":return[`filter-id-${$}`,C];default:return[`filter-${$}`,H,C]}}function Fl(H,C){if(C.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some($=>typeof $!=typeof C[0])?["filter-in-large",H,["literal",C.sort(lf)]]:["filter-in-small",H,["literal",C]]}}function oc(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function iu(H){return["!",H]}function sc(H){let C=typeof H;if(C==="number"||C==="boolean"||C==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let Mt="[";for(let Bt of H)Mt+=`${sc(Bt)},`;return`${Mt}]`}let $=Object.keys(H).sort(),ht="{";for(let Mt=0;Mt<$.length;Mt++)ht+=`${JSON.stringify($[Mt])}:${sc(H[$[Mt]])},`;return`${ht}}`}function Tc(H){let C="";for(let $ of dt)C+=`/${sc(H[$])}`;return C}function ku(H){let C=H.value;return C?[new bt(H.key,C,"constants have been deprecated as of v8")]:[]}function Gs(H){return H instanceof Number||H instanceof String||H instanceof Boolean?H.valueOf():H}function Du(H){if(Array.isArray(H))return H.map(Du);if(H instanceof Object&&!(H instanceof Number||H instanceof String||H instanceof Boolean)){let C={};for(let $ in H)C[$]=Du(H[$]);return C}return Gs(H)}function Xl(H){let C=H.key,$=H.value,ht=H.valueSpec||{},Mt=H.objectElementValidators||{},Bt=H.style,jt=H.styleSpec,oe=H.validateSpec,be=[],Be=Es($);if(Be!=="object")return[new bt(C,$,`object expected, ${Be} found`)];for(let Qe in $){let lr=Qe.split(".")[0],wr=ht[lr]||ht["*"],Fr;if(Mt[lr])Fr=Mt[lr];else if(ht[lr])Fr=oe;else if(Mt["*"])Fr=Mt["*"];else{if(!ht["*"]){be.push(new bt(C,$[Qe],`unknown property "${Qe}"`));continue}Fr=oe}be=be.concat(Fr({key:(C&&`${C}.`)+Qe,value:$[Qe],valueSpec:wr,style:Bt,styleSpec:jt,object:$,objectKey:Qe,validateSpec:oe},$))}for(let Qe in ht)Mt[Qe]||ht[Qe].required&&ht[Qe].default===void 0&&$[Qe]===void 0&&be.push(new bt(C,$,`missing required property "${Qe}"`));return be}function Xc(H){let C=H.value,$=H.valueSpec,ht=H.style,Mt=H.styleSpec,Bt=H.key,jt=H.arrayElementValidator||H.validateSpec;if(Es(C)!=="array")return[new bt(Bt,C,`array expected, ${Es(C)} found`)];if($.length&&C.length!==$.length)return[new bt(Bt,C,`array length ${$.length} expected, length ${C.length} found`)];if($["min-length"]&&C.length<$["min-length"])return[new bt(Bt,C,`array length at least ${$["min-length"]} expected, length ${C.length} found`)];let oe={type:$.value,values:$.values};Mt.$version<7&&(oe.function=$.function),Es($.value)==="object"&&(oe=$.value);let be=[];for(let Be=0;Be<C.length;Be++)be=be.concat(jt({array:C,arrayIndex:Be,value:C[Be],valueSpec:oe,validateSpec:H.validateSpec,style:ht,styleSpec:Mt,key:`${Bt}[${Be}]`}));return be}function Vs(H){let C=H.key,$=H.value,ht=H.valueSpec,Mt=Es($);return Mt==="number"&&$!=$&&(Mt="NaN"),Mt!=="number"?[new bt(C,$,`number expected, ${Mt} found`)]:"minimum"in ht&&$<ht.minimum?[new bt(C,$,`${$} is less than the minimum value ${ht.minimum}`)]:"maximum"in ht&&$>ht.maximum?[new bt(C,$,`${$} is greater than the maximum value ${ht.maximum}`)]:[]}function vc(H){let C=H.valueSpec,$=Gs(H.value.type),ht,Mt,Bt,jt={},oe=$!=="categorical"&&H.value.property===void 0,be=!oe,Be=Es(H.value.stops)==="array"&&Es(H.value.stops[0])==="array"&&Es(H.value.stops[0][0])==="object",Qe=Xl({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Fr){if($==="identity")return[new bt(Fr.key,Fr.value,'identity function may not have a "stops" property')];let Zr=[],en=Fr.value;return Zr=Zr.concat(Xc({key:Fr.key,value:en,valueSpec:Fr.valueSpec,validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec,arrayElementValidator:lr})),Es(en)==="array"&&en.length===0&&Zr.push(new bt(Fr.key,en,"array must have at least one stop")),Zr},default:function(Fr){return Fr.validateSpec({key:Fr.key,value:Fr.value,valueSpec:C,validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec})}}});return $==="identity"&&oe&&Qe.push(new bt(H.key,H.value,'missing required property "property"')),$==="identity"||H.value.stops||Qe.push(new bt(H.key,H.value,'missing required property "stops"')),$==="exponential"&&H.valueSpec.expression&&!Pc(H.valueSpec)&&Qe.push(new bt(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(be&&!wl(H.valueSpec)?Qe.push(new bt(H.key,H.value,"property functions not supported")):oe&&!Ju(H.valueSpec)&&Qe.push(new bt(H.key,H.value,"zoom functions not supported"))),$!=="categorical"&&!Be||H.value.property!==void 0||Qe.push(new bt(H.key,H.value,'"property" property is required')),Qe;function lr(Fr){let Zr=[],en=Fr.value,yn=Fr.key;if(Es(en)!=="array")return[new bt(yn,en,`array expected, ${Es(en)} found`)];if(en.length!==2)return[new bt(yn,en,`array length 2 expected, length ${en.length} found`)];if(Be){if(Es(en[0])!=="object")return[new bt(yn,en,`object expected, ${Es(en[0])} found`)];if(en[0].zoom===void 0)return[new bt(yn,en,"object stop key must have zoom")];if(en[0].value===void 0)return[new bt(yn,en,"object stop key must have value")];if(Bt&&Bt>Gs(en[0].zoom))return[new bt(yn,en[0].zoom,"stop zoom values must appear in ascending order")];Gs(en[0].zoom)!==Bt&&(Bt=Gs(en[0].zoom),Mt=void 0,jt={}),Zr=Zr.concat(Xl({key:`${yn}[0]`,value:en[0],valueSpec:{zoom:{}},validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec,objectElementValidators:{zoom:Vs,value:wr}}))}else Zr=Zr.concat(wr({key:`${yn}[0]`,value:en[0],validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec},en));return Gu(Du(en[1]))?Zr.concat([new bt(`${yn}[1]`,en[1],"expressions are not allowed in function stops.")]):Zr.concat(Fr.validateSpec({key:`${yn}[1]`,value:en[1],valueSpec:C,validateSpec:Fr.validateSpec,style:Fr.style,styleSpec:Fr.styleSpec}))}function wr(Fr,Zr){let en=Es(Fr.value),yn=Gs(Fr.value),Vn=Fr.value!==null?Fr.value:Zr;if(ht){if(en!==ht)return[new bt(Fr.key,Vn,`${en} stop domain type must match previous stop domain type ${ht}`)]}else ht=en;if(en!=="number"&&en!=="string"&&en!=="boolean")return[new bt(Fr.key,Vn,"stop domain value must be a number, string, or boolean")];if(en!=="number"&&$!=="categorical"){let Ca=`number expected, ${en} found`;return wl(C)&&$===void 0&&(Ca+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new bt(Fr.key,Vn,Ca)]}return $!=="categorical"||en!=="number"||isFinite(yn)&&Math.floor(yn)===yn?$!=="categorical"&&en==="number"&&Mt!==void 0&&yn<Mt?[new bt(Fr.key,Vn,"stop domain values must appear in ascending order")]:(Mt=yn,$==="categorical"&&yn in jt?[new bt(Fr.key,Vn,"stop domain values must be unique")]:(jt[yn]=!0,[])):[new bt(Fr.key,Vn,`integer expected, found ${yn}`)]}}function Ku(H){let C=(H.expressionContext==="property"?Yl:Bs)(Du(H.value),H.valueSpec);if(C.result==="error")return C.value.map(ht=>new bt(`${H.key}${ht.key}`,H.value,ht.message));let $=C.value.expression||C.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!$.outputDefined())return[new bt(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!du($))return[new bt(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!du($))return[new bt(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Bc($,["zoom","feature-state"]))return[new bt(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!Ic($))return[new bt(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ou(H){let C=H.key,$=H.value,ht=H.valueSpec,Mt=[];return Array.isArray(ht.values)?ht.values.indexOf(Gs($))===-1&&Mt.push(new bt(C,$,`expected one of [${ht.values.join(", ")}], ${JSON.stringify($)} found`)):Object.keys(ht.values).indexOf(Gs($))===-1&&Mt.push(new bt(C,$,`expected one of [${Object.keys(ht.values).join(", ")}], ${JSON.stringify($)} found`)),Mt}function Qu(H){return Tu(Du(H.value))?Ku(vt({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Yu(H)}function Yu(H){let C=H.value,$=H.key;if(Es(C)!=="array")return[new bt($,C,`array expected, ${Es(C)} found`)];let ht=H.styleSpec,Mt,Bt=[];if(C.length<1)return[new bt($,C,"filter array must have at least 1 element")];switch(Bt=Bt.concat(ou({key:`${$}[0]`,value:C[0],valueSpec:ht.filter_operator,style:H.style,styleSpec:H.styleSpec})),Gs(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Gs(C[1])==="$type"&&Bt.push(new bt($,C,`"$type" cannot be use with operator "${C[0]}"`));case"==":case"!=":C.length!==3&&Bt.push(new bt($,C,`filter array for operator "${C[0]}" must have 3 elements`));case"in":case"!in":C.length>=2&&(Mt=Es(C[1]),Mt!=="string"&&Bt.push(new bt(`${$}[1]`,C[1],`string expected, ${Mt} found`)));for(let jt=2;jt<C.length;jt++)Mt=Es(C[jt]),Gs(C[1])==="$type"?Bt=Bt.concat(ou({key:`${$}[${jt}]`,value:C[jt],valueSpec:ht.geometry_type,style:H.style,styleSpec:H.styleSpec})):Mt!=="string"&&Mt!=="number"&&Mt!=="boolean"&&Bt.push(new bt(`${$}[${jt}]`,C[jt],`string, number, or boolean expected, ${Mt} found`));break;case"any":case"all":case"none":for(let jt=1;jt<C.length;jt++)Bt=Bt.concat(Yu({key:`${$}[${jt}]`,value:C[jt],style:H.style,styleSpec:H.styleSpec}));break;case"has":case"!has":Mt=Es(C[1]),C.length!==2?Bt.push(new bt($,C,`filter array for "${C[0]}" operator must have 2 elements`)):Mt!=="string"&&Bt.push(new bt(`${$}[1]`,C[1],`string expected, ${Mt} found`))}return Bt}function yc(H,C){let $=H.key,ht=H.validateSpec,Mt=H.style,Bt=H.styleSpec,jt=H.value,oe=H.objectKey,be=Bt[`${C}_${H.layerType}`];if(!be)return[];let Be=oe.match(/^(.*)-transition$/);if(C==="paint"&&Be&&be[Be[1]]&&be[Be[1]].transition)return ht({key:$,value:jt,valueSpec:Bt.transition,style:Mt,styleSpec:Bt});let Qe=H.valueSpec||be[oe];if(!Qe)return[new bt($,jt,`unknown property "${oe}"`)];let lr;if(Es(jt)==="string"&&wl(Qe)&&!Qe.tokens&&(lr=/^{([^}]+)}$/.exec(jt)))return[new bt($,jt,`"${oe}" does not support interpolation syntax
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(lr[1])} }\`.`)];let wr=[];return H.layerType==="symbol"&&(oe==="text-field"&&Mt&&!Mt.glyphs&&wr.push(new bt($,jt,'use of "text-field" requires a style "glyphs" property')),oe==="text-font"&&_c(Du(jt))&&Gs(jt.type)==="identity"&&wr.push(new bt($,jt,'"text-font" does not support identity functions'))),wr.concat(ht({key:H.key,value:jt,valueSpec:Qe,style:Mt,styleSpec:Bt,expressionContext:"property",propertyType:C,propertyKey:oe}))}function uf(H){return yc(H,"paint")}function zl(H){return yc(H,"layout")}function Uc(H){let C=[],$=H.value,ht=H.key,Mt=H.style,Bt=H.styleSpec;$.type||$.ref||C.push(new bt(ht,$,'either "type" or "ref" is required'));let jt=Gs($.type),oe=Gs($.ref);if($.id){let be=Gs($.id);for(let Be=0;Be<H.arrayIndex;Be++){let Qe=Mt.layers[Be];Gs(Qe.id)===be&&C.push(new bt(ht,$.id,`duplicate layer id "${$.id}", previously used at line ${Qe.id.__line__}`))}}if("ref"in $){let be;["type","source","source-layer","filter","layout"].forEach(Be=>{Be in $&&C.push(new bt(ht,$[Be],`"${Be}" is prohibited for ref layers`))}),Mt.layers.forEach(Be=>{Gs(Be.id)===oe&&(be=Be)}),be?be.ref?C.push(new bt(ht,$.ref,"ref cannot reference another ref layer")):jt=Gs(be.type):C.push(new bt(ht,$.ref,`ref layer "${oe}" not found`))}else if(jt!=="background")if($.source){let be=Mt.sources&&Mt.sources[$.source],Be=be&&Gs(be.type);be?Be==="vector"&&jt==="raster"?C.push(new bt(ht,$.source,`layer "${$.id}" requires a raster source`)):Be!=="raster-dem"&&jt==="hillshade"?C.push(new bt(ht,$.source,`layer "${$.id}" requires a raster-dem source`)):Be==="raster"&&jt!=="raster"?C.push(new bt(ht,$.source,`layer "${$.id}" requires a vector source`)):Be!=="vector"||$["source-layer"]?Be==="raster-dem"&&jt!=="hillshade"?C.push(new bt(ht,$.source,"raster-dem source can only be used with layer type 'hillshade'.")):jt!=="line"||!$.paint||!$.paint["line-gradient"]||Be==="geojson"&&be.lineMetrics||C.push(new bt(ht,$,`layer "${$.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):C.push(new bt(ht,$,`layer "${$.id}" must specify a "source-layer"`)):C.push(new bt(ht,$.source,`source "${$.source}" not found`))}else C.push(new bt(ht,$,'missing required property "source"'));return C=C.concat(Xl({key:ht,value:$,valueSpec:Bt.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${ht}.type`,value:$.type,valueSpec:Bt.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:$,objectKey:"type"}),filter:Qu,layout:be=>Xl({layer:$,key:be.key,value:be.value,style:be.style,styleSpec:be.styleSpec,validateSpec:be.validateSpec,objectElementValidators:{"*":Be=>zl(vt({layerType:jt},Be))}}),paint:be=>Xl({layer:$,key:be.key,value:be.value,style:be.style,styleSpec:be.styleSpec,validateSpec:be.validateSpec,objectElementValidators:{"*":Be=>uf(vt({layerType:jt},Be))}})}})),C}function su(H){let C=H.value,$=H.key,ht=Es(C);return ht!=="string"?[new bt($,C,`string expected, ${ht} found`)]:[]}let Fu={promoteId:function({key:H,value:C}){if(Es(C)==="string")return su({key:H,value:C});{let $=[];for(let ht in C)$.push(...su({key:`${H}.${ht}`,value:C[ht]}));return $}}};function Au(H){let C=H.value,$=H.key,ht=H.styleSpec,Mt=H.style,Bt=H.validateSpec;if(!C.type)return[new bt($,C,'"type" is required')];let jt=Gs(C.type),oe;switch(jt){case"vector":case"raster":return oe=Xl({key:$,value:C,valueSpec:ht[`source_${jt.replace("-","_")}`],style:H.style,styleSpec:ht,objectElementValidators:Fu,validateSpec:Bt}),oe;case"raster-dem":return oe=function(be){var Be;let Qe=(Be=be.sourceName)!==null&&Be!==void 0?Be:"",lr=be.value,wr=be.styleSpec,Fr=wr.source_raster_dem,Zr=be.style,en=[],yn=Es(lr);if(lr===void 0)return en;if(yn!=="object")return en.push(new bt("source_raster_dem",lr,`object expected, ${yn} found`)),en;let Vn=Gs(lr.encoding)==="custom",Ca=["redFactor","greenFactor","blueFactor","baseShift"],ua=be.value.encoding?`"${be.value.encoding}"`:"Default";for(let wa in lr)!Vn&&Ca.includes(wa)?en.push(new bt(wa,lr[wa],`In "${Qe}": "${wa}" is only valid when "encoding" is set to "custom". ${ua} encoding found`)):Fr[wa]?en=en.concat(be.validateSpec({key:wa,value:lr[wa],valueSpec:Fr[wa],validateSpec:be.validateSpec,style:Zr,styleSpec:wr})):en.push(new bt(wa,lr[wa],`unknown property "${wa}"`));return en}({sourceName:$,value:C,style:H.style,styleSpec:ht,validateSpec:Bt}),oe;case"geojson":if(oe=Xl({key:$,value:C,valueSpec:ht.source_geojson,style:Mt,styleSpec:ht,validateSpec:Bt,objectElementValidators:Fu}),C.cluster)for(let be in C.clusterProperties){let[Be,Qe]=C.clusterProperties[be],lr=typeof Be=="string"?[Be,["accumulated"],["get",be]]:Be;oe.push(...Ku({key:`${$}.${be}.map`,value:Qe,expressionContext:"cluster-map"})),oe.push(...Ku({key:`${$}.${be}.reduce`,value:lr,expressionContext:"cluster-reduce"}))}return oe;case"video":return Xl({key:$,value:C,valueSpec:ht.source_video,style:Mt,validateSpec:Bt,styleSpec:ht});case"image":return Xl({key:$,value:C,valueSpec:ht.source_image,style:Mt,validateSpec:Bt,styleSpec:ht});case"canvas":return[new bt($,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ou({key:`${$}.type`,value:C.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function il(H){let C=H.value,$=H.styleSpec,ht=$.light,Mt=H.style,Bt=[],jt=Es(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 oe in C){let be=oe.match(/^(.*)-transition$/);Bt=Bt.concat(be&&ht[be[1]]&&ht[be[1]].transition?H.validateSpec({key:oe,value:C[oe],valueSpec:$.transition,validateSpec:H.validateSpec,style:Mt,styleSpec:$}):ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],validateSpec:H.validateSpec,style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)])}return Bt}function Cs(H){let C=H.value,$=H.styleSpec,ht=$.sky,Mt=H.style,Bt=Es(C);if(C===void 0)return[];if(Bt!=="object")return[new bt("sky",C,`object expected, ${Bt} found`)];let jt=[];for(let oe in C)jt=jt.concat(ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)]);return jt}function Mu(H){let C=H.value,$=H.styleSpec,ht=$.terrain,Mt=H.style,Bt=[],jt=Es(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 oe in C)Bt=Bt.concat(ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],validateSpec:H.validateSpec,style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)]);return Bt}function lc(H){let C=[],$=H.value,ht=H.key;if(Array.isArray($)){let Mt=[],Bt=[];for(let jt in $)$[jt].id&&Mt.includes($[jt].id)&&C.push(new bt(ht,$,`all the sprites' ids must be unique, but ${$[jt].id} is duplicated`)),Mt.push($[jt].id),$[jt].url&&Bt.includes($[jt].url)&&C.push(new bt(ht,$,`all the sprites' URLs must be unique, but ${$[jt].url} is duplicated`)),Bt.push($[jt].url),C=C.concat(Xl({key:`${ht}[${jt}]`,value:$[jt],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return C}return su({key:ht,value:$})}let Su={"*":()=>[],array:Xc,boolean:function(H){let C=H.value,$=H.key,ht=Es(C);return ht!=="boolean"?[new bt($,C,`boolean expected, ${ht} found`)]:[]},number:Vs,color:function(H){let C=H.key,$=H.value,ht=Es($);return ht!=="string"?[new bt(C,$,`color expected, ${ht} found`)]:tr.parse(String($))?[]:[new bt(C,$,`color expected, "${$}" found`)]},constants:ku,enum:ou,filter:Qu,function:vc,layer:Uc,object:Xl,source:Au,light:il,sky:Cs,terrain:Mu,projection:function(H){let C=H.value,$=H.styleSpec,ht=$.projection,Mt=H.style,Bt=Es(C);if(C===void 0)return[];if(Bt!=="object")return[new bt("projection",C,`object expected, ${Bt} found`)];let jt=[];for(let oe in C)jt=jt.concat(ht[oe]?H.validateSpec({key:oe,value:C[oe],valueSpec:ht[oe],style:Mt,styleSpec:$}):[new bt(oe,C[oe],`unknown property "${oe}"`)]);return jt},string:su,formatted:function(H){return su(H).length===0?[]:Ku(H)},resolvedImage:function(H){return su(H).length===0?[]:Ku(H)},padding:function(H){let C=H.key,$=H.value;if(Es($)==="array"){if($.length<1||$.length>4)return[new bt(C,$,`padding requires 1 to 4 values; ${$.length} values found`)];let ht={type:"number"},Mt=[];for(let Bt=0;Bt<$.length;Bt++)Mt=Mt.concat(H.validateSpec({key:`${C}[${Bt}]`,value:$[Bt],validateSpec:H.validateSpec,valueSpec:ht}));return Mt}return Vs({key:C,value:$,valueSpec:{}})},variableAnchorOffsetCollection:function(H){let C=H.key,$=H.value,ht=Es($),Mt=H.styleSpec;if(ht!=="array"||$.length<1||$.length%2!=0)return[new bt(C,$,"variableAnchorOffsetCollection requires a non-empty array of even length")];let Bt=[];for(let jt=0;jt<$.length;jt+=2)Bt=Bt.concat(ou({key:`${C}[${jt}]`,value:$[jt],valueSpec:Mt.layout_symbol["text-anchor"]})),Bt=Bt.concat(Xc({key:`${C}[${jt+1}]`,value:$[jt+1],valueSpec:{length:2,value:"number"},validateSpec:H.validateSpec,style:H.style,styleSpec:Mt}));return Bt},sprite:lc};function Oc(H){let C=H.value,$=H.valueSpec,ht=H.styleSpec;return H.validateSpec=Oc,$.expression&&_c(Gs(C))?vc(H):$.expression&&Gu(Du(C))?Ku(H):$.type&&Su[$.type]?Su[$.type](H):Xl(vt({},H,{valueSpec:$.type?ht[$.type]:$}))}function Xe(H){let C=H.value,$=H.key,ht=su(H);return ht.length||(C.indexOf("{fontstack}")===-1&&ht.push(new bt($,C,'"glyphs" url must include a "{fontstack}" token')),C.indexOf("{range}")===-1&&ht.push(new bt($,C,'"glyphs" url must include a "{range}" token'))),ht}function yr(H,C=nt){let $=[];return $=$.concat(Oc({key:"",value:H,valueSpec:C.$root,styleSpec:C,style:H,validateSpec:Oc,objectElementValidators:{glyphs:Xe,"*":()=>[]}})),H.constants&&($=$.concat(ku({key:"constants",value:H.constants}))),Rr($)}function Kr(H){return function(C){return H(um(gd({},C),{validateSpec:Oc}))}}function Rr(H){return[].concat(H).sort((C,$)=>C.line-$.line)}function mn(H){return function(...C){return Rr(H.apply(this,C))}}yr.source=mn(Kr(Au)),yr.sprite=mn(Kr(lc)),yr.glyphs=mn(Kr(Xe)),yr.light=mn(Kr(il)),yr.sky=mn(Kr(Cs)),yr.terrain=mn(Kr(Mu)),yr.layer=mn(Kr(Uc)),yr.filter=mn(Kr(Qu)),yr.paintProperty=mn(Kr(uf)),yr.layoutProperty=mn(Kr(zl));let Pn=yr,ha=Pn.light,Ta=Pn.sky,Ua=Pn.paintProperty,Ya=Pn.layoutProperty;function va(H,C){let $=!1;if(C&&C.length)for(let ht of C)H.fire(new q(new Error(ht.message))),$=!0;return $}class Ba{constructor(C,$,ht){let Mt=this.cells=[];if(C instanceof ArrayBuffer){this.arrayBuffer=C;let jt=new Int32Array(this.arrayBuffer);C=jt[0],this.d=($=jt[1])+2*(ht=jt[2]);for(let be=0;be<this.d*this.d;be++){let Be=jt[3+be],Qe=jt[3+be+1];Mt.push(Be===Qe?null:jt.subarray(Be,Qe))}let oe=jt[3+Mt.length+1];this.keys=jt.subarray(jt[3+Mt.length],oe),this.bboxes=jt.subarray(oe),this.insert=this._insertReadonly}else{this.d=$+2*ht;for(let jt=0;jt<this.d*this.d;jt++)Mt.push([]);this.keys=[],this.bboxes=[]}this.n=$,this.extent=C,this.padding=ht,this.scale=$/C,this.uid=0;let Bt=ht/$*C;this.min=-Bt,this.max=C+Bt}insert(C,$,ht,Mt,Bt){this._forEachCell($,ht,Mt,Bt,this._insertCell,this.uid++,void 0,void 0),this.keys.push(C),this.bboxes.push($),this.bboxes.push(ht),this.bboxes.push(Mt),this.bboxes.push(Bt)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(C,$,ht,Mt,Bt,jt){this.cells[Bt].push(jt)}query(C,$,ht,Mt,Bt){let jt=this.min,oe=this.max;if(C<=jt&&$<=jt&&oe<=ht&&oe<=Mt&&!Bt)return Array.prototype.slice.call(this.keys);{let be=[];return this._forEachCell(C,$,ht,Mt,this._queryCell,be,{},Bt),be}}_queryCell(C,$,ht,Mt,Bt,jt,oe,be){let Be=this.cells[Bt];if(Be!==null){let Qe=this.keys,lr=this.bboxes;for(let wr=0;wr<Be.length;wr++){let Fr=Be[wr];if(oe[Fr]===void 0){let Zr=4*Fr;(be?be(lr[Zr+0],lr[Zr+1],lr[Zr+2],lr[Zr+3]):C<=lr[Zr+2]&&$<=lr[Zr+3]&&ht>=lr[Zr+0]&&Mt>=lr[Zr+1])?(oe[Fr]=!0,jt.push(Qe[Fr])):oe[Fr]=!1}}}}_forEachCell(C,$,ht,Mt,Bt,jt,oe,be){let Be=this._convertToCellCoord(C),Qe=this._convertToCellCoord($),lr=this._convertToCellCoord(ht),wr=this._convertToCellCoord(Mt);for(let Fr=Be;Fr<=lr;Fr++)for(let Zr=Qe;Zr<=wr;Zr++){let en=this.d*Zr+Fr;if((!be||be(this._convertFromCellCoord(Fr),this._convertFromCellCoord(Zr),this._convertFromCellCoord(Fr+1),this._convertFromCellCoord(Zr+1)))&&Bt.call(this,C,$,ht,Mt,en,jt,oe,be))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,$=3+this.cells.length+1+1,ht=0;for(let jt=0;jt<this.cells.length;jt++)ht+=this.cells[jt].length;let Mt=new Int32Array($+ht+this.keys.length+this.bboxes.length);Mt[0]=this.extent,Mt[1]=this.n,Mt[2]=this.padding;let Bt=$;for(let jt=0;jt<C.length;jt++){let oe=C[jt];Mt[3+jt]=Bt,Mt.set(oe,Bt),Bt+=oe.length}return Mt[3+C.length]=Bt,Mt.set(this.keys,Bt),Bt+=this.keys.length,Mt[3+C.length+1]=Bt,Mt.set(this.bboxes,Bt),Bt+=this.bboxes.length,Mt.buffer}static serialize(C,$){let ht=C.toArrayBuffer();return $&&$.push(ht),{buffer:ht}}static deserialize(C){return new Ba(C.buffer)}}let za={};function ca(H,C,$={}){if(za[H])throw new Error(`${H} is already registered.`);Object.defineProperty(C,"_classRegistryKey",{value:H,writeable:!1}),za[H]={klass:C,omit:$.omit||[],shallow:$.shallow||[]}}ca("Object",Object),ca("TransferableGridIndex",Ba),ca("Color",tr),ca("Error",Error),ca("AJAXError",et),ca("ResolvedImage",Kn),ca("StylePropertyFunction",Ws),ca("StyleExpression",Kl,{omit:["_evaluator"]}),ca("ZoomDependentExpression",Rl),ca("ZoomConstantExpression",Ou),ca("CompoundExpression",bl,{omit:["_evaluate"]});for(let H in dc)dc[H]._classRegistryKey||ca(`Expression_${H}`,dc[H]);function ei(H){return H&&typeof ArrayBuffer<"u"&&(H instanceof ArrayBuffer||H.constructor&&H.constructor.name==="ArrayBuffer")}function Vi(H){return H.$name||H.constructor._classRegistryKey}function Oi(H){return!function(C){if(C===null||typeof C!="object")return!1;let $=Vi(C);return!(!$||$==="Object")}(H)&&(H==null||typeof H=="boolean"||typeof H=="number"||typeof H=="string"||H instanceof Boolean||H instanceof Number||H instanceof String||H instanceof Date||H instanceof RegExp||H instanceof Blob||H instanceof Error||ei(H)||B(H)||ArrayBuffer.isView(H)||H instanceof ImageData)}function Wi(H,C){if(Oi(H))return(ei(H)||B(H))&&C&&C.push(H),ArrayBuffer.isView(H)&&C&&C.push(H.buffer),H instanceof ImageData&&C&&C.push(H.data.buffer),H;if(Array.isArray(H)){let Bt=[];for(let jt of H)Bt.push(Wi(jt,C));return Bt}if(typeof H!="object")throw new Error("can't serialize object of type "+typeof H);let $=Vi(H);if(!$)throw new Error(`can't serialize object of unregistered class ${H.constructor.name}`);if(!za[$])throw new Error(`${$} is not registered.`);let{klass:ht}=za[$],Mt=ht.serialize?ht.serialize(H,C):{};if(ht.serialize){if(C&&Mt===C[C.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let Bt in H){if(!H.hasOwnProperty(Bt)||za[$].omit.indexOf(Bt)>=0)continue;let jt=H[Bt];Mt[Bt]=za[$].shallow.indexOf(Bt)>=0?jt:Wi(jt,C)}H instanceof Error&&(Mt.message=H.message)}if(Mt.$name)throw new Error("$name property is reserved for worker serialization logic.");return $!=="Object"&&(Mt.$name=$),Mt}function Xi(H){if(Oi(H))return H;if(Array.isArray(H))return H.map(Xi);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);let C=Vi(H)||"Object";if(!za[C])throw new Error(`can't deserialize unregistered class ${C}`);let{klass:$}=za[C];if(!$)throw new Error(`can't deserialize unregistered class ${C}`);if($.deserialize)return $.deserialize(H);let ht=Object.create($.prototype);for(let Mt of Object.keys(H)){if(Mt==="$name")continue;let Bt=H[Mt];ht[Mt]=za[C].shallow.indexOf(Mt)>=0?Bt:Xi(Bt)}return ht}class ni{constructor(){this.first=!0}update(C,$){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=$):this.lastFloorZoom<ht&&(this.lastIntegerZoom=ht,this.lastIntegerZoomTime=$),C!==this.lastZoom&&(this.lastZoom=C,this.lastFloorZoom=ht,!0))}}let Za={"Latin-1 Supplement":H=>H>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function $i(H){for(let C of H)if(Yo(C.charCodeAt(0)))return!0;return!1}function Do(H){for(let C of H)if(!ys(C.charCodeAt(0)))return!1;return!0}function ss(H){let C=H.map($=>{try{return new RegExp(`\\p{sc=${$}}`,"u").source}catch{return null}}).filter($=>$);return new RegExp(C.join("|"),"u")}let Ps=ss(["Arab","Dupl","Mong","Ougr","Syrc"]);function ys(H){return!Ps.test(String.fromCodePoint(H))}let Os=ss(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Yo(H){return!(H!==746&&H!==747&&(H<4352||!(Za["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||Za["CJK Compatibility"](H)||Za["CJK Strokes"](H)||!(!Za["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||Za["Enclosed CJK Letters and Months"](H)||Za["Ideographic Description Characters"](H)||Za.Kanbun(H)||Za.Katakana(H)&&H!==12540||!(!Za["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!Za["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||Za["Vertical Forms"](H)||Za["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||Os.test(String.fromCodePoint(H)))))}function ll(H){return!(Yo(H)||function(C){return!!(Za["Latin-1 Supplement"](C)&&(C===167||C===169||C===174||C===177||C===188||C===189||C===190||C===215||C===247)||Za["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)||Za["Letterlike Symbols"](C)||Za["Number Forms"](C)||Za["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)||Za["Control Pictures"](C)&&C!==9251||Za["Optical Character Recognition"](C)||Za["Enclosed Alphanumerics"](C)||Za["Geometric Shapes"](C)||Za["Miscellaneous Symbols"](C)&&!(C>=9754&&C<=9759)||Za["Miscellaneous Symbols and Arrows"](C)&&(C>=11026&&C<=11055||C>=11088&&C<=11097||C>=11192&&C<=11243)||Za["CJK Symbols and Punctuation"](C)||Za.Katakana(C)||Za["Private Use Area"](C)||Za["CJK Compatibility Forms"](C)||Za["Small Form Variants"](C)||Za["Halfwidth and Fullwidth Forms"](C)||C===8734||C===8756||C===8757||C>=9984&&C<=10087||C>=10102&&C<=10131||C===65532||C===65533)}(H))}let el=ss(["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 Rs(H){return el.test(String.fromCodePoint(H))}function bi(H,C){return!(!C&&Rs(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||Za.Khmer(H))}function so(H){for(let C of H)if(Rs(C.charCodeAt(0)))return!0;return!1}let ws=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class fs{constructor(C,$){this.zoom=C,$?(this.now=$.now,this.fadeDuration=$.fadeDuration,this.zoomHistory=$.zoomHistory,this.transition=$.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ni,this.transition={})}isSupportedScript(C){return function($,ht){for(let Mt of $)if(!bi(Mt.charCodeAt(0),ht))return!1;return!0}(C,ws.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let C=this.zoom,$=C-Math.floor(C),ht=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:$+(1-$)*ht}:{fromScale:.5,toScale:1,t:1-(1-ht)*$}}}class Ll{constructor(C,$){this.property=C,this.value=$,this.expression=function(ht,Mt){if(_c(ht))return new Ws(ht,Mt);if(Gu(ht)){let Bt=Yl(ht,Mt);if(Bt.result==="error")throw new Error(Bt.value.map(jt=>`${jt.key}: ${jt.message}`).join(", "));return Bt.value}{let Bt=ht;return Mt.type==="color"&&typeof ht=="string"?Bt=tr.parse(ht):Mt.type!=="padding"||typeof ht!="number"&&!Array.isArray(ht)?Mt.type==="variableAnchorOffsetCollection"&&Array.isArray(ht)&&(Bt=Nn.parse(ht)):Bt=$r.parse(ht),{kind:"constant",evaluate:()=>Bt}}}($===void 0?C.specification.default:$,C.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(C,$,ht){return this.property.possiblyEvaluate(this,C,$,ht)}}class $l{constructor(C){this.property=C,this.value=new Ll(C,void 0)}transitioned(C,$){return new Bu(this.property,this.value,$,k({},C.transition,this.transition),C.now)}untransitioned(){return new Bu(this.property,this.value,null,{},0)}}class jl{constructor(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)}getValue(C){return h(this._values[C].value.value)}setValue(C,$){Object.prototype.hasOwnProperty.call(this._values,C)||(this._values[C]=new $l(this._values[C].property)),this._values[C].value=new Ll(this._values[C].property,$===null?void 0:h($))}getTransition(C){return h(this._values[C].transition)}setTransition(C,$){Object.prototype.hasOwnProperty.call(this._values,C)||(this._values[C]=new $l(this._values[C].property)),this._values[C].transition=h($)||void 0}serialize(){let C={};for(let $ of Object.keys(this._values)){let ht=this.getValue($);ht!==void 0&&(C[$]=ht);let Mt=this.getTransition($);Mt!==void 0&&(C[`${$}-transition`]=Mt)}return C}transitioned(C,$){let ht=new Jl(this._properties);for(let Mt of Object.keys(this._values))ht._values[Mt]=this._values[Mt].transitioned(C,$._values[Mt]);return ht}untransitioned(){let C=new Jl(this._properties);for(let $ of Object.keys(this._values))C._values[$]=this._values[$].untransitioned();return C}}class Bu{constructor(C,$,ht,Mt,Bt){this.property=C,this.value=$,this.begin=Bt+Mt.delay||0,this.end=this.begin+Mt.duration||0,C.specification.transition&&(Mt.delay||Mt.duration)&&(this.prior=ht)}possiblyEvaluate(C,$,ht){let Mt=C.now||0,Bt=this.value.possiblyEvaluate(C,$,ht),jt=this.prior;if(jt){if(Mt>this.end)return this.prior=null,Bt;if(this.value.isDataDriven())return this.prior=null,Bt;if(Mt<this.begin)return jt.possiblyEvaluate(C,$,ht);{let oe=(Mt-this.begin)/(this.end-this.begin);return this.property.interpolate(jt.possiblyEvaluate(C,$,ht),Bt,function(be){if(be<=0)return 0;if(be>=1)return 1;let Be=be*be,Qe=Be*be;return 4*(be<.5?Qe:3*(be-Be)+Qe-.75)}(oe))}}return Bt}}class Jl{constructor(C){this._properties=C,this._values=Object.create(C.defaultTransitioningPropertyValues)}possiblyEvaluate(C,$,ht){let Mt=new Nu(this._properties);for(let Bt of Object.keys(this._values))Mt._values[Bt]=this._values[Bt].possiblyEvaluate(C,$,ht);return Mt}hasTransition(){for(let C of Object.keys(this._values))if(this._values[C].prior)return!0;return!1}}class Ru{constructor(C){this._properties=C,this._values=Object.create(C.defaultPropertyValues)}hasValue(C){return this._values[C].value!==void 0}getValue(C){return h(this._values[C].value)}setValue(C,$){this._values[C]=new Ll(this._values[C].property,$===null?void 0:h($))}serialize(){let C={};for(let $ of Object.keys(this._values)){let ht=this.getValue($);ht!==void 0&&(C[$]=ht)}return C}possiblyEvaluate(C,$,ht){let Mt=new Nu(this._properties);for(let Bt of Object.keys(this._values))Mt._values[Bt]=this._values[Bt].possiblyEvaluate(C,$,ht);return Mt}}class nl{constructor(C,$,ht){this.property=C,this.value=$,this.parameters=ht}isConstant(){return this.value.kind==="constant"}constantOr(C){return this.value.kind==="constant"?this.value.value:C}evaluate(C,$,ht,Mt){return this.property.evaluate(this.value,this.parameters,C,$,ht,Mt)}}class Nu{constructor(C){this._properties=C,this._values=Object.create(C.defaultPossiblyEvaluatedValues)}get(C){return this._values[C]}}class Ui{constructor(C){this.specification=C}possiblyEvaluate(C,$){if(C.isDataDriven())throw new Error("Value should not be data driven");return C.expression.evaluate($)}interpolate(C,$,ht){let Mt=Ti[this.specification.type];return Mt?Mt(C,$,ht):C}}class fo{constructor(C,$){this.specification=C,this.overrides=$}possiblyEvaluate(C,$,ht,Mt){return new nl(this,C.expression.kind==="constant"||C.expression.kind==="camera"?{kind:"constant",value:C.expression.evaluate($,null,{},ht,Mt)}:C.expression,$)}interpolate(C,$,ht){if(C.value.kind!=="constant"||$.value.kind!=="constant")return C;if(C.value.value===void 0||$.value.value===void 0)return new nl(this,{kind:"constant",value:void 0},C.parameters);let Mt=Ti[this.specification.type];if(Mt){let Bt=Mt(C.value.value,$.value.value,ht);return new nl(this,{kind:"constant",value:Bt},C.parameters)}return C}evaluate(C,$,ht,Mt,Bt,jt){return C.kind==="constant"?C.value:C.evaluate($,ht,Mt,Bt,jt)}}class Ql extends fo{possiblyEvaluate(C,$,ht,Mt){if(C.value===void 0)return new nl(this,{kind:"constant",value:void 0},$);if(C.expression.kind==="constant"){let Bt=C.expression.evaluate($,null,{},ht,Mt),jt=C.property.specification.type==="resolvedImage"&&typeof Bt!="string"?Bt.name:Bt,oe=this._calculate(jt,jt,jt,$);return new nl(this,{kind:"constant",value:oe},$)}if(C.expression.kind==="camera"){let Bt=this._calculate(C.expression.evaluate({zoom:$.zoom-1}),C.expression.evaluate({zoom:$.zoom}),C.expression.evaluate({zoom:$.zoom+1}),$);return new nl(this,{kind:"constant",value:Bt},$)}return new nl(this,C.expression,$)}evaluate(C,$,ht,Mt,Bt,jt){if(C.kind==="source"){let oe=C.evaluate($,ht,Mt,Bt,jt);return this._calculate(oe,oe,oe,$)}return C.kind==="composite"?this._calculate(C.evaluate({zoom:Math.floor($.zoom)-1},ht,Mt),C.evaluate({zoom:Math.floor($.zoom)},ht,Mt),C.evaluate({zoom:Math.floor($.zoom)+1},ht,Mt),$):C.value}_calculate(C,$,ht,Mt){return Mt.zoom>Mt.zoomHistory.lastIntegerZoom?{from:C,to:$}:{from:ht,to:$}}interpolate(C){return C}}class ul{constructor(C){this.specification=C}possiblyEvaluate(C,$,ht,Mt){if(C.value!==void 0){if(C.expression.kind==="constant"){let Bt=C.expression.evaluate($,null,{},ht,Mt);return this._calculate(Bt,Bt,Bt,$)}return this._calculate(C.expression.evaluate(new fs(Math.floor($.zoom-1),$)),C.expression.evaluate(new fs(Math.floor($.zoom),$)),C.expression.evaluate(new fs(Math.floor($.zoom+1),$)),$)}}_calculate(C,$,ht,Mt){return Mt.zoom>Mt.zoomHistory.lastIntegerZoom?{from:C,to:$}:{from:ht,to:$}}interpolate(C){return C}}class Dc{constructor(C){this.specification=C}possiblyEvaluate(C,$,ht,Mt){return!!C.expression.evaluate($,null,{},ht,Mt)}interpolate(){return!1}}class Pt{constructor(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let $ in C){let ht=C[$];ht.specification.overridable&&this.overridableProperties.push($);let Mt=this.defaultPropertyValues[$]=new Ll(ht,void 0),Bt=this.defaultTransitionablePropertyValues[$]=new $l(ht);this.defaultTransitioningPropertyValues[$]=Bt.untransitioned(),this.defaultPossiblyEvaluatedValues[$]=Mt.possiblyEvaluate({})}}}ca("DataDrivenProperty",fo),ca("DataConstantProperty",Ui),ca("CrossFadedDataDrivenProperty",Ql),ca("CrossFadedProperty",ul),ca("ColorRampProperty",Dc);let z="-transition";class at extends it{constructor(C,$){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),$.layout&&(this._unevaluatedLayout=new Ru($.layout)),$.paint)){this._transitionablePaint=new jl($.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 Nu($.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(C){return C==="visibility"?this.visibility:this._unevaluatedLayout.getValue(C)}setLayoutProperty(C,$,ht={}){$!=null&&this._validate(Ya,`layers.${this.id}.layout.${C}`,C,$,ht)||(C!=="visibility"?this._unevaluatedLayout.setValue(C,$):this.visibility=$)}getPaintProperty(C){return C.endsWith(z)?this._transitionablePaint.getTransition(C.slice(0,-11)):this._transitionablePaint.getValue(C)}setPaintProperty(C,$,ht={}){if($!=null&&this._validate(Ua,`layers.${this.id}.paint.${C}`,C,$,ht))return!1;if(C.endsWith(z))return this._transitionablePaint.setTransition(C.slice(0,-11),$||void 0),!1;{let Mt=this._transitionablePaint._values[C],Bt=Mt.property.specification["property-type"]==="cross-faded-data-driven",jt=Mt.value.isDataDriven(),oe=Mt.value;this._transitionablePaint.setValue(C,$),this._handleSpecialPaintPropertyUpdate(C);let be=this._transitionablePaint._values[C].value;return be.isDataDriven()||jt||Bt||this._handleOverridablePaintPropertyUpdate(C,oe,be)}}_handleSpecialPaintPropertyUpdate(C){}_handleOverridablePaintPropertyUpdate(C,$,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,$){C.getCrossfadeParameters&&(this._crossfadeParameters=C.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(C,void 0,$)),this.paint=this._transitioningPaint.possiblyEvaluate(C,void 0,$)}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),c(C,($,ht)=>!($===void 0||ht==="layout"&&!Object.keys($).length||ht==="paint"&&!Object.keys($).length))}_validate(C,$,ht,Mt,Bt={}){return(!Bt||Bt.validate!==!1)&&va(this,C.call(Pn,{key:$,layerType:this.type,objectKey:ht,value:Mt,styleSpec:nt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let C in this.paint._values){let $=this.paint.get(C);if($ instanceof nl&&wl($.property.specification)&&($.value.kind==="source"||$.value.kind==="composite")&&$.value.isStateDependent)return!0}return!1}}let xt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class kt{constructor(C,$){this._structArray=C,this._pos1=$*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Lt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(C,$){return C._trim(),$&&(C.isTransferred=!0,$.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}}static deserialize(C){let $=Object.create(this.prototype);return $.arrayBuffer=C.arrayBuffer,$.length=C.length,$.capacity=C.arrayBuffer.byteLength/$.bytesPerElement,$._refreshViews(),$}_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 $=this.uint8;this._refreshViews(),$&&this.uint8.set($)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function le(H,C=1){let $=0,ht=0;return{members:H.map(Mt=>{let Bt=xt[Mt.type].BYTES_PER_ELEMENT,jt=$=xe($,Math.max(C,Bt)),oe=Mt.components||1;return ht=Math.max(ht,Bt),$+=Bt*oe,{name:Mt.name,type:Mt.type,components:oe,offset:jt}}),size:xe($,Math.max(ht,C)),alignment:C}}function xe(H,C){return Math.ceil(H/C)*C}class Pe extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,$)}emplace(C,$,ht){let Mt=2*C;return this.int16[Mt+0]=$,this.int16[Mt+1]=ht,C}}Pe.prototype.bytesPerElement=4,ca("StructArrayLayout2i4",Pe);class $e extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.int16[Bt+0]=$,this.int16[Bt+1]=ht,this.int16[Bt+2]=Mt,C}}$e.prototype.bytesPerElement=6,ca("StructArrayLayout3i6",$e);class hr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt){let Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,C,$,ht,Mt)}emplace(C,$,ht,Mt,Bt){let jt=4*C;return this.int16[jt+0]=$,this.int16[jt+1]=ht,this.int16[jt+2]=Mt,this.int16[jt+3]=Bt,C}}hr.prototype.bytesPerElement=8,ca("StructArrayLayout4i8",hr);class pr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=6*C;return this.int16[be+0]=$,this.int16[be+1]=ht,this.int16[be+2]=Mt,this.int16[be+3]=Bt,this.int16[be+4]=jt,this.int16[be+5]=oe,C}}pr.prototype.bytesPerElement=12,ca("StructArrayLayout2i4i12",pr);class Br extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=4*C,Be=8*C;return this.int16[be+0]=$,this.int16[be+1]=ht,this.uint8[Be+4]=Mt,this.uint8[Be+5]=Bt,this.uint8[Be+6]=jt,this.uint8[Be+7]=oe,C}}Br.prototype.bytesPerElement=8,ca("StructArrayLayout2i4ub8",Br);class Jr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,$)}emplace(C,$,ht){let Mt=2*C;return this.float32[Mt+0]=$,this.float32[Mt+1]=ht,C}}Jr.prototype.bytesPerElement=8,ca("StructArrayLayout2f8",Jr);class Rt extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){let lr=this.length;return this.resize(lr+1),this.emplace(lr,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr){let wr=10*C;return this.uint16[wr+0]=$,this.uint16[wr+1]=ht,this.uint16[wr+2]=Mt,this.uint16[wr+3]=Bt,this.uint16[wr+4]=jt,this.uint16[wr+5]=oe,this.uint16[wr+6]=be,this.uint16[wr+7]=Be,this.uint16[wr+8]=Qe,this.uint16[wr+9]=lr,C}}Rt.prototype.bytesPerElement=20,ca("StructArrayLayout10ui20",Rt);class Gt extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr){let Fr=this.length;return this.resize(Fr+1),this.emplace(Fr,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr){let Zr=12*C;return this.int16[Zr+0]=$,this.int16[Zr+1]=ht,this.int16[Zr+2]=Mt,this.int16[Zr+3]=Bt,this.uint16[Zr+4]=jt,this.uint16[Zr+5]=oe,this.uint16[Zr+6]=be,this.uint16[Zr+7]=Be,this.int16[Zr+8]=Qe,this.int16[Zr+9]=lr,this.int16[Zr+10]=wr,this.int16[Zr+11]=Fr,C}}Gt.prototype.bytesPerElement=24,ca("StructArrayLayout4i4ui4i24",Gt);class ae extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.float32[Bt+0]=$,this.float32[Bt+1]=ht,this.float32[Bt+2]=Mt,C}}ae.prototype.bytesPerElement=12,ca("StructArrayLayout3f12",ae);class ce extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(C){let $=this.length;return this.resize($+1),this.emplace($,C)}emplace(C,$){return this.uint32[1*C+0]=$,C}}ce.prototype.bytesPerElement=4,ca("StructArrayLayout1ul4",ce);class Te extends Lt{_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,$,ht,Mt,Bt,jt,oe,be,Be){let Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,C,$,ht,Mt,Bt,jt,oe,be,Be)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){let lr=10*C,wr=5*C;return this.int16[lr+0]=$,this.int16[lr+1]=ht,this.int16[lr+2]=Mt,this.int16[lr+3]=Bt,this.int16[lr+4]=jt,this.int16[lr+5]=oe,this.uint32[wr+3]=be,this.uint16[lr+8]=Be,this.uint16[lr+9]=Qe,C}}Te.prototype.bytesPerElement=20,ca("StructArrayLayout6i1ul2ui20",Te);class ye extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=6*C;return this.int16[be+0]=$,this.int16[be+1]=ht,this.int16[be+2]=Mt,this.int16[be+3]=Bt,this.int16[be+4]=jt,this.int16[be+5]=oe,C}}ye.prototype.bytesPerElement=12,ca("StructArrayLayout2i2i2i12",ye);class ze extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,C,$,ht,Mt,Bt)}emplace(C,$,ht,Mt,Bt,jt){let oe=4*C,be=8*C;return this.float32[oe+0]=$,this.float32[oe+1]=ht,this.float32[oe+2]=Mt,this.int16[be+6]=Bt,this.int16[be+7]=jt,C}}ze.prototype.bytesPerElement=16,ca("StructArrayLayout2f1f2i16",ze);class rr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt,Bt,jt){let oe=this.length;return this.resize(oe+1),this.emplace(oe,C,$,ht,Mt,Bt,jt)}emplace(C,$,ht,Mt,Bt,jt,oe){let be=16*C,Be=4*C,Qe=8*C;return this.uint8[be+0]=$,this.uint8[be+1]=ht,this.float32[Be+1]=Mt,this.float32[Be+2]=Bt,this.int16[Qe+6]=jt,this.int16[Qe+7]=oe,C}}rr.prototype.bytesPerElement=16,ca("StructArrayLayout2ub2f2i16",rr);class fr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.uint16[Bt+0]=$,this.uint16[Bt+1]=ht,this.uint16[Bt+2]=Mt,C}}fr.prototype.bytesPerElement=6,ca("StructArrayLayout3ui6",fr);class gr extends Lt{_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,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn){let Ca=this.length;return this.resize(Ca+1),this.emplace(Ca,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca){let ua=24*C,wa=12*C,Xa=48*C;return this.int16[ua+0]=$,this.int16[ua+1]=ht,this.uint16[ua+2]=Mt,this.uint16[ua+3]=Bt,this.uint32[wa+2]=jt,this.uint32[wa+3]=oe,this.uint32[wa+4]=be,this.uint16[ua+10]=Be,this.uint16[ua+11]=Qe,this.uint16[ua+12]=lr,this.float32[wa+7]=wr,this.float32[wa+8]=Fr,this.uint8[Xa+36]=Zr,this.uint8[Xa+37]=en,this.uint8[Xa+38]=yn,this.uint32[wa+10]=Vn,this.int16[ua+22]=Ca,C}}gr.prototype.bytesPerElement=48,ca("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",gr);class Lr extends Lt{_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,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca,ua,wa,Xa,di,oo,as,eo,Ki,Co,xo){let ho=this.length;return this.resize(ho+1),this.emplace(ho,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca,ua,wa,Xa,di,oo,as,eo,Ki,Co,xo)}emplace(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en,yn,Vn,Ca,ua,wa,Xa,di,oo,as,eo,Ki,Co,xo,ho){let oi=32*C,Ro=16*C;return this.int16[oi+0]=$,this.int16[oi+1]=ht,this.int16[oi+2]=Mt,this.int16[oi+3]=Bt,this.int16[oi+4]=jt,this.int16[oi+5]=oe,this.int16[oi+6]=be,this.int16[oi+7]=Be,this.uint16[oi+8]=Qe,this.uint16[oi+9]=lr,this.uint16[oi+10]=wr,this.uint16[oi+11]=Fr,this.uint16[oi+12]=Zr,this.uint16[oi+13]=en,this.uint16[oi+14]=yn,this.uint16[oi+15]=Vn,this.uint16[oi+16]=Ca,this.uint16[oi+17]=ua,this.uint16[oi+18]=wa,this.uint16[oi+19]=Xa,this.uint16[oi+20]=di,this.uint16[oi+21]=oo,this.uint16[oi+22]=as,this.uint32[Ro+12]=eo,this.float32[Ro+13]=Ki,this.float32[Ro+14]=Co,this.uint16[oi+30]=xo,this.uint16[oi+31]=ho,C}}Lr.prototype.bytesPerElement=64,ca("StructArrayLayout8i15ui1ul2f2ui64",Lr);class Hr extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C){let $=this.length;return this.resize($+1),this.emplace($,C)}emplace(C,$){return this.float32[1*C+0]=$,C}}Hr.prototype.bytesPerElement=4,ca("StructArrayLayout1f4",Hr);class nn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=3*C;return this.uint16[6*C+0]=$,this.float32[Bt+1]=ht,this.float32[Bt+2]=Mt,C}}nn.prototype.bytesPerElement=12,ca("StructArrayLayout1ui2f12",nn);class cn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$,ht){let Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,C,$,ht)}emplace(C,$,ht,Mt){let Bt=4*C;return this.uint32[2*C+0]=$,this.uint16[Bt+2]=ht,this.uint16[Bt+3]=Mt,C}}cn.prototype.bytesPerElement=8,ca("StructArrayLayout1ul2ui8",cn);class Mn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C,$){let ht=this.length;return this.resize(ht+1),this.emplace(ht,C,$)}emplace(C,$,ht){let Mt=2*C;return this.uint16[Mt+0]=$,this.uint16[Mt+1]=ht,C}}Mn.prototype.bytesPerElement=4,ca("StructArrayLayout2ui4",Mn);class Jn extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(C){let $=this.length;return this.resize($+1),this.emplace($,C)}emplace(C,$){return this.uint16[1*C+0]=$,C}}Jn.prototype.bytesPerElement=2,ca("StructArrayLayout1ui2",Jn);class _a extends Lt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(C,$,ht,Mt){let Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,C,$,ht,Mt)}emplace(C,$,ht,Mt,Bt){let jt=4*C;return this.float32[jt+0]=$,this.float32[jt+1]=ht,this.float32[jt+2]=Mt,this.float32[jt+3]=Bt,C}}_a.prototype.bytesPerElement=16,ca("StructArrayLayout4f16",_a);class xa extends kt{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)}}xa.prototype.size=20;class La extends Te{get(C){return new xa(this,C)}}ca("CollisionBoxArray",La);class ai extends kt{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]}}ai.prototype.size=48;class Ai extends gr{get(C){return new ai(this,C)}}ca("PlacedSymbolArray",Ai);class mi extends kt{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]}}mi.prototype.size=64;class Yi extends Lr{get(C){return new mi(this,C)}}ca("SymbolInstanceArray",Yi);class Go extends Hr{getoffsetX(C){return this.float32[1*C+0]}}ca("GlyphOffsetArray",Go);class Xo extends $e{getx(C){return this.int16[3*C+0]}gety(C){return this.int16[3*C+1]}gettileUnitDistanceFromAnchor(C){return this.int16[3*C+2]}}ca("SymbolLineVertexArray",Xo);class po extends kt{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]}}po.prototype.size=12;class Qo extends nn{get(C){return new po(this,C)}}ca("TextAnchorOffsetArray",Qo);class Js extends kt{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 Us extends cn{get(C){return new Js(this,C)}}ca("FeatureIndexArray",Us);class To extends Pe{}class ko extends Pe{}class hl extends Pe{}class Sl extends pr{}class tu extends Br{}class gt extends Jr{}class Et extends Rt{}class Xt extends Gt{}class fe extends ae{}class me extends ce{}class we extends ye{}class Ve extends rr{}class je extends fr{}class or extends Mn{}let Cr=le([{name:"a_pos",components:2,type:"Int16"}],4),{members:Sr}=Cr;class Wr{constructor(C=[]){this.segments=C}prepareSegment(C,$,ht,Mt){let Bt=this.segments[this.segments.length-1];return C>Wr.MAX_VERTEX_ARRAY_LENGTH&&_(`Max vertices per segment is ${Wr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${C}`),(!Bt||Bt.vertexLength+C>Wr.MAX_VERTEX_ARRAY_LENGTH||Bt.sortKey!==Mt)&&(Bt={vertexOffset:$.length,primitiveOffset:ht.length,vertexLength:0,primitiveLength:0},Mt!==void 0&&(Bt.sortKey=Mt),this.segments.push(Bt)),Bt}get(){return this.segments}destroy(){for(let C of this.segments)for(let $ in C.vaos)C.vaos[$].destroy()}static simpleSegment(C,$,ht,Mt){return new Wr([{vertexOffset:C,primitiveOffset:$,vertexLength:ht,primitiveLength:Mt,vaos:{},sortKey:0}])}}function an(H,C){return 256*(H=y(Math.floor(H),0,255))+y(Math.floor(C),0,255)}Wr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ca("SegmentVector",Wr);let on=le([{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 ta={exports:{}},hn={exports:{}};hn.exports=function(H,C){var $,ht,Mt,Bt,jt,oe,be,Be;for(ht=H.length-($=3&H.length),Mt=C,jt=3432918353,oe=461845907,Be=0;Be<ht;)be=255&H.charCodeAt(Be)|(255&H.charCodeAt(++Be))<<8|(255&H.charCodeAt(++Be))<<16|(255&H.charCodeAt(++Be))<<24,++Be,Mt=27492+(65535&(Bt=5*(65535&(Mt=(Mt^=be=(65535&(be=(be=(65535&be)*jt+(((be>>>16)*jt&65535)<<16)&4294967295)<<15|be>>>17))*oe+(((be>>>16)*oe&65535)<<16)&4294967295)<<13|Mt>>>19))+((5*(Mt>>>16)&65535)<<16)&4294967295))+((58964+(Bt>>>16)&65535)<<16);switch(be=0,$){case 3:be^=(255&H.charCodeAt(Be+2))<<16;case 2:be^=(255&H.charCodeAt(Be+1))<<8;case 1:Mt^=be=(65535&(be=(be=(65535&(be^=255&H.charCodeAt(Be)))*jt+(((be>>>16)*jt&65535)<<16)&4294967295)<<15|be>>>17))*oe+(((be>>>16)*oe&65535)<<16)&4294967295}return Mt^=H.length,Mt=2246822507*(65535&(Mt^=Mt>>>16))+((2246822507*(Mt>>>16)&65535)<<16)&4294967295,Mt=3266489909*(65535&(Mt^=Mt>>>13))+((3266489909*(Mt>>>16)&65535)<<16)&4294967295,(Mt^=Mt>>>16)>>>0};var Bn=hn.exports,Hn={exports:{}};Hn.exports=function(H,C){for(var $,ht=H.length,Mt=C^ht,Bt=0;ht>=4;)$=1540483477*(65535&($=255&H.charCodeAt(Bt)|(255&H.charCodeAt(++Bt))<<8|(255&H.charCodeAt(++Bt))<<16|(255&H.charCodeAt(++Bt))<<24))+((1540483477*($>>>16)&65535)<<16),Mt=1540483477*(65535&Mt)+((1540483477*(Mt>>>16)&65535)<<16)^($=1540483477*(65535&($^=$>>>24))+((1540483477*($>>>16)&65535)<<16)),ht-=4,++Bt;switch(ht){case 3:Mt^=(255&H.charCodeAt(Bt+2))<<16;case 2:Mt^=(255&H.charCodeAt(Bt+1))<<8;case 1:Mt=1540483477*(65535&(Mt^=255&H.charCodeAt(Bt)))+((1540483477*(Mt>>>16)&65535)<<16)}return Mt=1540483477*(65535&(Mt^=Mt>>>13))+((1540483477*(Mt>>>16)&65535)<<16),(Mt^=Mt>>>15)>>>0};var Yn=Bn,na=Hn.exports;ta.exports=Yn,ta.exports.murmur3=Yn,ta.exports.murmur2=na;var _n=r(ta.exports);class Ha{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(C,$,ht,Mt){this.ids.push(Wa(C)),this.positions.push($,ht,Mt)}getPositions(C){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let $=Wa(C),ht=0,Mt=this.ids.length-1;for(;ht<Mt;){let jt=ht+Mt>>1;this.ids[jt]>=$?Mt=jt:ht=jt+1}let Bt=[];for(;this.ids[ht]===$;)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,$){let ht=new Float64Array(C.ids),Mt=new Uint32Array(C.positions);return ri(ht,Mt,0,ht.length-1),$&&$.push(ht.buffer,Mt.buffer),{ids:ht,positions:Mt}}static deserialize(C){let $=new Ha;return $.ids=C.ids,$.positions=C.positions,$.indexed=!0,$}}function Wa(H){let C=+H;return!isNaN(C)&&C<=Number.MAX_SAFE_INTEGER?C:_n(String(H))}function ri(H,C,$,ht){for(;$<ht;){let Mt=H[$+ht>>1],Bt=$-1,jt=ht+1;for(;;){do Bt++;while(H[Bt]<Mt);do jt--;while(H[jt]>Mt);if(Bt>=jt)break;xi(H,Bt,jt),xi(C,3*Bt,3*jt),xi(C,3*Bt+1,3*jt+1),xi(C,3*Bt+2,3*jt+2)}jt-$<ht-jt?(ri(H,C,$,jt),$=jt+1):(ri(H,C,jt+1,ht),ht=jt)}}function xi(H,C,$){let ht=H[C];H[C]=H[$],H[$]=ht}ca("FeaturePositionMap",Ha);class ki{constructor(C,$){this.gl=C.gl,this.location=$}}class zi extends ki{constructor(C,$){super(C,$),this.current=0}set(C){this.current!==C&&(this.current=C,this.gl.uniform1f(this.location,C))}}class jo extends ki{constructor(C,$){super(C,$),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 Ii extends ki{constructor(C,$){super(C,$),this.current=tr.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 es(H){return[an(255*H.r,255*H.g),an(255*H.b,255*H.a)]}class pl{constructor(C,$,ht){this.value=C,this.uniformNames=$.map(Mt=>`u_${Mt}`),this.type=ht}setUniform(C,$,ht){C.set(ht.constantOr(this.value))}getBinding(C,$,ht){return this.type==="color"?new Ii(C,$):new zi(C,$)}}class Ns{constructor(C,$){this.uniformNames=$.map(ht=>`u_${ht}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(C,$){this.pixelRatioFrom=$.pixelRatio,this.pixelRatioTo=C.pixelRatio,this.patternFrom=$.tlbr,this.patternTo=C.tlbr}setUniform(C,$,ht,Mt){let Bt=Mt==="u_pattern_to"?this.patternTo:Mt==="u_pattern_from"?this.patternFrom:Mt==="u_pixel_ratio_to"?this.pixelRatioTo:Mt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Bt&&C.set(Bt)}getBinding(C,$,ht){return ht.substr(0,9)==="u_pattern"?new jo(C,$):new zi(C,$)}}class fi{constructor(C,$,ht,Mt){this.expression=C,this.type=ht,this.maxValue=0,this.paintVertexAttributes=$.map(Bt=>({name:`a_${Bt}`,type:"Float32",components:ht==="color"?2:1,offset:0})),this.paintVertexArray=new Mt}populatePaintArray(C,$,ht,Mt,Bt){let jt=this.paintVertexArray.length,oe=this.expression.evaluate(new fs(0),$,{},Mt,[],Bt);this.paintVertexArray.resize(C),this._setPaintValue(jt,C,oe)}updatePaintArray(C,$,ht,Mt){let Bt=this.expression.evaluate({zoom:0},ht,Mt);this._setPaintValue(C,$,Bt)}_setPaintValue(C,$,ht){if(this.type==="color"){let Mt=es(ht);for(let Bt=C;Bt<$;Bt++)this.paintVertexArray.emplace(Bt,Mt[0],Mt[1])}else{for(let Mt=C;Mt<$;Mt++)this.paintVertexArray.emplace(Mt,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 Ao{constructor(C,$,ht,Mt,Bt,jt){this.expression=C,this.uniformNames=$.map(oe=>`u_${oe}_t`),this.type=ht,this.useIntegerZoom=Mt,this.zoom=Bt,this.maxValue=0,this.paintVertexAttributes=$.map(oe=>({name:`a_${oe}`,type:"Float32",components:ht==="color"?4:2,offset:0})),this.paintVertexArray=new jt}populatePaintArray(C,$,ht,Mt,Bt){let jt=this.expression.evaluate(new fs(this.zoom),$,{},Mt,[],Bt),oe=this.expression.evaluate(new fs(this.zoom+1),$,{},Mt,[],Bt),be=this.paintVertexArray.length;this.paintVertexArray.resize(C),this._setPaintValue(be,C,jt,oe)}updatePaintArray(C,$,ht,Mt){let Bt=this.expression.evaluate({zoom:this.zoom},ht,Mt),jt=this.expression.evaluate({zoom:this.zoom+1},ht,Mt);this._setPaintValue(C,$,Bt,jt)}_setPaintValue(C,$,ht,Mt){if(this.type==="color"){let Bt=es(ht),jt=es(Mt);for(let oe=C;oe<$;oe++)this.paintVertexArray.emplace(oe,Bt[0],Bt[1],jt[0],jt[1])}else{for(let Bt=C;Bt<$;Bt++)this.paintVertexArray.emplace(Bt,ht,Mt);this.maxValue=Math.max(this.maxValue,Math.abs(ht),Math.abs(Mt))}}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,$){let ht=this.useIntegerZoom?Math.floor($.zoom):$.zoom,Mt=y(this.expression.interpolationFactor(ht,this.zoom,this.zoom+1),0,1);C.set(Mt)}getBinding(C,$,ht){return new zi(C,$)}}class Bo{constructor(C,$,ht,Mt,Bt,jt){this.expression=C,this.type=$,this.useIntegerZoom=ht,this.zoom=Mt,this.layerId=jt,this.zoomInPaintVertexArray=new Bt,this.zoomOutPaintVertexArray=new Bt}populatePaintArray(C,$,ht){let Mt=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(C),this.zoomOutPaintVertexArray.resize(C),this._setPaintValues(Mt,C,$.patterns&&$.patterns[this.layerId],ht)}updatePaintArray(C,$,ht,Mt,Bt){this._setPaintValues(C,$,ht.patterns&&ht.patterns[this.layerId],Bt)}_setPaintValues(C,$,ht,Mt){if(!Mt||!ht)return;let{min:Bt,mid:jt,max:oe}=ht,be=Mt[Bt],Be=Mt[jt],Qe=Mt[oe];if(be&&Be&&Qe)for(let lr=C;lr<$;lr++)this.zoomInPaintVertexArray.emplace(lr,Be.tl[0],Be.tl[1],Be.br[0],Be.br[1],be.tl[0],be.tl[1],be.br[0],be.br[1],Be.pixelRatio,be.pixelRatio),this.zoomOutPaintVertexArray.emplace(lr,Be.tl[0],Be.tl[1],Be.br[0],Be.br[1],Qe.tl[0],Qe.tl[1],Qe.br[0],Qe.br[1],Be.pixelRatio,Qe.pixelRatio)}upload(C){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=C.createVertexBuffer(this.zoomInPaintVertexArray,on.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=C.createVertexBuffer(this.zoomOutPaintVertexArray,on.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ds{constructor(C,$,ht){this.binders={},this._buffers=[];let Mt=[];for(let Bt in C.paint._values){if(!ht(Bt))continue;let jt=C.paint.get(Bt);if(!(jt instanceof nl&&wl(jt.property.specification)))continue;let oe=lu(Bt,C.type),be=jt.value,Be=jt.property.specification.type,Qe=jt.property.useIntegerZoom,lr=jt.property.specification["property-type"],wr=lr==="cross-faded"||lr==="cross-faded-data-driven";if(be.kind==="constant")this.binders[Bt]=wr?new Ns(be.value,oe):new pl(be.value,oe,Be),Mt.push(`/u_${Bt}`);else if(be.kind==="source"||wr){let Fr=ps(Bt,Be,"source");this.binders[Bt]=wr?new Bo(be,Be,Qe,$,Fr,C.id):new fi(be,oe,Be,Fr),Mt.push(`/a_${Bt}`)}else{let Fr=ps(Bt,Be,"composite");this.binders[Bt]=new Ao(be,oe,Be,Qe,$,Fr),Mt.push(`/z_${Bt}`)}}this.cacheKey=Mt.sort().join("")}getMaxValue(C){let $=this.binders[C];return $ instanceof fi||$ instanceof Ao?$.maxValue:0}populatePaintArrays(C,$,ht,Mt,Bt){for(let jt in this.binders){let oe=this.binders[jt];(oe instanceof fi||oe instanceof Ao||oe instanceof Bo)&&oe.populatePaintArray(C,$,ht,Mt,Bt)}}setConstantPatternPositions(C,$){for(let ht in this.binders){let Mt=this.binders[ht];Mt instanceof Ns&&Mt.setConstantPatternPositions(C,$)}}updatePaintArrays(C,$,ht,Mt,Bt){let jt=!1;for(let oe in C){let be=$.getPositions(oe);for(let Be of be){let Qe=ht.feature(Be.index);for(let lr in this.binders){let wr=this.binders[lr];if((wr instanceof fi||wr instanceof Ao||wr instanceof Bo)&&wr.expression.isStateDependent===!0){let Fr=Mt.paint.get(lr);wr.expression=Fr.value,wr.updatePaintArray(Be.start,Be.end,Qe,C[oe],Bt),jt=!0}}}}return jt}defines(){let C=[];for(let $ in this.binders){let ht=this.binders[$];(ht instanceof pl||ht instanceof Ns)&&C.push(...ht.uniformNames.map(Mt=>`#define HAS_UNIFORM_${Mt}`))}return C}getBinderAttributes(){let C=[];for(let $ in this.binders){let ht=this.binders[$];if(ht instanceof fi||ht instanceof Ao)for(let Mt=0;Mt<ht.paintVertexAttributes.length;Mt++)C.push(ht.paintVertexAttributes[Mt].name);else if(ht instanceof Bo)for(let Mt=0;Mt<on.members.length;Mt++)C.push(on.members[Mt].name)}return C}getBinderUniforms(){let C=[];for(let $ in this.binders){let ht=this.binders[$];if(ht instanceof pl||ht instanceof Ns||ht instanceof Ao)for(let Mt of ht.uniformNames)C.push(Mt)}return C}getPaintVertexBuffers(){return this._buffers}getUniforms(C,$){let ht=[];for(let Mt in this.binders){let Bt=this.binders[Mt];if(Bt instanceof pl||Bt instanceof Ns||Bt instanceof Ao){for(let jt of Bt.uniformNames)if($[jt]){let oe=Bt.getBinding(C,$[jt],jt);ht.push({name:jt,property:Mt,binding:oe})}}}return ht}setUniforms(C,$,ht,Mt){for(let{name:Bt,property:jt,binding:oe}of $)this.binders[jt].setUniform(oe,Mt,ht.get(jt),Bt)}updatePaintBuffers(C){this._buffers=[];for(let $ in this.binders){let ht=this.binders[$];if(C&&ht instanceof Bo){let Mt=C.fromScale===2?ht.zoomInPaintVertexBuffer:ht.zoomOutPaintVertexBuffer;Mt&&this._buffers.push(Mt)}else(ht instanceof fi||ht instanceof Ao)&&ht.paintVertexBuffer&&this._buffers.push(ht.paintVertexBuffer)}}upload(C){for(let $ in this.binders){let ht=this.binders[$];(ht instanceof fi||ht instanceof Ao||ht instanceof Bo)&&ht.upload(C)}this.updatePaintBuffers()}destroy(){for(let C in this.binders){let $=this.binders[C];($ instanceof fi||$ instanceof Ao||$ instanceof Bo)&&$.destroy()}}}class Ts{constructor(C,$,ht=()=>!0){this.programConfigurations={};for(let Mt of C)this.programConfigurations[Mt.id]=new Ds(Mt,$,ht);this.needsUpload=!1,this._featureMap=new Ha,this._bufferOffset=0}populatePaintArrays(C,$,ht,Mt,Bt,jt){for(let oe in this.programConfigurations)this.programConfigurations[oe].populatePaintArrays(C,$,Mt,Bt,jt);$.id!==void 0&&this._featureMap.add($.id,ht,this._bufferOffset,C),this._bufferOffset=C,this.needsUpload=!0}updatePaintArrays(C,$,ht,Mt){for(let Bt of ht)this.needsUpload=this.programConfigurations[Bt.id].updatePaintArrays(C,this._featureMap,$,Bt,Mt)||this.needsUpload}get(C){return this.programConfigurations[C]}upload(C){if(this.needsUpload){for(let $ in this.programConfigurations)this.programConfigurations[$].upload(C);this.needsUpload=!1}}destroy(){for(let C in this.programConfigurations)this.programConfigurations[C].destroy()}}function lu(H,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"]}[H]||[H.replace(`${C}-`,"").replace(/-/g,"_")]}function ps(H,C,$){let ht={color:{source:Jr,composite:_a},number:{source:Hr,composite:Jr}},Mt=function(Bt){return{"line-pattern":{source:Et,composite:Et},"fill-pattern":{source:Et,composite:Et},"fill-extrusion-pattern":{source:Et,composite:Et}}[Bt]}(H);return Mt&&Mt[$]||ht[C][$]}ca("ConstantBinder",pl),ca("CrossFadedConstantBinder",Ns),ca("SourceExpressionBinder",fi),ca("CrossFadedCompositeBinder",Bo),ca("CompositeExpressionBinder",Ao),ca("ProgramConfiguration",Ds,{omit:["_buffers"]}),ca("ProgramConfigurationSet",Ts);let zs=8192,Eu=Math.pow(2,14)-1,ie=-Eu-1;function nr(H){let C=zs/H.extent,$=H.loadGeometry();for(let ht=0;ht<$.length;ht++){let Mt=$[ht];for(let Bt=0;Bt<Mt.length;Bt++){let jt=Mt[Bt],oe=Math.round(jt.x*C),be=Math.round(jt.y*C);jt.x=y(oe,ie,Eu),jt.y=y(be,ie,Eu),(oe<jt.x||oe>jt.x+1||be<jt.y||be>jt.y+1)&&_("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return $}function cr(H,C){return{type:H.type,id:H.id,properties:H.properties,geometry:C?nr(H):[]}}function sn(H,C,$,ht,Mt){H.emplaceBack(2*C+(ht+1)/2,2*$+(Mt+1)/2)}class zn{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new ko,this.indexArray=new je,this.segments=new Wr,this.programConfigurations=new Ts(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){let Mt=this.layers[0],Bt=[],jt=null,oe=!1;Mt.type==="circle"&&(jt=Mt.layout.get("circle-sort-key"),oe=!jt.isConstant());for(let{feature:be,id:Be,index:Qe,sourceLayerIndex:lr}of C){let wr=this.layers[0]._featureFilter.needGeometry,Fr=cr(be,wr);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),Fr,ht))continue;let Zr=oe?jt.evaluate(Fr,{},ht):void 0,en={id:Be,properties:be.properties,type:be.type,sourceLayerIndex:lr,index:Qe,geometry:wr?Fr.geometry:nr(be),patterns:{},sortKey:Zr};Bt.push(en)}oe&&Bt.sort((be,Be)=>be.sortKey-Be.sortKey);for(let be of Bt){let{geometry:Be,index:Qe,sourceLayerIndex:lr}=be,wr=C[Qe].feature;this.addFeature(be,Be,Qe,ht),$.featureIndex.insert(wr,Be,Qe,lr,this.index)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,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,Sr),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,$,ht,Mt){for(let Bt of $)for(let jt of Bt){let oe=jt.x,be=jt.y;if(oe<0||oe>=zs||be<0||be>=zs)continue;let Be=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Qe=Be.vertexLength;sn(this.layoutVertexArray,oe,be,-1,-1),sn(this.layoutVertexArray,oe,be,1,-1),sn(this.layoutVertexArray,oe,be,1,1),sn(this.layoutVertexArray,oe,be,-1,1),this.indexArray.emplaceBack(Qe,Qe+1,Qe+2),this.indexArray.emplaceBack(Qe,Qe+3,Qe+2),Be.vertexLength+=4,Be.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,{},Mt)}}function Tn(H,C){for(let $=0;$<H.length;$++)if(Un(C,H[$]))return!0;for(let $=0;$<C.length;$++)if(Un(H,C[$]))return!0;return!!ea(H,C)}function qr(H,C,$){return!!Un(H,C)||!!Ka(C,H,$)}function Sn(H,C){if(H.length===1)return fa(C,H[0]);for(let $=0;$<C.length;$++){let ht=C[$];for(let Mt=0;Mt<ht.length;Mt++)if(Un(H,ht[Mt]))return!0}for(let $=0;$<H.length;$++)if(fa(C,H[$]))return!0;for(let $=0;$<C.length;$++)if(ea(H,C[$]))return!0;return!1}function sa(H,C,$){if(H.length>1){if(ea(H,C))return!0;for(let ht=0;ht<C.length;ht++)if(Ka(C[ht],H,$))return!0}for(let ht=0;ht<H.length;ht++)if(Ka(H[ht],C,$))return!0;return!1}function ea(H,C){if(H.length===0||C.length===0)return!1;for(let $=0;$<H.length-1;$++){let ht=H[$],Mt=H[$+1];for(let Bt=0;Bt<C.length-1;Bt++)if(ka(ht,Mt,C[Bt],C[Bt+1]))return!0}return!1}function ka(H,C,$,ht){return P(H,$,ht)!==P(C,$,ht)&&P(H,C,$)!==P(H,C,ht)}function Ka(H,C,$){let ht=$*$;if(C.length===1)return H.distSqr(C[0])<ht;for(let Mt=1;Mt<C.length;Mt++)if(Va(H,C[Mt-1],C[Mt])<ht)return!0;return!1}function Va(H,C,$){let ht=C.distSqr($);if(ht===0)return H.distSqr(C);let Mt=((H.x-C.x)*($.x-C.x)+(H.y-C.y)*($.y-C.y))/ht;return H.distSqr(Mt<0?C:Mt>1?$:$.sub(C)._mult(Mt)._add(C))}function fa(H,C){let $,ht,Mt,Bt=!1;for(let jt=0;jt<H.length;jt++){$=H[jt];for(let oe=0,be=$.length-1;oe<$.length;be=oe++)ht=$[oe],Mt=$[be],ht.y>C.y!=Mt.y>C.y&&C.x<(Mt.x-ht.x)*(C.y-ht.y)/(Mt.y-ht.y)+ht.x&&(Bt=!Bt)}return Bt}function Un(H,C){let $=!1;for(let ht=0,Mt=H.length-1;ht<H.length;Mt=ht++){let Bt=H[ht],jt=H[Mt];Bt.y>C.y!=jt.y>C.y&&C.x<(jt.x-Bt.x)*(C.y-Bt.y)/(jt.y-Bt.y)+Bt.x&&($=!$)}return $}function Nr(H,C,$){let ht=$[0],Mt=$[2];if(H.x<ht.x&&C.x<ht.x||H.x>Mt.x&&C.x>Mt.x||H.y<ht.y&&C.y<ht.y||H.y>Mt.y&&C.y>Mt.y)return!1;let Bt=P(H,C,$[0]);return Bt!==P(H,C,$[1])||Bt!==P(H,C,$[2])||Bt!==P(H,C,$[3])}function fn(H,C,$){let ht=C.paint.get(H).value;return ht.kind==="constant"?ht.value:$.programConfigurations.get(C.id).getMaxValue(H)}function Xn(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function jn(H,C,$,ht,Mt){if(!C[0]&&!C[1])return H;let Bt=o.convert(C)._mult(Mt);$==="viewport"&&Bt._rotate(-ht);let jt=[];for(let oe=0;oe<H.length;oe++)jt.push(H[oe].sub(Bt));return jt}let kn,Ia;ca("CircleBucket",zn,{omit:["layers"]});var ya={get paint(){return Ia=Ia||new Pt({"circle-radius":new fo(nt.paint_circle["circle-radius"]),"circle-color":new fo(nt.paint_circle["circle-color"]),"circle-blur":new fo(nt.paint_circle["circle-blur"]),"circle-opacity":new fo(nt.paint_circle["circle-opacity"]),"circle-translate":new Ui(nt.paint_circle["circle-translate"]),"circle-translate-anchor":new Ui(nt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ui(nt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ui(nt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new fo(nt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new fo(nt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new fo(nt.paint_circle["circle-stroke-opacity"])})},get layout(){return kn=kn||new Pt({"circle-sort-key":new fo(nt.layout_circle["circle-sort-key"])})}},qa=1e-6,Rn=typeof Float32Array<"u"?Float32Array:Array;function An(H){return H[0]=1,H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=1,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=1,H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H}function Pa(H,C,$){var ht=C[0],Mt=C[1],Bt=C[2],jt=C[3],oe=C[4],be=C[5],Be=C[6],Qe=C[7],lr=C[8],wr=C[9],Fr=C[10],Zr=C[11],en=C[12],yn=C[13],Vn=C[14],Ca=C[15],ua=$[0],wa=$[1],Xa=$[2],di=$[3];return H[0]=ua*ht+wa*oe+Xa*lr+di*en,H[1]=ua*Mt+wa*be+Xa*wr+di*yn,H[2]=ua*Bt+wa*Be+Xa*Fr+di*Vn,H[3]=ua*jt+wa*Qe+Xa*Zr+di*Ca,H[4]=(ua=$[4])*ht+(wa=$[5])*oe+(Xa=$[6])*lr+(di=$[7])*en,H[5]=ua*Mt+wa*be+Xa*wr+di*yn,H[6]=ua*Bt+wa*Be+Xa*Fr+di*Vn,H[7]=ua*jt+wa*Qe+Xa*Zr+di*Ca,H[8]=(ua=$[8])*ht+(wa=$[9])*oe+(Xa=$[10])*lr+(di=$[11])*en,H[9]=ua*Mt+wa*be+Xa*wr+di*yn,H[10]=ua*Bt+wa*Be+Xa*Fr+di*Vn,H[11]=ua*jt+wa*Qe+Xa*Zr+di*Ca,H[12]=(ua=$[12])*ht+(wa=$[13])*oe+(Xa=$[14])*lr+(di=$[15])*en,H[13]=ua*Mt+wa*be+Xa*wr+di*yn,H[14]=ua*Bt+wa*Be+Xa*Fr+di*Vn,H[15]=ua*jt+wa*Qe+Xa*Zr+di*Ca,H}Math.hypot||(Math.hypot=function(){for(var H=0,C=arguments.length;C--;)H+=arguments[C]*arguments[C];return Math.sqrt(H)});var ba,aa=Pa;function oa(H,C,$){var ht=C[0],Mt=C[1],Bt=C[2],jt=C[3];return H[0]=$[0]*ht+$[4]*Mt+$[8]*Bt+$[12]*jt,H[1]=$[1]*ht+$[5]*Mt+$[9]*Bt+$[13]*jt,H[2]=$[2]*ht+$[6]*Mt+$[10]*Bt+$[14]*jt,H[3]=$[3]*ht+$[7]*Mt+$[11]*Bt+$[15]*jt,H}ba=new Rn(4),Rn!=Float32Array&&(ba[0]=0,ba[1]=0,ba[2]=0,ba[3]=0);class Sa extends at{constructor(C){super(C,ya)}createBucket(C){return new zn(C)}queryRadius(C){let $=C;return fn("circle-radius",this,$)+fn("circle-stroke-width",this,$)+Xn(this.paint.get("circle-translate"))}queryIntersectsFeature(C,$,ht,Mt,Bt,jt,oe,be){let Be=jn(C,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),jt.angle,oe),Qe=this.paint.get("circle-radius").evaluate($,ht)+this.paint.get("circle-stroke-width").evaluate($,ht),lr=this.paint.get("circle-pitch-alignment")==="map",wr=lr?Be:function(Zr,en){return Zr.map(yn=>_i(yn,en))}(Be,be),Fr=lr?Qe*oe:Qe;for(let Zr of Mt)for(let en of Zr){let yn=lr?en:_i(en,be),Vn=Fr,Ca=oa([],[en.x,en.y,0,1],be);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Vn*=Ca[3]/jt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Vn*=jt.cameraToCenterDistance/Ca[3]),qr(wr,yn,Vn))return!0}return!1}}function _i(H,C){let $=oa([],[H.x,H.y,0,1],C);return new o($[0]/$[3],$[1]/$[3])}class pi extends zn{}let Ma;ca("HeatmapBucket",pi,{omit:["layers"]});var Na={get paint(){return Ma=Ma||new Pt({"heatmap-radius":new fo(nt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new fo(nt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ui(nt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Dc(nt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ui(nt.paint_heatmap["heatmap-opacity"])})}};function ui(H,{width:C,height:$},ht,Mt){if(Mt){if(Mt instanceof Uint8ClampedArray)Mt=new Uint8Array(Mt.buffer);else if(Mt.length!==C*$*ht)throw new RangeError(`mismatched image size. expected: ${Mt.length} but got: ${C*$*ht}`)}else Mt=new Uint8Array(C*$*ht);return H.width=C,H.height=$,H.data=Mt,H}function gi(H,{width:C,height:$},ht){if(C===H.width&&$===H.height)return;let Mt=ui({},{width:C,height:$},ht);Ri(H,Mt,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,C),height:Math.min(H.height,$)},ht),H.width=C,H.height=$,H.data=Mt.data}function Ri(H,C,$,ht,Mt,Bt){if(Mt.width===0||Mt.height===0)return C;if(Mt.width>H.width||Mt.height>H.height||$.x>H.width-Mt.width||$.y>H.height-Mt.height)throw new RangeError("out of range source coordinates for image copy");if(Mt.width>C.width||Mt.height>C.height||ht.x>C.width-Mt.width||ht.y>C.height-Mt.height)throw new RangeError("out of range destination coordinates for image copy");let jt=H.data,oe=C.data;if(jt===oe)throw new Error("srcData equals dstData, so image is already copied");for(let be=0;be<Mt.height;be++){let Be=(($.y+be)*H.width+$.x)*Bt,Qe=((ht.y+be)*C.width+ht.x)*Bt;for(let lr=0;lr<Mt.width*Bt;lr++)oe[Qe+lr]=jt[Be+lr]}return C}class ds{constructor(C,$){ui(this,C,1,$)}resize(C){gi(this,C,1)}clone(){return new ds({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(C,$,ht,Mt,Bt){Ri(C,$,ht,Mt,Bt,1)}}class rs{constructor(C,$){ui(this,C,4,$)}resize(C){gi(this,C,4)}replace(C,$){$?this.data.set(C):this.data=C instanceof Uint8ClampedArray?new Uint8Array(C.buffer):C}clone(){return new rs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(C,$,ht,Mt,Bt){Ri(C,$,ht,Mt,Bt,4)}}function Zi(H){let C={},$=H.resolution||256,ht=H.clips?H.clips.length:1,Mt=H.image||new rs({width:$,height:ht});if(Math.log($)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${$}`);let Bt=(jt,oe,be)=>{C[H.evaluationKey]=be;let Be=H.expression.evaluate(C);Mt.data[jt+oe+0]=Math.floor(255*Be.r/Be.a),Mt.data[jt+oe+1]=Math.floor(255*Be.g/Be.a),Mt.data[jt+oe+2]=Math.floor(255*Be.b/Be.a),Mt.data[jt+oe+3]=Math.floor(255*Be.a)};if(H.clips)for(let jt=0,oe=0;jt<ht;++jt,oe+=4*$)for(let be=0,Be=0;be<$;be++,Be+=4){let Qe=be/($-1),{start:lr,end:wr}=H.clips[jt];Bt(oe,Be,lr*(1-Qe)+wr*Qe)}else for(let jt=0,oe=0;jt<$;jt++,oe+=4)Bt(0,oe,jt/($-1));return Mt}ca("AlphaImage",ds),ca("RGBAImage",rs);let Zs="big-fb";class Zo extends at{createBucket(C){return new pi(C)}constructor(C){super(C,Na),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(C){C==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Zi({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Zs)&&this.heatmapFbos.delete(Zs)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Qs;var El={get paint(){return Qs=Qs||new Pt({"hillshade-illumination-direction":new Ui(nt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ui(nt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ui(nt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ui(nt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ui(nt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ui(nt.paint_hillshade["hillshade-accent-color"])})}};class Cl extends at{constructor(C){super(C,El)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let Hs=le([{name:"a_pos",components:2,type:"Int16"}],4),{members:js}=Hs;function Ks(H,C,$=2){let ht=C&&C.length,Mt=ht?C[0]*$:H.length,Bt=Mi(H,0,Mt,$,!0),jt=[];if(!Bt||Bt.next===Bt.prev)return jt;let oe,be,Be;if(ht&&(Bt=function(Qe,lr,wr,Fr){let Zr=[];for(let en=0,yn=lr.length;en<yn;en++){let Vn=Mi(Qe,lr[en]*Fr,en<yn-1?lr[en+1]*Fr:Qe.length,Fr,!1);Vn===Vn.next&&(Vn.steiner=!0),Zr.push(Y(Vn))}Zr.sort(ns);for(let en=0;en<Zr.length;en++)wr=$o(Zr[en],wr);return wr}(H,C,Bt,$)),H.length>80*$){oe=1/0,be=1/0;let Qe=-1/0,lr=-1/0;for(let wr=$;wr<Mt;wr+=$){let Fr=H[wr],Zr=H[wr+1];Fr<oe&&(oe=Fr),Zr<be&&(be=Zr),Fr>Qe&&(Qe=Fr),Zr>lr&&(lr=Zr)}Be=Math.max(Qe-oe,lr-be),Be=Be!==0?32767/Be:0}return Uo(Bt,jt,$,oe,be,Be,0),jt}function Mi(H,C,$,ht,Mt){let Bt;if(Mt===function(jt,oe,be,Be){let Qe=0;for(let lr=oe,wr=be-Be;lr<be;lr+=Be)Qe+=(jt[wr]-jt[lr])*(jt[lr+1]+jt[wr+1]),wr=lr;return Qe}(H,C,$,ht)>0)for(let jt=C;jt<$;jt+=ht)Bt=Fe(jt/ht|0,H[jt],H[jt+1],Bt);else for(let jt=$-ht;jt>=C;jt-=ht)Bt=Fe(jt/ht|0,H[jt],H[jt+1],Bt);return Bt&&ne(Bt,Bt.next)&&(He(Bt),Bt=Bt.next),Bt}function Ys(H,C){if(!H)return H;C||(C=H);let $,ht=H;do if($=!1,ht.steiner||!ne(ht,ht.next)&&Qt(ht.prev,ht,ht.next)!==0)ht=ht.next;else{if(He(ht),ht=C=ht.prev,ht===ht.next)break;$=!0}while($||ht!==C);return C}function Uo(H,C,$,ht,Mt,Bt,jt){if(!H)return;!jt&&Bt&&function(be,Be,Qe,lr){let wr=be;do wr.z===0&&(wr.z=tt(wr.x,wr.y,Be,Qe,lr)),wr.prevZ=wr.prev,wr.nextZ=wr.next,wr=wr.next;while(wr!==be);wr.prevZ.nextZ=null,wr.prevZ=null,function(Fr){let Zr,en=1;do{let yn,Vn=Fr;Fr=null;let Ca=null;for(Zr=0;Vn;){Zr++;let ua=Vn,wa=0;for(let di=0;di<en&&(wa++,ua=ua.nextZ,ua);di++);let Xa=en;for(;wa>0||Xa>0&&ua;)wa!==0&&(Xa===0||!ua||Vn.z<=ua.z)?(yn=Vn,Vn=Vn.nextZ,wa--):(yn=ua,ua=ua.nextZ,Xa--),Ca?Ca.nextZ=yn:Fr=yn,yn.prevZ=Ca,Ca=yn;Vn=ua}Ca.nextZ=null,en*=2}while(Zr>1)}(wr)}(H,ht,Mt,Bt);let oe=H;for(;H.prev!==H.next;){let be=H.prev,Be=H.next;if(Bt?Il(H,ht,Mt,Bt):tl(H))C.push(be.i,H.i,Be.i),He(H),H=Be.next,oe=Be.next;else if((H=Be)===oe){jt?jt===1?Uo(H=vi(Ys(H),C),C,$,ht,Mt,Bt,2):jt===2&&lo(H,C,$,ht,Mt,Bt):Uo(Ys(H),C,$,ht,Mt,Bt,1);break}}}function tl(H){let C=H.prev,$=H,ht=H.next;if(Qt(C,$,ht)>=0)return!1;let Mt=C.x,Bt=$.x,jt=ht.x,oe=C.y,be=$.y,Be=ht.y,Qe=Mt<Bt?Mt<jt?Mt:jt:Bt<jt?Bt:jt,lr=oe<be?oe<Be?oe:Be:be<Be?be:Be,wr=Mt>Bt?Mt>jt?Mt:jt:Bt>jt?Bt:jt,Fr=oe>be?oe>Be?oe:Be:be>Be?be:Be,Zr=ht.next;for(;Zr!==C;){if(Zr.x>=Qe&&Zr.x<=wr&&Zr.y>=lr&&Zr.y<=Fr&&ft(Mt,oe,Bt,be,jt,Be,Zr.x,Zr.y)&&Qt(Zr.prev,Zr,Zr.next)>=0)return!1;Zr=Zr.next}return!0}function Il(H,C,$,ht){let Mt=H.prev,Bt=H,jt=H.next;if(Qt(Mt,Bt,jt)>=0)return!1;let oe=Mt.x,be=Bt.x,Be=jt.x,Qe=Mt.y,lr=Bt.y,wr=jt.y,Fr=oe<be?oe<Be?oe:Be:be<Be?be:Be,Zr=Qe<lr?Qe<wr?Qe:wr:lr<wr?lr:wr,en=oe>be?oe>Be?oe:Be:be>Be?be:Be,yn=Qe>lr?Qe>wr?Qe:wr:lr>wr?lr:wr,Vn=tt(Fr,Zr,C,$,ht),Ca=tt(en,yn,C,$,ht),ua=H.prevZ,wa=H.nextZ;for(;ua&&ua.z>=Vn&&wa&&wa.z<=Ca;){if(ua.x>=Fr&&ua.x<=en&&ua.y>=Zr&&ua.y<=yn&&ua!==Mt&&ua!==jt&&ft(oe,Qe,be,lr,Be,wr,ua.x,ua.y)&&Qt(ua.prev,ua,ua.next)>=0||(ua=ua.prevZ,wa.x>=Fr&&wa.x<=en&&wa.y>=Zr&&wa.y<=yn&&wa!==Mt&&wa!==jt&&ft(oe,Qe,be,lr,Be,wr,wa.x,wa.y)&&Qt(wa.prev,wa,wa.next)>=0))return!1;wa=wa.nextZ}for(;ua&&ua.z>=Vn;){if(ua.x>=Fr&&ua.x<=en&&ua.y>=Zr&&ua.y<=yn&&ua!==Mt&&ua!==jt&&ft(oe,Qe,be,lr,Be,wr,ua.x,ua.y)&&Qt(ua.prev,ua,ua.next)>=0)return!1;ua=ua.prevZ}for(;wa&&wa.z<=Ca;){if(wa.x>=Fr&&wa.x<=en&&wa.y>=Zr&&wa.y<=yn&&wa!==Mt&&wa!==jt&&ft(oe,Qe,be,lr,Be,wr,wa.x,wa.y)&&Qt(wa.prev,wa,wa.next)>=0)return!1;wa=wa.nextZ}return!0}function vi(H,C){let $=H;do{let ht=$.prev,Mt=$.next.next;!ne(ht,Mt)&&Ft(ht,$,$.next,Mt)&&Ne(ht,Mt)&&Ne(Mt,ht)&&(C.push(ht.i,$.i,Mt.i),He($),He($.next),$=H=Mt),$=$.next}while($!==H);return Ys($)}function lo(H,C,$,ht,Mt,Bt){let jt=H;do{let oe=jt.next.next;for(;oe!==jt.prev;){if(jt.i!==oe.i&&zt(jt,oe)){let be=Ie(jt,oe);return jt=Ys(jt,jt.next),be=Ys(be,be.next),Uo(jt,C,$,ht,Mt,Bt,0),void Uo(be,C,$,ht,Mt,Bt,0)}oe=oe.next}jt=jt.next}while(jt!==H)}function ns(H,C){return H.x-C.x}function $o(H,C){let $=function(Mt,Bt){let jt=Bt,oe=Mt.x,be=Mt.y,Be,Qe=-1/0;do{if(be<=jt.y&&be>=jt.next.y&&jt.next.y!==jt.y){let en=jt.x+(be-jt.y)*(jt.next.x-jt.x)/(jt.next.y-jt.y);if(en<=oe&&en>Qe&&(Qe=en,Be=jt.x<jt.next.x?jt:jt.next,en===oe))return Be}jt=jt.next}while(jt!==Bt);if(!Be)return null;let lr=Be,wr=Be.x,Fr=Be.y,Zr=1/0;jt=Be;do{if(oe>=jt.x&&jt.x>=wr&&oe!==jt.x&&ft(be<Fr?oe:Qe,be,wr,Fr,be<Fr?Qe:oe,be,jt.x,jt.y)){let en=Math.abs(be-jt.y)/(oe-jt.x);Ne(jt,Mt)&&(en<Zr||en===Zr&&(jt.x>Be.x||jt.x===Be.x&&U(Be,jt)))&&(Be=jt,Zr=en)}jt=jt.next}while(jt!==lr);return Be}(H,C);if(!$)return C;let ht=Ie($,H);return Ys(ht,ht.next),Ys($,$.next)}function U(H,C){return Qt(H.prev,H,C.prev)<0&&Qt(C.next,H,H.next)<0}function tt(H,C,$,ht,Mt){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-$)*Mt|0)|H<<8))|H<<4))|H<<2))|H<<1))|(C=1431655765&((C=858993459&((C=252645135&((C=16711935&((C=(C-ht)*Mt|0)|C<<8))|C<<4))|C<<2))|C<<1))<<1}function Y(H){let C=H,$=H;do(C.x<$.x||C.x===$.x&&C.y<$.y)&&($=C),C=C.next;while(C!==H);return $}function ft(H,C,$,ht,Mt,Bt,jt,oe){return(Mt-jt)*(C-oe)>=(H-jt)*(Bt-oe)&&(H-jt)*(ht-oe)>=($-jt)*(C-oe)&&($-jt)*(Bt-oe)>=(Mt-jt)*(ht-oe)}function zt(H,C){return H.next.i!==C.i&&H.prev.i!==C.i&&!function($,ht){let Mt=$;do{if(Mt.i!==$.i&&Mt.next.i!==$.i&&Mt.i!==ht.i&&Mt.next.i!==ht.i&&Ft(Mt,Mt.next,$,ht))return!0;Mt=Mt.next}while(Mt!==$);return!1}(H,C)&&(Ne(H,C)&&Ne(C,H)&&function($,ht){let Mt=$,Bt=!1,jt=($.x+ht.x)/2,oe=($.y+ht.y)/2;do Mt.y>oe!=Mt.next.y>oe&&Mt.next.y!==Mt.y&&jt<(Mt.next.x-Mt.x)*(oe-Mt.y)/(Mt.next.y-Mt.y)+Mt.x&&(Bt=!Bt),Mt=Mt.next;while(Mt!==$);return Bt}(H,C)&&(Qt(H.prev,H,C.prev)||Qt(H,C.prev,C))||ne(H,C)&&Qt(H.prev,H,H.next)>0&&Qt(C.prev,C,C.next)>0)}function Qt(H,C,$){return(C.y-H.y)*($.x-C.x)-(C.x-H.x)*($.y-C.y)}function ne(H,C){return H.x===C.x&&H.y===C.y}function Ft(H,C,$,ht){let Mt=he(Qt(H,C,$)),Bt=he(Qt(H,C,ht)),jt=he(Qt($,ht,H)),oe=he(Qt($,ht,C));return Mt!==Bt&&jt!==oe||!(Mt!==0||!$t(H,$,C))||!(Bt!==0||!$t(H,ht,C))||!(jt!==0||!$t($,H,ht))||!(oe!==0||!$t($,C,ht))}function $t(H,C,$){return C.x<=Math.max(H.x,$.x)&&C.x>=Math.min(H.x,$.x)&&C.y<=Math.max(H.y,$.y)&&C.y>=Math.min(H.y,$.y)}function he(H){return H>0?1:H<0?-1:0}function Ne(H,C){return Qt(H.prev,H,H.next)<0?Qt(H,C,H.next)>=0&&Qt(H,H.prev,C)>=0:Qt(H,C,H.prev)<0||Qt(H,H.next,C)<0}function Ie(H,C){let $=Ge(H.i,H.x,H.y),ht=Ge(C.i,C.x,C.y),Mt=H.next,Bt=C.prev;return H.next=C,C.prev=H,$.next=Mt,Mt.prev=$,ht.next=$,$.prev=ht,Bt.next=ht,ht.prev=Bt,ht}function Fe(H,C,$,ht){let Mt=Ge(H,C,$);return ht?(Mt.next=ht.next,Mt.prev=ht,ht.next.prev=Mt,ht.next=Mt):(Mt.prev=Mt,Mt.next=Mt),Mt}function He(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Ge(H,C,$){return{i:H,x:C,y:$,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ae(H,C,$){let ht=$.patternDependencies,Mt=!1;for(let Bt of C){let jt=Bt.paint.get(`${H}-pattern`);jt.isConstant()||(Mt=!0);let oe=jt.constantOr(null);oe&&(Mt=!0,ht[oe.to]=!0,ht[oe.from]=!0)}return Mt}function Oe(H,C,$,ht,Mt){let Bt=Mt.patternDependencies;for(let jt of C){let oe=jt.paint.get(`${H}-pattern`).value;if(oe.kind!=="constant"){let be=oe.evaluate({zoom:ht-1},$,{},Mt.availableImages),Be=oe.evaluate({zoom:ht},$,{},Mt.availableImages),Qe=oe.evaluate({zoom:ht+1},$,{},Mt.availableImages);be=be&&be.name?be.name:be,Be=Be&&Be.name?Be.name:Be,Qe=Qe&&Qe.name?Qe.name:Qe,Bt[be]=!0,Bt[Be]=!0,Bt[Qe]=!0,$.patterns[jt.id]={min:be,mid:Be,max:Qe}}}return $}class Le{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new hl,this.indexArray=new je,this.indexArray2=new or,this.programConfigurations=new Ts(C.layers,C.zoom),this.segments=new Wr,this.segments2=new Wr,this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){this.hasPattern=Ae("fill",this.layers,$);let Mt=this.layers[0].layout.get("fill-sort-key"),Bt=!Mt.isConstant(),jt=[];for(let{feature:oe,id:be,index:Be,sourceLayerIndex:Qe}of C){let lr=this.layers[0]._featureFilter.needGeometry,wr=cr(oe,lr);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),wr,ht))continue;let Fr=Bt?Mt.evaluate(wr,{},ht,$.availableImages):void 0,Zr={id:be,properties:oe.properties,type:oe.type,sourceLayerIndex:Qe,index:Be,geometry:lr?wr.geometry:nr(oe),patterns:{},sortKey:Fr};jt.push(Zr)}Bt&&jt.sort((oe,be)=>oe.sortKey-be.sortKey);for(let oe of jt){let{geometry:be,index:Be,sourceLayerIndex:Qe}=oe;if(this.hasPattern){let lr=Oe("fill",this.layers,oe,this.zoom,$);this.patternFeatures.push(lr)}else this.addFeature(oe,be,Be,ht,{});$.featureIndex.insert(C[Be].feature,be,Be,Qe,this.index)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,this.stateDependentLayers,ht)}addFeatures(C,$,ht){for(let Mt of this.patternFeatures)this.addFeature(Mt,Mt.geometry,Mt.index,$,ht)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,js),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,$,ht,Mt,Bt){for(let jt of au($,500)){let oe=0;for(let Fr of jt)oe+=Fr.length;let be=this.segments.prepareSegment(oe,this.layoutVertexArray,this.indexArray),Be=be.vertexLength,Qe=[],lr=[];for(let Fr of jt){if(Fr.length===0)continue;Fr!==jt[0]&&lr.push(Qe.length/2);let Zr=this.segments2.prepareSegment(Fr.length,this.layoutVertexArray,this.indexArray2),en=Zr.vertexLength;this.layoutVertexArray.emplaceBack(Fr[0].x,Fr[0].y),this.indexArray2.emplaceBack(en+Fr.length-1,en),Qe.push(Fr[0].x),Qe.push(Fr[0].y);for(let yn=1;yn<Fr.length;yn++)this.layoutVertexArray.emplaceBack(Fr[yn].x,Fr[yn].y),this.indexArray2.emplaceBack(en+yn-1,en+yn),Qe.push(Fr[yn].x),Qe.push(Fr[yn].y);Zr.vertexLength+=Fr.length,Zr.primitiveLength+=Fr.length}let wr=Ks(Qe,lr);for(let Fr=0;Fr<wr.length;Fr+=3)this.indexArray.emplaceBack(Be+wr[Fr],Be+wr[Fr+1],Be+wr[Fr+2]);be.vertexLength+=oe,be.primitiveLength+=wr.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,Mt)}}let ur,Dr;ca("FillBucket",Le,{omit:["layers","patternFeatures"]});var jr={get paint(){return Dr=Dr||new Pt({"fill-antialias":new Ui(nt.paint_fill["fill-antialias"]),"fill-opacity":new fo(nt.paint_fill["fill-opacity"]),"fill-color":new fo(nt.paint_fill["fill-color"]),"fill-outline-color":new fo(nt.paint_fill["fill-outline-color"]),"fill-translate":new Ui(nt.paint_fill["fill-translate"]),"fill-translate-anchor":new Ui(nt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ql(nt.paint_fill["fill-pattern"])})},get layout(){return ur=ur||new Pt({"fill-sort-key":new fo(nt.layout_fill["fill-sort-key"])})}};class On extends at{constructor(C){super(C,jr)}recalculate(C,$){super.recalculate(C,$);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 Le(C)}queryRadius(){return Xn(this.paint.get("fill-translate"))}queryIntersectsFeature(C,$,ht,Mt,Bt,jt,oe){return Sn(jn(C,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),jt.angle,oe),Mt)}isTileClipped(){return!0}}let Ln=le([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),xn=le([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Wn}=Ln;var Dn={},la=i,qn=Gn;function Gn(H,C,$,ht,Mt){this.properties={},this.extent=$,this.type=0,this._pbf=H,this._geometry=-1,this._keys=ht,this._values=Mt,H.readFields(ma,this,C)}function ma(H,C,$){H==1?C.id=$.readVarint():H==2?function(ht,Mt){for(var Bt=ht.readVarint()+ht.pos;ht.pos<Bt;){var jt=Mt._keys[ht.readVarint()],oe=Mt._values[ht.readVarint()];Mt.properties[jt]=oe}}($,C):H==3?C.type=$.readVarint():H==4&&(C._geometry=$.pos)}function ti(H){for(var C,$,ht=0,Mt=0,Bt=H.length,jt=Bt-1;Mt<Bt;jt=Mt++)ht+=(($=H[jt]).x-(C=H[Mt]).x)*(C.y+$.y);return ht}Gn.types=["Unknown","Point","LineString","Polygon"],Gn.prototype.loadGeometry=function(){var H=this._pbf;H.pos=this._geometry;for(var C,$=H.readVarint()+H.pos,ht=1,Mt=0,Bt=0,jt=0,oe=[];H.pos<$;){if(Mt<=0){var be=H.readVarint();ht=7&be,Mt=be>>3}if(Mt--,ht===1||ht===2)Bt+=H.readSVarint(),jt+=H.readSVarint(),ht===1&&(C&&oe.push(C),C=[]),C.push(new la(Bt,jt));else{if(ht!==7)throw new Error("unknown command "+ht);C&&C.push(C[0].clone())}}return C&&oe.push(C),oe},Gn.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var C=H.readVarint()+H.pos,$=1,ht=0,Mt=0,Bt=0,jt=1/0,oe=-1/0,be=1/0,Be=-1/0;H.pos<C;){if(ht<=0){var Qe=H.readVarint();$=7&Qe,ht=Qe>>3}if(ht--,$===1||$===2)(Mt+=H.readSVarint())<jt&&(jt=Mt),Mt>oe&&(oe=Mt),(Bt+=H.readSVarint())<be&&(be=Bt),Bt>Be&&(Be=Bt);else if($!==7)throw new Error("unknown command "+$)}return[jt,be,oe,Be]},Gn.prototype.toGeoJSON=function(H,C,$){var ht,Mt,Bt=this.extent*Math.pow(2,$),jt=this.extent*H,oe=this.extent*C,be=this.loadGeometry(),Be=Gn.types[this.type];function Qe(Fr){for(var Zr=0;Zr<Fr.length;Zr++){var en=Fr[Zr];Fr[Zr]=[360*(en.x+jt)/Bt-180,360/Math.PI*Math.atan(Math.exp((180-360*(en.y+oe)/Bt)*Math.PI/180))-90]}}switch(this.type){case 1:var lr=[];for(ht=0;ht<be.length;ht++)lr[ht]=be[ht][0];Qe(be=lr);break;case 2:for(ht=0;ht<be.length;ht++)Qe(be[ht]);break;case 3:for(be=function(Fr){var Zr=Fr.length;if(Zr<=1)return[Fr];for(var en,yn,Vn=[],Ca=0;Ca<Zr;Ca++){var ua=ti(Fr[Ca]);ua!==0&&(yn===void 0&&(yn=ua<0),yn===ua<0?(en&&Vn.push(en),en=[Fr[Ca]]):en.push(Fr[Ca]))}return en&&Vn.push(en),Vn}(be),ht=0;ht<be.length;ht++)for(Mt=0;Mt<be[ht].length;Mt++)Qe(be[ht][Mt])}be.length===1?be=be[0]:Be="Multi"+Be;var wr={type:"Feature",geometry:{type:Be,coordinates:be},properties:this.properties};return"id"in this&&(wr.id=this.id),wr};var si=qn,Li=to;function to(H,C){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=H,this._keys=[],this._values=[],this._features=[],H.readFields(ls,this,C),this.length=this._features.length}function ls(H,C,$){H===15?C.version=$.readVarint():H===1?C.name=$.readString():H===5?C.extent=$.readVarint():H===2?C._features.push($.pos):H===3?C._keys.push($.readString()):H===4&&C._values.push(function(ht){for(var Mt=null,Bt=ht.readVarint()+ht.pos;ht.pos<Bt;){var jt=ht.readVarint()>>3;Mt=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 Mt}($))}to.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var C=this._pbf.readVarint()+this._pbf.pos;return new si(this._pbf,C,this.extent,this._keys,this._values)};var ms=Li;function Ko(H,C,$){if(H===3){var ht=new ms($,$.readVarint()+$.pos);ht.length&&(C[ht.name]=ht)}}Dn.VectorTile=function(H,C){this.layers=H.readFields(Ko,{},C)},Dn.VectorTileFeature=qn,Dn.VectorTileLayer=Li;let gs=Dn.VectorTileFeature.types,Pl=Math.pow(2,13);function mo(H,C,$,ht,Mt,Bt,jt,oe){H.emplaceBack(C,$,2*Math.floor(ht*Pl)+jt,Mt*Pl*2,Bt*Pl*2,Math.round(oe))}class Xs{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Sl,this.centroidVertexArray=new To,this.indexArray=new je,this.programConfigurations=new Ts(C.layers,C.zoom),this.segments=new Wr,this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){this.features=[],this.hasPattern=Ae("fill-extrusion",this.layers,$);for(let{feature:Mt,id:Bt,index:jt,sourceLayerIndex:oe}of C){let be=this.layers[0]._featureFilter.needGeometry,Be=cr(Mt,be);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),Be,ht))continue;let Qe={id:Bt,sourceLayerIndex:oe,index:jt,geometry:be?Be.geometry:nr(Mt),properties:Mt.properties,type:Mt.type,patterns:{}};this.hasPattern?this.features.push(Oe("fill-extrusion",this.layers,Qe,this.zoom,$)):this.addFeature(Qe,Qe.geometry,jt,ht,{}),$.featureIndex.insert(Mt,Qe.geometry,jt,oe,this.index,!0)}}addFeatures(C,$,ht){for(let Mt of this.features){let{geometry:Bt}=Mt;this.addFeature(Mt,Bt,Mt.index,$,ht)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,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,Wn),this.centroidVertexBuffer=C.createVertexBuffer(this.centroidVertexArray,xn.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,$,ht,Mt,Bt){for(let jt of au($,500)){let oe={x:0,y:0,vertexCount:0},be=0;for(let Zr of jt)be+=Zr.length;let Be=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Zr of jt){if(Zr.length===0||kc(Zr))continue;let en=0;for(let yn=0;yn<Zr.length;yn++){let Vn=Zr[yn];if(yn>=1){let Ca=Zr[yn-1];if(!tc(Vn,Ca)){Be.vertexLength+4>Wr.MAX_VERTEX_ARRAY_LENGTH&&(Be=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let ua=Vn.sub(Ca)._perp()._unit(),wa=Ca.dist(Vn);en+wa>32768&&(en=0),mo(this.layoutVertexArray,Vn.x,Vn.y,ua.x,ua.y,0,0,en),mo(this.layoutVertexArray,Vn.x,Vn.y,ua.x,ua.y,0,1,en),oe.x+=2*Vn.x,oe.y+=2*Vn.y,oe.vertexCount+=2,en+=wa,mo(this.layoutVertexArray,Ca.x,Ca.y,ua.x,ua.y,0,0,en),mo(this.layoutVertexArray,Ca.x,Ca.y,ua.x,ua.y,0,1,en),oe.x+=2*Ca.x,oe.y+=2*Ca.y,oe.vertexCount+=2;let Xa=Be.vertexLength;this.indexArray.emplaceBack(Xa,Xa+2,Xa+1),this.indexArray.emplaceBack(Xa+1,Xa+2,Xa+3),Be.vertexLength+=4,Be.primitiveLength+=2}}}}if(Be.vertexLength+be>Wr.MAX_VERTEX_ARRAY_LENGTH&&(Be=this.segments.prepareSegment(be,this.layoutVertexArray,this.indexArray)),gs[C.type]!=="Polygon")continue;let Qe=[],lr=[],wr=Be.vertexLength;for(let Zr of jt)if(Zr.length!==0){Zr!==jt[0]&&lr.push(Qe.length/2);for(let en=0;en<Zr.length;en++){let yn=Zr[en];mo(this.layoutVertexArray,yn.x,yn.y,0,0,1,1,0),oe.x+=yn.x,oe.y+=yn.y,oe.vertexCount+=1,Qe.push(yn.x),Qe.push(yn.y)}}let Fr=Ks(Qe,lr);for(let Zr=0;Zr<Fr.length;Zr+=3)this.indexArray.emplaceBack(wr+Fr[Zr],wr+Fr[Zr+2],wr+Fr[Zr+1]);Be.primitiveLength+=Fr.length/3,Be.vertexLength+=be;for(let Zr=0;Zr<oe.vertexCount;Zr++){let en=Math.floor(oe.x/oe.vertexCount),yn=Math.floor(oe.y/oe.vertexCount);this.centroidVertexArray.emplaceBack(en,yn)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,Mt)}}function tc(H,C){return H.x===C.x&&(H.x<0||H.x>zs)||H.y===C.y&&(H.y<0||H.y>zs)}function kc(H){return H.every(C=>C.x<0)||H.every(C=>C.x>zs)||H.every(C=>C.y<0)||H.every(C=>C.y>zs)}let lh;ca("FillExtrusionBucket",Xs,{omit:["layers","features"]});var gh={get paint(){return lh=lh||new Pt({"fill-extrusion-opacity":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new fo(nt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ql(nt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new fo(nt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new fo(nt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ui(nt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Zf extends at{constructor(C){super(C,gh)}createBucket(C){return new Xs(C)}queryRadius(){return Xn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(C,$,ht,Mt,Bt,jt,oe,be){let Be=jn(C,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,oe),Qe=this.paint.get("fill-extrusion-height").evaluate($,ht),lr=this.paint.get("fill-extrusion-base").evaluate($,ht),wr=function(Zr,en,yn,Vn){let Ca=[];for(let ua of Zr){let wa=[ua.x,ua.y,0,1];oa(wa,wa,en),Ca.push(new o(wa[0]/wa[3],wa[1]/wa[3]))}return Ca}(Be,be),Fr=function(Zr,en,yn,Vn){let Ca=[],ua=[],wa=Vn[8]*en,Xa=Vn[9]*en,di=Vn[10]*en,oo=Vn[11]*en,as=Vn[8]*yn,eo=Vn[9]*yn,Ki=Vn[10]*yn,Co=Vn[11]*yn;for(let xo of Zr){let ho=[],oi=[];for(let Ro of xo){let Io=Ro.x,xs=Ro.y,mu=Vn[0]*Io+Vn[4]*xs+Vn[12],uu=Vn[1]*Io+Vn[5]*xs+Vn[13],tf=Vn[2]*Io+Vn[6]*xs+Vn[14],Jf=Vn[3]*Io+Vn[7]*xs+Vn[15],Ac=tf+di,Hc=Jf+oo,Bf=mu+as,Rf=uu+eo,Nf=tf+Ki,rc=Jf+Co,ef=new o((mu+wa)/Hc,(uu+Xa)/Hc);ef.z=Ac/Hc,ho.push(ef);let zf=new o(Bf/rc,Rf/rc);zf.z=Nf/rc,oi.push(zf)}Ca.push(ho),ua.push(oi)}return[Ca,ua]}(Mt,lr,Qe,be);return function(Zr,en,yn){let Vn=1/0;Sn(yn,en)&&(Vn=_h(yn,en[0]));for(let Ca=0;Ca<en.length;Ca++){let ua=en[Ca],wa=Zr[Ca];for(let Xa=0;Xa<ua.length-1;Xa++){let di=ua[Xa],oo=[di,ua[Xa+1],wa[Xa+1],wa[Xa],di];Tn(yn,oo)&&(Vn=Math.min(Vn,_h(yn,oo)))}}return Vn!==1/0&&Vn}(Fr[0],Fr[1],wr)}}function Kf(H,C){return H.x*C.x+H.y*C.y}function _h(H,C){if(H.length===1){let $=0,ht=C[$++],Mt;for(;!Mt||ht.equals(Mt);)if(Mt=C[$++],!Mt)return 1/0;for(;$<C.length;$++){let Bt=C[$],jt=H[0],oe=Mt.sub(ht),be=Bt.sub(ht),Be=jt.sub(ht),Qe=Kf(oe,oe),lr=Kf(oe,be),wr=Kf(be,be),Fr=Kf(Be,oe),Zr=Kf(Be,be),en=Qe*wr-lr*lr,yn=(wr*Fr-lr*Zr)/en,Vn=(Qe*Zr-lr*Fr)/en,Ca=ht.z*(1-yn-Vn)+Mt.z*yn+Bt.z*Vn;if(isFinite(Ca))return Ca}return 1/0}{let $=1/0;for(let ht of C)$=Math.min($,ht.z);return $}}let Sf=le([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Yf}=Sf,yf=le([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Ch}=yf,ip=Dn.VectorTileFeature.types,Xf=Math.cos(Math.PI/180*37.5),$f=Math.pow(2,14)/.5;class Ef{constructor(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map($=>$.id),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach($=>{this.gradients[$.id]={}}),this.layoutVertexArray=new tu,this.layoutVertexArray2=new gt,this.indexArray=new je,this.programConfigurations=new Ts(C.layers,C.zoom),this.segments=new Wr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id)}populate(C,$,ht){this.hasPattern=Ae("line",this.layers,$);let Mt=this.layers[0].layout.get("line-sort-key"),Bt=!Mt.isConstant(),jt=[];for(let{feature:oe,id:be,index:Be,sourceLayerIndex:Qe}of C){let lr=this.layers[0]._featureFilter.needGeometry,wr=cr(oe,lr);if(!this.layers[0]._featureFilter.filter(new fs(this.zoom),wr,ht))continue;let Fr=Bt?Mt.evaluate(wr,{},ht):void 0,Zr={id:be,properties:oe.properties,type:oe.type,sourceLayerIndex:Qe,index:Be,geometry:lr?wr.geometry:nr(oe),patterns:{},sortKey:Fr};jt.push(Zr)}Bt&&jt.sort((oe,be)=>oe.sortKey-be.sortKey);for(let oe of jt){let{geometry:be,index:Be,sourceLayerIndex:Qe}=oe;if(this.hasPattern){let lr=Oe("line",this.layers,oe,this.zoom,$);this.patternFeatures.push(lr)}else this.addFeature(oe,be,Be,ht,{});$.featureIndex.insert(C[Be].feature,be,Be,Qe,this.index)}}update(C,$,ht){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,$,this.stateDependentLayers,ht)}addFeatures(C,$,ht){for(let Mt of this.patternFeatures)this.addFeature(Mt,Mt.geometry,Mt.index,$,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,Ch)),this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Yf),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,$,ht,Mt,Bt){let jt=this.layers[0].layout,oe=jt.get("line-join").evaluate(C,{}),be=jt.get("line-cap"),Be=jt.get("line-miter-limit"),Qe=jt.get("line-round-limit");this.lineClips=this.lineFeatureClips(C);for(let lr of $)this.addLine(lr,C,oe,be,Be,Qe);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ht,Bt,Mt)}addLine(C,$,ht,Mt,Bt,jt){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Vn=0;Vn<C.length-1;Vn++)this.totalDistance+=C[Vn].dist(C[Vn+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let oe=ip[$.type]==="Polygon",be=C.length;for(;be>=2&&C[be-1].equals(C[be-2]);)be--;let Be=0;for(;Be<be-1&&C[Be].equals(C[Be+1]);)Be++;if(be<(oe?3:2))return;ht==="bevel"&&(Bt=1.05);let Qe=this.overscaling<=16?15*zs/(512*this.overscaling):0,lr=this.segments.prepareSegment(10*be,this.layoutVertexArray,this.indexArray),wr,Fr,Zr,en,yn;this.e1=this.e2=-1,oe&&(wr=C[be-2],yn=C[Be].sub(wr)._unit()._perp());for(let Vn=Be;Vn<be;Vn++){if(Zr=Vn===be-1?oe?C[Be+1]:void 0:C[Vn+1],Zr&&C[Vn].equals(Zr))continue;yn&&(en=yn),wr&&(Fr=wr),wr=C[Vn],yn=Zr?Zr.sub(wr)._unit()._perp():en,en=en||yn;let Ca=en.add(yn);Ca.x===0&&Ca.y===0||Ca._unit();let ua=en.x*yn.x+en.y*yn.y,wa=Ca.x*yn.x+Ca.y*yn.y,Xa=wa!==0?1/wa:1/0,di=2*Math.sqrt(2-2*wa),oo=wa<Xf&&Fr&&Zr,as=en.x*yn.y-en.y*yn.x>0;if(oo&&Vn>Be){let Co=wr.dist(Fr);if(Co>2*Qe){let xo=wr.sub(wr.sub(Fr)._mult(Qe/Co)._round());this.updateDistance(Fr,xo),this.addCurrentVertex(xo,en,0,0,lr),Fr=xo}}let eo=Fr&&Zr,Ki=eo?ht:oe?"butt":Mt;if(eo&&Ki==="round"&&(Xa<jt?Ki="miter":Xa<=2&&(Ki="fakeround")),Ki==="miter"&&Xa>Bt&&(Ki="bevel"),Ki==="bevel"&&(Xa>2&&(Ki="flipbevel"),Xa<Bt&&(Ki="miter")),Fr&&this.updateDistance(Fr,wr),Ki==="miter")Ca._mult(Xa),this.addCurrentVertex(wr,Ca,0,0,lr);else if(Ki==="flipbevel"){if(Xa>100)Ca=yn.mult(-1);else{let Co=Xa*en.add(yn).mag()/en.sub(yn).mag();Ca._perp()._mult(Co*(as?-1:1))}this.addCurrentVertex(wr,Ca,0,0,lr),this.addCurrentVertex(wr,Ca.mult(-1),0,0,lr)}else if(Ki==="bevel"||Ki==="fakeround"){let Co=-Math.sqrt(Xa*Xa-1),xo=as?Co:0,ho=as?0:Co;if(Fr&&this.addCurrentVertex(wr,en,xo,ho,lr),Ki==="fakeround"){let oi=Math.round(180*di/Math.PI/20);for(let Ro=1;Ro<oi;Ro++){let Io=Ro/oi;if(Io!==.5){let mu=Io-.5;Io+=Io*mu*(Io-1)*((1.0904+ua*(ua*(3.55645-1.43519*ua)-3.2452))*mu*mu+(.848013+ua*(.215638*ua-1.06021)))}let xs=yn.sub(en)._mult(Io)._add(en)._unit()._mult(as?-1:1);this.addHalfVertex(wr,xs.x,xs.y,!1,as,0,lr)}}Zr&&this.addCurrentVertex(wr,yn,-xo,-ho,lr)}else if(Ki==="butt")this.addCurrentVertex(wr,Ca,0,0,lr);else if(Ki==="square"){let Co=Fr?1:-1;this.addCurrentVertex(wr,Ca,Co,Co,lr)}else Ki==="round"&&(Fr&&(this.addCurrentVertex(wr,en,0,0,lr),this.addCurrentVertex(wr,en,1,1,lr,!0)),Zr&&(this.addCurrentVertex(wr,yn,-1,-1,lr,!0),this.addCurrentVertex(wr,yn,0,0,lr)));if(oo&&Vn<be-1){let Co=wr.dist(Zr);if(Co>2*Qe){let xo=wr.add(Zr.sub(wr)._mult(Qe/Co)._round());this.updateDistance(wr,xo),this.addCurrentVertex(xo,yn,0,0,lr),wr=xo}}}}addCurrentVertex(C,$,ht,Mt,Bt,jt=!1){let oe=$.y*Mt-$.x,be=-$.y-$.x*Mt;this.addHalfVertex(C,$.x+$.y*ht,$.y-$.x*ht,jt,!1,ht,Bt),this.addHalfVertex(C,oe,be,jt,!0,-Mt,Bt),this.distance>$f/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(C,$,ht,Mt,Bt,jt))}addHalfVertex({x:C,y:$},ht,Mt,Bt,jt,oe,be){let Be=.5*(this.lineClips?this.scaledDistance*($f-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((C<<1)+(Bt?1:0),($<<1)+(jt?1:0),Math.round(63*ht)+128,Math.round(63*Mt)+128,1+(oe===0?0:oe<0?-1:1)|(63&Be)<<2,Be>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Qe=be.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Qe),be.primitiveLength++),jt?this.e2=Qe:this.e1=Qe}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(C,$){this.distance+=C.dist($),this.updateScaledDistance()}}let op,wp;ca("LineBucket",Ef,{omit:["layers","patternFeatures"]});var sp={get paint(){return wp=wp||new Pt({"line-opacity":new fo(nt.paint_line["line-opacity"]),"line-color":new fo(nt.paint_line["line-color"]),"line-translate":new Ui(nt.paint_line["line-translate"]),"line-translate-anchor":new Ui(nt.paint_line["line-translate-anchor"]),"line-width":new fo(nt.paint_line["line-width"]),"line-gap-width":new fo(nt.paint_line["line-gap-width"]),"line-offset":new fo(nt.paint_line["line-offset"]),"line-blur":new fo(nt.paint_line["line-blur"]),"line-dasharray":new ul(nt.paint_line["line-dasharray"]),"line-pattern":new Ql(nt.paint_line["line-pattern"]),"line-gradient":new Dc(nt.paint_line["line-gradient"])})},get layout(){return op=op||new Pt({"line-cap":new Ui(nt.layout_line["line-cap"]),"line-join":new fo(nt.layout_line["line-join"]),"line-miter-limit":new Ui(nt.layout_line["line-miter-limit"]),"line-round-limit":new Ui(nt.layout_line["line-round-limit"]),"line-sort-key":new fo(nt.layout_line["line-sort-key"])})}};class $c extends fo{possiblyEvaluate(C,$){return $=new fs(Math.floor($.zoom),{now:$.now,fadeDuration:$.fadeDuration,zoomHistory:$.zoomHistory,transition:$.transition}),super.possiblyEvaluate(C,$)}evaluate(C,$,ht,Mt){return $=k({},$,{zoom:Math.floor($.zoom)}),super.evaluate(C,$,ht,Mt)}}let Wh;class Tp extends at{constructor(C){super(C,sp),this.gradientVersion=0,Wh||(Wh=new $c(sp.paint.properties["line-width"].specification),Wh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(C){if(C==="line-gradient"){let $=this.gradientExpression();this.stepInterpolant=!!function(ht){return ht._styleExpression!==void 0}($)&&$._styleExpression.expression instanceof vn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(C,$){super.recalculate(C,$),this.paint._values["line-floorwidth"]=Wh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,C)}createBucket(C){return new Ef(C)}queryRadius(C){let $=C,ht=Jc(fn("line-width",this,$),fn("line-gap-width",this,$)),Mt=fn("line-offset",this,$);return ht/2+Math.abs(Mt)+Xn(this.paint.get("line-translate"))}queryIntersectsFeature(C,$,ht,Mt,Bt,jt,oe){let be=jn(C,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,oe),Be=oe/2*Jc(this.paint.get("line-width").evaluate($,ht),this.paint.get("line-gap-width").evaluate($,ht)),Qe=this.paint.get("line-offset").evaluate($,ht);return Qe&&(Mt=function(lr,wr){let Fr=[];for(let Zr=0;Zr<lr.length;Zr++){let en=lr[Zr],yn=[];for(let Vn=0;Vn<en.length;Vn++){let Ca=en[Vn-1],ua=en[Vn],wa=en[Vn+1],Xa=Vn===0?new o(0,0):ua.sub(Ca)._unit()._perp(),di=Vn===en.length-1?new o(0,0):wa.sub(ua)._unit()._perp(),oo=Xa._add(di)._unit(),as=oo.x*di.x+oo.y*di.y;as!==0&&oo._mult(1/as),yn.push(oo._mult(wr)._add(ua))}Fr.push(yn)}return Fr}(Mt,Qe*oe)),function(lr,wr,Fr){for(let Zr=0;Zr<wr.length;Zr++){let en=wr[Zr];if(lr.length>=3){for(let yn=0;yn<en.length;yn++)if(Un(lr,en[yn]))return!0}if(sa(lr,en,Fr))return!0}return!1}(be,Mt,Be)}isTileClipped(){return!0}}function Jc(H,C){return C>0?C+2*H:H}let lp=le([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zp=le([{name:"a_projected_pos",components:3,type:"Float32"}],4);le([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let Kp=le([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);le([{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 bh=le([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kp=le([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ec(H,C,$){return H.sections.forEach(ht=>{ht.text=function(Mt,Bt,jt){let oe=Bt.layout.get("text-transform").evaluate(jt,{});return oe==="uppercase"?Mt=Mt.toLocaleUpperCase():oe==="lowercase"&&(Mt=Mt.toLocaleLowerCase()),ws.applyArabicShaping&&(Mt=ws.applyArabicShaping(Mt)),Mt}(ht.text,C,$)}),H}le([{name:"triangle",components:3,type:"Uint16"}]),le([{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"}]),le([{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"}]),le([{type:"Float32",name:"offsetX"}]),le([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),le([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Qc={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ol=24,Ap=Ul,Yp=function(H,C,$,ht,Mt){var Bt,jt,oe=8*Mt-ht-1,be=(1<<oe)-1,Be=be>>1,Qe=-7,lr=Mt-1,wr=-1,Fr=H[C+lr];for(lr+=wr,Bt=Fr&(1<<-Qe)-1,Fr>>=-Qe,Qe+=oe;Qe>0;Bt=256*Bt+H[C+lr],lr+=wr,Qe-=8);for(jt=Bt&(1<<-Qe)-1,Bt>>=-Qe,Qe+=ht;Qe>0;jt=256*jt+H[C+lr],lr+=wr,Qe-=8);if(Bt===0)Bt=1-Be;else{if(Bt===be)return jt?NaN:1/0*(Fr?-1:1);jt+=Math.pow(2,ht),Bt-=Be}return(Fr?-1:1)*jt*Math.pow(2,Bt-ht)},C0=function(H,C,$,ht,Mt,Bt){var jt,oe,be,Be=8*Bt-Mt-1,Qe=(1<<Be)-1,lr=Qe>>1,wr=Mt===23?Math.pow(2,-24)-Math.pow(2,-77):0,Fr=0,Zr=1,en=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(oe=isNaN(C)?1:0,jt=Qe):(jt=Math.floor(Math.log(C)/Math.LN2),C*(be=Math.pow(2,-jt))<1&&(jt--,be*=2),(C+=jt+lr>=1?wr/be:wr*Math.pow(2,1-lr))*be>=2&&(jt++,be/=2),jt+lr>=Qe?(oe=0,jt=Qe):jt+lr>=1?(oe=(C*be-1)*Math.pow(2,Mt),jt+=lr):(oe=C*Math.pow(2,lr-1)*Math.pow(2,Mt),jt=0));Mt>=8;H[$+Fr]=255&oe,Fr+=Zr,oe/=256,Mt-=8);for(jt=jt<<Mt|oe,Be+=Mt;Be>0;H[$+Fr]=255&jt,Fr+=Zr,jt/=256,Be-=8);H[$+Fr-Zr]|=128*en};function Ul(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Ul.Varint=0,Ul.Fixed64=1,Ul.Bytes=2,Ul.Fixed32=5;var Gh=4294967296,I0=1/Gh,Mp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function wh(H){return H.type===Ul.Bytes?H.readVarint()+H.pos:H.pos+1}function Zm(H,C,$){return $?4294967296*C+(H>>>0):4294967296*(C>>>0)+(H>>>0)}function Xp(H,C,$){var ht=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(7*Math.LN2));$.realloc(ht);for(var Mt=$.pos-1;Mt>=H;Mt--)$.buf[Mt+ht]=$.buf[Mt]}function o_(H,C){for(var $=0;$<H.length;$++)C.writeVarint(H[$])}function s_(H,C){for(var $=0;$<H.length;$++)C.writeSVarint(H[$])}function l_(H,C){for(var $=0;$<H.length;$++)C.writeFloat(H[$])}function u_(H,C){for(var $=0;$<H.length;$++)C.writeDouble(H[$])}function c_(H,C){for(var $=0;$<H.length;$++)C.writeBoolean(H[$])}function f_(H,C){for(var $=0;$<H.length;$++)C.writeFixed32(H[$])}function h_(H,C){for(var $=0;$<H.length;$++)C.writeSFixed32(H[$])}function p_(H,C){for(var $=0;$<H.length;$++)C.writeFixed64(H[$])}function P0(H,C){for(var $=0;$<H.length;$++)C.writeSFixed64(H[$])}function O0(H,C){return(H[C]|H[C+1]<<8|H[C+2]<<16)+16777216*H[C+3]}function $p(H,C,$){H[$]=C,H[$+1]=C>>>8,H[$+2]=C>>>16,H[$+3]=C>>>24}function Fv(H,C){return(H[C]|H[C+1]<<8|H[C+2]<<16)+(H[C+3]<<24)}Ul.prototype={destroy:function(){this.buf=null},readFields:function(H,C,$){for($=$||this.length;this.pos<$;){var ht=this.readVarint(),Mt=ht>>3,Bt=this.pos;this.type=7&ht,H(Mt,C,this),this.pos===Bt&&this.skip(ht)}return C},readMessage:function(H,C){return this.readFields(H,C,this.readVarint()+this.pos)},readFixed32:function(){var H=O0(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=Fv(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=O0(this.buf,this.pos)+O0(this.buf,this.pos+4)*Gh;return this.pos+=8,H},readSFixed64:function(){var H=O0(this.buf,this.pos)+Fv(this.buf,this.pos+4)*Gh;return this.pos+=8,H},readFloat:function(){var H=Yp(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Yp(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var C,$,ht=this.buf;return C=127&($=ht[this.pos++]),$<128?C:(C|=(127&($=ht[this.pos++]))<<7,$<128?C:(C|=(127&($=ht[this.pos++]))<<14,$<128?C:(C|=(127&($=ht[this.pos++]))<<21,$<128?C:function(Mt,Bt,jt){var oe,be,Be=jt.buf;if(oe=(112&(be=Be[jt.pos++]))>>4,be<128||(oe|=(127&(be=Be[jt.pos++]))<<3,be<128)||(oe|=(127&(be=Be[jt.pos++]))<<10,be<128)||(oe|=(127&(be=Be[jt.pos++]))<<17,be<128)||(oe|=(127&(be=Be[jt.pos++]))<<24,be<128)||(oe|=(1&(be=Be[jt.pos++]))<<31,be<128))return Zm(Mt,oe,Bt);throw new Error("Expected varint not more than 10 bytes")}(C|=(15&($=ht[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,C=this.pos;return this.pos=H,H-C>=12&&Mp?function($,ht,Mt){return Mp.decode($.subarray(ht,Mt))}(this.buf,C,H):function($,ht,Mt){for(var Bt="",jt=ht;jt<Mt;){var oe,be,Be,Qe=$[jt],lr=null,wr=Qe>239?4:Qe>223?3:Qe>191?2:1;if(jt+wr>Mt)break;wr===1?Qe<128&&(lr=Qe):wr===2?(192&(oe=$[jt+1]))==128&&(lr=(31&Qe)<<6|63&oe)<=127&&(lr=null):wr===3?(be=$[jt+2],(192&(oe=$[jt+1]))==128&&(192&be)==128&&((lr=(15&Qe)<<12|(63&oe)<<6|63&be)<=2047||lr>=55296&&lr<=57343)&&(lr=null)):wr===4&&(be=$[jt+2],Be=$[jt+3],(192&(oe=$[jt+1]))==128&&(192&be)==128&&(192&Be)==128&&((lr=(15&Qe)<<18|(63&oe)<<12|(63&be)<<6|63&Be)<=65535||lr>=1114112)&&(lr=null)),lr===null?(lr=65533,wr=1):lr>65535&&(lr-=65536,Bt+=String.fromCharCode(lr>>>10&1023|55296),lr=56320|1023&lr),Bt+=String.fromCharCode(lr),jt+=wr}return Bt}(this.buf,C,H)},readBytes:function(){var H=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,H);return this.pos=H,C},readPackedVarint:function(H,C){if(this.type!==Ul.Bytes)return H.push(this.readVarint(C));var $=wh(this);for(H=H||[];this.pos<$;)H.push(this.readVarint(C));return H},readPackedSVarint:function(H){if(this.type!==Ul.Bytes)return H.push(this.readSVarint());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readSVarint());return H},readPackedBoolean:function(H){if(this.type!==Ul.Bytes)return H.push(this.readBoolean());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readBoolean());return H},readPackedFloat:function(H){if(this.type!==Ul.Bytes)return H.push(this.readFloat());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readFloat());return H},readPackedDouble:function(H){if(this.type!==Ul.Bytes)return H.push(this.readDouble());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readDouble());return H},readPackedFixed32:function(H){if(this.type!==Ul.Bytes)return H.push(this.readFixed32());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readFixed32());return H},readPackedSFixed32:function(H){if(this.type!==Ul.Bytes)return H.push(this.readSFixed32());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readSFixed32());return H},readPackedFixed64:function(H){if(this.type!==Ul.Bytes)return H.push(this.readFixed64());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readFixed64());return H},readPackedSFixed64:function(H){if(this.type!==Ul.Bytes)return H.push(this.readSFixed64());var C=wh(this);for(H=H||[];this.pos<C;)H.push(this.readSFixed64());return H},skip:function(H){var C=7&H;if(C===Ul.Varint)for(;this.buf[this.pos++]>127;);else if(C===Ul.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Ul.Fixed32)this.pos+=4;else{if(C!==Ul.Fixed64)throw new Error("Unimplemented type: "+C);this.pos+=8}},writeTag:function(H,C){this.writeVarint(H<<3|C)},realloc:function(H){for(var C=this.length||16;C<this.pos+H;)C*=2;if(C!==this.length){var $=new Uint8Array(C);$.set(this.buf),this.buf=$,this.length=C}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(H){this.realloc(4),$p(this.buf,H,this.pos),this.pos+=4},writeSFixed32:function(H){this.realloc(4),$p(this.buf,H,this.pos),this.pos+=4},writeFixed64:function(H){this.realloc(8),$p(this.buf,-1&H,this.pos),$p(this.buf,Math.floor(H*I0),this.pos+4),this.pos+=8},writeSFixed64:function(H){this.realloc(8),$p(this.buf,-1&H,this.pos),$p(this.buf,Math.floor(H*I0),this.pos+4),this.pos+=8},writeVarint:function(H){(H=+H||0)>268435455||H<0?function(C,$){var ht,Mt;if(C>=0?(ht=C%4294967296|0,Mt=C/4294967296|0):(Mt=~(-C/4294967296),4294967295^(ht=~(-C%4294967296))?ht=ht+1|0:(ht=0,Mt=Mt+1|0)),C>=18446744073709552e3||C<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");$.realloc(10),function(Bt,jt,oe){oe.buf[oe.pos++]=127&Bt|128,Bt>>>=7,oe.buf[oe.pos++]=127&Bt|128,Bt>>>=7,oe.buf[oe.pos++]=127&Bt|128,Bt>>>=7,oe.buf[oe.pos++]=127&Bt|128,oe.buf[oe.pos]=127&(Bt>>>=7)}(ht,0,$),function(Bt,jt){var oe=(7&Bt)<<4;jt.buf[jt.pos++]|=oe|((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)))))}(Mt,$)}(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var C=this.pos;this.pos=function(ht,Mt,Bt){for(var jt,oe,be=0;be<Mt.length;be++){if((jt=Mt.charCodeAt(be))>55295&&jt<57344){if(!oe){jt>56319||be+1===Mt.length?(ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189):oe=jt;continue}if(jt<56320){ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189,oe=jt;continue}jt=oe-55296<<10|jt-56320|65536,oe=null}else oe&&(ht[Bt++]=239,ht[Bt++]=191,ht[Bt++]=189,oe=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,H,this.pos);var $=this.pos-C;$>=128&&Xp(C,$,this),this.pos=C-1,this.writeVarint($),this.pos+=$},writeFloat:function(H){this.realloc(4),C0(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),C0(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var C=H.length;this.writeVarint(C),this.realloc(C);for(var $=0;$<C;$++)this.buf[this.pos++]=H[$]},writeRawMessage:function(H,C){this.pos++;var $=this.pos;H(C,this);var ht=this.pos-$;ht>=128&&Xp($,ht,this),this.pos=$-1,this.writeVarint(ht),this.pos+=ht},writeMessage:function(H,C,$){this.writeTag(H,Ul.Bytes),this.writeRawMessage(C,$)},writePackedVarint:function(H,C){C.length&&this.writeMessage(H,o_,C)},writePackedSVarint:function(H,C){C.length&&this.writeMessage(H,s_,C)},writePackedBoolean:function(H,C){C.length&&this.writeMessage(H,c_,C)},writePackedFloat:function(H,C){C.length&&this.writeMessage(H,l_,C)},writePackedDouble:function(H,C){C.length&&this.writeMessage(H,u_,C)},writePackedFixed32:function(H,C){C.length&&this.writeMessage(H,f_,C)},writePackedSFixed32:function(H,C){C.length&&this.writeMessage(H,h_,C)},writePackedFixed64:function(H,C){C.length&&this.writeMessage(H,p_,C)},writePackedSFixed64:function(H,C){C.length&&this.writeMessage(H,P0,C)},writeBytesField:function(H,C){this.writeTag(H,Ul.Bytes),this.writeBytes(C)},writeFixed32Field:function(H,C){this.writeTag(H,Ul.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(H,C){this.writeTag(H,Ul.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(H,C){this.writeTag(H,Ul.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(H,C){this.writeTag(H,Ul.Fixed64),this.writeSFixed64(C)},writeVarintField:function(H,C){this.writeTag(H,Ul.Varint),this.writeVarint(C)},writeSVarintField:function(H,C){this.writeTag(H,Ul.Varint),this.writeSVarint(C)},writeStringField:function(H,C){this.writeTag(H,Ul.Bytes),this.writeString(C)},writeFloatField:function(H,C){this.writeTag(H,Ul.Fixed32),this.writeFloat(C)},writeDoubleField:function(H,C){this.writeTag(H,Ul.Fixed64),this.writeDouble(C)},writeBooleanField:function(H,C){this.writeVarintField(H,!!C)}};var Km=r(Ap);let D0=3;function d_(H,C,$){H===1&&$.readMessage(Bv,C)}function Bv(H,C,$){if(H===3){let{id:ht,bitmap:Mt,width:Bt,height:jt,left:oe,top:be,advance:Be}=$.readMessage(Ym,{});C.push({id:ht,bitmap:new ds({width:Bt+2*D0,height:jt+2*D0},Mt),metrics:{width:Bt,height:jt,left:oe,top:be,advance:Be}})}}function Ym(H,C,$){H===1?C.id=$.readVarint():H===2?C.bitmap=$.readBytes():H===3?C.width=$.readVarint():H===4?C.height=$.readVarint():H===5?C.left=$.readSVarint():H===6?C.top=$.readSVarint():H===7&&(C.advance=$.readVarint())}let Xm=D0;function F0(H){let C=0,$=0;for(let jt of H)C+=jt.w*jt.h,$=Math.max($,jt.w);H.sort((jt,oe)=>oe.h-jt.h);let ht=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(C/.95)),$),h:1/0}],Mt=0,Bt=0;for(let jt of H)for(let oe=ht.length-1;oe>=0;oe--){let be=ht[oe];if(!(jt.w>be.w||jt.h>be.h)){if(jt.x=be.x,jt.y=be.y,Bt=Math.max(Bt,jt.y+jt.h),Mt=Math.max(Mt,jt.x+jt.w),jt.w===be.w&&jt.h===be.h){let Be=ht.pop();oe<ht.length&&(ht[oe]=Be)}else jt.h===be.h?(be.x+=jt.w,be.w-=jt.w):jt.w===be.w?(be.y+=jt.h,be.h-=jt.h):(ht.push({x:be.x+jt.w,y:be.y,w:be.w-jt.w,h:jt.h}),be.y+=jt.h,be.h-=jt.h);break}}return{w:Mt,h:Bt,fill:C/(Mt*Bt)||0}}let Vc=1;class xf{constructor(C,{pixelRatio:$,version:ht,stretchX:Mt,stretchY:Bt,content:jt,textFitWidth:oe,textFitHeight:be}){this.paddedRect=C,this.pixelRatio=$,this.stretchX=Mt,this.stretchY=Bt,this.content=jt,this.version=ht,this.textFitWidth=oe,this.textFitHeight=be}get tl(){return[this.paddedRect.x+Vc,this.paddedRect.y+Vc]}get br(){return[this.paddedRect.x+this.paddedRect.w-Vc,this.paddedRect.y+this.paddedRect.h-Vc]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Vc)/this.pixelRatio,(this.paddedRect.h-2*Vc)/this.pixelRatio]}}class Rv{constructor(C,$){let ht={},Mt={};this.haveRenderCallbacks=[];let Bt=[];this.addImages(C,ht,Bt),this.addImages($,Mt,Bt);let{w:jt,h:oe}=F0(Bt),be=new rs({width:jt||1,height:oe||1});for(let Be in C){let Qe=C[Be],lr=ht[Be].paddedRect;rs.copy(Qe.data,be,{x:0,y:0},{x:lr.x+Vc,y:lr.y+Vc},Qe.data)}for(let Be in $){let Qe=$[Be],lr=Mt[Be].paddedRect,wr=lr.x+Vc,Fr=lr.y+Vc,Zr=Qe.data.width,en=Qe.data.height;rs.copy(Qe.data,be,{x:0,y:0},{x:wr,y:Fr},Qe.data),rs.copy(Qe.data,be,{x:0,y:en-1},{x:wr,y:Fr-1},{width:Zr,height:1}),rs.copy(Qe.data,be,{x:0,y:0},{x:wr,y:Fr+en},{width:Zr,height:1}),rs.copy(Qe.data,be,{x:Zr-1,y:0},{x:wr-1,y:Fr},{width:1,height:en}),rs.copy(Qe.data,be,{x:0,y:0},{x:wr+Zr,y:Fr},{width:1,height:en})}this.image=be,this.iconPositions=ht,this.patternPositions=Mt}addImages(C,$,ht){for(let Mt in C){let Bt=C[Mt],jt={x:0,y:0,w:Bt.data.width+2*Vc,h:Bt.data.height+2*Vc};ht.push(jt),$[Mt]=new xf(jt,Bt),Bt.hasRenderCallback&&this.haveRenderCallbacks.push(Mt)}}patchUpdatedImages(C,$){C.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let ht in C.updatedImages)this.patchUpdatedImage(this.iconPositions[ht],C.getImage(ht),$),this.patchUpdatedImage(this.patternPositions[ht],C.getImage(ht),$)}patchUpdatedImage(C,$,ht){if(!C||!$||C.version===$.version)return;C.version=$.version;let[Mt,Bt]=C.tl;ht.update($.data,void 0,{x:Mt,y:Bt})}}var up;ca("ImagePosition",xf),ca("ImageAtlas",Rv),t.ah=void 0,(up=t.ah||(t.ah={}))[up.none=0]="none",up[up.horizontal=1]="horizontal",up[up.vertical=2]="vertical",up[up.horizontalOnly=3]="horizontalOnly";let Jp=-17;class Wd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(C,$){let ht=new Wd;return ht.scale=C||1,ht.fontStack=$,ht}static forImage(C){let $=new Wd;return $.imageName=C,$}}class Qp{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(C,$){let ht=new Qp;for(let Mt=0;Mt<C.sections.length;Mt++){let Bt=C.sections[Mt];Bt.image?ht.addImageSection(Bt):ht.addTextSection(Bt,$)}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 $="";for(let ht=0;ht<C.length;ht++){let Mt=C.charCodeAt(ht+1)||null,Bt=C.charCodeAt(ht-1)||null;$+=Mt&&ll(Mt)&&!Qc[C[ht+1]]||Bt&&ll(Bt)&&!Qc[C[ht-1]]||!Qc[C[ht]]?C[ht]:Qc[C[ht]]}return $}(this.text)}trim(){let C=0;for(let ht=0;ht<this.text.length&&R0[this.text.charCodeAt(ht)];ht++)C++;let $=this.text.length;for(let ht=this.text.length-1;ht>=0&&ht>=C&&R0[this.text.charCodeAt(ht)];ht--)$--;this.text=this.text.substring(C,$),this.sectionIndex=this.sectionIndex.slice(C,$)}substring(C,$){let ht=new Qp;return ht.text=this.text.substring(C,$),ht.sectionIndex=this.sectionIndex.slice(C,$),ht.sections=this.sections,ht}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((C,$)=>Math.max(C,this.sections[$].scale),0)}addTextSection(C,$){this.text+=C.text,this.sections.push(Wd.forText(C.scale,C.fontStack||$));let ht=this.sections.length-1;for(let Mt=0;Mt<C.text.length;++Mt)this.sectionIndex.push(ht)}addImageSection(C){let $=C.image?C.image.name:"";if($.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(Wd.forImage($)),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 B0(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr){let en=Qp.fromFeature(H,Mt),yn;lr===t.ah.vertical&&en.verticalizePunctuation();let{processBidirectionalText:Vn,processStyledBidirectionalText:Ca}=ws;if(Vn&&en.sections.length===1){yn=[];let Xa=Vn(en.toString(),Sp(en,Be,Bt,C,ht,Fr));for(let di of Xa){let oo=new Qp;oo.text=di,oo.sections=en.sections;for(let as=0;as<di.length;as++)oo.sectionIndex.push(0);yn.push(oo)}}else if(Ca){yn=[];let Xa=Ca(en.text,en.sectionIndex,Sp(en,Be,Bt,C,ht,Fr));for(let di of Xa){let oo=new Qp;oo.text=di[0],oo.sectionIndex=di[1],oo.sections=en.sections,yn.push(oo)}}else yn=function(Xa,di){let oo=[],as=Xa.text,eo=0;for(let Ki of di)oo.push(Xa.substring(eo,Ki)),eo=Ki;return eo<as.length&&oo.push(Xa.substring(eo,as.length)),oo}(en,Sp(en,Be,Bt,C,ht,Fr));let ua=[],wa={positionedLines:ua,text:en.toString(),top:Qe[1],bottom:Qe[1],left:Qe[0],right:Qe[0],writingMode:lr,iconsInText:!1,verticalizable:!1};return function(Xa,di,oo,as,eo,Ki,Co,xo,ho,oi,Ro,Io){let xs=0,mu=Jp,uu=0,tf=0,Jf=xo==="right"?1:xo==="left"?0:.5,Ac=0;for(let rc of eo){rc.trim();let ef=rc.getMaxScale(),zf=(ef-1)*Ol,bf={positionedGlyphs:[],lineOffset:0};Xa.positionedLines[Ac]=bf;let jf=bf.positionedGlyphs,ff=0;if(!rc.length()){mu+=Ki,++Ac;continue}for(let zu=0;zu<rc.length();zu++){let vl=rc.getSection(zu),Vl=rc.getSectionIndex(zu),eu=rc.getCharCode(zu),Xu=0,Lu=null,ld=null,Th=null,kh=Ol,Lf=!(ho===t.ah.horizontal||!Ro&&!Yo(eu)||Ro&&(R0[eu]||(Hc=eu,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(Hc)))));if(vl.imageName){let gu=as[vl.imageName];if(!gu)continue;Th=vl.imageName,Xa.iconsInText=Xa.iconsInText||!0,ld=gu.paddedRect;let hf=gu.displaySize;vl.scale=vl.scale*Ol/Io,Lu={width:hf[0],height:hf[1],left:Vc,top:-Xm,advance:Lf?hf[1]:hf[0]},Xu=zf+(Ol-hf[1]*vl.scale),kh=Lu.advance;let yh=Lf?hf[0]*vl.scale-Ol*ef:hf[1]*vl.scale-Ol*ef;yh>0&&yh>ff&&(ff=yh)}else{let gu=oo[vl.fontStack],hf=gu&&gu[eu];if(hf&&hf.rect)ld=hf.rect,Lu=hf.metrics;else{let yh=di[vl.fontStack],fh=yh&&yh[eu];if(!fh)continue;Lu=fh.metrics}Xu=(ef-vl.scale)*Ol}Lf?(Xa.verticalizable=!0,jf.push({glyph:eu,imageName:Th,x:xs,y:mu+Xu,vertical:Lf,scale:vl.scale,fontStack:vl.fontStack,sectionIndex:Vl,metrics:Lu,rect:ld}),xs+=kh*vl.scale+oi):(jf.push({glyph:eu,imageName:Th,x:xs,y:mu+Xu,vertical:Lf,scale:vl.scale,fontStack:vl.fontStack,sectionIndex:Vl,metrics:Lu,rect:ld}),xs+=Lu.advance*vl.scale+oi)}jf.length!==0&&(uu=Math.max(xs-oi,uu),v_(jf,0,jf.length-1,Jf,ff)),xs=0;let ch=Ki*ef+ff;bf.lineOffset=Math.max(ff,zf),mu+=ch,tf=Math.max(ch,tf),++Ac}var Hc;let Bf=mu-Jp,{horizontalAlign:Rf,verticalAlign:Nf}=Jm(Co);(function(rc,ef,zf,bf,jf,ff,ch,zu,vl){let Vl=(ef-zf)*jf,eu=0;eu=ff!==ch?-zu*bf-Jp:(-bf*vl+.5)*ch;for(let Xu of rc)for(let Lu of Xu.positionedGlyphs)Lu.x+=Vl,Lu.y+=eu})(Xa.positionedLines,Jf,Rf,Nf,uu,tf,Ki,Bf,eo.length),Xa.top+=-Nf*Bf,Xa.bottom=Xa.top+Bf,Xa.left+=-Rf*uu,Xa.right=Xa.left+uu}(wa,C,$,ht,yn,jt,oe,be,lr,Be,wr,Zr),!function(Xa){for(let di of Xa)if(di.positionedGlyphs.length!==0)return!1;return!0}(ua)&&wa}let R0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},m_={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},g_={40:!0};function N0(H,C,$,ht,Mt,Bt){if(C.imageName){let jt=ht[C.imageName];return jt?jt.displaySize[0]*C.scale*Ol/Bt+Mt:0}{let jt=$[C.fontStack],oe=jt&&jt[H];return oe?oe.metrics.advance*C.scale+Mt:0}}function Nv(H,C,$,ht){let Mt=Math.pow(H-C,2);return ht?H<C?Mt/2:2*Mt:Mt+Math.abs($)*$}function j0(H,C,$){let ht=0;return H===10&&(ht-=1e4),$&&(ht+=150),H!==40&&H!==65288||(ht+=50),C!==41&&C!==65289||(ht+=50),ht}function $m(H,C,$,ht,Mt,Bt){let jt=null,oe=Nv(C,$,Mt,Bt);for(let be of ht){let Be=Nv(C-be.x,$,Mt,Bt)+be.badness;Be<=oe&&(jt=be,oe=Be)}return{index:H,x:C,priorBreak:jt,badness:oe}}function Zh(H){return H?Zh(H.priorBreak).concat(H.index):[]}function Sp(H,C,$,ht,Mt,Bt){if(!H)return[];let jt=[],oe=function(lr,wr,Fr,Zr,en,yn){let Vn=0;for(let Ca=0;Ca<lr.length();Ca++){let ua=lr.getSection(Ca);Vn+=N0(lr.getCharCode(Ca),ua,Zr,en,wr,yn)}return Vn/Math.max(1,Math.ceil(Vn/Fr))}(H,C,$,ht,Mt,Bt),be=H.text.indexOf("")>=0,Be=0;for(let lr=0;lr<H.length();lr++){let wr=H.getSection(lr),Fr=H.getCharCode(lr);if(R0[Fr]||(Be+=N0(Fr,wr,ht,Mt,C,Bt)),lr<H.length()-1){let Zr=!((Qe=Fr)<11904)&&(!!Za["CJK Compatibility Forms"](Qe)||!!Za["CJK Compatibility"](Qe)||!!Za["CJK Strokes"](Qe)||!!Za["CJK Symbols and Punctuation"](Qe)||!!Za["Enclosed CJK Letters and Months"](Qe)||!!Za["Halfwidth and Fullwidth Forms"](Qe)||!!Za["Ideographic Description Characters"](Qe)||!!Za["Vertical Forms"](Qe)||Os.test(String.fromCodePoint(Qe)));(m_[Fr]||Zr||wr.imageName||lr!==H.length()-2&&g_[H.getCharCode(lr+1)])&&jt.push($m(lr+1,Be,oe,jt,j0(Fr,H.getCharCode(lr+1),Zr&&be),!1))}}var Qe;return Zh($m(H.length(),Be,oe,jt,0,!0))}function Jm(H){let C=.5,$=.5;switch(H){case"right":case"top-right":case"bottom-right":C=1;break;case"left":case"top-left":case"bottom-left":C=0}switch(H){case"bottom":case"bottom-right":case"bottom-left":$=1;break;case"top":case"top-right":case"top-left":$=0}return{horizontalAlign:C,verticalAlign:$}}function v_(H,C,$,ht,Mt){if(!ht&&!Mt)return;let Bt=H[$],jt=(H[$].x+Bt.metrics.advance*Bt.scale)*ht;for(let oe=C;oe<=$;oe++)H[oe].x-=jt,H[oe].y+=Mt}function y_(H,C,$){let{horizontalAlign:ht,verticalAlign:Mt}=Jm($),Bt=C[0]-H.displaySize[0]*ht,jt=C[1]-H.displaySize[1]*Mt;return{image:H,top:jt,bottom:jt+H.displaySize[1],left:Bt,right:Bt+H.displaySize[0]}}function jv(H){var C,$;let ht=H.left,Mt=H.top,Bt=H.right-ht,jt=H.bottom-Mt,oe=(C=H.image.textFitWidth)!==null&&C!==void 0?C:"stretchOrShrink",be=($=H.image.textFitHeight)!==null&&$!==void 0?$:"stretchOrShrink",Be=(H.image.content[2]-H.image.content[0])/(H.image.content[3]-H.image.content[1]);if(be==="proportional"){if(oe==="stretchOnly"&&Bt/jt<Be||oe==="proportional"){let Qe=Math.ceil(jt*Be);ht*=Qe/Bt,Bt=Qe}}else if(oe==="proportional"&&be==="stretchOnly"&&Be!==0&&Bt/jt>Be){let Qe=Math.ceil(Bt/Be);Mt*=Qe/jt,jt=Qe}return{x1:ht,y1:Mt,x2:ht+Bt,y2:Mt+jt}}function Uv(H,C,$,ht,Mt,Bt){let jt=H.image,oe;if(jt.content){let yn=jt.content,Vn=jt.pixelRatio||1;oe=[yn[0]/Vn,yn[1]/Vn,jt.displaySize[0]-yn[2]/Vn,jt.displaySize[1]-yn[3]/Vn]}let be=C.left*Bt,Be=C.right*Bt,Qe,lr,wr,Fr;$==="width"||$==="both"?(Fr=Mt[0]+be-ht[3],lr=Mt[0]+Be+ht[1]):(Fr=Mt[0]+(be+Be-jt.displaySize[0])/2,lr=Fr+jt.displaySize[0]);let Zr=C.top*Bt,en=C.bottom*Bt;return $==="height"||$==="both"?(Qe=Mt[1]+Zr-ht[0],wr=Mt[1]+en+ht[2]):(Qe=Mt[1]+(Zr+en-jt.displaySize[1])/2,wr=Qe+jt.displaySize[1]),{image:jt,top:Qe,right:lr,bottom:wr,left:Fr,collisionPadding:oe}}let Gd=255,Ih=128,cp=Gd*Ih;function Vv(H,C){let{expression:$}=C;if($.kind==="constant")return{kind:"constant",layoutSize:$.evaluate(new fs(H+1))};if($.kind==="source")return{kind:"source"};{let{zoomStops:ht,interpolationType:Mt}=$,Bt=0;for(;Bt<ht.length&&ht[Bt]<=H;)Bt++;Bt=Math.max(0,Bt-1);let jt=Bt;for(;jt<ht.length&&ht[jt]<H+1;)jt++;jt=Math.min(ht.length-1,jt);let oe=ht[Bt],be=ht[jt];return $.kind==="composite"?{kind:"composite",minZoom:oe,maxZoom:be,interpolationType:Mt}:{kind:"camera",minZoom:oe,maxZoom:be,minSize:$.evaluate(new fs(oe)),maxSize:$.evaluate(new fs(be)),interpolationType:Mt}}}function Qm(H,C,$){let ht="never",Mt=H.get(C);return Mt?ht=Mt:H.get($)&&(ht="always"),ht}let x_=Dn.VectorTileFeature.types,tg=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function U0(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr){let Fr=oe?Math.min(cp,Math.round(oe[0])):0,Zr=oe?Math.min(cp,Math.round(oe[1])):0;H.emplaceBack(C,$,Math.round(32*ht),Math.round(32*Mt),Bt,jt,(Fr<<1)+(be?1:0),Zr,16*Be,16*Qe,256*lr,256*wr)}function fp(H,C,$){H.emplaceBack(C.x,C.y,$),H.emplaceBack(C.x,C.y,$),H.emplaceBack(C.x,C.y,$),H.emplaceBack(C.x,C.y,$)}function __(H){for(let C of H.sections)if(so(C.text))return!0;return!1}class uc{constructor(C){this.layoutVertexArray=new Xt,this.indexArray=new je,this.programConfigurations=C,this.segments=new Wr,this.dynamicLayoutVertexArray=new fe,this.opacityVertexArray=new me,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ai}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(C,$,ht,Mt){this.isEmpty()||(ht&&(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,lp.members),this.indexBuffer=C.createIndexBuffer(this.indexArray,$),this.dynamicLayoutVertexBuffer=C.createVertexBuffer(this.dynamicLayoutVertexArray,Zp.members,!0),this.opacityVertexBuffer=C.createVertexBuffer(this.opacityVertexArray,tg,!0),this.opacityVertexBuffer.itemSize=1),(ht||Mt)&&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())}}ca("SymbolBuffers",uc);class td{constructor(C,$,ht){this.layoutVertexArray=new C,this.layoutAttributes=$,this.indexArray=new ht,this.segments=new Wr,this.collisionVertexArray=new Ve}upload(C){this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=C.createVertexBuffer(this.collisionVertexArray,Kp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}ca("CollisionBuffers",td);class Ep{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=An([]),this.placementViewportMatrix=An([]);let $=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Vv(this.zoom,$["text-size"]),this.iconSizeData=Vv(this.zoom,$["icon-size"]);let ht=this.layers[0].layout,Mt=ht.get("symbol-sort-key"),Bt=ht.get("symbol-z-order");this.canOverlap=Qm(ht,"text-overlap","text-allow-overlap")!=="never"||Qm(ht,"icon-overlap","icon-allow-overlap")!=="never"||ht.get("text-ignore-placement")||ht.get("icon-ignore-placement"),this.sortFeaturesByKey=Bt!=="viewport-y"&&!Mt.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 uc(new Ts(this.layers,this.zoom,C=>/^text/.test(C))),this.icon=new uc(new Ts(this.layers,this.zoom,C=>/^icon/.test(C))),this.glyphOffsetArray=new Go,this.lineVertexArray=new Xo,this.symbolInstances=new Yi,this.textAnchorOffsets=new Qo}calculateGlyphDependencies(C,$,ht,Mt,Bt){for(let jt=0;jt<C.length;jt++)if($[C.charCodeAt(jt)]=!0,(ht||Mt)&&Bt){let oe=Qc[C.charAt(jt)];oe&&($[oe.charCodeAt(0)]=!0)}}populate(C,$,ht){let Mt=this.layers[0],Bt=Mt.layout,jt=Bt.get("text-font"),oe=Bt.get("text-field"),be=Bt.get("icon-image"),Be=(oe.value.kind!=="constant"||oe.value.value instanceof Yr&&!oe.value.value.isEmpty()||oe.value.value.toString().length>0)&&(jt.value.kind!=="constant"||jt.value.value.length>0),Qe=be.value.kind!=="constant"||!!be.value.value||Object.keys(be.parameters).length>0,lr=Bt.get("symbol-sort-key");if(this.features=[],!Be&&!Qe)return;let wr=$.iconDependencies,Fr=$.glyphDependencies,Zr=$.availableImages,en=new fs(this.zoom);for(let{feature:yn,id:Vn,index:Ca,sourceLayerIndex:ua}of C){let wa=Mt._featureFilter.needGeometry,Xa=cr(yn,wa);if(!Mt._featureFilter.filter(en,Xa,ht))continue;let di,oo;if(wa||(Xa.geometry=nr(yn)),Be){let eo=Mt.getValueAndResolveTokens("text-field",Xa,ht,Zr),Ki=Yr.factory(eo),Co=this.hasRTLText=this.hasRTLText||__(Ki);(!Co||ws.getRTLTextPluginStatus()==="unavailable"||Co&&ws.isParsed())&&(di=ec(Ki,Mt,Xa))}if(Qe){let eo=Mt.getValueAndResolveTokens("icon-image",Xa,ht,Zr);oo=eo instanceof Kn?eo:Kn.fromString(eo)}if(!di&&!oo)continue;let as=this.sortFeaturesByKey?lr.evaluate(Xa,{},ht):void 0;if(this.features.push({id:Vn,text:di,icon:oo,index:Ca,sourceLayerIndex:ua,geometry:Xa.geometry,properties:yn.properties,type:x_[yn.type],sortKey:as}),oo&&(wr[oo.name]=!0),di){let eo=jt.evaluate(Xa,{},ht).join(","),Ki=Bt.get("text-rotation-alignment")!=="viewport"&&Bt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(let Co of di.sections)if(Co.image)wr[Co.image.name]=!0;else{let xo=$i(di.toString()),ho=Co.fontStack||eo,oi=Fr[ho]=Fr[ho]||{};this.calculateGlyphDependencies(Co.text,oi,Ki,this.allowVerticalPlacement,xo)}}}Bt.get("symbol-placement")==="line"&&(this.features=function(yn){let Vn={},Ca={},ua=[],wa=0;function Xa(eo){ua.push(yn[eo]),wa++}function di(eo,Ki,Co){let xo=Ca[eo];return delete Ca[eo],Ca[Ki]=xo,ua[xo].geometry[0].pop(),ua[xo].geometry[0]=ua[xo].geometry[0].concat(Co[0]),xo}function oo(eo,Ki,Co){let xo=Vn[Ki];return delete Vn[Ki],Vn[eo]=xo,ua[xo].geometry[0].shift(),ua[xo].geometry[0]=Co[0].concat(ua[xo].geometry[0]),xo}function as(eo,Ki,Co){let xo=Co?Ki[0][Ki[0].length-1]:Ki[0][0];return`${eo}:${xo.x}:${xo.y}`}for(let eo=0;eo<yn.length;eo++){let Ki=yn[eo],Co=Ki.geometry,xo=Ki.text?Ki.text.toString():null;if(!xo){Xa(eo);continue}let ho=as(xo,Co),oi=as(xo,Co,!0);if(ho in Ca&&oi in Vn&&Ca[ho]!==Vn[oi]){let Ro=oo(ho,oi,Co),Io=di(ho,oi,ua[Ro].geometry);delete Vn[ho],delete Ca[oi],Ca[as(xo,ua[Io].geometry,!0)]=Io,ua[Ro].geometry=null}else ho in Ca?di(ho,oi,Co):oi in Vn?oo(ho,oi,Co):(Xa(eo),Vn[ho]=wa-1,Ca[oi]=wa-1)}return ua.filter(eo=>eo.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((yn,Vn)=>yn.sortKey-Vn.sortKey)}update(C,$,ht){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(C,$,this.layers,ht),this.icon.programConfigurations.updatePaintArrays(C,$,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,$){let ht=this.lineVertexArray.length;if(C.segment!==void 0){let Mt=C.dist($[C.segment+1]),Bt=C.dist($[C.segment]),jt={};for(let oe=C.segment+1;oe<$.length;oe++)jt[oe]={x:$[oe].x,y:$[oe].y,tileUnitDistanceFromAnchor:Mt},oe<$.length-1&&(Mt+=$[oe+1].dist($[oe]));for(let oe=C.segment||0;oe>=0;oe--)jt[oe]={x:$[oe].x,y:$[oe].y,tileUnitDistanceFromAnchor:Bt},oe>0&&(Bt+=$[oe-1].dist($[oe]));for(let oe=0;oe<$.length;oe++){let be=jt[oe];this.lineVertexArray.emplaceBack(be.x,be.y,be.tileUnitDistanceFromAnchor)}}return{lineStartIndex:ht,lineLength:this.lineVertexArray.length-ht}}addSymbols(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr){let Fr=C.indexArray,Zr=C.layoutVertexArray,en=C.segments.prepareSegment(4*$.length,Zr,Fr,this.canOverlap?jt.sortKey:void 0),yn=this.glyphOffsetArray.length,Vn=en.vertexLength,Ca=this.allowVerticalPlacement&&oe===t.ah.vertical?Math.PI/2:0,ua=jt.text&&jt.text.sections;for(let wa=0;wa<$.length;wa++){let{tl:Xa,tr:di,bl:oo,br:as,tex:eo,pixelOffsetTL:Ki,pixelOffsetBR:Co,minFontScaleX:xo,minFontScaleY:ho,glyphOffset:oi,isSDF:Ro,sectionIndex:Io}=$[wa],xs=en.vertexLength,mu=oi[1];U0(Zr,be.x,be.y,Xa.x,mu+Xa.y,eo.x,eo.y,ht,Ro,Ki.x,Ki.y,xo,ho),U0(Zr,be.x,be.y,di.x,mu+di.y,eo.x+eo.w,eo.y,ht,Ro,Co.x,Ki.y,xo,ho),U0(Zr,be.x,be.y,oo.x,mu+oo.y,eo.x,eo.y+eo.h,ht,Ro,Ki.x,Co.y,xo,ho),U0(Zr,be.x,be.y,as.x,mu+as.y,eo.x+eo.w,eo.y+eo.h,ht,Ro,Co.x,Co.y,xo,ho),fp(C.dynamicLayoutVertexArray,be,Ca),Fr.emplaceBack(xs,xs+1,xs+2),Fr.emplaceBack(xs+1,xs+2,xs+3),en.vertexLength+=4,en.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(oi[0]),wa!==$.length-1&&Io===$[wa+1].sectionIndex||C.programConfigurations.populatePaintArrays(Zr.length,jt,jt.index,{},wr,ua&&ua[Io])}C.placedSymbolArray.emplaceBack(be.x,be.y,yn,this.glyphOffsetArray.length-yn,Vn,Be,Qe,be.segment,ht?ht[0]:0,ht?ht[1]:0,Mt[0],Mt[1],oe,0,!1,0,lr)}_addCollisionDebugVertex(C,$,ht,Mt,Bt,jt){return $.emplaceBack(0,0),C.emplaceBack(ht.x,ht.y,Mt,Bt,Math.round(jt.x),Math.round(jt.y))}addCollisionDebugVertices(C,$,ht,Mt,Bt,jt,oe){let be=Bt.segments.prepareSegment(4,Bt.layoutVertexArray,Bt.indexArray),Be=be.vertexLength,Qe=Bt.layoutVertexArray,lr=Bt.collisionVertexArray,wr=oe.anchorX,Fr=oe.anchorY;this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(C,$)),this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(ht,$)),this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(ht,Mt)),this._addCollisionDebugVertex(Qe,lr,jt,wr,Fr,new o(C,Mt)),be.vertexLength+=4;let Zr=Bt.indexArray;Zr.emplaceBack(Be,Be+1),Zr.emplaceBack(Be+1,Be+2),Zr.emplaceBack(Be+2,Be+3),Zr.emplaceBack(Be+3,Be),be.primitiveLength+=4}addDebugCollisionBoxes(C,$,ht,Mt){for(let Bt=C;Bt<$;Bt++){let jt=this.collisionBoxArray.get(Bt);this.addCollisionDebugVertices(jt.x1,jt.y1,jt.x2,jt.y2,Mt?this.textCollisionBox:this.iconCollisionBox,jt.anchorPoint,ht)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new td(we,bh.members,or),this.iconCollisionBox=new td(we,bh.members,or);for(let C=0;C<this.symbolInstances.length;C++){let $=this.symbolInstances.get(C);this.addDebugCollisionBoxes($.textBoxStartIndex,$.textBoxEndIndex,$,!0),this.addDebugCollisionBoxes($.verticalTextBoxStartIndex,$.verticalTextBoxEndIndex,$,!0),this.addDebugCollisionBoxes($.iconBoxStartIndex,$.iconBoxEndIndex,$,!1),this.addDebugCollisionBoxes($.verticalIconBoxStartIndex,$.verticalIconBoxEndIndex,$,!1)}}_deserializeCollisionBoxesForSymbol(C,$,ht,Mt,Bt,jt,oe,be,Be){let Qe={};for(let lr=$;lr<ht;lr++){let wr=C.get(lr);Qe.textBox={x1:wr.x1,y1:wr.y1,x2:wr.x2,y2:wr.y2,anchorPointX:wr.anchorPointX,anchorPointY:wr.anchorPointY},Qe.textFeatureIndex=wr.featureIndex;break}for(let lr=Mt;lr<Bt;lr++){let wr=C.get(lr);Qe.verticalTextBox={x1:wr.x1,y1:wr.y1,x2:wr.x2,y2:wr.y2,anchorPointX:wr.anchorPointX,anchorPointY:wr.anchorPointY},Qe.verticalTextFeatureIndex=wr.featureIndex;break}for(let lr=jt;lr<oe;lr++){let wr=C.get(lr);Qe.iconBox={x1:wr.x1,y1:wr.y1,x2:wr.x2,y2:wr.y2,anchorPointX:wr.anchorPointX,anchorPointY:wr.anchorPointY},Qe.iconFeatureIndex=wr.featureIndex;break}for(let lr=be;lr<Be;lr++){let wr=C.get(lr);Qe.verticalIconBox={x1:wr.x1,y1:wr.y1,x2:wr.x2,y2:wr.y2,anchorPointX:wr.anchorPointX,anchorPointY:wr.anchorPointY},Qe.verticalIconFeatureIndex=wr.featureIndex;break}return Qe}deserializeCollisionBoxes(C){this.collisionArrays=[];for(let $=0;$<this.symbolInstances.length;$++){let ht=this.symbolInstances.get($);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,$){let ht=C.placedSymbolArray.get($),Mt=ht.vertexStartIndex+4*ht.numGlyphs;for(let Bt=ht.vertexStartIndex;Bt<Mt;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 $=Math.sin(C),ht=Math.cos(C),Mt=[],Bt=[],jt=[];for(let oe=0;oe<this.symbolInstances.length;++oe){jt.push(oe);let be=this.symbolInstances.get(oe);Mt.push(0|Math.round($*be.anchorX+ht*be.anchorY)),Bt.push(be.featureIndex)}return jt.sort((oe,be)=>Mt[oe]-Mt[be]||Bt[be]-Bt[oe]),jt}addToSortKeyRanges(C,$){let ht=this.sortKeyRanges[this.sortKeyRanges.length-1];ht&&ht.sortKey===$?ht.symbolInstanceEnd=C+1:this.sortKeyRanges.push({sortKey:$,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 $ of this.symbolInstanceIndexes){let ht=this.symbolInstances.get($);this.featureSortOrder.push(ht.featureIndex),[ht.rightJustifiedTextSymbolIndex,ht.centerJustifiedTextSymbolIndex,ht.leftJustifiedTextSymbolIndex].forEach((Mt,Bt,jt)=>{Mt>=0&&jt.indexOf(Mt)===Bt&&this.addIndicesForPlacedSymbol(this.text,Mt)}),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 Zd,Kd;ca("SymbolBucket",Ep,{omit:["layers","collisionBoxArray","features","compareText"]}),Ep.MAX_GLYPHS=65535,Ep.addDynamicAttributes=fp;var eg={get paint(){return Kd=Kd||new Pt({"icon-opacity":new fo(nt.paint_symbol["icon-opacity"]),"icon-color":new fo(nt.paint_symbol["icon-color"]),"icon-halo-color":new fo(nt.paint_symbol["icon-halo-color"]),"icon-halo-width":new fo(nt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new fo(nt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ui(nt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ui(nt.paint_symbol["icon-translate-anchor"]),"text-opacity":new fo(nt.paint_symbol["text-opacity"]),"text-color":new fo(nt.paint_symbol["text-color"],{runtimeType:We,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new fo(nt.paint_symbol["text-halo-color"]),"text-halo-width":new fo(nt.paint_symbol["text-halo-width"]),"text-halo-blur":new fo(nt.paint_symbol["text-halo-blur"]),"text-translate":new Ui(nt.paint_symbol["text-translate"]),"text-translate-anchor":new Ui(nt.paint_symbol["text-translate-anchor"])})},get layout(){return Zd=Zd||new Pt({"symbol-placement":new Ui(nt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ui(nt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ui(nt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new fo(nt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ui(nt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ui(nt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ui(nt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ui(nt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ui(nt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ui(nt.layout_symbol["icon-rotation-alignment"]),"icon-size":new fo(nt.layout_symbol["icon-size"]),"icon-text-fit":new Ui(nt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ui(nt.layout_symbol["icon-text-fit-padding"]),"icon-image":new fo(nt.layout_symbol["icon-image"]),"icon-rotate":new fo(nt.layout_symbol["icon-rotate"]),"icon-padding":new fo(nt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ui(nt.layout_symbol["icon-keep-upright"]),"icon-offset":new fo(nt.layout_symbol["icon-offset"]),"icon-anchor":new fo(nt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ui(nt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ui(nt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ui(nt.layout_symbol["text-rotation-alignment"]),"text-field":new fo(nt.layout_symbol["text-field"]),"text-font":new fo(nt.layout_symbol["text-font"]),"text-size":new fo(nt.layout_symbol["text-size"]),"text-max-width":new fo(nt.layout_symbol["text-max-width"]),"text-line-height":new Ui(nt.layout_symbol["text-line-height"]),"text-letter-spacing":new fo(nt.layout_symbol["text-letter-spacing"]),"text-justify":new fo(nt.layout_symbol["text-justify"]),"text-radial-offset":new fo(nt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ui(nt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new fo(nt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new fo(nt.layout_symbol["text-anchor"]),"text-max-angle":new Ui(nt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ui(nt.layout_symbol["text-writing-mode"]),"text-rotate":new fo(nt.layout_symbol["text-rotate"]),"text-padding":new Ui(nt.layout_symbol["text-padding"]),"text-keep-upright":new Ui(nt.layout_symbol["text-keep-upright"]),"text-transform":new fo(nt.layout_symbol["text-transform"]),"text-offset":new fo(nt.layout_symbol["text-offset"]),"text-allow-overlap":new Ui(nt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ui(nt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ui(nt.layout_symbol["text-ignore-placement"]),"text-optional":new Ui(nt.layout_symbol["text-optional"])})}};class ed{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 $=this.defaultValue.property.overrides;if($&&$.hasOverride(C.formattedSection))return $.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}}ca("FormatSectionOverride",ed,{omit:["defaultValue"]});class V0 extends at{constructor(C){super(C,eg)}recalculate(C,$){if(super.recalculate(C,$),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 Mt=[];for(let Bt of ht)Mt.indexOf(Bt)<0&&Mt.push(Bt);this.layout._values["text-writing-mode"]=Mt}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(C,$,ht,Mt){let Bt=this.layout.get(C).evaluate($,{},ht,Mt),jt=this._unevaluatedLayout._values[C];return jt.isDataDriven()||Gu(jt.value)||!Bt?Bt:function(oe,be){return be.replace(/{([^{}]+)}/g,(Be,Qe)=>oe&&Qe in oe?String(oe[Qe]):"")}($.properties,Bt)}createBucket(C){return new Ep(C)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let C of eg.paint.overridableProperties){if(!V0.hasPaintOverride(this.layout,C))continue;let $=this.paint.get(C),ht=new ed($),Mt=new Kl(ht,$.property.specification),Bt=null;Bt=$.value.kind==="constant"||$.value.kind==="source"?new Ou("source",Mt):new Rl("composite",Mt,$.value.zoomStops),this.paint._values[C]=new nl($.property,Bt,$.parameters)}}_handleOverridablePaintPropertyUpdate(C,$,ht){return!(!this.layout||$.isDataDriven()||ht.isDataDriven())&&V0.hasPaintOverride(this.layout,C)}static hasPaintOverride(C,$){let ht=C.get("text-field"),Mt=eg.paint.properties[$],Bt=!1,jt=oe=>{for(let be of oe)if(Mt.overrides&&Mt.overrides.hasOverride(be))return void(Bt=!0)};if(ht.value.kind==="constant"&&ht.value.value instanceof Yr)jt(ht.value.value.sections);else if(ht.value.kind==="source"){let oe=Be=>{Bt||(Be instanceof Ga&&Cn(Be.value)===er?jt(Be.value.sections):Be instanceof ts?jt(Be.sections):Be.eachChild(oe))},be=ht.value;be._styleExpression&&oe(be._styleExpression.expression)}return Bt}}let rg;var Hv={get paint(){return rg=rg||new Pt({"background-color":new Ui(nt.paint_background["background-color"]),"background-pattern":new ul(nt.paint_background["background-pattern"]),"background-opacity":new Ui(nt.paint_background["background-opacity"])})}};class Yd extends at{constructor(C){super(C,Hv)}}let H0;var ng={get paint(){return H0=H0||new Pt({"raster-opacity":new Ui(nt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ui(nt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ui(nt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ui(nt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ui(nt.paint_raster["raster-saturation"]),"raster-contrast":new Ui(nt.paint_raster["raster-contrast"]),"raster-resampling":new Ui(nt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ui(nt.paint_raster["raster-fade-duration"])})}};class b_ extends at{constructor(C){super(C,ng)}}class qv extends at{constructor(C){super(C,{}),this.onAdd=$=>{this.implementation.onAdd&&this.implementation.onAdd($,$.painter.context.gl)},this.onRemove=$=>{this.implementation.onRemove&&this.implementation.onRemove($,$.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 Xd{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 ag=63710088e-1;class Ph{constructor(C,$){if(isNaN(C)||isNaN($))throw new Error(`Invalid LngLat object: (${C}, ${$})`);if(this.lng=+C,this.lat=+$,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ph(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(C){let $=Math.PI/180,ht=this.lat*$,Mt=C.lat*$,Bt=Math.sin(ht)*Math.sin(Mt)+Math.cos(ht)*Math.cos(Mt)*Math.cos((C.lng-this.lng)*$);return ag*Math.acos(Math.min(Bt,1))}static convert(C){if(C instanceof Ph)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Ph(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Ph(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 Wv=2*Math.PI*ag;function q0(H){return Wv*Math.cos(H*Math.PI/180)}function W0(H){return(180+H)/360}function Gv(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function vh(H,C){return H/q0(C)}function ig(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class $d{constructor(C,$,ht=0){this.x=+C,this.y=+$,this.z=+ht}static fromLngLat(C,$=0){let ht=Ph.convert(C);return new $d(W0(ht.lng),Gv(ht.lat),vh($,ht.lat))}toLngLat(){return new Ph(360*this.x-180,ig(this.y))}toAltitude(){return this.z*q0(ig(this.y))}meterInMercatorCoordinateUnits(){return 1/Wv*(C=ig(this.y),1/Math.cos(C*Math.PI/180));var C}}function Zv(H,C,$){var ht=2*Math.PI*6378137/256/Math.pow(2,$);return[H*ht-2*Math.PI*6378137/2,C*ht-2*Math.PI*6378137/2]}class og{constructor(C,$,ht){if(!function(Mt,Bt,jt){return!(Mt<0||Mt>25||jt<0||jt>=Math.pow(2,Mt)||Bt<0||Bt>=Math.pow(2,Mt))}(C,$,ht))throw new Error(`x=${$}, 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=$,this.y=ht,this.key=rd(0,C,C,$,ht)}equals(C){return this.z===C.z&&this.x===C.x&&this.y===C.y}url(C,$,ht){let Mt=(jt=this.y,oe=this.z,be=Zv(256*(Bt=this.x),256*(jt=Math.pow(2,oe)-jt-1),oe),Be=Zv(256*(Bt+1),256*(jt+1),oe),be[0]+","+be[1]+","+Be[0]+","+Be[1]);var Bt,jt,oe,be,Be;let Qe=function(lr,wr,Fr){let Zr,en="";for(let yn=lr;yn>0;yn--)Zr=1<<yn-1,en+=(wr&Zr?1:0)+(Fr&Zr?2:0);return en}(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,$>1?"@2x":"").replace(/{quadkey}/g,Qe).replace(/{bbox-epsg-3857}/g,Mt)}isChildOf(C){let $=this.z-C.z;return $>0&&C.x===this.x>>$&&C.y===this.y>>$}getTilePoint(C){let $=Math.pow(2,this.z);return new o((C.x*$-this.x)*zs,(C.y*$-this.y)*zs)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Kv{constructor(C,$){this.wrap=C,this.canonical=$,this.key=rd(C,$.z,$.z,$.x,$.y)}}class ph{constructor(C,$,ht,Mt,Bt){if(C<ht)throw new Error(`overscaledZ should be >= z; overscaledZ = ${C}; z = ${ht}`);this.overscaledZ=C,this.wrap=$,this.canonical=new og(ht,+Mt,+Bt),this.key=rd($,C,ht,Mt,Bt)}clone(){return new ph(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 $=this.canonical.z-C;return C>this.canonical.z?new ph(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ph(C,this.wrap,C,this.canonical.x>>$,this.canonical.y>>$)}calculateScaledKey(C,$){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?rd(this.wrap*+$,C,this.canonical.z,this.canonical.x,this.canonical.y):rd(this.wrap*+$,C,C,this.canonical.x>>ht,this.canonical.y>>ht)}isChildOf(C){if(C.wrap!==this.wrap)return!1;let $=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ<this.overscaledZ&&C.canonical.x===this.canonical.x>>$&&C.canonical.y===this.canonical.y>>$}children(C){if(this.overscaledZ>=C)return[new ph(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let $=this.canonical.z+1,ht=2*this.canonical.x,Mt=2*this.canonical.y;return[new ph($,this.wrap,$,ht,Mt),new ph($,this.wrap,$,ht+1,Mt),new ph($,this.wrap,$,ht,Mt+1),new ph($,this.wrap,$,ht+1,Mt+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 ph(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(C){return new ph(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 Kv(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(C){return this.canonical.getTilePoint(new $d(C.x-this.wrap,C.y))}}function rd(H,C,$,ht,Mt){(H*=2)<0&&(H=-1*H-1);let Bt=1<<$;return(Bt*Bt*H+Bt*Mt+ht).toString(36)+$.toString(36)+C.toString(36)}ca("CanonicalTileID",og),ca("OverscaledTileID",ph,{omit:["posMatrix"]});class zp{constructor(C,$,ht,Mt=1,Bt=1,jt=1,oe=0){if(this.uid=C,$.height!==$.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=$.height;let be=this.dim=$.height-2;switch(this.data=new Uint32Array($.data.buffer),ht){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=Mt,this.greenFactor=Bt,this.blueFactor=jt,this.baseShift=oe;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let Be=0;Be<be;Be++)this.data[this._idx(-1,Be)]=this.data[this._idx(0,Be)],this.data[this._idx(be,Be)]=this.data[this._idx(be-1,Be)],this.data[this._idx(Be,-1)]=this.data[this._idx(Be,0)],this.data[this._idx(Be,be)]=this.data[this._idx(Be,be-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(be,-1)]=this.data[this._idx(be-1,0)],this.data[this._idx(-1,be)]=this.data[this._idx(0,be-1)],this.data[this._idx(be,be)]=this.data[this._idx(be-1,be-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let Be=0;Be<be;Be++)for(let Qe=0;Qe<be;Qe++){let lr=this.get(Be,Qe);lr>this.max&&(this.max=lr),lr<this.min&&(this.min=lr)}}get(C,$){let ht=new Uint8Array(this.data.buffer),Mt=4*this._idx(C,$);return this.unpack(ht[Mt],ht[Mt+1],ht[Mt+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(C,$){if(C<-1||C>=this.dim+1||$<-1||$>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return($+1)*this.stride+(C+1)}unpack(C,$,ht){return C*this.redFactor+$*this.greenFactor+ht*this.blueFactor-this.baseShift}getPixels(){return new rs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(C,$,ht){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");let Mt=$*this.dim,Bt=$*this.dim+this.dim,jt=ht*this.dim,oe=ht*this.dim+this.dim;switch($){case-1:Mt=Bt-1;break;case 1:Bt=Mt+1}switch(ht){case-1:jt=oe-1;break;case 1:oe=jt+1}let be=-$*this.dim,Be=-ht*this.dim;for(let Qe=jt;Qe<oe;Qe++)for(let lr=Mt;lr<Bt;lr++)this.data[this._idx(lr,Qe)]=C.data[this._idx(lr+be,Qe+Be)]}}ca("DEMData",zp);class Yv{constructor(C){this._stringToNumber={},this._numberToString=[];for(let $=0;$<C.length;$++){let ht=C[$];this._stringToNumber[ht]=$,this._numberToString[$]=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 Xv{constructor(C,$,ht,Mt,Bt){this.type="Feature",this._vectorTileFeature=C,C._z=$,C._x=ht,C._y=Mt,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 $ in this)$!=="_geometry"&&$!=="_vectorTileFeature"&&(C[$]=this[$]);return C}}class $v{constructor(C,$){this.tileID=C,this.x=C.canonical.x,this.y=C.canonical.y,this.z=C.canonical.z,this.grid=new Ba(zs,16,0),this.grid3D=new Ba(zs,16,0),this.featureIndexArray=new Us,this.promoteId=$}insert(C,$,ht,Mt,Bt,jt){let oe=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ht,Mt,Bt);let be=jt?this.grid3D:this.grid;for(let Be=0;Be<$.length;Be++){let Qe=$[Be],lr=[1/0,1/0,-1/0,-1/0];for(let wr=0;wr<Qe.length;wr++){let Fr=Qe[wr];lr[0]=Math.min(lr[0],Fr.x),lr[1]=Math.min(lr[1],Fr.y),lr[2]=Math.max(lr[2],Fr.x),lr[3]=Math.max(lr[3],Fr.y)}lr[0]<zs&&lr[1]<zs&&lr[2]>=0&&lr[3]>=0&&be.insert(oe,lr[0],lr[1],lr[2],lr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Dn.VectorTile(new Km(this.rawTileData)).layers,this.sourceLayerCoder=new Yv(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(C,$,ht,Mt){this.loadVTLayers();let Bt=C.params||{},jt=zs/C.tileSize/C.scale,oe=bc(Bt.filter),be=C.queryGeometry,Be=C.queryPadding*jt,Qe=sg(be),lr=this.grid.query(Qe.minX-Be,Qe.minY-Be,Qe.maxX+Be,Qe.maxY+Be),wr=sg(C.cameraQueryGeometry),Fr=this.grid3D.query(wr.minX-Be,wr.minY-Be,wr.maxX+Be,wr.maxY+Be,(yn,Vn,Ca,ua)=>function(wa,Xa,di,oo,as){for(let Ki of wa)if(Xa<=Ki.x&&di<=Ki.y&&oo>=Ki.x&&as>=Ki.y)return!0;let eo=[new o(Xa,di),new o(Xa,as),new o(oo,as),new o(oo,di)];if(wa.length>2){for(let Ki of eo)if(Un(wa,Ki))return!0}for(let Ki=0;Ki<wa.length-1;Ki++)if(Nr(wa[Ki],wa[Ki+1],eo))return!0;return!1}(C.cameraQueryGeometry,yn-Be,Vn-Be,Ca+Be,ua+Be));for(let yn of Fr)lr.push(yn);lr.sort(Qv);let Zr={},en;for(let yn=0;yn<lr.length;yn++){let Vn=lr[yn];if(Vn===en)continue;en=Vn;let Ca=this.featureIndexArray.get(Vn),ua=null;this.loadMatchingFeature(Zr,Ca.bucketIndex,Ca.sourceLayerIndex,Ca.featureIndex,oe,Bt.layers,Bt.availableImages,$,ht,Mt,(wa,Xa,di)=>(ua||(ua=nr(wa)),Xa.queryIntersectsFeature(be,wa,di,ua,this.z,C.transform,jt,C.pixelPosMatrix)))}return Zr}loadMatchingFeature(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr){let wr=this.bucketLayerIDs[$];if(jt&&!function(yn,Vn){for(let Ca=0;Ca<yn.length;Ca++)if(Vn.indexOf(yn[Ca])>=0)return!0;return!1}(jt,wr))return;let Fr=this.sourceLayerCoder.decode(ht),Zr=this.vtLayers[Fr].feature(Mt);if(Bt.needGeometry){let yn=cr(Zr,!0);if(!Bt.filter(new fs(this.tileID.overscaledZ),yn,this.tileID.canonical))return}else if(!Bt.filter(new fs(this.tileID.overscaledZ),Zr))return;let en=this.getId(Zr,Fr);for(let yn=0;yn<wr.length;yn++){let Vn=wr[yn];if(jt&&jt.indexOf(Vn)<0)continue;let Ca=be[Vn];if(!Ca)continue;let ua={};en&&Qe&&(ua=Qe.getState(Ca.sourceLayer||"_geojsonTileLayer",en));let wa=k({},Be[Vn]);wa.paint=Jv(wa.paint,Ca.paint,Zr,ua,oe),wa.layout=Jv(wa.layout,Ca.layout,Zr,ua,oe);let Xa=!lr||lr(Zr,Ca,ua);if(!Xa)continue;let di=new Xv(Zr,this.z,this.x,this.y,en);di.layer=wa;let oo=C[Vn];oo===void 0&&(oo=C[Vn]=[]),oo.push({featureIndex:Mt,feature:di,intersectionZ:Xa})}}lookupSymbolFeatures(C,$,ht,Mt,Bt,jt,oe,be){let Be={};this.loadVTLayers();let Qe=bc(Bt);for(let lr of C)this.loadMatchingFeature(Be,ht,Mt,lr,Qe,jt,oe,be,$);return Be}hasLayer(C){for(let $ of this.bucketLayerIDs)for(let ht of $)if(C===ht)return!0;return!1}getId(C,$){let ht=C.id;return this.promoteId&&(ht=C.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[$]],typeof ht=="boolean"&&(ht=Number(ht))),ht}}function Jv(H,C,$,ht,Mt){return T(H,(Bt,jt)=>{let oe=C instanceof Nu?C.get(jt):null;return oe&&oe.evaluate?oe.evaluate($,ht,Mt):oe})}function sg(H){let C=1/0,$=1/0,ht=-1/0,Mt=-1/0;for(let Bt of H)C=Math.min(C,Bt.x),$=Math.min($,Bt.y),ht=Math.max(ht,Bt.x),Mt=Math.max(Mt,Bt.y);return{minX:C,minY:$,maxX:ht,maxY:Mt}}function Qv(H,C){return C-H}function ty(H,C,$,ht,Mt){let Bt=[];for(let jt=0;jt<H.length;jt++){let oe=H[jt],be;for(let Be=0;Be<oe.length-1;Be++){let Qe=oe[Be],lr=oe[Be+1];Qe.x<C&&lr.x<C||(Qe.x<C?Qe=new o(C,Qe.y+(C-Qe.x)/(lr.x-Qe.x)*(lr.y-Qe.y))._round():lr.x<C&&(lr=new o(C,Qe.y+(C-Qe.x)/(lr.x-Qe.x)*(lr.y-Qe.y))._round()),Qe.y<$&&lr.y<$||(Qe.y<$?Qe=new o(Qe.x+($-Qe.y)/(lr.y-Qe.y)*(lr.x-Qe.x),$)._round():lr.y<$&&(lr=new o(Qe.x+($-Qe.y)/(lr.y-Qe.y)*(lr.x-Qe.x),$)._round()),Qe.x>=ht&&lr.x>=ht||(Qe.x>=ht?Qe=new o(ht,Qe.y+(ht-Qe.x)/(lr.x-Qe.x)*(lr.y-Qe.y))._round():lr.x>=ht&&(lr=new o(ht,Qe.y+(ht-Qe.x)/(lr.x-Qe.x)*(lr.y-Qe.y))._round()),Qe.y>=Mt&&lr.y>=Mt||(Qe.y>=Mt?Qe=new o(Qe.x+(Mt-Qe.y)/(lr.y-Qe.y)*(lr.x-Qe.x),Mt)._round():lr.y>=Mt&&(lr=new o(Qe.x+(Mt-Qe.y)/(lr.y-Qe.y)*(lr.x-Qe.x),Mt)._round()),be&&Qe.equals(be[be.length-1])||(be=[Qe],Bt.push(be)),be.push(lr)))))}}return Bt}ca("FeatureIndex",$v,{omit:["rawTileData","sourceLayerCoder"]});class hp extends o{constructor(C,$,ht,Mt){super(C,$),this.angle=ht,Mt!==void 0&&(this.segment=Mt)}clone(){return new hp(this.x,this.y,this.angle,this.segment)}}function ey(H,C,$,ht,Mt){if(C.segment===void 0||$===0)return!0;let Bt=C,jt=C.segment+1,oe=0;for(;oe>-$/2;){if(jt--,jt<0)return!1;oe-=H[jt].dist(Bt),Bt=H[jt]}oe+=H[jt].dist(H[jt+1]),jt++;let be=[],Be=0;for(;oe<$/2;){let Qe=H[jt],lr=H[jt+1];if(!lr)return!1;let wr=H[jt-1].angleTo(Qe)-Qe.angleTo(lr);for(wr=Math.abs((wr+3*Math.PI)%(2*Math.PI)-Math.PI),be.push({distance:oe,angleDelta:wr}),Be+=wr;oe-be[0].distance>ht;)Be-=be.shift().angleDelta;if(Be>Mt)return!1;jt++,oe+=Qe.dist(lr)}return!0}function ry(H){let C=0;for(let $=0;$<H.length-1;$++)C+=H[$].dist(H[$+1]);return C}function ny(H,C,$){return H?.6*C*$:0}function ay(H,C){return Math.max(H?H.right-H.left:0,C?C.right-C.left:0)}function w_(H,C,$,ht,Mt,Bt){let jt=ny($,Mt,Bt),oe=ay($,ht)*Bt,be=0,Be=ry(H)/2;for(let Qe=0;Qe<H.length-1;Qe++){let lr=H[Qe],wr=H[Qe+1],Fr=lr.dist(wr);if(be+Fr>Be){let Zr=(Be-be)/Fr,en=Ti.number(lr.x,wr.x,Zr),yn=Ti.number(lr.y,wr.y,Zr),Vn=new hp(en,yn,wr.angleTo(lr),Qe);return Vn._round(),!jt||ey(H,Vn,oe,jt,C)?Vn:void 0}be+=Fr}}function T_(H,C,$,ht,Mt,Bt,jt,oe,be){let Be=ny(ht,Bt,jt),Qe=ay(ht,Mt),lr=Qe*jt,wr=H[0].x===0||H[0].x===be||H[0].y===0||H[0].y===be;return C-lr<C/4&&(C=lr+C/4),Lp(H,wr?C/2*oe%C:(Qe/2+2*Bt)*jt*oe%C,C,Be,$,lr,wr,!1,be)}function Lp(H,C,$,ht,Mt,Bt,jt,oe,be){let Be=Bt/2,Qe=ry(H),lr=0,wr=C-$,Fr=[];for(let Zr=0;Zr<H.length-1;Zr++){let en=H[Zr],yn=H[Zr+1],Vn=en.dist(yn),Ca=yn.angleTo(en);for(;wr+$<lr+Vn;){wr+=$;let ua=(wr-lr)/Vn,wa=Ti.number(en.x,yn.x,ua),Xa=Ti.number(en.y,yn.y,ua);if(wa>=0&&wa<be&&Xa>=0&&Xa<be&&wr-Be>=0&&wr+Be<=Qe){let di=new hp(wa,Xa,Ca,Zr);di._round(),ht&&!ey(H,di,Bt,ht,Mt)||Fr.push(di)}}lr+=Vn}return oe||Fr.length||jt||(Fr=Lp(H,lr/2,$,ht,Mt,Bt,jt,!0,be)),Fr}ca("Anchor",hp);let nd=Vc;function iy(H,C,$,ht){let Mt=[],Bt=H.image,jt=Bt.pixelRatio,oe=Bt.paddedRect.w-2*nd,be=Bt.paddedRect.h-2*nd,Be={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom},Qe=Bt.stretchX||[[0,oe]],lr=Bt.stretchY||[[0,be]],wr=(oi,Ro)=>oi+Ro[1]-Ro[0],Fr=Qe.reduce(wr,0),Zr=lr.reduce(wr,0),en=oe-Fr,yn=be-Zr,Vn=0,Ca=Fr,ua=0,wa=Zr,Xa=0,di=en,oo=0,as=yn;if(Bt.content&&ht){let oi=Bt.content,Ro=oi[2]-oi[0],Io=oi[3]-oi[1];(Bt.textFitWidth||Bt.textFitHeight)&&(Be=jv(H)),Vn=ad(Qe,0,oi[0]),ua=ad(lr,0,oi[1]),Ca=ad(Qe,oi[0],oi[2]),wa=ad(lr,oi[1],oi[3]),Xa=oi[0]-Vn,oo=oi[1]-ua,di=Ro-Ca,as=Io-wa}let eo=Be.x1,Ki=Be.y1,Co=Be.x2-eo,xo=Be.y2-Ki,ho=(oi,Ro,Io,xs)=>{let mu=uh(oi.stretch-Vn,Ca,Co,eo),uu=G0(oi.fixed-Xa,di,oi.stretch,Fr),tf=uh(Ro.stretch-ua,wa,xo,Ki),Jf=G0(Ro.fixed-oo,as,Ro.stretch,Zr),Ac=uh(Io.stretch-Vn,Ca,Co,eo),Hc=G0(Io.fixed-Xa,di,Io.stretch,Fr),Bf=uh(xs.stretch-ua,wa,xo,Ki),Rf=G0(xs.fixed-oo,as,xs.stretch,Zr),Nf=new o(mu,tf),rc=new o(Ac,tf),ef=new o(Ac,Bf),zf=new o(mu,Bf),bf=new o(uu/jt,Jf/jt),jf=new o(Hc/jt,Rf/jt),ff=C*Math.PI/180;if(ff){let vl=Math.sin(ff),Vl=Math.cos(ff),eu=[Vl,-vl,vl,Vl];Nf._matMult(eu),rc._matMult(eu),zf._matMult(eu),ef._matMult(eu)}let ch=oi.stretch+oi.fixed,zu=Ro.stretch+Ro.fixed;return{tl:Nf,tr:rc,bl:zf,br:ef,tex:{x:Bt.paddedRect.x+nd+ch,y:Bt.paddedRect.y+nd+zu,w:Io.stretch+Io.fixed-ch,h:xs.stretch+xs.fixed-zu},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:bf,pixelOffsetBR:jf,minFontScaleX:di/jt/Co,minFontScaleY:as/jt/xo,isSDF:$}};if(ht&&(Bt.stretchX||Bt.stretchY)){let oi=id(Qe,en,Fr),Ro=id(lr,yn,Zr);for(let Io=0;Io<oi.length-1;Io++){let xs=oi[Io],mu=oi[Io+1];for(let uu=0;uu<Ro.length-1;uu++)Mt.push(ho(xs,Ro[uu],mu,Ro[uu+1]))}}else Mt.push(ho({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:oe+1},{fixed:0,stretch:be+1}));return Mt}function ad(H,C,$){let ht=0;for(let Mt of H)ht+=Math.max(C,Math.min($,Mt[1]))-Math.max(C,Math.min($,Mt[0]));return ht}function id(H,C,$){let ht=[{fixed:-nd,stretch:0}];for(let[Mt,Bt]of H){let jt=ht[ht.length-1];ht.push({fixed:Mt-jt.stretch,stretch:jt.stretch}),ht.push({fixed:Mt-jt.stretch,stretch:jt.stretch+(Bt-Mt)})}return ht.push({fixed:C+nd,stretch:$}),ht}function uh(H,C,$,ht){return H/C*$+ht}function G0(H,C,$,ht){return H-C*$/ht}class Z0{constructor(C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){var lr;if(this.boxStartIndex=C.length,Be){let wr=jt.top,Fr=jt.bottom,Zr=jt.collisionPadding;Zr&&(wr-=Zr[1],Fr+=Zr[3]);let en=Fr-wr;en>0&&(en=Math.max(10,en),this.circleDiameter=en)}else{let wr=!((lr=jt.image)===null||lr===void 0)&&lr.content&&(jt.image.textFitWidth||jt.image.textFitHeight)?jv(jt):{x1:jt.left,y1:jt.top,x2:jt.right,y2:jt.bottom};wr.y1=wr.y1*oe-be[0],wr.y2=wr.y2*oe+be[2],wr.x1=wr.x1*oe-be[3],wr.x2=wr.x2*oe+be[1];let Fr=jt.collisionPadding;if(Fr&&(wr.x1-=Fr[0]*oe,wr.y1-=Fr[1]*oe,wr.x2+=Fr[2]*oe,wr.y2+=Fr[3]*oe),Qe){let Zr=new o(wr.x1,wr.y1),en=new o(wr.x2,wr.y1),yn=new o(wr.x1,wr.y2),Vn=new o(wr.x2,wr.y2),Ca=Qe*Math.PI/180;Zr._rotate(Ca),en._rotate(Ca),yn._rotate(Ca),Vn._rotate(Ca),wr.x1=Math.min(Zr.x,en.x,yn.x,Vn.x),wr.x2=Math.max(Zr.x,en.x,yn.x,Vn.x),wr.y1=Math.min(Zr.y,en.y,yn.y,Vn.y),wr.y2=Math.max(Zr.y,en.y,yn.y,Vn.y)}C.emplaceBack($.x,$.y,wr.x1,wr.y1,wr.x2,wr.y2,ht,Mt,Bt)}this.boxEndIndex=C.length}}class k_{constructor(C=[],$=(ht,Mt)=>ht<Mt?-1:ht>Mt?1:0){if(this.data=C,this.length=this.data.length,this.compare=$,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],$=this.data.pop();return--this.length>0&&(this.data[0]=$,this._down(0)),C}peek(){return this.data[0]}_up(C){let{data:$,compare:ht}=this,Mt=$[C];for(;C>0;){let Bt=C-1>>1,jt=$[Bt];if(ht(Mt,jt)>=0)break;$[C]=jt,C=Bt}$[C]=Mt}_down(C){let{data:$,compare:ht}=this,Mt=this.length>>1,Bt=$[C];for(;C<Mt;){let jt=1+(C<<1),oe=jt+1;if(oe<this.length&&ht($[oe],$[jt])<0&&(jt=oe),ht($[jt],Bt)>=0)break;$[C]=$[jt],C=jt}$[C]=Bt}}function A_(H,C=1,$=!1){let ht=1/0,Mt=1/0,Bt=-1/0,jt=-1/0,oe=H[0];for(let Fr=0;Fr<oe.length;Fr++){let Zr=oe[Fr];(!Fr||Zr.x<ht)&&(ht=Zr.x),(!Fr||Zr.y<Mt)&&(Mt=Zr.y),(!Fr||Zr.x>Bt)&&(Bt=Zr.x),(!Fr||Zr.y>jt)&&(jt=Zr.y)}let be=Math.min(Bt-ht,jt-Mt),Be=be/2,Qe=new k_([],M_);if(be===0)return new o(ht,Mt);for(let Fr=ht;Fr<Bt;Fr+=be)for(let Zr=Mt;Zr<jt;Zr+=be)Qe.push(new Oh(Fr+Be,Zr+Be,Be,H));let lr=function(Fr){let Zr=0,en=0,yn=0,Vn=Fr[0];for(let Ca=0,ua=Vn.length,wa=ua-1;Ca<ua;wa=Ca++){let Xa=Vn[Ca],di=Vn[wa],oo=Xa.x*di.y-di.x*Xa.y;en+=(Xa.x+di.x)*oo,yn+=(Xa.y+di.y)*oo,Zr+=3*oo}return new Oh(en/Zr,yn/Zr,0,Fr)}(H),wr=Qe.length;for(;Qe.length;){let Fr=Qe.pop();(Fr.d>lr.d||!lr.d)&&(lr=Fr,$&&console.log("found best %d after %d probes",Math.round(1e4*Fr.d)/1e4,wr)),Fr.max-lr.d<=C||(Be=Fr.h/2,Qe.push(new Oh(Fr.p.x-Be,Fr.p.y-Be,Be,H)),Qe.push(new Oh(Fr.p.x+Be,Fr.p.y-Be,Be,H)),Qe.push(new Oh(Fr.p.x-Be,Fr.p.y+Be,Be,H)),Qe.push(new Oh(Fr.p.x+Be,Fr.p.y+Be,Be,H)),wr+=4)}return $&&(console.log(`num probes: ${wr}`),console.log(`best distance: ${lr.d}`)),lr.p}function M_(H,C){return C.max-H.max}function Oh(H,C,$,ht){this.p=new o(H,C),this.h=$,this.d=function(Mt,Bt){let jt=!1,oe=1/0;for(let be=0;be<Bt.length;be++){let Be=Bt[be];for(let Qe=0,lr=Be.length,wr=lr-1;Qe<lr;wr=Qe++){let Fr=Be[Qe],Zr=Be[wr];Fr.y>Mt.y!=Zr.y>Mt.y&&Mt.x<(Zr.x-Fr.x)*(Mt.y-Fr.y)/(Zr.y-Fr.y)+Fr.x&&(jt=!jt),oe=Math.min(oe,Va(Mt,Fr,Zr))}}return(jt?1:-1)*Math.sqrt(oe)}(this.p,ht),this.max=this.d+this.h*Math.SQRT2}var cf;t.aq=void 0,(cf=t.aq||(t.aq={}))[cf.center=1]="center",cf[cf.left=2]="left",cf[cf.right=3]="right",cf[cf.top=4]="top",cf[cf.bottom=5]="bottom",cf[cf["top-left"]=6]="top-left",cf[cf["top-right"]=7]="top-right",cf[cf["bottom-left"]=8]="bottom-left",cf[cf["bottom-right"]=9]="bottom-right";let pp=7,lg=Number.POSITIVE_INFINITY;function oy(H,C){return C[1]!==lg?function($,ht,Mt){let Bt=0,jt=0;switch(ht=Math.abs(ht),Mt=Math.abs(Mt),$){case"top-right":case"top-left":case"top":jt=Mt-pp;break;case"bottom-right":case"bottom-left":case"bottom":jt=-Mt+pp}switch($){case"top-right":case"bottom-right":case"right":Bt=-ht;break;case"top-left":case"bottom-left":case"left":Bt=ht}return[Bt,jt]}(H,C[0],C[1]):function($,ht){let Mt=0,Bt=0;ht<0&&(ht=0);let jt=ht/Math.SQRT2;switch($){case"top-right":case"top-left":Bt=jt-pp;break;case"bottom-right":case"bottom-left":Bt=-jt+pp;break;case"bottom":Bt=-ht+pp;break;case"top":Bt=ht-pp}switch($){case"top-right":case"bottom-right":Mt=-jt;break;case"top-left":case"bottom-left":Mt=jt;break;case"left":Mt=ht;break;case"right":Mt=-ht}return[Mt,Bt]}(H,C[0])}function sy(H,C,$){var ht;let Mt=H.layout,Bt=(ht=Mt.get("text-variable-anchor-offset"))===null||ht===void 0?void 0:ht.evaluate(C,{},$);if(Bt){let oe=Bt.values,be=[];for(let Be=0;Be<oe.length;Be+=2){let Qe=be[Be]=oe[Be],lr=oe[Be+1].map(wr=>wr*Ol);Qe.startsWith("top")?lr[1]-=pp:Qe.startsWith("bottom")&&(lr[1]+=pp),be[Be+1]=lr}return new Nn(be)}let jt=Mt.get("text-variable-anchor");if(jt){let oe;oe=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Mt.get("text-radial-offset").evaluate(C,{},$)*Ol,lg]:Mt.get("text-offset").evaluate(C,{},$).map(Be=>Be*Ol);let be=[];for(let Be of jt)be.push(Be,oy(Be,oe));return new Nn(be)}return null}function ug(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function S_(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe){let lr=Bt.textMaxSize.evaluate(C,{});lr===void 0&&(lr=jt);let wr=H.layers[0].layout,Fr=wr.get("icon-offset").evaluate(C,{},Qe),Zr=uy($.horizontal),en=jt/24,yn=H.tilePixelRatio*en,Vn=H.tilePixelRatio*lr/24,Ca=H.tilePixelRatio*oe,ua=H.tilePixelRatio*wr.get("symbol-spacing"),wa=wr.get("text-padding")*H.tilePixelRatio,Xa=function(oi,Ro,Io,xs=1){let mu=oi.get("icon-padding").evaluate(Ro,{},Io),uu=mu&&mu.values;return[uu[0]*xs,uu[1]*xs,uu[2]*xs,uu[3]*xs]}(wr,C,Qe,H.tilePixelRatio),di=wr.get("text-max-angle")/180*Math.PI,oo=wr.get("text-rotation-alignment")!=="viewport"&&wr.get("symbol-placement")!=="point",as=wr.get("icon-rotation-alignment")==="map"&&wr.get("symbol-placement")!=="point",eo=wr.get("symbol-placement"),Ki=ua/2,Co=wr.get("icon-text-fit"),xo;ht&&Co!=="none"&&(H.allowVerticalPlacement&&$.vertical&&(xo=Uv(ht,$.vertical,Co,wr.get("icon-text-fit-padding"),Fr,en)),Zr&&(ht=Uv(ht,Zr,Co,wr.get("icon-text-fit-padding"),Fr,en)));let ho=(oi,Ro)=>{Ro.x<0||Ro.x>=zs||Ro.y<0||Ro.y>=zs||function(Io,xs,mu,uu,tf,Jf,Ac,Hc,Bf,Rf,Nf,rc,ef,zf,bf,jf,ff,ch,zu,vl,Vl,eu,Xu,Lu,ld){let Th=Io.addToLineVertexArray(xs,mu),kh,Lf,gu,hf,yh=0,fh=0,Uf=0,mg=0,gg=-1,$0=-1,Kh={},vg=_n("");if(Io.allowVerticalPlacement&&uu.vertical){let wf=Hc.layout.get("text-rotate").evaluate(Vl,{},Lu)+90;gu=new Z0(Bf,xs,Rf,Nf,rc,uu.vertical,ef,zf,bf,wf),Ac&&(hf=new Z0(Bf,xs,Rf,Nf,rc,Ac,ff,ch,bf,wf))}if(tf){let wf=Hc.layout.get("icon-rotate").evaluate(Vl,{}),hh=Hc.layout.get("icon-text-fit")!=="none",dp=iy(tf,wf,Xu,hh),Ah=Ac?iy(Ac,wf,Xu,hh):void 0;Lf=new Z0(Bf,xs,Rf,Nf,rc,tf,ff,ch,!1,wf),yh=4*dp.length;let Cp=Io.iconSizeData,Mh=null;Cp.kind==="source"?(Mh=[Ih*Hc.layout.get("icon-size").evaluate(Vl,{})],Mh[0]>cp&&_(`${Io.layerIds[0]}: Value for "icon-size" is >= ${Gd}. Reduce your "icon-size".`)):Cp.kind==="composite"&&(Mh=[Ih*eu.compositeIconSizes[0].evaluate(Vl,{},Lu),Ih*eu.compositeIconSizes[1].evaluate(Vl,{},Lu)],(Mh[0]>cp||Mh[1]>cp)&&_(`${Io.layerIds[0]}: Value for "icon-size" is >= ${Gd}. Reduce your "icon-size".`)),Io.addSymbols(Io.icon,dp,Mh,vl,zu,Vl,t.ah.none,xs,Th.lineStartIndex,Th.lineLength,-1,Lu),gg=Io.icon.placedSymbolArray.length-1,Ah&&(fh=4*Ah.length,Io.addSymbols(Io.icon,Ah,Mh,vl,zu,Vl,t.ah.vertical,xs,Th.lineStartIndex,Th.lineLength,-1,Lu),$0=Io.icon.placedSymbolArray.length-1)}let yg=Object.keys(uu.horizontal);for(let wf of yg){let hh=uu.horizontal[wf];if(!kh){vg=_n(hh.text);let Ah=Hc.layout.get("text-rotate").evaluate(Vl,{},Lu);kh=new Z0(Bf,xs,Rf,Nf,rc,hh,ef,zf,bf,Ah)}let dp=hh.positionedLines.length===1;if(Uf+=ly(Io,xs,hh,Jf,Hc,bf,Vl,jf,Th,uu.vertical?t.ah.horizontal:t.ah.horizontalOnly,dp?yg:[wf],Kh,gg,eu,Lu),dp)break}uu.vertical&&(mg+=ly(Io,xs,uu.vertical,Jf,Hc,bf,Vl,jf,Th,t.ah.vertical,["vertical"],Kh,$0,eu,Lu));let xg=kh?kh.boxStartIndex:Io.collisionBoxArray.length,_g=kh?kh.boxEndIndex:Io.collisionBoxArray.length,E_=gu?gu.boxStartIndex:Io.collisionBoxArray.length,z_=gu?gu.boxEndIndex:Io.collisionBoxArray.length,L_=Lf?Lf.boxStartIndex:Io.collisionBoxArray.length,C_=Lf?Lf.boxEndIndex:Io.collisionBoxArray.length,dy=hf?hf.boxStartIndex:Io.collisionBoxArray.length,ud=hf?hf.boxEndIndex:Io.collisionBoxArray.length,qc=-1,cd=(wf,hh)=>wf&&wf.circleDiameter?Math.max(wf.circleDiameter,hh):hh;qc=cd(kh,qc),qc=cd(gu,qc),qc=cd(Lf,qc),qc=cd(hf,qc);let bg=qc>-1?1:0;bg&&(qc*=ld/Ol),Io.glyphOffsetArray.length>=Ep.MAX_GLYPHS&&_("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vl.sortKey!==void 0&&Io.addToSortKeyRanges(Io.symbolInstances.length,Vl.sortKey);let my=sy(Hc,Vl,Lu),[I_,gy]=function(wf,hh){let dp=wf.length,Ah=hh?.values;if(Ah?.length>0)for(let Cp=0;Cp<Ah.length;Cp+=2){let Mh=Ah[Cp+1];wf.emplaceBack(t.aq[Ah[Cp]],Mh[0],Mh[1])}return[dp,wf.length]}(Io.textAnchorOffsets,my);Io.symbolInstances.emplaceBack(xs.x,xs.y,Kh.right>=0?Kh.right:-1,Kh.center>=0?Kh.center:-1,Kh.left>=0?Kh.left:-1,Kh.vertical||-1,gg,$0,vg,xg,_g,E_,z_,L_,C_,dy,ud,Rf,Uf,mg,yh,fh,bg,0,ef,qc,I_,gy)}(H,Ro,oi,$,ht,Mt,xo,H.layers[0],H.collisionBoxArray,C.index,C.sourceLayerIndex,H.index,yn,[wa,wa,wa,wa],oo,be,Ca,Xa,as,Fr,C,Bt,Be,Qe,jt)};if(eo==="line")for(let oi of ty(C.geometry,0,0,zs,zs)){let Ro=T_(oi,ua,di,$.vertical||Zr,ht,24,Vn,H.overscaling,zs);for(let Io of Ro)Zr&&cy(H,Zr.text,Ki,Io)||ho(oi,Io)}else if(eo==="line-center"){for(let oi of C.geometry)if(oi.length>1){let Ro=w_(oi,di,$.vertical||Zr,ht,24,Vn);Ro&&ho(oi,Ro)}}else if(C.type==="Polygon")for(let oi of au(C.geometry,0)){let Ro=A_(oi,16);ho(oi[0],new hp(Ro.x,Ro.y,0))}else if(C.type==="LineString")for(let oi of C.geometry)ho(oi,new hp(oi[0].x,oi[0].y,0));else if(C.type==="Point")for(let oi of C.geometry)for(let Ro of oi)ho([Ro],new hp(Ro.x,Ro.y,0))}function ly(H,C,$,ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr){let en=function(Ca,ua,wa,Xa,di,oo,as,eo){let Ki=Xa.layout.get("text-rotate").evaluate(oo,{})*Math.PI/180,Co=[];for(let xo of ua.positionedLines)for(let ho of xo.positionedGlyphs){if(!ho.rect)continue;let oi=ho.rect||{},Ro=Xm+1,Io=!0,xs=1,mu=0,uu=(di||eo)&&ho.vertical,tf=ho.metrics.advance*ho.scale/2;if(eo&&ua.verticalizable&&(mu=xo.lineOffset/2-(ho.imageName?-(Ol-ho.metrics.width*ho.scale)/2:(ho.scale-1)*Ol)),ho.imageName){let vl=as[ho.imageName];Io=vl.sdf,xs=vl.pixelRatio,Ro=Vc/xs}let Jf=di?[ho.x+tf,ho.y]:[0,0],Ac=di?[0,0]:[ho.x+tf+wa[0],ho.y+wa[1]-mu],Hc=[0,0];uu&&(Hc=Ac,Ac=[0,0]);let Bf=ho.metrics.isDoubleResolution?2:1,Rf=(ho.metrics.left-Ro)*ho.scale-tf+Ac[0],Nf=(-ho.metrics.top-Ro)*ho.scale+Ac[1],rc=Rf+oi.w/Bf*ho.scale/xs,ef=Nf+oi.h/Bf*ho.scale/xs,zf=new o(Rf,Nf),bf=new o(rc,Nf),jf=new o(Rf,ef),ff=new o(rc,ef);if(uu){let vl=new o(-tf,tf-Jp),Vl=-Math.PI/2,eu=Ol/2-tf,Xu=new o(5-Jp-eu,-(ho.imageName?eu:0)),Lu=new o(...Hc);zf._rotateAround(Vl,vl)._add(Xu)._add(Lu),bf._rotateAround(Vl,vl)._add(Xu)._add(Lu),jf._rotateAround(Vl,vl)._add(Xu)._add(Lu),ff._rotateAround(Vl,vl)._add(Xu)._add(Lu)}if(Ki){let vl=Math.sin(Ki),Vl=Math.cos(Ki),eu=[Vl,-vl,vl,Vl];zf._matMult(eu),bf._matMult(eu),jf._matMult(eu),ff._matMult(eu)}let ch=new o(0,0),zu=new o(0,0);Co.push({tl:zf,tr:bf,bl:jf,br:ff,tex:oi,writingMode:ua.writingMode,glyphOffset:Jf,sectionIndex:ho.sectionIndex,isSDF:Io,pixelOffsetTL:ch,pixelOffsetBR:zu,minFontScaleX:0,minFontScaleY:0})}return Co}(0,$,oe,Mt,Bt,jt,ht,H.allowVerticalPlacement),yn=H.textSizeData,Vn=null;yn.kind==="source"?(Vn=[Ih*Mt.layout.get("text-size").evaluate(jt,{})],Vn[0]>cp&&_(`${H.layerIds[0]}: Value for "text-size" is >= ${Gd}. Reduce your "text-size".`)):yn.kind==="composite"&&(Vn=[Ih*Fr.compositeTextSizes[0].evaluate(jt,{},Zr),Ih*Fr.compositeTextSizes[1].evaluate(jt,{},Zr)],(Vn[0]>cp||Vn[1]>cp)&&_(`${H.layerIds[0]}: Value for "text-size" is >= ${Gd}. Reduce your "text-size".`)),H.addSymbols(H.text,en,Vn,oe,Bt,jt,Be,C,be.lineStartIndex,be.lineLength,wr,Zr);for(let Ca of Qe)lr[Ca]=H.text.placedSymbolArray.length-1;return 4*en.length}function uy(H){for(let C in H)return H[C];return null}function cy(H,C,$,ht){let Mt=H.compareText;if(C in Mt){let Bt=Mt[C];for(let jt=Bt.length-1;jt>=0;jt--)if(ht.dist(Bt[jt])<$)return!0}else Mt[C]=[];return Mt[C].push(ht),!1}let fy=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class cg{static from(C){if(!(C instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[$,ht]=new Uint8Array(C,0,2);if($!==219)throw new Error("Data does not appear to be in a KDBush format.");let Mt=ht>>4;if(Mt!==1)throw new Error(`Got v${Mt} data when expected v1.`);let Bt=fy[15&ht];if(!Bt)throw new Error("Unrecognized array type.");let[jt]=new Uint16Array(C,2,1),[oe]=new Uint32Array(C,4,1);return new cg(oe,jt,Bt,C)}constructor(C,$=64,ht=Float64Array,Mt){if(isNaN(C)||C<0)throw new Error(`Unpexpected numItems value: ${C}.`);this.numItems=+C,this.nodeSize=Math.min(Math.max(+$,2),65535),this.ArrayType=ht,this.IndexArrayType=C<65536?Uint16Array:Uint32Array;let Bt=fy.indexOf(this.ArrayType),jt=2*C*this.ArrayType.BYTES_PER_ELEMENT,oe=C*this.IndexArrayType.BYTES_PER_ELEMENT,be=(8-oe%8)%8;if(Bt<0)throw new Error(`Unexpected typed array class: ${ht}.`);Mt&&Mt instanceof ArrayBuffer?(this.data=Mt,this.ids=new this.IndexArrayType(this.data,8,C),this.coords=new this.ArrayType(this.data,8+oe+be,2*C),this._pos=2*C,this._finished=!0):(this.data=new ArrayBuffer(8+jt+oe+be),this.ids=new this.IndexArrayType(this.data,8,C),this.coords=new this.ArrayType(this.data,8+oe+be,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]=$,new Uint32Array(this.data,4,1)[0]=C)}add(C,$){let ht=this._pos>>1;return this.ids[ht]=ht,this.coords[this._pos++]=C,this.coords[this._pos++]=$,ht}finish(){let C=this._pos>>1;if(C!==this.numItems)throw new Error(`Added ${C} items when expected ${this.numItems}.`);return fg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(C,$,ht,Mt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Bt,coords:jt,nodeSize:oe}=this,be=[0,Bt.length-1,0],Be=[];for(;be.length;){let Qe=be.pop()||0,lr=be.pop()||0,wr=be.pop()||0;if(lr-wr<=oe){for(let yn=wr;yn<=lr;yn++){let Vn=jt[2*yn],Ca=jt[2*yn+1];Vn>=C&&Vn<=ht&&Ca>=$&&Ca<=Mt&&Be.push(Bt[yn])}continue}let Fr=wr+lr>>1,Zr=jt[2*Fr],en=jt[2*Fr+1];Zr>=C&&Zr<=ht&&en>=$&&en<=Mt&&Be.push(Bt[Fr]),(Qe===0?C<=Zr:$<=en)&&(be.push(wr),be.push(Fr-1),be.push(1-Qe)),(Qe===0?ht>=Zr:Mt>=en)&&(be.push(Fr+1),be.push(lr),be.push(1-Qe))}return Be}within(C,$,ht){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Mt,coords:Bt,nodeSize:jt}=this,oe=[0,Mt.length-1,0],be=[],Be=ht*ht;for(;oe.length;){let Qe=oe.pop()||0,lr=oe.pop()||0,wr=oe.pop()||0;if(lr-wr<=jt){for(let yn=wr;yn<=lr;yn++)_f(Bt[2*yn],Bt[2*yn+1],C,$)<=Be&&be.push(Mt[yn]);continue}let Fr=wr+lr>>1,Zr=Bt[2*Fr],en=Bt[2*Fr+1];_f(Zr,en,C,$)<=Be&&be.push(Mt[Fr]),(Qe===0?C-ht<=Zr:$-ht<=en)&&(oe.push(wr),oe.push(Fr-1),oe.push(1-Qe)),(Qe===0?C+ht>=Zr:$+ht>=en)&&(oe.push(Fr+1),oe.push(lr),oe.push(1-Qe))}return be}}function fg(H,C,$,ht,Mt,Bt){if(Mt-ht<=$)return;let jt=ht+Mt>>1;hy(H,C,jt,ht,Mt,Bt),fg(H,C,$,ht,jt-1,1-Bt),fg(H,C,$,jt+1,Mt,1-Bt)}function hy(H,C,$,ht,Mt,Bt){for(;Mt>ht;){if(Mt-ht>600){let Be=Mt-ht+1,Qe=$-ht+1,lr=Math.log(Be),wr=.5*Math.exp(2*lr/3),Fr=.5*Math.sqrt(lr*wr*(Be-wr)/Be)*(Qe-Be/2<0?-1:1);hy(H,C,$,Math.max(ht,Math.floor($-Qe*wr/Be+Fr)),Math.min(Mt,Math.floor($+(Be-Qe)*wr/Be+Fr)),Bt)}let jt=C[2*$+Bt],oe=ht,be=Mt;for(od(H,C,ht,$),C[2*Mt+Bt]>jt&&od(H,C,ht,Mt);oe<be;){for(od(H,C,oe,be),oe++,be--;C[2*oe+Bt]<jt;)oe++;for(;C[2*be+Bt]>jt;)be--}C[2*ht+Bt]===jt?od(H,C,ht,be):(be++,od(H,C,be,Mt)),be<=$&&(ht=be+1),$<=be&&(Mt=be-1)}}function od(H,C,$,ht){K0(H,$,ht),K0(C,2*$,2*ht),K0(C,2*$+1,2*ht+1)}function K0(H,C,$){let ht=H[C];H[C]=H[$],H[$]=ht}function _f(H,C,$,ht){let Mt=H-$,Bt=C-ht;return Mt*Mt+Bt*Bt}var hg;t.bg=void 0,(hg=t.bg||(t.bg={})).create="create",hg.load="load",hg.fullLoad="fullLoad";let Y0=null,sd=[],pg=1e3/60,X0="loadTime",dg="fullLoadTime",py={mark(H){performance.mark(H)},frame(H){let C=H;Y0!=null&&sd.push(C-Y0),Y0=C},clearMetrics(){Y0=null,sd=[],performance.clearMeasures(X0),performance.clearMeasures(dg);for(let H in t.bg)performance.clearMarks(t.bg[H])},getPerformanceMetrics(){performance.measure(X0,t.bg.create,t.bg.load),performance.measure(dg,t.bg.create,t.bg.fullLoad);let H=performance.getEntriesByName(X0)[0].duration,C=performance.getEntriesByName(dg)[0].duration,$=sd.length,ht=1/(sd.reduce((Bt,jt)=>Bt+jt,0)/$/1e3),Mt=sd.filter(Bt=>Bt>pg).reduce((Bt,jt)=>Bt+(jt-pg)/pg,0);return{loadTime:H,fullLoadTime:C,fps:ht,percentDroppedFrames:Mt/($+Mt)*100,totalFrames:$}}};t.$=class extends hr{},t.A=Rn,t.B=Ta,t.C=function(H){if(D==null){let C=H.navigator?H.navigator.userAgent:null;D=!!H.safari||!(!C||!(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return D},t.D=Ui,t.E=it,t.F=class{constructor(H,C){this.target=H,this.mapId=C,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Xd(()=>this.process()),this.subscription=function($,ht,Mt,Bt){return $.addEventListener(ht,Mt,!1),{unsubscribe:()=>{$.removeEventListener(ht,Mt,!1)}}}(this.target,"message",$=>this.receive($)),this.globalScope=L(self)?H:window}registerMessageHandler(H,C){this.messageHandlers[H]=C}sendAsync(H,C){return new Promise(($,ht)=>{let Mt=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Mt]={resolve:$,reject:ht},C&&C.signal.addEventListener("abort",()=>{delete this.resolveRejects[Mt];let oe={id:Mt,type:"<cancel>",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(oe)},{once:!0});let Bt=[],jt=Object.assign(Object.assign({},H),{id:Mt,sourceMapId:this.mapId,origin:location.origin,data:Wi(H.data,Bt)});this.target.postMessage(jt,{transfer:Bt})})}receive(H){let C=H.data,$=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[$];let ht=this.abortControllers[$];return delete this.abortControllers[$],void(ht&&ht.abort())}if(L(self)||C.mustQueue)return this.tasks[$]=C,this.taskQueue.push($),void this.invoker.trigger();this.processTask($,C)}}process(){if(this.taskQueue.length===0)return;let H=this.taskQueue.shift(),C=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),C&&this.processTask(H,C)}processTask(H,C){return e(this,void 0,void 0,function*(){if(C.type==="<response>"){let Mt=this.resolveRejects[H];return delete this.resolveRejects[H],Mt?void(C.error?Mt.reject(Xi(C.error)):Mt.resolve(Xi(C.data))):void 0}if(!this.messageHandlers[C.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${C.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let $=Xi(C.data),ht=new AbortController;this.abortControllers[H]=ht;try{let Mt=yield this.messageHandlers[C.type](C.sourceMapId,$,ht);this.completeTask(H,null,Mt)}catch(Mt){this.completeTask(H,Mt)}})}completeTask(H,C,$){let ht=[];delete this.abortControllers[H];let Mt={id:H,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:C?Wi(C):null,data:Wi($,ht)};this.target.postMessage(Mt,{transfer:ht})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=st,t.H=function(){var H=new Rn(16);return Rn!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},t.I=xf,t.J=function(H,C,$){var ht,Mt,Bt,jt,oe,be,Be,Qe,lr,wr,Fr,Zr,en=$[0],yn=$[1],Vn=$[2];return C===H?(H[12]=C[0]*en+C[4]*yn+C[8]*Vn+C[12],H[13]=C[1]*en+C[5]*yn+C[9]*Vn+C[13],H[14]=C[2]*en+C[6]*yn+C[10]*Vn+C[14],H[15]=C[3]*en+C[7]*yn+C[11]*Vn+C[15]):(Mt=C[1],Bt=C[2],jt=C[3],oe=C[4],be=C[5],Be=C[6],Qe=C[7],lr=C[8],wr=C[9],Fr=C[10],Zr=C[11],H[0]=ht=C[0],H[1]=Mt,H[2]=Bt,H[3]=jt,H[4]=oe,H[5]=be,H[6]=Be,H[7]=Qe,H[8]=lr,H[9]=wr,H[10]=Fr,H[11]=Zr,H[12]=ht*en+oe*yn+lr*Vn+C[12],H[13]=Mt*en+be*yn+wr*Vn+C[13],H[14]=Bt*en+Be*yn+Fr*Vn+C[14],H[15]=jt*en+Qe*yn+Zr*Vn+C[15]),H},t.K=function(H,C,$){var ht=$[0],Mt=$[1],Bt=$[2];return H[0]=C[0]*ht,H[1]=C[1]*ht,H[2]=C[2]*ht,H[3]=C[3]*ht,H[4]=C[4]*Mt,H[5]=C[5]*Mt,H[6]=C[6]*Mt,H[7]=C[7]*Mt,H[8]=C[8]*Bt,H[9]=C[9]*Bt,H[10]=C[10]*Bt,H[11]=C[11]*Bt,H[12]=C[12],H[13]=C[13],H[14]=C[14],H[15]=C[15],H},t.L=Pa,t.M=function(H,C){let $={};for(let ht=0;ht<C.length;ht++){let Mt=C[ht];Mt in H&&($[Mt]=H[Mt])}return $},t.N=Ph,t.O=W0,t.P=o,t.Q=Gv,t.R=rs,t.S=ph,t.T=jl,t.U=m,t.V=w,t.W=I,t.X=zs,t.Y=le,t.Z=$d,t._=e,t.a=rt,t.a$=function(H,C){var $=H[0],ht=H[1],Mt=H[2],Bt=H[3],jt=H[4],oe=H[5],be=H[6],Be=H[7],Qe=H[8],lr=H[9],wr=H[10],Fr=H[11],Zr=H[12],en=H[13],yn=H[14],Vn=H[15],Ca=C[0],ua=C[1],wa=C[2],Xa=C[3],di=C[4],oo=C[5],as=C[6],eo=C[7],Ki=C[8],Co=C[9],xo=C[10],ho=C[11],oi=C[12],Ro=C[13],Io=C[14],xs=C[15];return Math.abs($-Ca)<=qa*Math.max(1,Math.abs($),Math.abs(Ca))&&Math.abs(ht-ua)<=qa*Math.max(1,Math.abs(ht),Math.abs(ua))&&Math.abs(Mt-wa)<=qa*Math.max(1,Math.abs(Mt),Math.abs(wa))&&Math.abs(Bt-Xa)<=qa*Math.max(1,Math.abs(Bt),Math.abs(Xa))&&Math.abs(jt-di)<=qa*Math.max(1,Math.abs(jt),Math.abs(di))&&Math.abs(oe-oo)<=qa*Math.max(1,Math.abs(oe),Math.abs(oo))&&Math.abs(be-as)<=qa*Math.max(1,Math.abs(be),Math.abs(as))&&Math.abs(Be-eo)<=qa*Math.max(1,Math.abs(Be),Math.abs(eo))&&Math.abs(Qe-Ki)<=qa*Math.max(1,Math.abs(Qe),Math.abs(Ki))&&Math.abs(lr-Co)<=qa*Math.max(1,Math.abs(lr),Math.abs(Co))&&Math.abs(wr-xo)<=qa*Math.max(1,Math.abs(wr),Math.abs(xo))&&Math.abs(Fr-ho)<=qa*Math.max(1,Math.abs(Fr),Math.abs(ho))&&Math.abs(Zr-oi)<=qa*Math.max(1,Math.abs(Zr),Math.abs(oi))&&Math.abs(en-Ro)<=qa*Math.max(1,Math.abs(en),Math.abs(Ro))&&Math.abs(yn-Io)<=qa*Math.max(1,Math.abs(yn),Math.abs(Io))&&Math.abs(Vn-xs)<=qa*Math.max(1,Math.abs(Vn),Math.abs(xs))},t.a0=Wr,t.a1=og,t.a2=bt,t.a3=H=>{let C=window.document.createElement("video");return C.muted=!0,new Promise($=>{C.onloadstart=()=>{$(C)};for(let ht of H){let Mt=window.document.createElement("source");X(ht)||(C.crossOrigin="Anonymous"),Mt.src=ht,C.appendChild(Mt)}})},t.a4=function(){return M++},t.a5=La,t.a6=Ep,t.a7=bc,t.a8=cr,t.a9=Xv,t.aA=function(H){if(H.type==="custom")return new qv(H);switch(H.type){case"background":return new Yd(H);case"circle":return new Sa(H);case"fill":return new On(H);case"fill-extrusion":return new Zf(H);case"heatmap":return new Zo(H);case"hillshade":return new Cl(H);case"line":return new Tp(H);case"raster":return new b_(H);case"symbol":return new V0(H)}},t.aB=h,t.aC=function(H,C){if(!H)return[{command:"setStyle",args:[C]}];let $=[];try{if(!wt(H.version,C.version))return[{command:"setStyle",args:[C]}];wt(H.center,C.center)||$.push({command:"setCenter",args:[C.center]}),wt(H.zoom,C.zoom)||$.push({command:"setZoom",args:[C.zoom]}),wt(H.bearing,C.bearing)||$.push({command:"setBearing",args:[C.bearing]}),wt(H.pitch,C.pitch)||$.push({command:"setPitch",args:[C.pitch]}),wt(H.sprite,C.sprite)||$.push({command:"setSprite",args:[C.sprite]}),wt(H.glyphs,C.glyphs)||$.push({command:"setGlyphs",args:[C.glyphs]}),wt(H.transition,C.transition)||$.push({command:"setTransition",args:[C.transition]}),wt(H.light,C.light)||$.push({command:"setLight",args:[C.light]}),wt(H.terrain,C.terrain)||$.push({command:"setTerrain",args:[C.terrain]}),wt(H.sky,C.sky)||$.push({command:"setSky",args:[C.sky]}),wt(H.projection,C.projection)||$.push({command:"setProjection",args:[C.projection]});let ht={},Mt=[];(function(jt,oe,be,Be){let Qe;for(Qe in oe=oe||{},jt=jt||{})Object.prototype.hasOwnProperty.call(jt,Qe)&&(Object.prototype.hasOwnProperty.call(oe,Qe)||Nt(Qe,be,Be));for(Qe in oe)Object.prototype.hasOwnProperty.call(oe,Qe)&&(Object.prototype.hasOwnProperty.call(jt,Qe)?wt(jt[Qe],oe[Qe])||(jt[Qe].type==="geojson"&&oe[Qe].type==="geojson"&&Jt(jt,oe,Qe)?It(be,{command:"setGeoJSONSourceData",args:[Qe,oe[Qe].data]}):ee(Qe,oe,be,Be)):Ct(Qe,oe,be))})(H.sources,C.sources,Mt,ht);let Bt=[];H.layers&&H.layers.forEach(jt=>{"source"in jt&&ht[jt.source]?$.push({command:"removeLayer",args:[jt.id]}):Bt.push(jt)}),$=$.concat(Mt),function(jt,oe,be){oe=oe||[];let Be=(jt=jt||[]).map(Kt),Qe=oe.map(Kt),lr=jt.reduce(mt,{}),wr=oe.reduce(mt,{}),Fr=Be.slice(),Zr=Object.create(null),en,yn,Vn,Ca,ua;for(let wa=0,Xa=0;wa<Be.length;wa++)en=Be[wa],Object.prototype.hasOwnProperty.call(wr,en)?Xa++:(It(be,{command:"removeLayer",args:[en]}),Fr.splice(Fr.indexOf(en,Xa),1));for(let wa=0,Xa=0;wa<Qe.length;wa++)en=Qe[Qe.length-1-wa],Fr[Fr.length-1-wa]!==en&&(Object.prototype.hasOwnProperty.call(lr,en)?(It(be,{command:"removeLayer",args:[en]}),Fr.splice(Fr.lastIndexOf(en,Fr.length-Xa),1)):Xa++,Ca=Fr[Fr.length-wa],It(be,{command:"addLayer",args:[wr[en],Ca]}),Fr.splice(Fr.length-wa,0,en),Zr[en]=!0);for(let wa=0;wa<Qe.length;wa++)if(en=Qe[wa],yn=lr[en],Vn=wr[en],!Zr[en]&&!wt(yn,Vn))if(wt(yn.source,Vn.source)&&wt(yn["source-layer"],Vn["source-layer"])&&wt(yn.type,Vn.type)){for(ua in te(yn.layout,Vn.layout,be,en,null,"setLayoutProperty"),te(yn.paint,Vn.paint,be,en,null,"setPaintProperty"),wt(yn.filter,Vn.filter)||It(be,{command:"setFilter",args:[en,Vn.filter]}),wt(yn.minzoom,Vn.minzoom)&&wt(yn.maxzoom,Vn.maxzoom)||It(be,{command:"setLayerZoomRange",args:[en,Vn.minzoom,Vn.maxzoom]}),yn)Object.prototype.hasOwnProperty.call(yn,ua)&&ua!=="layout"&&ua!=="paint"&&ua!=="filter"&&ua!=="metadata"&&ua!=="minzoom"&&ua!=="maxzoom"&&(ua.indexOf("paint.")===0?te(yn[ua],Vn[ua],be,en,ua.slice(6),"setPaintProperty"):wt(yn[ua],Vn[ua])||It(be,{command:"setLayerProperty",args:[en,ua,Vn[ua]]}));for(ua in Vn)Object.prototype.hasOwnProperty.call(Vn,ua)&&!Object.prototype.hasOwnProperty.call(yn,ua)&&ua!=="layout"&&ua!=="paint"&&ua!=="filter"&&ua!=="metadata"&&ua!=="minzoom"&&ua!=="maxzoom"&&(ua.indexOf("paint.")===0?te(yn[ua],Vn[ua],be,en,ua.slice(6),"setPaintProperty"):wt(yn[ua],Vn[ua])||It(be,{command:"setLayerProperty",args:[en,ua,Vn[ua]]}))}else It(be,{command:"removeLayer",args:[en]}),Ca=Fr[Fr.lastIndexOf(en)+1],It(be,{command:"addLayer",args:[Vn,Ca]})}(Bt,C.layers,$)}catch(ht){console.warn("Unable to compute style diff:",ht),$=[{command:"setStyle",args:[C]}]}return $},t.aD=function(H){let C=[],$=H.id;return $===void 0&&C.push({message:`layers.${$}: missing required property "id"`}),H.render===void 0&&C.push({message:`layers.${$}: missing required method "render"`}),H.renderingMode&&H.renderingMode!=="2d"&&H.renderingMode!=="3d"&&C.push({message:`layers.${$}: property "renderingMode" must be either "2d" or "3d"`}),C},t.aE=function H(C,$){if(Array.isArray(C)){if(!Array.isArray($)||C.length!==$.length)return!1;for(let ht=0;ht<C.length;ht++)if(!H(C[ht],$[ht]))return!1;return!0}if(typeof C=="object"&&C!==null&&$!==null){if(typeof $!="object"||Object.keys(C).length!==Object.keys($).length)return!1;for(let ht in C)if(!H(C[ht],$[ht]))return!1;return!0}return C===$},t.aF=T,t.aG=c,t.aH=class extends ki{constructor(H,C){super(H,C),this.current=0}set(H){this.current!==H&&(this.current=H,this.gl.uniform1i(this.location,H))}},t.aI=zi,t.aJ=class extends ki{constructor(H,C){super(H,C),this.current=Ji}set(H){if(H[12]!==this.current[12]||H[0]!==this.current[0])return this.current=H,void this.gl.uniformMatrix4fv(this.location,!1,H);for(let C=1;C<16;C++)if(H[C]!==this.current[C]){this.current=H,this.gl.uniformMatrix4fv(this.location,!1,H);break}}},t.aK=jo,t.aL=Ii,t.aM=tr,t.aN=class extends ki{constructor(H,C){super(H,C),this.current=[0,0,0]}set(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]))}},t.aO=class extends ki{constructor(H,C){super(H,C),this.current=[0,0]}set(H){H[0]===this.current[0]&&H[1]===this.current[1]||(this.current=H,this.gl.uniform2f(this.location,H[0],H[1]))}},t.aP=function(H,C,$,ht,Mt,Bt,jt){var oe=1/(C-$),be=1/(ht-Mt),Be=1/(Bt-jt);return H[0]=-2*oe,H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=-2*be,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=2*Be,H[11]=0,H[12]=(C+$)*oe,H[13]=(Mt+ht)*be,H[14]=(jt+Bt)*Be,H[15]=1,H},t.aQ=aa,t.aR=class extends ze{},t.aS=kp,t.aT=class extends fr{},t.aU=Zs,t.aV=function(H){return H<=1?1:Math.pow(2,Math.ceil(Math.log(H)/Math.LN2))},t.aW=Zi,t.aX=To,t.aY=je,t.aZ=class extends Jn{},t.a_=function(H,C){return H[0]===C[0]&&H[1]===C[1]&&H[2]===C[2]&&H[3]===C[3]&&H[4]===C[4]&&H[5]===C[5]&&H[6]===C[6]&&H[7]===C[7]&&H[8]===C[8]&&H[9]===C[9]&&H[10]===C[10]&&H[11]===C[11]&&H[12]===C[12]&&H[13]===C[13]&&H[14]===C[14]&&H[15]===C[15]},t.aa=function(H){let C={};if(H.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,($,ht,Mt,Bt)=>{let jt=Mt||Bt;return C[ht]=!jt||jt.toLowerCase(),""}),C["max-age"]){let $=parseInt(C["max-age"],10);isNaN($)?delete C["max-age"]:C["max-age"]=$}return C},t.ab=function(H,C){let $=[];for(let ht in H)ht in C||$.push(ht);return $},t.ac=y,t.ad=function(H,C,$){var ht=Math.sin($),Mt=Math.cos($),Bt=C[0],jt=C[1],oe=C[2],be=C[3],Be=C[4],Qe=C[5],lr=C[6],wr=C[7];return C!==H&&(H[8]=C[8],H[9]=C[9],H[10]=C[10],H[11]=C[11],H[12]=C[12],H[13]=C[13],H[14]=C[14],H[15]=C[15]),H[0]=Bt*Mt+Be*ht,H[1]=jt*Mt+Qe*ht,H[2]=oe*Mt+lr*ht,H[3]=be*Mt+wr*ht,H[4]=Be*Mt-Bt*ht,H[5]=Qe*Mt-jt*ht,H[6]=lr*Mt-oe*ht,H[7]=wr*Mt-be*ht,H},t.ae=function(H){var C=new Rn(16);return C[0]=H[0],C[1]=H[1],C[2]=H[2],C[3]=H[3],C[4]=H[4],C[5]=H[5],C[6]=H[6],C[7]=H[7],C[8]=H[8],C[9]=H[9],C[10]=H[10],C[11]=H[11],C[12]=H[12],C[13]=H[13],C[14]=H[14],C[15]=H[15],C},t.af=oa,t.ag=function(H,C){let $=0,ht=0;if(H.kind==="constant")ht=H.layoutSize;else if(H.kind!=="source"){let{interpolationType:Mt,minZoom:Bt,maxZoom:jt}=H,oe=Mt?y(Ra.interpolationFactor(Mt,C,Bt,jt),0,1):0;H.kind==="camera"?ht=Ti.number(H.minSize,H.maxSize,oe):$=oe}return{uSizeT:$,uSize:ht}},t.ai=function(H,{uSize:C,uSizeT:$},{lowerSize:ht,upperSize:Mt}){return H.kind==="source"?ht/Ih:H.kind==="composite"?Ti.number(ht/Ih,Mt/Ih,$):C},t.aj=fp,t.ak=function(H,C,$,ht){let Mt=C.y-H.y,Bt=C.x-H.x,jt=ht.y-$.y,oe=ht.x-$.x,be=jt*Bt-oe*Mt;if(be===0)return null;let Be=(oe*(H.y-$.y)-jt*(H.x-$.x))/be;return new o(H.x+Be*Bt,H.y+Be*Mt)},t.al=ty,t.am=Tn,t.an=An,t.ao=function(H){let C=1/0,$=1/0,ht=-1/0,Mt=-1/0;for(let Bt of H)C=Math.min(C,Bt.x),$=Math.min($,Bt.y),ht=Math.max(ht,Bt.x),Mt=Math.max(Mt,Bt.y);return[C,$,ht,Mt]},t.ap=Ol,t.ar=Qm,t.as=function(H,C){var $=C[0],ht=C[1],Mt=C[2],Bt=C[3],jt=C[4],oe=C[5],be=C[6],Be=C[7],Qe=C[8],lr=C[9],wr=C[10],Fr=C[11],Zr=C[12],en=C[13],yn=C[14],Vn=C[15],Ca=$*oe-ht*jt,ua=$*be-Mt*jt,wa=$*Be-Bt*jt,Xa=ht*be-Mt*oe,di=ht*Be-Bt*oe,oo=Mt*Be-Bt*be,as=Qe*en-lr*Zr,eo=Qe*yn-wr*Zr,Ki=Qe*Vn-Fr*Zr,Co=lr*yn-wr*en,xo=lr*Vn-Fr*en,ho=wr*Vn-Fr*yn,oi=Ca*ho-ua*xo+wa*Co+Xa*Ki-di*eo+oo*as;return oi?(H[0]=(oe*ho-be*xo+Be*Co)*(oi=1/oi),H[1]=(Mt*xo-ht*ho-Bt*Co)*oi,H[2]=(en*oo-yn*di+Vn*Xa)*oi,H[3]=(wr*di-lr*oo-Fr*Xa)*oi,H[4]=(be*Ki-jt*ho-Be*eo)*oi,H[5]=($*ho-Mt*Ki+Bt*eo)*oi,H[6]=(yn*wa-Zr*oo-Vn*ua)*oi,H[7]=(Qe*oo-wr*wa+Fr*ua)*oi,H[8]=(jt*xo-oe*Ki+Be*as)*oi,H[9]=(ht*Ki-$*xo-Bt*as)*oi,H[10]=(Zr*di-en*wa+Vn*Ca)*oi,H[11]=(lr*wa-Qe*di-Fr*Ca)*oi,H[12]=(oe*eo-jt*Co-be*as)*oi,H[13]=($*Co-ht*eo+Mt*as)*oi,H[14]=(en*ua-Zr*Xa-yn*Ca)*oi,H[15]=(Qe*Xa-lr*ua+wr*Ca)*oi,H):null},t.at=ug,t.au=Jm,t.av=cg,t.aw=function(){let H={},C=nt.$version;for(let $ in nt.$root){let ht=nt.$root[$];if(ht.required){let Mt=null;Mt=$==="version"?C:ht.type==="array"?[]:{},Mt!=null&&(H[$]=Mt)}}return H},t.ax=ni,t.ay=K,t.az=function(H){H=H.slice();let C=Object.create(null);for(let $=0;$<H.length;$++)C[H[$].id]=H[$];for(let $=0;$<H.length;$++)"ref"in H[$]&&(H[$]=Tt(H[$],C[H[$].ref]));return H},t.b=B,t.b0=function(H,C){return H[0]=C[0],H[1]=C[1],H[2]=C[2],H[3]=C[3],H[4]=C[4],H[5]=C[5],H[6]=C[6],H[7]=C[7],H[8]=C[8],H[9]=C[9],H[10]=C[10],H[11]=C[11],H[12]=C[12],H[13]=C[13],H[14]=C[14],H[15]=C[15],H},t.b1=function(H,C,$){return H[0]=C[0]*$[0],H[1]=C[1]*$[1],H[2]=C[2]*$[2],H[3]=C[3]*$[3],H},t.b2=function(H,C){return H[0]*C[0]+H[1]*C[1]+H[2]*C[2]+H[3]*C[3]},t.b3=S,t.b4=Kv,t.b5=vh,t.b6=function(H,C,$,ht,Mt){var Bt,jt=1/Math.tan(C/2);return H[0]=jt/$,H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=jt,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=-1,H[12]=0,H[13]=0,H[15]=0,Mt!=null&&Mt!==1/0?(H[10]=(Mt+ht)*(Bt=1/(ht-Mt)),H[14]=2*Mt*ht*Bt):(H[10]=-1,H[14]=-2*ht),H},t.b7=function(H,C,$){var ht=Math.sin($),Mt=Math.cos($),Bt=C[4],jt=C[5],oe=C[6],be=C[7],Be=C[8],Qe=C[9],lr=C[10],wr=C[11];return C!==H&&(H[0]=C[0],H[1]=C[1],H[2]=C[2],H[3]=C[3],H[12]=C[12],H[13]=C[13],H[14]=C[14],H[15]=C[15]),H[4]=Bt*Mt+Be*ht,H[5]=jt*Mt+Qe*ht,H[6]=oe*Mt+lr*ht,H[7]=be*Mt+wr*ht,H[8]=Be*Mt-Bt*ht,H[9]=Qe*Mt-jt*ht,H[10]=lr*Mt-oe*ht,H[11]=wr*Mt-be*ht,H},t.b8=l,t.b9=x,t.bA=Ap,t.bB=function(H){return H.message===j},t.bC=Bs,t.bD=ws,t.ba=function(H){return H*Math.PI/180},t.bb=function(H,C){let{x:$,y:ht}=$d.fromLngLat(C);return!(H<0||H>25||ht<0||ht>=1||$<0||$>=1)},t.bc=function(H,C){return H[0]=C[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=C[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=C[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},t.bd=class extends $e{},t.be=ag,t.bf=py,t.bh=et,t.bi=function(H,C){rt.REGISTERED_PROTOCOLS[H]=C},t.bj=function(H){delete rt.REGISTERED_PROTOCOLS[H]},t.bk=function(H,C){let $={};for(let Mt=0;Mt<H.length;Mt++){let Bt=C&&C[H[Mt].id]||Tc(H[Mt]);C&&(C[H[Mt].id]=Bt);let jt=$[Bt];jt||(jt=$[Bt]=[]),jt.push(H[Mt])}let ht=[];for(let Mt in $)ht.push($[Mt]);return ht},t.bl=ca,t.bm=Yv,t.bn=$v,t.bo=Rv,t.bp=function(H){H.bucket.createArrays(),H.bucket.tilePixelRatio=zs/(512*H.bucket.overscaling),H.bucket.compareText={},H.bucket.iconsNeedLinear=!1;let C=H.bucket.layers[0],$=C.layout,ht=C._unevaluatedLayout._values,Mt={layoutIconSize:ht["icon-size"].possiblyEvaluate(new fs(H.bucket.zoom+1),H.canonical),layoutTextSize:ht["text-size"].possiblyEvaluate(new fs(H.bucket.zoom+1),H.canonical),textMaxSize:ht["text-size"].possiblyEvaluate(new fs(18))};if(H.bucket.textSizeData.kind==="composite"){let{minZoom:Be,maxZoom:Qe}=H.bucket.textSizeData;Mt.compositeTextSizes=[ht["text-size"].possiblyEvaluate(new fs(Be),H.canonical),ht["text-size"].possiblyEvaluate(new fs(Qe),H.canonical)]}if(H.bucket.iconSizeData.kind==="composite"){let{minZoom:Be,maxZoom:Qe}=H.bucket.iconSizeData;Mt.compositeIconSizes=[ht["icon-size"].possiblyEvaluate(new fs(Be),H.canonical),ht["icon-size"].possiblyEvaluate(new fs(Qe),H.canonical)]}let Bt=$.get("text-line-height")*Ol,jt=$.get("text-rotation-alignment")!=="viewport"&&$.get("symbol-placement")!=="point",oe=$.get("text-keep-upright"),be=$.get("text-size");for(let Be of H.bucket.features){let Qe=$.get("text-font").evaluate(Be,{},H.canonical).join(","),lr=be.evaluate(Be,{},H.canonical),wr=Mt.layoutTextSize.evaluate(Be,{},H.canonical),Fr=Mt.layoutIconSize.evaluate(Be,{},H.canonical),Zr={horizontal:{},vertical:void 0},en=Be.text,yn,Vn=[0,0];if(en){let wa=en.toString(),Xa=$.get("text-letter-spacing").evaluate(Be,{},H.canonical)*Ol,di=Do(wa)?Xa:0,oo=$.get("text-anchor").evaluate(Be,{},H.canonical),as=sy(C,Be,H.canonical);if(!as){let xo=$.get("text-radial-offset").evaluate(Be,{},H.canonical);Vn=xo?oy(oo,[xo*Ol,lg]):$.get("text-offset").evaluate(Be,{},H.canonical).map(ho=>ho*Ol)}let eo=jt?"center":$.get("text-justify").evaluate(Be,{},H.canonical),Ki=$.get("symbol-placement")==="point"?$.get("text-max-width").evaluate(Be,{},H.canonical)*Ol:1/0,Co=()=>{H.bucket.allowVerticalPlacement&&$i(wa)&&(Zr.vertical=B0(en,H.glyphMap,H.glyphPositions,H.imagePositions,Qe,Ki,Bt,oo,"left",di,Vn,t.ah.vertical,!0,wr,lr))};if(!jt&&as){let xo=new Set;if(eo==="auto")for(let oi=0;oi<as.values.length;oi+=2)xo.add(ug(as.values[oi]));else xo.add(eo);let ho=!1;for(let oi of xo)if(!Zr.horizontal[oi])if(ho)Zr.horizontal[oi]=Zr.horizontal[0];else{let Ro=B0(en,H.glyphMap,H.glyphPositions,H.imagePositions,Qe,Ki,Bt,"center",oi,di,Vn,t.ah.horizontal,!1,wr,lr);Ro&&(Zr.horizontal[oi]=Ro,ho=Ro.positionedLines.length===1)}Co()}else{eo==="auto"&&(eo=ug(oo));let xo=B0(en,H.glyphMap,H.glyphPositions,H.imagePositions,Qe,Ki,Bt,oo,eo,di,Vn,t.ah.horizontal,!1,wr,lr);xo&&(Zr.horizontal[eo]=xo),Co(),$i(wa)&&jt&&oe&&(Zr.vertical=B0(en,H.glyphMap,H.glyphPositions,H.imagePositions,Qe,Ki,Bt,oo,eo,di,Vn,t.ah.vertical,!1,wr,lr))}}let Ca=!1;if(Be.icon&&Be.icon.name){let wa=H.imageMap[Be.icon.name];wa&&(yn=y_(H.imagePositions[Be.icon.name],$.get("icon-offset").evaluate(Be,{},H.canonical),$.get("icon-anchor").evaluate(Be,{},H.canonical)),Ca=!!wa.sdf,H.bucket.sdfIcons===void 0?H.bucket.sdfIcons=Ca:H.bucket.sdfIcons!==Ca&&_("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(wa.pixelRatio!==H.bucket.pixelRatio||$.get("icon-rotate").constantOr(1)!==0)&&(H.bucket.iconsNeedLinear=!0))}let ua=uy(Zr.horizontal)||Zr.vertical;H.bucket.iconsInText=!!ua&&ua.iconsInText,(ua||yn)&&S_(H.bucket,Be,Zr,yn,H.imageMap,Mt,wr,Fr,Vn,Ca,H.canonical)}H.showCollisionBoxes&&H.bucket.generateCollisionDebugBuffers()},t.bq=Ef,t.br=Le,t.bs=Xs,t.bt=Dn,t.bu=Km,t.bv=class{constructor(H){this._marks={start:[H.url,"start"].join("#"),end:[H.url,"end"].join("#"),measure:H.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let H=performance.getEntriesByName(this._marks.measure);return H.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),H=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),H}},t.bw=function(H,C,$,ht,Mt){return e(this,void 0,void 0,function*(){if(w())try{return yield I(H,C,$,ht,Mt)}catch{}return function(Bt,jt,oe,be,Be){let Qe=Bt.width,lr=Bt.height;F&&N||(F=new OffscreenCanvas(Qe,lr),N=F.getContext("2d",{willReadFrequently:!0})),F.width=Qe,F.height=lr,N.drawImage(Bt,0,0,Qe,lr);let wr=N.getImageData(jt,oe,be,Be);return N.clearRect(0,0,Qe,lr),wr.data}(H,C,$,ht,Mt)})},t.bx=zp,t.by=r,t.bz=i,t.c=G,t.d=H=>e(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));let C=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(C)}catch($){throw new Error(`Could not load image because of ${$.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=k,t.f=H=>new Promise((C,$)=>{let ht=new Image;ht.onload=()=>{C(ht),URL.revokeObjectURL(ht.src),ht.onload=null,window.requestAnimationFrame(()=>{ht.src=R})},ht.onerror=()=>$(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 Mt=new Blob([new Uint8Array(H)],{type:"image/png"});ht.src=H.byteLength?URL.createObjectURL(Mt):R}),t.g=ct,t.h=(H,C)=>ot(k(H,{type:"json"}),C),t.i=L,t.j=q,t.k=J,t.l=(H,C)=>ot(k(H,{type:"arrayBuffer"}),C),t.m=ot,t.n=function(H){return new Km(H).readFields(d_,[])},t.o=ds,t.p=F0,t.q=Pt,t.r=ha,t.s=X,t.t=va,t.u=Pn,t.v=nt,t.w=_,t.x=function([H,C,$]){return C+=90,C*=Math.PI/180,$*=Math.PI/180,{x:H*Math.cos(C)*Math.sin($),y:H*Math.sin(C)*Math.sin($),z:H*Math.cos($)}},t.y=Ti,t.z=fs}),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 lt of Dt){this._layerConfigs[lt.id]=lt;let yt=this._layers[lt.id]=t.aA(lt);yt._featureFilter=t.a7(yt.filter),this.keyCache[lt.id]&&delete this.keyCache[lt.id]}for(let lt of qt)delete this.keyCache[lt],delete this._layerConfigs[lt],delete this._layers[lt];this.familiesBySource={};let _t=t.bk(Object.values(this._layerConfigs),this.keyCache);for(let lt of _t){let yt=lt.map(Ee=>this._layers[Ee.id]),St=yt[0];if(St.visibility==="none")continue;let Ht=St.source||"",Yt=this.familiesBySource[Ht];Yt||(Yt=this.familiesBySource[Ht]={});let se=St.sourceLayer||"_geojsonTileLayer",ke=Yt[se];ke||(ke=Yt[se]=[]),ke.push(yt)}}}class r{constructor(Dt){let qt={},_t=[];for(let Ht in Dt){let Yt=Dt[Ht],se=qt[Ht]={};for(let ke in Yt){let Ee=Yt[+ke];if(!Ee||Ee.bitmap.width===0||Ee.bitmap.height===0)continue;let Ue={x:0,y:0,w:Ee.bitmap.width+2,h:Ee.bitmap.height+2};_t.push(Ue),se[ke]={rect:Ue,metrics:Ee.metrics}}}let{w:lt,h:yt}=t.p(_t),St=new t.o({width:lt||1,height:yt||1});for(let Ht in Dt){let Yt=Dt[Ht];for(let se in Yt){let ke=Yt[+se];if(!ke||ke.bitmap.width===0||ke.bitmap.height===0)continue;let Ee=qt[Ht][se].rect;t.o.copy(ke.bitmap,St,{x:0,y:0},{x:Ee.x+1,y:Ee.y+1},ke.bitmap)}}this.image=St,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,_t,lt){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()),St=new t.bn(this.tileID,this.promoteId);St.bucketLayerIDs=[];let Ht={},Yt={featureIndex:St,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:_t},se=qt.familiesBySource[this.source];for(let En in se){let gn=Dt.layers[En];if(!gn)continue;gn.version===1&&t.w(`Vector tile source "${this.source}" layer "${En}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let da=yt.encode(En),ra=[];for(let Se=0;Se<gn.length;Se++){let Re=gn.feature(Se),Ze=St.getId(Re,En);ra.push({feature:Re,id:Ze,index:Se,sourceLayerIndex:da})}for(let Se of se[En]){let Re=Se[0];Re.source!==this.source&&t.w(`layer.source = ${Re.source} does not equal this.source = ${this.source}`),Re.minzoom&&this.zoom<Math.floor(Re.minzoom)||Re.maxzoom&&this.zoom>=Re.maxzoom||Re.visibility!=="none"&&(n(Se,this.zoom,_t),(Ht[Re.id]=Re.createBucket({index:St.bucketLayerIDs.length,layers:Se,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:da,sourceID:this.source})).populate(ra,Yt,this.tileID.canonical),St.bucketLayerIDs.push(Se.map(Ze=>Ze.id)))}}let ke=t.aF(Yt.glyphDependencies,En=>Object.keys(En).map(Number));this.inFlightDependencies.forEach(En=>En?.abort()),this.inFlightDependencies=[];let Ee=Promise.resolve({});if(Object.keys(ke).length){let En=new AbortController;this.inFlightDependencies.push(En),Ee=lt.sendAsync({type:"GG",data:{stacks:ke,source:this.source,tileID:this.tileID,type:"glyphs"}},En)}let Ue=Object.keys(Yt.iconDependencies),ir=Promise.resolve({});if(Ue.length){let En=new AbortController;this.inFlightDependencies.push(En),ir=lt.sendAsync({type:"GI",data:{icons:Ue,source:this.source,tileID:this.tileID,type:"icons"}},En)}let ar=Object.keys(Yt.patternDependencies),Ye=Promise.resolve({});if(ar.length){let En=new AbortController;this.inFlightDependencies.push(En),Ye=lt.sendAsync({type:"GI",data:{icons:ar,source:this.source,tileID:this.tileID,type:"patterns"}},En)}let[Er,pn,dn]=yield Promise.all([Ee,ir,Ye]),bn=new r(Er),Zn=new t.bo(pn,dn);for(let En in Ht){let gn=Ht[En];gn instanceof t.a6?(n(gn.layers,this.zoom,_t),t.bp({bucket:gn,glyphMap:Er,glyphPositions:bn.positions,imageMap:pn,imagePositions:Zn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):gn.hasPattern&&(gn instanceof t.bq||gn instanceof t.br||gn instanceof t.bs)&&(n(gn.layers,this.zoom,_t),gn.addFeatures(Yt,this.tileID.canonical,Zn.patternPositions))}return this.status="done",{buckets:Object.values(Ht).filter(En=>!En.isEmpty()),featureIndex:St,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bn.image,imageAtlas:Zn,glyphMap:this.returnDependencies?Er:null,iconMap:this.returnDependencies?pn:null,glyphPositions:this.returnDependencies?bn.positions:null}})}}function n(de,Dt,qt){let _t=new t.z(Dt);for(let lt of de)lt.recalculate(_t,qt)}class o{constructor(Dt,qt,_t){this.actor=Dt,this.layerIndex=qt,this.availableImages=_t,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Dt,qt){return t._(this,void 0,void 0,function*(){let _t=yield t.l(Dt.request,qt);try{return{vectorTile:new t.bt.VectorTile(new t.bu(_t.data)),rawData:_t.data,cacheControl:_t.cacheControl,expires:_t.expires}}catch(lt){let yt=new Uint8Array(_t.data),St=`Unable to parse the tile at ${Dt.request.url}, `;throw St+=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: ${lt.message}`,new Error(St)}})}loadTile(Dt){return t._(this,void 0,void 0,function*(){let qt=Dt.uid,_t=!!(Dt&&Dt.request&&Dt.request.collectResourceTiming)&&new t.bv(Dt.request),lt=new i(Dt);this.loading[qt]=lt;let yt=new AbortController;lt.abort=yt;try{let St=yield this.loadVectorTile(Dt,yt);if(delete this.loading[qt],!St)return null;let Ht=St.rawData,Yt={};St.expires&&(Yt.expires=St.expires),St.cacheControl&&(Yt.cacheControl=St.cacheControl);let se={};if(_t){let Ee=_t.finish();Ee&&(se.resourceTiming=JSON.parse(JSON.stringify(Ee)))}lt.vectorTile=St.vectorTile;let ke=lt.parse(St.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[qt]=lt,this.fetching[qt]={rawTileData:Ht,cacheControl:Yt,resourceTiming:se};try{let Ee=yield ke;return t.e({rawTileData:Ht.slice(0)},Ee,Yt,se)}finally{delete this.fetching[qt]}}catch(St){throw delete this.loading[qt],lt.status="done",this.loaded[qt]=lt,St}})}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 _t=this.loaded[qt];if(_t.showCollisionBoxes=Dt.showCollisionBoxes,_t.status==="parsing"){let lt=yield _t.parse(_t.vectorTile,this.layerIndex,this.availableImages,this.actor),yt;if(this.fetching[qt]){let{rawTileData:St,cacheControl:Ht,resourceTiming:Yt}=this.fetching[qt];delete this.fetching[qt],yt=t.e({rawTileData:St.slice(0)},lt,Ht,Yt)}else yt=lt;return yt}if(_t.status==="done"&&_t.vectorTile)return _t.parse(_t.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Dt){return t._(this,void 0,void 0,function*(){let qt=this.loading,_t=Dt.uid;qt&&qt[_t]&&qt[_t].abort&&(qt[_t].abort.abort(),delete qt[_t])})}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:_t,rawImageData:lt,redFactor:yt,greenFactor:St,blueFactor:Ht,baseShift:Yt}=Dt,se=lt.width+2,ke=lt.height+2,Ee=t.b(lt)?new t.R({width:se,height:ke},yield t.bw(lt,-1,-1,se,ke)):lt,Ue=new t.bx(qt,Ee,_t,yt,St,Ht,Yt);return this.loaded=this.loaded||{},this.loaded[qt]=Ue,Ue})}removeTile(Dt){let qt=this.loaded,_t=Dt.uid;qt&&qt[_t]&&delete qt[_t]}}function s(de,Dt){if(de.length!==0){f(de[0],Dt);for(var qt=1;qt<de.length;qt++)f(de[qt],!Dt)}}function f(de,Dt){for(var qt=0,_t=0,lt=0,yt=de.length,St=yt-1;lt<yt;St=lt++){var Ht=(de[lt][0]-de[St][0])*(de[St][1]+de[lt][1]),Yt=qt+Ht;_t+=Math.abs(qt)>=Math.abs(Ht)?qt-Yt+Ht:Ht-Yt+qt,qt=Yt}qt+_t>=0!=!!Dt&&de.reverse()}var v=t.by(function de(Dt,qt){var _t,lt=Dt&&Dt.type;if(lt==="FeatureCollection")for(_t=0;_t<Dt.features.length;_t++)de(Dt.features[_t],qt);else if(lt==="GeometryCollection")for(_t=0;_t<Dt.geometries.length;_t++)de(Dt.geometries[_t],qt);else if(lt==="Feature")de(Dt.geometry,qt);else if(lt==="Polygon")s(Dt.coordinates,qt);else if(lt==="MultiPolygon")for(_t=0;_t<Dt.coordinates.length;_t++)s(Dt.coordinates[_t],qt);return Dt});let g=t.bt.VectorTileFeature.prototype.toGeoJSON;var m={exports:{}},w=t.bz,l=t.bt.VectorTileFeature,x=y;function y(de,Dt){this.options=Dt||{},this.features=de,this.length=de.length}function S(de,Dt){this.id=typeof de.id=="number"?de.id:void 0,this.type=de.type,this.rawGeometry=de.type===1?[de.geometry]:de.geometry,this.properties=de.tags,this.extent=Dt||4096}y.prototype.feature=function(de){return new S(this.features[de],this.options.extent)},S.prototype.loadGeometry=function(){var de=this.rawGeometry;this.geometry=[];for(var Dt=0;Dt<de.length;Dt++){for(var qt=de[Dt],_t=[],lt=0;lt<qt.length;lt++)_t.push(new w(qt[lt][0],qt[lt][1]));this.geometry.push(_t)}return this.geometry},S.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var de=this.geometry,Dt=1/0,qt=-1/0,_t=1/0,lt=-1/0,yt=0;yt<de.length;yt++)for(var St=de[yt],Ht=0;Ht<St.length;Ht++){var Yt=St[Ht];Dt=Math.min(Dt,Yt.x),qt=Math.max(qt,Yt.x),_t=Math.min(_t,Yt.y),lt=Math.max(lt,Yt.y)}return[Dt,_t,qt,lt]},S.prototype.toGeoJSON=l.prototype.toGeoJSON;var k=t.bA,M=x;function T(de){var Dt=new k;return function(qt,_t){for(var lt in qt.layers)_t.writeMessage(3,c,qt.layers[lt])}(de,Dt),Dt.finish()}function c(de,Dt){var qt;Dt.writeVarintField(15,de.version||1),Dt.writeStringField(1,de.name||""),Dt.writeVarintField(5,de.extent||4096);var _t={keys:[],values:[],keycache:{},valuecache:{}};for(qt=0;qt<de.length;qt++)_t.feature=de.feature(qt),Dt.writeMessage(2,h,_t);var lt=_t.keys;for(qt=0;qt<lt.length;qt++)Dt.writeStringField(3,lt[qt]);var yt=_t.values;for(qt=0;qt<yt.length;qt++)Dt.writeMessage(4,D,yt[qt])}function h(de,Dt){var qt=de.feature;qt.id!==void 0&&Dt.writeVarintField(1,qt.id),Dt.writeMessage(2,b,de),Dt.writeVarintField(3,qt.type),Dt.writeMessage(4,L,qt)}function b(de,Dt){var qt=de.feature,_t=de.keys,lt=de.values,yt=de.keycache,St=de.valuecache;for(var Ht in qt.properties){var Yt=qt.properties[Ht],se=yt[Ht];if(Yt!==null){se===void 0&&(_t.push(Ht),yt[Ht]=se=_t.length-1),Dt.writeVarint(se);var ke=typeof Yt;ke!=="string"&&ke!=="boolean"&&ke!=="number"&&(Yt=JSON.stringify(Yt));var Ee=ke+":"+Yt,Ue=St[Ee];Ue===void 0&&(lt.push(Yt),St[Ee]=Ue=lt.length-1),Dt.writeVarint(Ue)}}}function _(de,Dt){return(Dt<<3)+(7&de)}function P(de){return de<<1^de>>31}function L(de,Dt){for(var qt=de.loadGeometry(),_t=de.type,lt=0,yt=0,St=qt.length,Ht=0;Ht<St;Ht++){var Yt=qt[Ht],se=1;_t===1&&(se=Yt.length),Dt.writeVarint(_(1,se));for(var ke=_t===3?Yt.length-1:Yt.length,Ee=0;Ee<ke;Ee++){Ee===1&&_t!==1&&Dt.writeVarint(_(2,ke-1));var Ue=Yt[Ee].x-lt,ir=Yt[Ee].y-yt;Dt.writeVarint(P(Ue)),Dt.writeVarint(P(ir)),lt+=Ue,yt+=ir}_t===3&&Dt.writeVarint(_(7,1))}}function D(de,Dt){var qt=typeof de;qt==="string"?Dt.writeStringField(1,de):qt==="boolean"?Dt.writeBooleanField(7,de):qt==="number"&&(de%1!=0?Dt.writeDoubleField(3,de):de<0?Dt.writeSVarintField(6,de):Dt.writeVarintField(5,de))}m.exports=T,m.exports.fromVectorTileJs=T,m.exports.fromGeojsonVt=function(de,Dt){Dt=Dt||{};var qt={};for(var _t in de)qt[_t]=new M(de[_t].features,Dt),qt[_t].name=_t,qt[_t].version=Dt.version,qt[_t].extent=Dt.extent;return T({layers:qt})},m.exports.GeoJSONWrapper=M;var B=t.by(m.exports);let R={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:de=>de},I=Math.fround||(F=new Float32Array(1),de=>(F[0]=+de,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:_t,maxZoom:lt}=this.options;qt&&console.time("total time");let yt=`prepare ${Dt.length} points`;qt&&console.time(yt),this.points=Dt;let St=[];for(let Yt=0;Yt<Dt.length;Yt++){let se=Dt[Yt];if(!se.geometry)continue;let[ke,Ee]=se.geometry.coordinates,Ue=I(et(ke)),ir=I(K(Ee));St.push(Ue,ir,1/0,Yt,-1,1),this.options.reduce&&St.push(0)}let Ht=this.trees[lt+1]=this._createTree(St);qt&&console.timeEnd(yt);for(let Yt=lt;Yt>=_t;Yt--){let se=+Date.now();Ht=this.trees[Yt]=this._createTree(this._cluster(Ht,Yt)),qt&&console.log("z%d: %d clusters in %dms",Yt,Ht.numItems,+Date.now()-se)}return qt&&console.timeEnd("total time"),this}getClusters(Dt,qt){let _t=((Dt[0]+180)%360+360)%360-180,lt=Math.max(-90,Math.min(90,Dt[1])),yt=Dt[2]===180?180:((Dt[2]+180)%360+360)%360-180,St=Math.max(-90,Math.min(90,Dt[3]));if(Dt[2]-Dt[0]>=360)_t=-180,yt=180;else if(_t>yt){let Ee=this.getClusters([_t,lt,180,St],qt),Ue=this.getClusters([-180,lt,yt,St],qt);return Ee.concat(Ue)}let Ht=this.trees[this._limitZoom(qt)],Yt=Ht.range(et(_t),K(St),et(yt),K(lt)),se=Ht.data,ke=[];for(let Ee of Yt){let Ue=this.stride*Ee;ke.push(se[Ue+j]>1?ct(se,Ue,this.clusterProps):this.points[se[Ue+N]])}return ke}getChildren(Dt){let qt=this._getOriginId(Dt),_t=this._getOriginZoom(Dt),lt="No cluster with the specified id.",yt=this.trees[_t];if(!yt)throw new Error(lt);let St=yt.data;if(qt*this.stride>=St.length)throw new Error(lt);let Ht=this.options.radius/(this.options.extent*Math.pow(2,_t-1)),Yt=yt.within(St[qt*this.stride],St[qt*this.stride+1],Ht),se=[];for(let ke of Yt){let Ee=ke*this.stride;St[Ee+4]===Dt&&se.push(St[Ee+j]>1?ct(St,Ee,this.clusterProps):this.points[St[Ee+N]])}if(se.length===0)throw new Error(lt);return se}getLeaves(Dt,qt,_t){let lt=[];return this._appendLeaves(lt,Dt,qt=qt||10,_t=_t||0,0),lt}getTile(Dt,qt,_t){let lt=this.trees[this._limitZoom(Dt)],yt=Math.pow(2,Dt),{extent:St,radius:Ht}=this.options,Yt=Ht/St,se=(_t-Yt)/yt,ke=(_t+1+Yt)/yt,Ee={features:[]};return this._addTileFeatures(lt.range((qt-Yt)/yt,se,(qt+1+Yt)/yt,ke),lt.data,qt,_t,yt,Ee),qt===0&&this._addTileFeatures(lt.range(1-Yt/yt,se,1,ke),lt.data,yt,_t,yt,Ee),qt===yt-1&&this._addTileFeatures(lt.range(0,se,Yt/yt,ke),lt.data,-1,_t,yt,Ee),Ee.features.length?Ee:null}getClusterExpansionZoom(Dt){let qt=this._getOriginZoom(Dt)-1;for(;qt<=this.options.maxZoom;){let _t=this.getChildren(Dt);if(qt++,_t.length!==1)break;Dt=_t[0].properties.cluster_id}return qt}_appendLeaves(Dt,qt,_t,lt,yt){let St=this.getChildren(qt);for(let Ht of St){let Yt=Ht.properties;if(Yt&&Yt.cluster?yt+Yt.point_count<=lt?yt+=Yt.point_count:yt=this._appendLeaves(Dt,Yt.cluster_id,_t,lt,yt):yt<lt?yt++:Dt.push(Ht),Dt.length===_t)break}return yt}_createTree(Dt){let qt=new t.av(Dt.length/this.stride|0,this.options.nodeSize,Float32Array);for(let _t=0;_t<Dt.length;_t+=this.stride)qt.add(Dt[_t],Dt[_t+1]);return qt.finish(),qt.data=Dt,qt}_addTileFeatures(Dt,qt,_t,lt,yt,St){for(let Ht of Dt){let Yt=Ht*this.stride,se=qt[Yt+j]>1,ke,Ee,Ue;if(se)ke=st(qt,Yt,this.clusterProps),Ee=qt[Yt],Ue=qt[Yt+1];else{let Ye=this.points[qt[Yt+N]];ke=Ye.properties;let[Er,pn]=Ye.geometry.coordinates;Ee=et(Er),Ue=K(pn)}let ir={type:1,geometry:[[Math.round(this.options.extent*(Ee*yt-_t)),Math.round(this.options.extent*(Ue*yt-lt))]],tags:ke},ar;ar=se||this.options.generateId?qt[Yt+N]:this.points[qt[Yt+N]].id,ar!==void 0&&(ir.id=ar),St.features.push(ir)}}_limitZoom(Dt){return Math.max(this.options.minZoom,Math.min(Math.floor(+Dt),this.options.maxZoom+1))}_cluster(Dt,qt){let{radius:_t,extent:lt,reduce:yt,minPoints:St}=this.options,Ht=_t/(lt*Math.pow(2,qt)),Yt=Dt.data,se=[],ke=this.stride;for(let Ee=0;Ee<Yt.length;Ee+=ke){if(Yt[Ee+2]<=qt)continue;Yt[Ee+2]=qt;let Ue=Yt[Ee],ir=Yt[Ee+1],ar=Dt.within(Yt[Ee],Yt[Ee+1],Ht),Ye=Yt[Ee+j],Er=Ye;for(let pn of ar){let dn=pn*ke;Yt[dn+2]>qt&&(Er+=Yt[dn+j])}if(Er>Ye&&Er>=St){let pn,dn=Ue*Ye,bn=ir*Ye,Zn=-1,En=((Ee/ke|0)<<5)+(qt+1)+this.points.length;for(let gn of ar){let da=gn*ke;if(Yt[da+2]<=qt)continue;Yt[da+2]=qt;let ra=Yt[da+j];dn+=Yt[da]*ra,bn+=Yt[da+1]*ra,Yt[da+4]=En,yt&&(pn||(pn=this._map(Yt,Ee,!0),Zn=this.clusterProps.length,this.clusterProps.push(pn)),yt(pn,this._map(Yt,da)))}Yt[Ee+4]=En,se.push(dn/Er,bn/Er,1/0,En,-1,Er),yt&&se.push(Zn)}else{for(let pn=0;pn<ke;pn++)se.push(Yt[Ee+pn]);if(Er>1)for(let pn of ar){let dn=pn*ke;if(!(Yt[dn+2]<=qt)){Yt[dn+2]=qt;for(let bn=0;bn<ke;bn++)se.push(Yt[dn+bn])}}}}return se}_getOriginId(Dt){return Dt-this.points.length>>5}_getOriginZoom(Dt){return(Dt-this.points.length)%32}_map(Dt,qt,_t){if(Dt[qt+j]>1){let St=this.clusterProps[Dt[qt+G]];return _t?Object.assign({},St):St}let lt=this.points[Dt[qt+N]].properties,yt=this.options.map(lt);return _t&&yt===lt?Object.assign({},yt):yt}}function ct(de,Dt,qt){return{type:"Feature",id:de[Dt+N],properties:st(de,Dt,qt),geometry:{type:"Point",coordinates:[(_t=de[Dt],360*(_t-.5)),ot(de[Dt+1])]}};var _t}function st(de,Dt,qt){let _t=de[Dt+j],lt=_t>=1e4?`${Math.round(_t/1e3)}k`:_t>=1e3?Math.round(_t/100)/10+"k":_t,yt=de[Dt+G],St=yt===-1?{}:Object.assign({},qt[yt]);return Object.assign(St,{cluster:!0,cluster_id:de[Dt+N],point_count:_t,point_count_abbreviated:lt})}function et(de){return de/360+.5}function K(de){let Dt=Math.sin(de*Math.PI/180),qt=.5-.25*Math.log((1+Dt)/(1-Dt))/Math.PI;return qt<0?0:qt>1?1:qt}function ot(de){let Dt=(180-360*de)*Math.PI/180;return 360*Math.atan(Math.exp(Dt))/Math.PI-90}function X(de,Dt,qt,_t){let lt=_t,yt=Dt+(qt-Dt>>1),St,Ht=qt-Dt,Yt=de[Dt],se=de[Dt+1],ke=de[qt],Ee=de[qt+1];for(let Ue=Dt+3;Ue<qt;Ue+=3){let ir=Q(de[Ue],de[Ue+1],Yt,se,ke,Ee);if(ir>lt)St=Ue,lt=ir;else if(ir===lt){let ar=Math.abs(Ue-yt);ar<Ht&&(St=Ue,Ht=ar)}}lt>_t&&(St-Dt>3&&X(de,Dt,St,_t),de[St+2]=lt,qt-St>3&&X(de,St,qt,_t))}function Q(de,Dt,qt,_t,lt,yt){let St=lt-qt,Ht=yt-_t;if(St!==0||Ht!==0){let Yt=((de-qt)*St+(Dt-_t)*Ht)/(St*St+Ht*Ht);Yt>1?(qt=lt,_t=yt):Yt>0&&(qt+=St*Yt,_t+=Ht*Yt)}return St=de-qt,Ht=Dt-_t,St*St+Ht*Ht}function ut(de,Dt,qt,_t){let lt={id:de??null,type:Dt,geometry:qt,tags:_t,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Dt==="Point"||Dt==="MultiPoint"||Dt==="LineString")J(lt,qt);else if(Dt==="Polygon")J(lt,qt[0]);else if(Dt==="MultiLineString")for(let yt of qt)J(lt,yt);else if(Dt==="MultiPolygon")for(let yt of qt)J(lt,yt[0]);return lt}function J(de,Dt){for(let qt=0;qt<Dt.length;qt+=3)de.minX=Math.min(de.minX,Dt[qt]),de.minY=Math.min(de.minY,Dt[qt+1]),de.maxX=Math.max(de.maxX,Dt[qt]),de.maxY=Math.max(de.maxY,Dt[qt+1])}function q(de,Dt,qt,_t){if(!Dt.geometry)return;let lt=Dt.geometry.coordinates;if(lt&&lt.length===0)return;let yt=Dt.geometry.type,St=Math.pow(qt.tolerance/((1<<qt.maxZoom)*qt.extent),2),Ht=[],Yt=Dt.id;if(qt.promoteId?Yt=Dt.properties[qt.promoteId]:qt.generateId&&(Yt=_t||0),yt==="Point")it(lt,Ht);else if(yt==="MultiPoint")for(let se of lt)it(se,Ht);else if(yt==="LineString")nt(lt,Ht,St,!1);else if(yt==="MultiLineString"){if(qt.lineMetrics){for(let se of lt)Ht=[],nt(se,Ht,St,!1),de.push(ut(Yt,"LineString",Ht,Dt.properties));return}dt(lt,Ht,St,!1)}else if(yt==="Polygon")dt(lt,Ht,St,!0);else{if(yt!=="MultiPolygon"){if(yt==="GeometryCollection"){for(let se of Dt.geometry.geometries)q(de,{id:Yt,geometry:se,properties:Dt.properties},qt,_t);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let se of lt){let ke=[];dt(se,ke,St,!0),Ht.push(ke)}}de.push(ut(Yt,yt,Ht,Dt.properties))}function it(de,Dt){Dt.push(Tt(de[0]),wt(de[1]),0)}function nt(de,Dt,qt,_t){let lt,yt,St=0;for(let Yt=0;Yt<de.length;Yt++){let se=Tt(de[Yt][0]),ke=wt(de[Yt][1]);Dt.push(se,ke,0),Yt>0&&(St+=_t?(lt*ke-se*yt)/2:Math.sqrt(Math.pow(se-lt,2)+Math.pow(ke-yt,2))),lt=se,yt=ke}let Ht=Dt.length-3;Dt[2]=1,X(Dt,0,Ht,qt),Dt[Ht+2]=1,Dt.size=Math.abs(St),Dt.start=0,Dt.end=Dt.size}function dt(de,Dt,qt,_t){for(let lt=0;lt<de.length;lt++){let yt=[];nt(de[lt],yt,qt,_t),Dt.push(yt)}}function Tt(de){return de/360+.5}function wt(de){let Dt=Math.sin(de*Math.PI/180),qt=.5-.25*Math.log((1+Dt)/(1-Dt))/Math.PI;return qt<0?0:qt>1?1:qt}function It(de,Dt,qt,_t,lt,yt,St,Ht){if(_t/=Dt,yt>=(qt/=Dt)&&St<_t)return de;if(St<qt||yt>=_t)return null;let Yt=[];for(let se of de){let ke=se.geometry,Ee=se.type,Ue=lt===0?se.minX:se.minY,ir=lt===0?se.maxX:se.maxY;if(Ue>=qt&&ir<_t){Yt.push(se);continue}if(ir<qt||Ue>=_t)continue;let ar=[];if(Ee==="Point"||Ee==="MultiPoint")Ct(ke,ar,qt,_t,lt);else if(Ee==="LineString")Nt(ke,ar,qt,_t,lt,!1,Ht.lineMetrics);else if(Ee==="MultiLineString")Jt(ke,ar,qt,_t,lt,!1);else if(Ee==="Polygon")Jt(ke,ar,qt,_t,lt,!0);else if(Ee==="MultiPolygon")for(let Ye of ke){let Er=[];Jt(Ye,Er,qt,_t,lt,!0),Er.length&&ar.push(Er)}if(ar.length){if(Ht.lineMetrics&&Ee==="LineString"){for(let Ye of ar)Yt.push(ut(se.id,Ee,Ye,se.tags));continue}Ee!=="LineString"&&Ee!=="MultiLineString"||(ar.length===1?(Ee="LineString",ar=ar[0]):Ee="MultiLineString"),Ee!=="Point"&&Ee!=="MultiPoint"||(Ee=ar.length===3?"Point":"MultiPoint"),Yt.push(ut(se.id,Ee,ar,se.tags))}}return Yt.length?Yt:null}function Ct(de,Dt,qt,_t,lt){for(let yt=0;yt<de.length;yt+=3){let St=de[yt+lt];St>=qt&&St<=_t&&te(Dt,de[yt],de[yt+1],de[yt+2])}}function Nt(de,Dt,qt,_t,lt,yt,St){let Ht=ee(de),Yt=lt===0?Kt:mt,se,ke,Ee=de.start;for(let Er=0;Er<de.length-3;Er+=3){let pn=de[Er],dn=de[Er+1],bn=de[Er+2],Zn=de[Er+3],En=de[Er+4],gn=lt===0?pn:dn,da=lt===0?Zn:En,ra=!1;St&&(se=Math.sqrt(Math.pow(pn-Zn,2)+Math.pow(dn-En,2))),gn<qt?da>qt&&(ke=Yt(Ht,pn,dn,Zn,En,qt),St&&(Ht.start=Ee+se*ke)):gn>_t?da<_t&&(ke=Yt(Ht,pn,dn,Zn,En,_t),St&&(Ht.start=Ee+se*ke)):te(Ht,pn,dn,bn),da<qt&&gn>=qt&&(ke=Yt(Ht,pn,dn,Zn,En,qt),ra=!0),da>_t&&gn<=_t&&(ke=Yt(Ht,pn,dn,Zn,En,_t),ra=!0),!yt&&ra&&(St&&(Ht.end=Ee+se*ke),Dt.push(Ht),Ht=ee(de)),St&&(Ee+=se)}let Ue=de.length-3,ir=de[Ue],ar=de[Ue+1],Ye=lt===0?ir:ar;Ye>=qt&&Ye<=_t&&te(Ht,ir,ar,de[Ue+2]),Ue=Ht.length-3,yt&&Ue>=3&&(Ht[Ue]!==Ht[0]||Ht[Ue+1]!==Ht[1])&&te(Ht,Ht[0],Ht[1],Ht[2]),Ht.length&&Dt.push(Ht)}function ee(de){let Dt=[];return Dt.size=de.size,Dt.start=de.start,Dt.end=de.end,Dt}function Jt(de,Dt,qt,_t,lt,yt){for(let St of de)Nt(St,Dt,qt,_t,lt,yt,!1)}function te(de,Dt,qt,_t){de.push(Dt,qt,_t)}function Kt(de,Dt,qt,_t,lt,yt){let St=(yt-Dt)/(_t-Dt);return te(de,yt,qt+(lt-qt)*St,1),St}function mt(de,Dt,qt,_t,lt,yt){let St=(yt-qt)/(lt-qt);return te(de,Dt+(_t-Dt)*St,yt,1),St}function bt(de,Dt){let qt=[];for(let _t=0;_t<de.length;_t++){let lt=de[_t],yt=lt.type,St;if(yt==="Point"||yt==="MultiPoint"||yt==="LineString")St=vt(lt.geometry,Dt);else if(yt==="MultiLineString"||yt==="Polygon"){St=[];for(let Ht of lt.geometry)St.push(vt(Ht,Dt))}else if(yt==="MultiPolygon"){St=[];for(let Ht of lt.geometry){let Yt=[];for(let se of Ht)Yt.push(vt(se,Dt));St.push(Yt)}}qt.push(ut(lt.id,yt,St,lt.tags))}return qt}function vt(de,Dt){let qt=[];qt.size=de.size,de.start!==void 0&&(qt.start=de.start,qt.end=de.end);for(let _t=0;_t<de.length;_t+=3)qt.push(de[_t]+Dt,de[_t+1],de[_t+2]);return qt}function Ut(de,Dt){if(de.transformed)return de;let qt=1<<de.z,_t=de.x,lt=de.y;for(let yt of de.features){let St=yt.geometry,Ht=yt.type;if(yt.geometry=[],Ht===1)for(let Yt=0;Yt<St.length;Yt+=2)yt.geometry.push(re(St[Yt],St[Yt+1],Dt,qt,_t,lt));else for(let Yt=0;Yt<St.length;Yt++){let se=[];for(let ke=0;ke<St[Yt].length;ke+=2)se.push(re(St[Yt][ke],St[Yt][ke+1],Dt,qt,_t,lt));yt.geometry.push(se)}}return de.transformed=!0,de}function re(de,Dt,qt,_t,lt,yt){return[Math.round(qt*(de*_t-lt)),Math.round(qt*(Dt*_t-yt))]}function Zt(de,Dt,qt,_t,lt){let yt=Dt===lt.maxZoom?0:lt.tolerance/((1<<Dt)*lt.extent),St={features:[],numPoints:0,numSimplified:0,numFeatures:de.length,source:null,x:qt,y:_t,z:Dt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let Ht of de)ue(St,Ht,yt,lt);return St}function ue(de,Dt,qt,_t){let lt=Dt.geometry,yt=Dt.type,St=[];if(de.minX=Math.min(de.minX,Dt.minX),de.minY=Math.min(de.minY,Dt.minY),de.maxX=Math.max(de.maxX,Dt.maxX),de.maxY=Math.max(de.maxY,Dt.maxY),yt==="Point"||yt==="MultiPoint")for(let Ht=0;Ht<lt.length;Ht+=3)St.push(lt[Ht],lt[Ht+1]),de.numPoints++,de.numSimplified++;else if(yt==="LineString")Me(St,lt,de,qt,!1,!1);else if(yt==="MultiLineString"||yt==="Polygon")for(let Ht=0;Ht<lt.length;Ht++)Me(St,lt[Ht],de,qt,yt==="Polygon",Ht===0);else if(yt==="MultiPolygon")for(let Ht=0;Ht<lt.length;Ht++){let Yt=lt[Ht];for(let se=0;se<Yt.length;se++)Me(St,Yt[se],de,qt,!0,se===0)}if(St.length){let Ht=Dt.tags||null;if(yt==="LineString"&&_t.lineMetrics){Ht={};for(let se in Dt.tags)Ht[se]=Dt.tags[se];Ht.mapbox_clip_start=lt.start/lt.size,Ht.mapbox_clip_end=lt.end/lt.size}let Yt={geometry:St,type:yt==="Polygon"||yt==="MultiPolygon"?3:yt==="LineString"||yt==="MultiLineString"?2:1,tags:Ht};Dt.id!==null&&(Yt.id=Dt.id),de.features.push(Yt)}}function Me(de,Dt,qt,_t,lt,yt){let St=_t*_t;if(_t>0&&Dt.size<(lt?St:_t))return void(qt.numPoints+=Dt.length/3);let Ht=[];for(let Yt=0;Yt<Dt.length;Yt+=3)(_t===0||Dt[Yt+2]>St)&&(qt.numSimplified++,Ht.push(Dt[Yt],Dt[Yt+1])),qt.numPoints++;lt&&function(Yt,se){let ke=0;for(let Ee=0,Ue=Yt.length,ir=Ue-2;Ee<Ue;ir=Ee,Ee+=2)ke+=(Yt[Ee]-Yt[ir])*(Yt[Ee+1]+Yt[ir+1]);if(ke>0===se)for(let Ee=0,Ue=Yt.length;Ee<Ue/2;Ee+=2){let ir=Yt[Ee],ar=Yt[Ee+1];Yt[Ee]=Yt[Ue-2-Ee],Yt[Ee+1]=Yt[Ue-1-Ee],Yt[Ue-2-Ee]=ir,Yt[Ue-1-Ee]=ar}}(Ht,yt),de.push(Ht)}let Ce={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class We{constructor(Dt,qt){let _t=(qt=this.options=function(yt,St){for(let Ht in St)yt[Ht]=St[Ht];return yt}(Object.create(Ce),qt)).debug;if(_t&&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 lt=function(yt,St){let Ht=[];if(yt.type==="FeatureCollection")for(let Yt=0;Yt<yt.features.length;Yt++)q(Ht,yt.features[Yt],St,Yt);else q(Ht,yt.type==="Feature"?yt:{geometry:yt},St);return Ht}(Dt,qt);this.tiles={},this.tileCoords=[],_t&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",qt.indexMaxZoom,qt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),lt=function(yt,St){let Ht=St.buffer/St.extent,Yt=yt,se=It(yt,1,-1-Ht,Ht,0,-1,2,St),ke=It(yt,1,1-Ht,2+Ht,0,-1,2,St);return(se||ke)&&(Yt=It(yt,1,-Ht,1+Ht,0,-1,2,St)||[],se&&(Yt=bt(se,1).concat(Yt)),ke&&(Yt=Yt.concat(bt(ke,-1)))),Yt}(lt,qt),lt.length&&this.splitTile(lt,0,0,0),_t&&(lt.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,_t,lt,yt,St,Ht){let Yt=[Dt,qt,_t,lt],se=this.options,ke=se.debug;for(;Yt.length;){lt=Yt.pop(),_t=Yt.pop(),qt=Yt.pop(),Dt=Yt.pop();let Ee=1<<qt,Ue=qe(qt,_t,lt),ir=this.tiles[Ue];if(!ir&&(ke>1&&console.time("creation"),ir=this.tiles[Ue]=Zt(Dt,qt,_t,lt,se),this.tileCoords.push({z:qt,x:_t,y:lt}),ke)){ke>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,_t,lt,ir.numFeatures,ir.numPoints,ir.numSimplified),console.timeEnd("creation"));let ra=`z${qt}`;this.stats[ra]=(this.stats[ra]||0)+1,this.total++}if(ir.source=Dt,yt==null){if(qt===se.indexMaxZoom||ir.numPoints<=se.indexMaxPoints)continue}else{if(qt===se.maxZoom||qt===yt)continue;if(yt!=null){let ra=yt-qt;if(_t!==St>>ra||lt!==Ht>>ra)continue}}if(ir.source=null,Dt.length===0)continue;ke>1&&console.time("clipping");let ar=.5*se.buffer/se.extent,Ye=.5-ar,Er=.5+ar,pn=1+ar,dn=null,bn=null,Zn=null,En=null,gn=It(Dt,Ee,_t-ar,_t+Er,0,ir.minX,ir.maxX,se),da=It(Dt,Ee,_t+Ye,_t+pn,0,ir.minX,ir.maxX,se);Dt=null,gn&&(dn=It(gn,Ee,lt-ar,lt+Er,1,ir.minY,ir.maxY,se),bn=It(gn,Ee,lt+Ye,lt+pn,1,ir.minY,ir.maxY,se),gn=null),da&&(Zn=It(da,Ee,lt-ar,lt+Er,1,ir.minY,ir.maxY,se),En=It(da,Ee,lt+Ye,lt+pn,1,ir.minY,ir.maxY,se),da=null),ke>1&&console.timeEnd("clipping"),Yt.push(dn||[],qt+1,2*_t,2*lt),Yt.push(bn||[],qt+1,2*_t,2*lt+1),Yt.push(Zn||[],qt+1,2*_t+1,2*lt),Yt.push(En||[],qt+1,2*_t+1,2*lt+1)}}getTile(Dt,qt,_t){Dt=+Dt,qt=+qt,_t=+_t;let lt=this.options,{extent:yt,debug:St}=lt;if(Dt<0||Dt>24)return null;let Ht=1<<Dt,Yt=qe(Dt,qt=qt+Ht&Ht-1,_t);if(this.tiles[Yt])return Ut(this.tiles[Yt],yt);St>1&&console.log("drilling down to z%d-%d-%d",Dt,qt,_t);let se,ke=Dt,Ee=qt,Ue=_t;for(;!se&&ke>0;)ke--,Ee>>=1,Ue>>=1,se=this.tiles[qe(ke,Ee,Ue)];return se&&se.source?(St>1&&(console.log("found parent tile z%d-%d-%d",ke,Ee,Ue),console.time("drilling down")),this.splitTile(se.source,ke,Ee,Ue,Dt,qt,_t),St>1&&console.timeEnd("drilling down"),this.tiles[Yt]?Ut(this.tiles[Yt],yt):null):null}}function qe(de,Dt,qt){return 32*((1<<de)*qt+Dt)+de}function vr(de,Dt){return Dt?de.properties[Dt]:de.id}function _r(de,Dt){if(de==null)return!0;if(de.type==="Feature")return vr(de,Dt)!=null;if(de.type==="FeatureCollection"){let qt=new Set;for(let _t of de.features){let lt=vr(_t,Dt);if(lt==null||qt.has(lt))return!1;qt.add(lt)}return!0}return!1}function er(de,Dt){let qt=new Map;if(de!=null)if(de.type==="Feature")qt.set(vr(de,Dt),de);else for(let _t of de.features)qt.set(vr(_t,Dt),_t);return qt}class Mr extends o{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(Dt,qt){return t._(this,void 0,void 0,function*(){let _t=Dt.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let lt=this._geoJSONIndex.getTile(_t.z,_t.x,_t.y);if(!lt)return null;let yt=new class{constructor(Ht){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=Ht.length,this._features=Ht}feature(Ht){return new class{constructor(Yt){this._feature=Yt,this.extent=t.X,this.type=Yt.type,this.properties=Yt.tags,"id"in Yt&&!isNaN(Yt.id)&&(this.id=parseInt(Yt.id,10))}loadGeometry(){if(this._feature.type===1){let Yt=[];for(let se of this._feature.geometry)Yt.push([new t.P(se[0],se[1])]);return Yt}{let Yt=[];for(let se of this._feature.geometry){let ke=[];for(let Ee of se)ke.push(new t.P(Ee[0],Ee[1]));Yt.push(ke)}return Yt}}toGeoJSON(Yt,se,ke){return g.call(this,Yt,se,ke)}}(this._features[Ht])}}(lt.features),St=B(yt);return St.byteOffset===0&&St.byteLength===St.buffer.byteLength||(St=new Uint8Array(St)),{vectorTile:yt,rawData:St.buffer}})}loadData(Dt){return t._(this,void 0,void 0,function*(){var qt;(qt=this._pendingRequest)===null||qt===void 0||qt.abort();let _t=!!(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:St,clusterProperties:Ht}){if(!Ht||!St)return St;let Yt={},se={},ke={accumulated:null,zoom:0},Ee={properties:null},Ue=Object.keys(Ht);for(let ir of Ue){let[ar,Ye]=Ht[ir],Er=t.bC(Ye),pn=t.bC(typeof ar=="string"?[ar,["accumulated"],["get",ir]]:ar);Yt[ir]=Er.value,se[ir]=pn.value}return St.map=ir=>{Ee.properties=ir;let ar={};for(let Ye of Ue)ar[Ye]=Yt[Ye].evaluate(ke,Ee);return ar},St.reduce=(ir,ar)=>{Ee.properties=ar;for(let Ye of Ue)ke.accumulated=ir[Ye],ir[Ye]=se[Ye].evaluate(ke,Ee)},St}(Dt)).load((yield this._pendingData).features):(lt=yield this._pendingData,new We(lt,Dt.geojsonVtOptions)),this.loaded={};let yt={};if(_t){let St=_t.finish();St&&(yt.resourceTiming={},yt.resourceTiming[Dt.source]=JSON.parse(JSON.stringify(St)))}return yt}catch(yt){if(delete this._pendingRequest,t.bB(yt))return{abandoned:!0};throw yt}var lt})}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 _t=yield this.loadGeoJSON(Dt,qt);if(delete this._pendingRequest,typeof _t!="object")throw new Error(`Input data given to '${Dt.source}' is not a valid GeoJSON object.`);if(v(_t,!0),Dt.filter){let lt=t.bC(Dt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(lt.result==="error")throw new Error(lt.value.map(yt=>`${yt.key}: ${yt.message}`).join(", "));_t={type:"FeatureCollection",features:_t.features.filter(yt=>lt.value.evaluate({zoom:0},yt))}}return _t})}loadGeoJSON(Dt,qt){return t._(this,void 0,void 0,function*(){let{promoteId:_t}=Dt;if(Dt.request){let lt=yield t.h(Dt.request,qt);return this._dataUpdateable=_r(lt.data,_t)?er(lt.data,_t):void 0,lt.data}if(typeof Dt.data=="string")try{let lt=JSON.parse(Dt.data);return this._dataUpdateable=_r(lt,_t)?er(lt,_t):void 0,lt}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(lt,yt,St){var Ht,Yt,se,ke;if(yt.removeAll&&lt.clear(),yt.remove)for(let Ee of yt.remove)lt.delete(Ee);if(yt.add)for(let Ee of yt.add){let Ue=vr(Ee,St);Ue!=null&&lt.set(Ue,Ee)}if(yt.update)for(let Ee of yt.update){let Ue=lt.get(Ee.id);if(Ue==null)continue;let ir=!Ee.removeAllProperties&&(((Ht=Ee.removeProperties)===null||Ht===void 0?void 0:Ht.length)>0||((Yt=Ee.addOrUpdateProperties)===null||Yt===void 0?void 0:Yt.length)>0);if((Ee.newGeometry||Ee.removeAllProperties||ir)&&(Ue=Object.assign({},Ue),lt.set(Ee.id,Ue),ir&&(Ue.properties=Object.assign({},Ue.properties))),Ee.newGeometry&&(Ue.geometry=Ee.newGeometry),Ee.removeAllProperties)Ue.properties={};else if(((se=Ee.removeProperties)===null||se===void 0?void 0:se.length)>0)for(let ar of Ee.removeProperties)Object.prototype.hasOwnProperty.call(Ue.properties,ar)&&delete Ue.properties[ar];if(((ke=Ee.addOrUpdateProperties)===null||ke===void 0?void 0:ke.length)>0)for(let{key:ar,value:Ye}of Ee.addOrUpdateProperties)Ue.properties[ar]=Ye}}(this._dataUpdateable,Dt.dataDiff,_t),{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 Ir{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,_t)=>{if(this.externalWorkerSourceTypes[qt])throw new Error(`Worker source with name "${qt}" already registered.`);this.externalWorkerSourceTypes[qt]=_t},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,_t)=>this._getDEMWorkerSource(qt,_t.source).loadTile(_t)),this.actor.registerMessageHandler("RDT",(qt,_t)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(qt,_t.source).removeTile(_t)})),this.actor.registerMessageHandler("GCEZ",(qt,_t)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,_t.type,_t.source).getClusterExpansionZoom(_t)})),this.actor.registerMessageHandler("GCC",(qt,_t)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,_t.type,_t.source).getClusterChildren(_t)})),this.actor.registerMessageHandler("GCL",(qt,_t)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(qt,_t.type,_t.source).getClusterLeaves(_t)})),this.actor.registerMessageHandler("LD",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).loadData(_t)),this.actor.registerMessageHandler("GD",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).getData()),this.actor.registerMessageHandler("LT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).loadTile(_t)),this.actor.registerMessageHandler("RT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).reloadTile(_t)),this.actor.registerMessageHandler("AT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).abortTile(_t)),this.actor.registerMessageHandler("RMT",(qt,_t)=>this._getWorkerSource(qt,_t.type,_t.source).removeTile(_t)),this.actor.registerMessageHandler("RS",(qt,_t)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[qt]||!this.workerSources[qt][_t.type]||!this.workerSources[qt][_t.type][_t.source])return;let lt=this.workerSources[qt][_t.type][_t.source];delete this.workerSources[qt][_t.type][_t.source],lt.removeSource!==void 0&&lt.removeSource(_t)})),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,_t)=>t._(this,void 0,void 0,function*(){this.referrer=_t})),this.actor.registerMessageHandler("SRPS",(qt,_t)=>this._syncRTLPluginState(qt,_t)),this.actor.registerMessageHandler("IS",(qt,_t)=>t._(this,void 0,void 0,function*(){this.self.importScripts(_t)})),this.actor.registerMessageHandler("SI",(qt,_t)=>this._setImages(qt,_t)),this.actor.registerMessageHandler("UL",(qt,_t)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(qt).update(_t.layers,_t.removedIds)})),this.actor.registerMessageHandler("SL",(qt,_t)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(qt).replace(_t)}))}_setImages(Dt,qt){return t._(this,void 0,void 0,function*(){this.availableImages[Dt]=qt;for(let _t in this.workerSources[Dt]){let lt=this.workerSources[Dt][_t];for(let yt in lt)lt[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 _t=qt.pluginURL;if(this.self.importScripts(_t),t.bD.isParsed()){let lt={pluginStatus:"loaded",pluginURL:_t};return t.bD.setState(lt),lt}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${_t}`)})}_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,_t){if(this.workerSources[Dt]||(this.workerSources[Dt]={}),this.workerSources[Dt][qt]||(this.workerSources[Dt][qt]={}),!this.workerSources[Dt][qt][_t]){let lt={sendAsync:(yt,St)=>(yt.targetMapId=Dt,this.actor.sendAsync(yt,St))};switch(qt){case"vector":this.workerSources[Dt][qt][_t]=new o(lt,this._getLayerIndex(Dt),this._getAvailableImages(Dt));break;case"geojson":this.workerSources[Dt][qt][_t]=new Mr(lt,this._getLayerIndex(Dt),this._getAvailableImages(Dt));break;default:this.workerSources[Dt][qt][_t]=new this.externalWorkerSourceTypes[qt](lt,this._getLayerIndex(Dt),this._getAvailableImages(Dt))}}return this.workerSources[Dt][qt][_t]}_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 Ir(self)),Ir}),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:Pt=>new Promise((z,at)=>{let xt=requestAnimationFrame(z);Pt.signal.addEventListener("abort",()=>{cancelAnimationFrame(xt),at(e.c())})}),getImageData(Pt,z=0){return this.getImageCanvasContext(Pt).getImageData(-z,-z,Pt.width+2*z,Pt.height+2*z)},getImageCanvasContext(Pt){let z=window.document.createElement("canvas"),at=z.getContext("2d",{willReadFrequently:!0});if(!at)throw new Error("failed to create canvas 2d context");return z.width=Pt.width,z.height=Pt.height,at.drawImage(Pt,0,0,Pt.width,Pt.height),at},resolveURL:Pt=>(i||(i=document.createElement("a")),i.href=Pt,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(z){if(!a.docStyle)return z[0];for(let at=0;at<z.length;at++)if(z[at]in a.docStyle)return z[at];return z[0]}static create(z,at,xt){let kt=window.document.createElement(z);return at!==void 0&&(kt.className=at),xt&&xt.appendChild(kt),kt}static createNS(z,at){return window.document.createElementNS(z,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(z,at){z.style[a.transformProp]=at}static addEventListener(z,at,xt,kt={}){z.addEventListener(at,xt,"passive"in kt?kt:kt.capture)}static removeEventListener(z,at,xt,kt={}){z.removeEventListener(at,xt,"passive"in kt?kt:kt.capture)}static suppressClickInternal(z){z.preventDefault(),z.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(z){let at=z.getBoundingClientRect();return{x:at.width/z.offsetWidth||1,y:at.height/z.offsetHeight||1,boundingClientRect:at}}static getPoint(z,at,xt){let kt=at.boundingClientRect;return new e.P((xt.clientX-kt.left)/at.x-z.clientLeft,(xt.clientY-kt.top)/at.y-z.clientTop)}static mousePos(z,at){let xt=a.getScale(z);return a.getPoint(z,xt,at)}static touchPos(z,at){let xt=[],kt=a.getScale(z);for(let Lt=0;Lt<at.length;Lt++)xt.push(a.getPoint(z,kt,at[Lt]));return xt}static mouseButton(z){return z.button}static remove(z){z.parentNode&&z.parentNode.removeChild(z)}}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(Pt){!g&&v&&(m?w(Pt):f=Pt)}},f,v,g=!1,m=!1;function w(Pt){let z=Pt.createTexture();Pt.bindTexture(Pt.TEXTURE_2D,z);try{if(Pt.texImage2D(Pt.TEXTURE_2D,0,Pt.RGBA,Pt.RGBA,Pt.UNSIGNED_BYTE,v),Pt.isContextLost())return;s.supported=!0}catch{}Pt.deleteTexture(z),g=!0}var l;typeof document<"u"&&(v=document.createElement("img"),v.onload=()=>{f&&w(f),f=null,m=!0},v.onerror=()=>{g=!0,f=null},v.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Pt){let z,at,xt,kt;Pt.resetRequestQueue=()=>{z=[],at=0,xt=0,kt={}},Pt.addThrottleControl=Pe=>{let $e=xt++;return kt[$e]=Pe,$e},Pt.removeThrottleControl=Pe=>{delete kt[Pe],le()},Pt.getImage=(Pe,$e,hr=!0)=>new Promise((pr,Br)=>{s.supported&&(Pe.headers||(Pe.headers={}),Pe.headers.accept="image/webp,*/*"),e.e(Pe,{type:"image"}),z.push({abortController:$e,requestParameters:Pe,supportImageRefresh:hr,state:"queued",onError:Jr=>{Br(Jr)},onSuccess:Jr=>{pr(Jr)}}),le()});let Lt=Pe=>e._(this,void 0,void 0,function*(){Pe.state="running";let{requestParameters:$e,supportImageRefresh:hr,onError:pr,onSuccess:Br,abortController:Jr}=Pe,Rt=hr===!1&&!e.i(self)&&!e.g($e.url)&&(!$e.headers||Object.keys($e.headers).reduce((ce,Te)=>ce&&Te==="accept",!0));at++;let Gt=Rt?xe($e,Jr):e.m($e,Jr);try{let ce=yield Gt;delete Pe.abortController,Pe.state="completed",ce.data instanceof HTMLImageElement||e.b(ce.data)?Br(ce):ce.data&&Br({data:yield(ae=ce.data,typeof createImageBitmap=="function"?e.d(ae):e.f(ae)),cacheControl:ce.cacheControl,expires:ce.expires})}catch(ce){delete Pe.abortController,pr(ce)}finally{at--,le()}var ae}),le=()=>{let Pe=(()=>{for(let $e of Object.keys(kt))if(kt[$e]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let $e=at;$e<Pe&&z.length>0;$e++){let hr=z.shift();hr.abortController.signal.aborted?$e--:Lt(hr)}},xe=(Pe,$e)=>new Promise((hr,pr)=>{let Br=new Image,Jr=Pe.url,Rt=Pe.credentials;Rt&&Rt==="include"?Br.crossOrigin="use-credentials":(Rt&&Rt==="same-origin"||!e.s(Jr))&&(Br.crossOrigin="anonymous"),$e.signal.addEventListener("abort",()=>{Br.src="",pr(e.c())}),Br.fetchPriority="high",Br.onload=()=>{Br.onerror=Br.onload=null,hr({data:Br})},Br.onerror=()=>{Br.onerror=Br.onload=null,$e.signal.aborted||pr(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."))},Br.src=Jr})}(l||(l={})),l.resetRequestQueue();class x{constructor(z){this._transformRequestFn=z}transformRequest(z,at){return this._transformRequestFn&&this._transformRequestFn(z,at)||{url:z}}setTransformRequest(z){this._transformRequestFn=z}}function y(Pt){var z=new e.A(3);return z[0]=Pt[0],z[1]=Pt[1],z[2]=Pt[2],z}var S,k=function(Pt,z,at){return Pt[0]=z[0]-at[0],Pt[1]=z[1]-at[1],Pt[2]=z[2]-at[2],Pt};S=new e.A(3),e.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var M=function(Pt){var z=Pt[0],at=Pt[1];return z*z+at*at};function T(Pt){let z=[];if(typeof Pt=="string")z.push({id:"default",url:Pt});else if(Pt&&Pt.length>0){let at=[];for(let{id:xt,url:kt}of Pt){let Lt=`${xt}${kt}`;at.indexOf(Lt)===-1&&(at.push(Lt),z.push({id:xt,url:kt}))}}return z}function c(Pt,z,at){let xt=Pt.split("?");return xt[0]+=`${z}${at}`,xt.join("?")}(function(){var Pt=new e.A(2);e.A!=Float32Array&&(Pt[0]=0,Pt[1]=0)})();class h{constructor(z,at,xt,kt){this.context=z,this.format=xt,this.texture=z.gl.createTexture(),this.update(at,kt)}update(z,at,xt){let{width:kt,height:Lt}=z,le=!(this.size&&this.size[0]===kt&&this.size[1]===Lt||xt),{context:xe}=this,{gl:Pe}=xe;if(this.useMipmap=!!(at&&at.useMipmap),Pe.bindTexture(Pe.TEXTURE_2D,this.texture),xe.pixelStoreUnpackFlipY.set(!1),xe.pixelStoreUnpack.set(1),xe.pixelStoreUnpackPremultiplyAlpha.set(this.format===Pe.RGBA&&(!at||at.premultiply!==!1)),le)this.size=[kt,Lt],z instanceof HTMLImageElement||z instanceof HTMLCanvasElement||z instanceof HTMLVideoElement||z instanceof ImageData||e.b(z)?Pe.texImage2D(Pe.TEXTURE_2D,0,this.format,this.format,Pe.UNSIGNED_BYTE,z):Pe.texImage2D(Pe.TEXTURE_2D,0,this.format,kt,Lt,0,this.format,Pe.UNSIGNED_BYTE,z.data);else{let{x:$e,y:hr}=xt||{x:0,y:0};z instanceof HTMLImageElement||z instanceof HTMLCanvasElement||z instanceof HTMLVideoElement||z instanceof ImageData||e.b(z)?Pe.texSubImage2D(Pe.TEXTURE_2D,0,$e,hr,Pe.RGBA,Pe.UNSIGNED_BYTE,z):Pe.texSubImage2D(Pe.TEXTURE_2D,0,$e,hr,kt,Lt,Pe.RGBA,Pe.UNSIGNED_BYTE,z.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Pe.generateMipmap(Pe.TEXTURE_2D)}bind(z,at,xt){let{context:kt}=this,{gl:Lt}=kt;Lt.bindTexture(Lt.TEXTURE_2D,this.texture),xt!==Lt.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(xt=Lt.LINEAR),z!==this.filter&&(Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MAG_FILTER,z),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MIN_FILTER,xt||z),this.filter=z),at!==this.wrap&&(Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_S,at),Lt.texParameteri(Lt.TEXTURE_2D,Lt.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:z}=this.context;z.deleteTexture(this.texture),this.texture=null}}function b(Pt){let{userImage:z}=Pt;return!!(z&&z.render&&z.render())&&(Pt.data.replace(new Uint8Array(z.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(z){if(this.loaded!==z&&(this.loaded=z,z)){for(let{ids:at,promiseResolve:xt}of this.requestors)xt(this._getImagesForIds(at));this.requestors=[]}}getImage(z){let at=this.images[z];if(at&&!at.data&&at.spriteData){let xt=at.spriteData;at.data=new e.R({width:xt.width,height:xt.height},xt.context.getImageData(xt.x,xt.y,xt.width,xt.height).data),at.spriteData=null}return at}addImage(z,at){if(this.images[z])throw new Error(`Image id ${z} already exist, use updateImage instead`);this._validate(z,at)&&(this.images[z]=at)}_validate(z,at){let xt=!0,kt=at.data||at.spriteData;return this._validateStretch(at.stretchX,kt&&kt.width)||(this.fire(new e.j(new Error(`Image "${z}" has invalid "stretchX" value`))),xt=!1),this._validateStretch(at.stretchY,kt&&kt.height)||(this.fire(new e.j(new Error(`Image "${z}" has invalid "stretchY" value`))),xt=!1),this._validateContent(at.content,at)||(this.fire(new e.j(new Error(`Image "${z}" has invalid "content" value`))),xt=!1),xt}_validateStretch(z,at){if(!z)return!0;let xt=0;for(let kt of z){if(kt[0]<xt||kt[1]<kt[0]||at<kt[1])return!1;xt=kt[1]}return!0}_validateContent(z,at){if(!z)return!0;if(z.length!==4)return!1;let xt=at.spriteData,kt=xt&&xt.width||at.data.width,Lt=xt&&xt.height||at.data.height;return!(z[0]<0||kt<z[0]||z[1]<0||Lt<z[1]||z[2]<0||kt<z[2]||z[3]<0||Lt<z[3]||z[2]<z[0]||z[3]<z[1])}updateImage(z,at,xt=!0){let kt=this.getImage(z);if(xt&&(kt.data.width!==at.data.width||kt.data.height!==at.data.height))throw new Error(`size mismatch between old image (${kt.data.width}x${kt.data.height}) and new image (${at.data.width}x${at.data.height}).`);at.version=kt.version+1,this.images[z]=at,this.updatedImages[z]=!0}removeImage(z){let at=this.images[z];delete this.images[z],delete this.patterns[z],at.userImage&&at.userImage.onRemove&&at.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(z){return new Promise((at,xt)=>{let kt=!0;if(!this.isLoaded())for(let Lt of z)this.images[Lt]||(kt=!1);this.isLoaded()||kt?at(this._getImagesForIds(z)):this.requestors.push({ids:z,promiseResolve:at})})}_getImagesForIds(z){let at={};for(let xt of z){let kt=this.getImage(xt);kt||(this.fire(new e.k("styleimagemissing",{id:xt})),kt=this.getImage(xt)),kt?at[xt]={data:kt.data.clone(),pixelRatio:kt.pixelRatio,sdf:kt.sdf,version:kt.version,stretchX:kt.stretchX,stretchY:kt.stretchY,content:kt.content,textFitWidth:kt.textFitWidth,textFitHeight:kt.textFitHeight,hasRenderCallback:!!(kt.userImage&&kt.userImage.render)}:e.w(`Image "${xt}" 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:z,height:at}=this.atlasImage;return{width:z,height:at}}getPattern(z){let at=this.patterns[z],xt=this.getImage(z);if(!xt)return null;if(at&&at.position.version===xt.version)return at.position;if(at)at.position.version=xt.version;else{let kt={w:xt.data.width+2,h:xt.data.height+2,x:0,y:0},Lt=new e.I(kt,xt);this.patterns[z]={bin:kt,position:Lt}}return this._updatePatternAtlas(),this.patterns[z].position}bind(z){let at=z.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new h(z,this.atlasImage,at.RGBA),this.atlasTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}_updatePatternAtlas(){let z=[];for(let Lt in this.patterns)z.push(this.patterns[Lt].bin);let{w:at,h:xt}=e.p(z),kt=this.atlasImage;kt.resize({width:at||1,height:xt||1});for(let Lt in this.patterns){let{bin:le}=this.patterns[Lt],xe=le.x+1,Pe=le.y+1,$e=this.getImage(Lt).data,hr=$e.width,pr=$e.height;e.R.copy($e,kt,{x:0,y:0},{x:xe,y:Pe},{width:hr,height:pr}),e.R.copy($e,kt,{x:0,y:pr-1},{x:xe,y:Pe-1},{width:hr,height:1}),e.R.copy($e,kt,{x:0,y:0},{x:xe,y:Pe+pr},{width:hr,height:1}),e.R.copy($e,kt,{x:hr-1,y:0},{x:xe-1,y:Pe},{width:1,height:pr}),e.R.copy($e,kt,{x:0,y:0},{x:xe+hr,y:Pe},{width:1,height:pr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(z){for(let at of z){if(this.callbackDispatchedThisFrame[at])continue;this.callbackDispatchedThisFrame[at]=!0;let xt=this.getImage(at);xt||e.w(`Image with ID: "${at}" was not found`),b(xt)&&this.updateImage(at,xt)}}}let P=1e20;function L(Pt,z,at,xt,kt,Lt,le,xe,Pe){for(let $e=z;$e<z+xt;$e++)D(Pt,at*Lt+$e,Lt,kt,le,xe,Pe);for(let $e=at;$e<at+kt;$e++)D(Pt,$e*Lt+z,1,xt,le,xe,Pe)}function D(Pt,z,at,xt,kt,Lt,le){Lt[0]=0,le[0]=-P,le[1]=P,kt[0]=Pt[z];for(let xe=1,Pe=0,$e=0;xe<xt;xe++){kt[xe]=Pt[z+xe*at];let hr=xe*xe;do{let pr=Lt[Pe];$e=(kt[xe]-kt[pr]+hr-pr*pr)/(xe-pr)/2}while($e<=le[Pe]&&--Pe>-1);Pe++,Lt[Pe]=xe,le[Pe]=$e,le[Pe+1]=P}for(let xe=0,Pe=0;xe<xt;xe++){for(;le[Pe+1]<xe;)Pe++;let $e=Lt[Pe],hr=xe-$e;Pt[z+xe*at]=kt[$e]+hr*hr}}class B{constructor(z,at){this.requestManager=z,this.localIdeographFontFamily=at,this.entries={}}setURL(z){this.url=z}getGlyphs(z){return e._(this,void 0,void 0,function*(){let at=[];for(let Lt in z)for(let le of z[Lt])at.push(this._getAndCacheGlyphsPromise(Lt,le));let xt=yield Promise.all(at),kt={};for(let{stack:Lt,id:le,glyph:xe}of xt)kt[Lt]||(kt[Lt]={}),kt[Lt][le]=xe&&{id:xe.id,bitmap:xe.bitmap.clone(),metrics:xe.metrics};return kt})}_getAndCacheGlyphsPromise(z,at){return e._(this,void 0,void 0,function*(){let xt=this.entries[z];xt||(xt=this.entries[z]={glyphs:{},requests:{},ranges:{}});let kt=xt.glyphs[at];if(kt!==void 0)return{stack:z,id:at,glyph:kt};if(kt=this._tinySDF(xt,z,at),kt)return xt.glyphs[at]=kt,{stack:z,id:at,glyph:kt};let Lt=Math.floor(at/256);if(256*Lt>65535)throw new Error("glyphs > 65535 not supported");if(xt.ranges[Lt])return{stack:z,id:at,glyph:kt};if(!this.url)throw new Error("glyphsUrl is not set");if(!xt.requests[Lt]){let xe=B.loadGlyphRange(z,Lt,this.url,this.requestManager);xt.requests[Lt]=xe}let le=yield xt.requests[Lt];for(let xe in le)this._doesCharSupportLocalGlyph(+xe)||(xt.glyphs[+xe]=le[+xe]);return xt.ranges[Lt]=!0,{stack:z,id:at,glyph:le[at]||null}})}_doesCharSupportLocalGlyph(z){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(z))}_tinySDF(z,at,xt){let kt=this.localIdeographFontFamily;if(!kt||!this._doesCharSupportLocalGlyph(xt))return;let Lt=z.tinySDF;if(!Lt){let xe="400";/bold/i.test(at)?xe="900":/medium/i.test(at)?xe="500":/light/i.test(at)&&(xe="200"),Lt=z.tinySDF=new B.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:kt,fontWeight:xe})}let le=Lt.draw(String.fromCharCode(xt));return{id:xt,bitmap:new e.o({width:le.width||60,height:le.height||60},le.data),metrics:{width:le.glyphWidth/2||24,height:le.glyphHeight/2||24,left:le.glyphLeft/2+.5||0,top:le.glyphTop/2-27.5||-8,advance:le.glyphAdvance/2||24,isDoubleResolution:!0}}}}B.loadGlyphRange=function(Pt,z,at,xt){return e._(this,void 0,void 0,function*(){let kt=256*z,Lt=kt+255,le=xt.transformRequest(at.replace("{fontstack}",Pt).replace("{range}",`${kt}-${Lt}`),"Glyphs"),xe=yield e.l(le,new AbortController);if(!xe||!xe.data)throw new Error(`Could not load glyph range. range: ${z}, ${kt}-${Lt}`);let Pe={};for(let $e of e.n(xe.data))Pe[$e.id]=$e;return Pe})},B.TinySDF=class{constructor({fontSize:Pt=24,buffer:z=3,radius:at=8,cutoff:xt=.25,fontFamily:kt="sans-serif",fontWeight:Lt="normal",fontStyle:le="normal"}={}){this.buffer=z,this.cutoff=xt,this.radius=at;let xe=this.size=Pt+4*z,Pe=this._createCanvas(xe),$e=this.ctx=Pe.getContext("2d",{willReadFrequently:!0});$e.font=`${le} ${Lt} ${Pt}px ${kt}`,$e.textBaseline="alphabetic",$e.textAlign="left",$e.fillStyle="black",this.gridOuter=new Float64Array(xe*xe),this.gridInner=new Float64Array(xe*xe),this.f=new Float64Array(xe),this.z=new Float64Array(xe+1),this.v=new Uint16Array(xe)}_createCanvas(Pt){let z=document.createElement("canvas");return z.width=z.height=Pt,z}draw(Pt){let{width:z,actualBoundingBoxAscent:at,actualBoundingBoxDescent:xt,actualBoundingBoxLeft:kt,actualBoundingBoxRight:Lt}=this.ctx.measureText(Pt),le=Math.ceil(at),xe=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Lt-kt))),Pe=Math.min(this.size-this.buffer,le+Math.ceil(xt)),$e=xe+2*this.buffer,hr=Pe+2*this.buffer,pr=Math.max($e*hr,0),Br=new Uint8ClampedArray(pr),Jr={data:Br,width:$e,height:hr,glyphWidth:xe,glyphHeight:Pe,glyphTop:le,glyphLeft:0,glyphAdvance:z};if(xe===0||Pe===0)return Jr;let{ctx:Rt,buffer:Gt,gridInner:ae,gridOuter:ce}=this;Rt.clearRect(Gt,Gt,xe,Pe),Rt.fillText(Pt,Gt,Gt+le);let Te=Rt.getImageData(Gt,Gt,xe,Pe);ce.fill(P,0,pr),ae.fill(0,0,pr);for(let ye=0;ye<Pe;ye++)for(let ze=0;ze<xe;ze++){let rr=Te.data[4*(ye*xe+ze)+3]/255;if(rr===0)continue;let fr=(ye+Gt)*$e+ze+Gt;if(rr===1)ce[fr]=0,ae[fr]=P;else{let gr=.5-rr;ce[fr]=gr>0?gr*gr:0,ae[fr]=gr<0?gr*gr:0}}L(ce,0,0,$e,hr,$e,this.f,this.v,this.z),L(ae,Gt,Gt,xe,Pe,$e,this.f,this.v,this.z);for(let ye=0;ye<pr;ye++){let ze=Math.sqrt(ce[ye])-Math.sqrt(ae[ye]);Br[ye]=Math.round(255-255*(ze/this.radius+this.cutoff))}return Jr}};class R{constructor(){this.specification=e.v.light.position}possiblyEvaluate(z,at){return e.x(z.expression.evaluate(at))}interpolate(z,at,xt){return{x:e.y.number(z.x,at.x,xt),y:e.y.number(z.y,at.y,xt),z:e.y.number(z.z,at.z,xt)}}}let I;class F extends e.E{constructor(z){super(),I=I||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(I),this.setLight(z),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(z,at={}){if(!this._validate(e.r,z,at))for(let xt in z){let kt=z[xt];xt.endsWith("-transition")?this._transitionable.setTransition(xt.slice(0,-11),kt):this._transitionable.setValue(xt,kt)}}updateTransitions(z){this._transitioning=this._transitionable.transitioned(z,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(z){this.properties=this._transitioning.possiblyEvaluate(z)}_validate(z,at,xt){return(!xt||xt.validate!==!1)&&e.t(this,z.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(z){super(),this._transitionable=new e.T(N),this.setSky(z),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(z,at={}){if(!this._validate(e.B,z,at)){z||(z={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let xt in z){let kt=z[xt];xt.endsWith("-transition")?this._transitionable.setTransition(xt.slice(0,-11),kt):this._transitionable.setValue(xt,kt)}}}getSky(){return this._transitionable.serialize()}updateTransitions(z){this._transitioning=this._transitionable.transitioned(z,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(z){this.properties=this._transitioning.possiblyEvaluate(z)}_validate(z,at,xt={}){return xt?.validate!==!1&&e.t(this,z.call(e.u,e.e({value:at,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(z){return z<60?0:z<70?(z-60)/10:1}}class G{constructor(z,at){this.width=z,this.height=at,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(z,at){let xt=z.join(",")+String(at);return this.dashEntry[xt]||(this.dashEntry[xt]=this.addDash(z,at)),this.dashEntry[xt]}getDashRanges(z,at,xt){let kt=[],Lt=z.length%2==1?-z[z.length-1]*xt:0,le=z[0]*xt,xe=!0;kt.push({left:Lt,right:le,isDash:xe,zeroLength:z[0]===0});let Pe=z[0];for(let $e=1;$e<z.length;$e++){xe=!xe;let hr=z[$e];Lt=Pe*xt,Pe+=hr,le=Pe*xt,kt.push({left:Lt,right:le,isDash:xe,zeroLength:hr===0})}return kt}addRoundDash(z,at,xt){let kt=at/2;for(let Lt=-xt;Lt<=xt;Lt++){let le=this.width*(this.nextRow+xt+Lt),xe=0,Pe=z[xe];for(let $e=0;$e<this.width;$e++){$e/Pe.right>1&&(Pe=z[++xe]);let hr=Math.abs($e-Pe.left),pr=Math.abs($e-Pe.right),Br=Math.min(hr,pr),Jr,Rt=Lt/xt*(kt+1);if(Pe.isDash){let Gt=kt-Math.abs(Rt);Jr=Math.sqrt(Br*Br+Gt*Gt)}else Jr=kt-Math.sqrt(Br*Br+Rt*Rt);this.data[le+$e]=Math.max(0,Math.min(255,Jr+128))}}}addRegularDash(z){for(let xe=z.length-1;xe>=0;--xe){let Pe=z[xe],$e=z[xe+1];Pe.zeroLength?z.splice(xe,1):$e&&$e.isDash===Pe.isDash&&($e.left=Pe.left,z.splice(xe,1))}let at=z[0],xt=z[z.length-1];at.isDash===xt.isDash&&(at.left=xt.left-this.width,xt.right=at.right+this.width);let kt=this.width*this.nextRow,Lt=0,le=z[Lt];for(let xe=0;xe<this.width;xe++){xe/le.right>1&&(le=z[++Lt]);let Pe=Math.abs(xe-le.left),$e=Math.abs(xe-le.right),hr=Math.min(Pe,$e);this.data[kt+xe]=Math.max(0,Math.min(255,(le.isDash?hr:-hr)+128))}}addDash(z,at){let xt=at?7:0,kt=2*xt+1;if(this.nextRow+kt>this.height)return e.w("LineAtlas out of space"),null;let Lt=0;for(let xe=0;xe<z.length;xe++)Lt+=z[xe];if(Lt!==0){let xe=this.width/Lt,Pe=this.getDashRanges(z,this.width,xe);at?this.addRoundDash(Pe,xe,xt):this.addRegularDash(Pe)}let le={y:(this.nextRow+xt+.5)/this.height,height:2*xt/this.height,width:Lt};return this.nextRow+=kt,this.dirty=!0,le}bind(z){let at=z.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(z){if(!this.workers)for(this.workers=[];this.workers.length<ct.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[z]=!0,this.workers.slice()}release(z){delete this.active[z],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 st=Math.floor(o.hardwareConcurrency/2),et,K;function ot(){return et||(et=new ct),et}ct.workerCount=e.C(globalThis)?Math.max(Math.min(st,3),1):1;class X{constructor(z,at){this.workerPool=z,this.actors=[],this.currentActor=0,this.id=at;let xt=this.workerPool.acquire(at);for(let kt=0;kt<xt.length;kt++){let Lt=new e.F(xt[kt],at);Lt.name=`Worker ${kt}`,this.actors.push(Lt)}if(!this.actors.length)throw new Error("No actors found")}broadcast(z,at){let xt=[];for(let kt of this.actors)xt.push(kt.sendAsync({type:z,data:at}));return Promise.all(xt)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(z=!0){this.actors.forEach(at=>{at.remove()}),this.actors=[],z&&this.workerPool.release(this.id)}registerMessageHandler(z,at){for(let xt of this.actors)xt.registerMessageHandler(z,at)}}function Q(){return K||(K=new X(ot(),e.G),K.registerMessageHandler("GR",(Pt,z,at)=>e.m(z,at))),K}function ut(Pt,z){let at=e.H();return e.J(at,at,[1,1,0]),e.K(at,at,[.5*Pt.width,.5*Pt.height,1]),e.L(at,at,Pt.calculatePosMatrix(z.toUnwrapped()))}function J(Pt,z,at,xt,kt,Lt){let le=function(pr,Br,Jr){if(pr)for(let Rt of pr){let Gt=Br[Rt];if(Gt&&Gt.source===Jr&&Gt.type==="fill-extrusion")return!0}else for(let Rt in Br){let Gt=Br[Rt];if(Gt.source===Jr&&Gt.type==="fill-extrusion")return!0}return!1}(kt&&kt.layers,z,Pt.id),xe=Lt.maxPitchScaleFactor(),Pe=Pt.tilesIn(xt,xe,le);Pe.sort(q);let $e=[];for(let pr of Pe)$e.push({wrappedTileID:pr.tileID.wrapped().key,queryResults:pr.tile.queryRenderedFeatures(z,at,Pt._state,pr.queryGeometry,pr.cameraQueryGeometry,pr.scale,kt,Lt,xe,ut(Pt.transform,pr.tileID))});let hr=function(pr){let Br={},Jr={};for(let Rt of pr){let Gt=Rt.queryResults,ae=Rt.wrappedTileID,ce=Jr[ae]=Jr[ae]||{};for(let Te in Gt){let ye=Gt[Te],ze=ce[Te]=ce[Te]||{},rr=Br[Te]=Br[Te]||[];for(let fr of ye)ze[fr.featureIndex]||(ze[fr.featureIndex]=!0,rr.push(fr))}}return Br}($e);for(let pr in hr)hr[pr].forEach(Br=>{let Jr=Br.feature,Rt=Pt.getFeatureState(Jr.layer["source-layer"],Jr.id);Jr.source=Jr.layer.source,Jr.layer["source-layer"]&&(Jr.sourceLayer=Jr.layer["source-layer"]),Jr.state=Rt});return hr}function q(Pt,z){let at=Pt.tileID,xt=z.tileID;return at.overscaledZ-xt.overscaledZ||at.canonical.y-xt.canonical.y||at.wrap-xt.wrap||at.canonical.x-xt.canonical.x}function it(Pt,z,at){return e._(this,void 0,void 0,function*(){let xt=Pt;if(Pt.url?xt=(yield e.h(z.transformRequest(Pt.url,"Source"),at)).data:yield o.frameAsync(at),!xt)return null;let kt=e.M(e.e(xt,Pt),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in xt&&xt.vector_layers&&(kt.vectorLayerIds=xt.vector_layers.map(Lt=>Lt.id)),kt})}class nt{constructor(z,at){z&&(at?this.setSouthWest(z).setNorthEast(at):Array.isArray(z)&&(z.length===4?this.setSouthWest([z[0],z[1]]).setNorthEast([z[2],z[3]]):this.setSouthWest(z[0]).setNorthEast(z[1])))}setNorthEast(z){return this._ne=z instanceof e.N?new e.N(z.lng,z.lat):e.N.convert(z),this}setSouthWest(z){return this._sw=z instanceof e.N?new e.N(z.lng,z.lat):e.N.convert(z),this}extend(z){let at=this._sw,xt=this._ne,kt,Lt;if(z instanceof e.N)kt=z,Lt=z;else{if(!(z instanceof nt))return Array.isArray(z)?z.length===4||z.every(Array.isArray)?this.extend(nt.convert(z)):this.extend(e.N.convert(z)):z&&("lng"in z||"lon"in z)&&"lat"in z?this.extend(e.N.convert(z)):this;if(kt=z._sw,Lt=z._ne,!kt||!Lt)return this}return at||xt?(at.lng=Math.min(kt.lng,at.lng),at.lat=Math.min(kt.lat,at.lat),xt.lng=Math.max(Lt.lng,xt.lng),xt.lat=Math.max(Lt.lat,xt.lat)):(this._sw=new e.N(kt.lng,kt.lat),this._ne=new e.N(Lt.lng,Lt.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(z){let{lng:at,lat:xt}=e.N.convert(z),kt=this._sw.lng<=at&&at<=this._ne.lng;return this._sw.lng>this._ne.lng&&(kt=this._sw.lng>=at&&at>=this._ne.lng),this._sw.lat<=xt&&xt<=this._ne.lat&&kt}static convert(z){return z instanceof nt?z:z&&new nt(z)}static fromLngLat(z,at=0){let xt=360*at/40075017,kt=xt/Math.cos(Math.PI/180*z.lat);return new nt(new e.N(z.lng-kt,z.lat-xt),new e.N(z.lng+kt,z.lat+xt))}adjustAntiMeridian(){let z=new e.N(this._sw.lng,this._sw.lat),at=new e.N(this._ne.lng,this._ne.lat);return new nt(z,z.lng>at.lng?new e.N(at.lng+360,at.lat):at)}}class dt{constructor(z,at,xt){this.bounds=nt.convert(this.validateBounds(z)),this.minzoom=at||0,this.maxzoom=xt||24}validateBounds(z){return Array.isArray(z)&&z.length===4?[Math.max(-180,z[0]),Math.max(-90,z[1]),Math.min(180,z[2]),Math.min(90,z[3])]:[-180,-90,180,90]}contains(z){let at=Math.pow(2,z.z),xt=Math.floor(e.O(this.bounds.getWest())*at),kt=Math.floor(e.Q(this.bounds.getNorth())*at),Lt=Math.ceil(e.O(this.bounds.getEast())*at),le=Math.ceil(e.Q(this.bounds.getSouth())*at);return z.x>=xt&&z.x<Lt&&z.y>=kt&&z.y<le}}class Tt extends e.E{constructor(z,at,xt,kt){if(super(),this.id=z,this.dispatcher=xt,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(kt)}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 z=yield it(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),z&&(e.e(this,z),z.bounds&&(this.tileBounds=new dt(z.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(z){this._tileJSONRequest=null,this.fire(new e.j(z))}})}loaded(){return this._loaded}hasTile(z){return!this.tileBounds||this.tileBounds.contains(z.canonical)}onAdd(z){this.map=z,this.load()}setSourceProperty(z){this._tileJSONRequest&&this._tileJSONRequest.abort(),z(),this.load()}setTiles(z){return this.setSourceProperty(()=>{this._options.tiles=z}),this}setUrl(z){return this.setSourceProperty(()=>{this.url=z,this._options.url=z}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(z){return e._(this,void 0,void 0,function*(){let at=z.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),xt={request:this.map._requestManager.transformRequest(at,"Tile"),uid:z.uid,tileID:z.tileID,zoom:z.tileID.overscaledZ,tileSize:this.tileSize*z.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};xt.request.collectResourceTiming=this._collectResourceTiming;let kt="RT";if(z.actor&&z.state!=="expired"){if(z.state==="loading")return new Promise((Lt,le)=>{z.reloadPromise={resolve:Lt,reject:le}})}else z.actor=this.dispatcher.getActor(),kt="LT";z.abortController=new AbortController;try{let Lt=yield z.actor.sendAsync({type:kt,data:xt},z.abortController);if(delete z.abortController,z.aborted)return;this._afterTileLoadWorkerResponse(z,Lt)}catch(Lt){if(delete z.abortController,z.aborted)return;if(Lt&&Lt.status!==404)throw Lt;this._afterTileLoadWorkerResponse(z,null)}})}_afterTileLoadWorkerResponse(z,at){if(at&&at.resourceTiming&&(z.resourceTiming=at.resourceTiming),at&&this.map._refreshExpiredTiles&&z.setExpiryData(at),z.loadVectorData(at,this.map.painter),z.reloadPromise){let xt=z.reloadPromise;z.reloadPromise=null,this.loadTile(z).then(xt.resolve).catch(xt.reject)}}abortTile(z){return e._(this,void 0,void 0,function*(){z.abortController&&(z.abortController.abort(),delete z.abortController),z.actor&&(yield z.actor.sendAsync({type:"AT",data:{uid:z.uid,type:this.type,source:this.id}}))})}unloadTile(z){return e._(this,void 0,void 0,function*(){z.unloadVectorData(),z.actor&&(yield z.actor.sendAsync({type:"RMT",data:{uid:z.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class wt extends e.E{constructor(z,at,xt,kt){super(),this.id=z,this.dispatcher=xt,this.setEventedParent(kt),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 z=yield it(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,z&&(e.e(this,z),z.bounds&&(this.tileBounds=new dt(z.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(z){this._tileJSONRequest=null,this.fire(new e.j(z))}})}loaded(){return this._loaded}onAdd(z){this.map=z,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(z){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),z(),this.load()}setTiles(z){return this.setSourceProperty(()=>{this._options.tiles=z}),this}setUrl(z){return this.setSourceProperty(()=>{this.url=z,this._options.url=z}),this}serialize(){return e.e({},this._options)}hasTile(z){return!this.tileBounds||this.tileBounds.contains(z.canonical)}loadTile(z){return e._(this,void 0,void 0,function*(){let at=z.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);z.abortController=new AbortController;try{let xt=yield l.getImage(this.map._requestManager.transformRequest(at,"Tile"),z.abortController,this.map._refreshExpiredTiles);if(delete z.abortController,z.aborted)return void(z.state="unloaded");if(xt&&xt.data){this.map._refreshExpiredTiles&&xt.cacheControl&&xt.expires&&z.setExpiryData({cacheControl:xt.cacheControl,expires:xt.expires});let kt=this.map.painter.context,Lt=kt.gl,le=xt.data;z.texture=this.map.painter.getTileTexture(le.width),z.texture?z.texture.update(le,{useMipmap:!0}):(z.texture=new h(kt,le,Lt.RGBA,{useMipmap:!0}),z.texture.bind(Lt.LINEAR,Lt.CLAMP_TO_EDGE,Lt.LINEAR_MIPMAP_NEAREST)),z.state="loaded"}}catch(xt){if(delete z.abortController,z.aborted)z.state="unloaded";else if(xt)throw z.state="errored",xt}})}abortTile(z){return e._(this,void 0,void 0,function*(){z.abortController&&(z.abortController.abort(),delete z.abortController)})}unloadTile(z){return e._(this,void 0,void 0,function*(){z.texture&&this.map.painter.saveTileTexture(z.texture)})}hasTransition(){return!1}}class It extends wt{constructor(z,at,xt,kt){super(z,at,xt,kt),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(z){return e._(this,void 0,void 0,function*(){let at=z.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),xt=this.map._requestManager.transformRequest(at,"Tile");z.neighboringTiles=this._getNeighboringTiles(z.tileID),z.abortController=new AbortController;try{let kt=yield l.getImage(xt,z.abortController,this.map._refreshExpiredTiles);if(delete z.abortController,z.aborted)return void(z.state="unloaded");if(kt&&kt.data){let Lt=kt.data;this.map._refreshExpiredTiles&&kt.cacheControl&&kt.expires&&z.setExpiryData({cacheControl:kt.cacheControl,expires:kt.expires});let le=e.b(Lt)&&e.U()?Lt:yield this.readImageNow(Lt),xe={type:this.type,uid:z.uid,source:this.id,rawImageData:le,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!z.actor||z.state==="expired"){z.actor=this.dispatcher.getActor();let Pe=yield z.actor.sendAsync({type:"LDT",data:xe});z.dem=Pe,z.needsHillshadePrepare=!0,z.needsTerrainPrepare=!0,z.state="loaded"}}}catch(kt){if(delete z.abortController,z.aborted)z.state="unloaded";else if(kt)throw z.state="errored",kt}})}readImageNow(z){return e._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&e.V()){let at=z.width+2,xt=z.height+2;try{return new e.R({width:at,height:xt},yield e.W(z,-1,-1,at,xt))}catch{}}return o.getImageData(z,1)})}_getNeighboringTiles(z){let at=z.canonical,xt=Math.pow(2,at.z),kt=(at.x-1+xt)%xt,Lt=at.x===0?z.wrap-1:z.wrap,le=(at.x+1+xt)%xt,xe=at.x+1===xt?z.wrap+1:z.wrap,Pe={};return Pe[new e.S(z.overscaledZ,Lt,at.z,kt,at.y).key]={backfilled:!1},Pe[new e.S(z.overscaledZ,xe,at.z,le,at.y).key]={backfilled:!1},at.y>0&&(Pe[new e.S(z.overscaledZ,Lt,at.z,kt,at.y-1).key]={backfilled:!1},Pe[new e.S(z.overscaledZ,z.wrap,at.z,at.x,at.y-1).key]={backfilled:!1},Pe[new e.S(z.overscaledZ,xe,at.z,le,at.y-1).key]={backfilled:!1}),at.y+1<xt&&(Pe[new e.S(z.overscaledZ,Lt,at.z,kt,at.y+1).key]={backfilled:!1},Pe[new e.S(z.overscaledZ,z.wrap,at.z,at.x,at.y+1).key]={backfilled:!1},Pe[new e.S(z.overscaledZ,xe,at.z,le,at.y+1).key]={backfilled:!1}),Pe}unloadTile(z){return e._(this,void 0,void 0,function*(){z.demTexture&&this.map.painter.saveTileTexture(z.demTexture),z.fbo&&(z.fbo.destroy(),delete z.fbo),z.dem&&delete z.dem,delete z.neighboringTiles,z.state="unloaded",z.actor&&(yield z.actor.sendAsync({type:"RDT",data:{type:this.type,uid:z.uid,source:this.id}}))})}}class Ct extends e.E{constructor(z,at,xt,kt){super(),this.id=z,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=xt.getActor(),this.setEventedParent(kt),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 Lt=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)*Lt,tolerance:(at.tolerance!==void 0?at.tolerance:.375)*Lt,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)*Lt,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(z){this.map=z,this.load()}setData(z){return this._data=z,this._updateWorkerData(),this}updateData(z){return this._updateWorkerData(z),this}getData(){return e._(this,void 0,void 0,function*(){let z=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:z})})}setClusterOptions(z){return this.workerOptions.cluster=z.cluster,z&&(z.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=z.clusterRadius),z.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=z.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(z){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:z,source:this.id}})}getClusterChildren(z){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:z,source:this.id}})}getClusterLeaves(z,at,xt){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:z,limit:at,offset:xt}})}_updateWorkerData(z){return e._(this,void 0,void 0,function*(){let at=e.e({type:this.type},this.workerOptions);z?at.dataDiff=z: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 xt=yield this.actor.sendAsync({type:"LD",data:at});if(this._pendingLoads--,this._removed||xt.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let kt=null;xt.resourceTiming&&xt.resourceTiming[this.id]&&(kt=xt.resourceTiming[this.id].slice(0));let Lt={dataType:"source"};this._collectResourceTiming&&kt&&kt.length>0&&e.e(Lt,{resourceTiming:kt}),this.fire(new e.k("data",Object.assign(Object.assign({},Lt),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},Lt),{sourceDataType:"content"})))}catch(xt){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(xt))}})}loaded(){return this._pendingLoads===0}loadTile(z){return e._(this,void 0,void 0,function*(){let at=z.actor?"RT":"LT";z.actor=this.actor;let xt={type:this.type,uid:z.uid,tileID:z.tileID,zoom:z.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};z.abortController=new AbortController;let kt=yield this.actor.sendAsync({type:at,data:xt},z.abortController);delete z.abortController,z.unloadVectorData(),z.aborted||z.loadVectorData(kt,this.map.painter,at==="RT")})}abortTile(z){return e._(this,void 0,void 0,function*(){z.abortController&&(z.abortController.abort(),delete z.abortController),z.aborted=!0})}unloadTile(z){return e._(this,void 0,void 0,function*(){z.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:z.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 ee extends e.E{constructor(z,at,xt,kt){super(),this.id=z,this.dispatcher=xt,this.coordinates=at.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(kt),this.options=at}load(z){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,z&&(this.coordinates=z),this._finishLoading())}catch(at){this._request=null,this._loaded=!0,this.fire(new e.j(at))}})}loaded(){return this._loaded}updateImage(z){return z.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=z.url,this.load(z.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(z){this.map=z,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(z){this.coordinates=z;let at=z.map(e.Z.fromLngLat);this.tileID=function(kt){let Lt=1/0,le=1/0,xe=-1/0,Pe=-1/0;for(let Br of kt)Lt=Math.min(Lt,Br.x),le=Math.min(le,Br.y),xe=Math.max(xe,Br.x),Pe=Math.max(Pe,Br.y);let $e=Math.max(xe-Lt,Pe-le),hr=Math.max(0,Math.floor(-Math.log($e)/Math.LN2)),pr=Math.pow(2,hr);return new e.a1(hr,Math.floor((Lt+xe)/2*pr),Math.floor((le+Pe)/2*pr))}(at),this.minzoom=this.maxzoom=this.tileID.z;let xt=at.map(kt=>this.tileID.getTilePoint(kt)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(xt[0].x,xt[0].y,0,0),this._boundsArray.emplaceBack(xt[1].x,xt[1].y,e.X,0),this._boundsArray.emplaceBack(xt[3].x,xt[3].y,0,e.X),this._boundsArray.emplaceBack(xt[2].x,xt[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 z=this.map.painter.context,at=z.gl;this.boundsBuffer||(this.boundsBuffer=z.createVertexBuffer(this._boundsArray,Nt.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new h(z,this.image,at.RGBA),this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE));let xt=!1;for(let kt in this.tiles){let Lt=this.tiles[kt];Lt.state!=="loaded"&&(Lt.state="loaded",Lt.texture=this.texture,xt=!0)}xt&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(z){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(z.tileID.canonical)?(this.tiles[String(z.tileID.wrap)]=z,z.buckets={}):z.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Jt extends ee{constructor(z,at,xt,kt){super(z,at,xt,kt),this.roundZoom=!0,this.type="video",this.options=at}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;let z=this.options;this.urls=[];for(let at of z.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(z){if(this.video){let at=this.video.seekable;z<at.start(0)||z>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=z}}getVideo(){return this.video}onAdd(z){this.map||(this.map=z,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 z=this.map.painter.context,at=z.gl;this.boundsBuffer||(this.boundsBuffer=z.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 h(z,this.video,at.RGBA),this.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE));let xt=!1;for(let kt in this.tiles){let Lt=this.tiles[kt];Lt.state!=="loaded"&&(Lt.state="loaded",Lt.texture=this.texture,xt=!0)}xt&&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 te extends ee{constructor(z,at,xt,kt){super(z,at,xt,kt),at.coordinates?Array.isArray(at.coordinates)&&at.coordinates.length===4&&!at.coordinates.some(Lt=>!Array.isArray(Lt)||Lt.length!==2||Lt.some(le=>typeof le!="number"))||this.fire(new e.j(new e.a2(`sources.${z}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${z}`,null,'missing required property "coordinates"'))),at.animate&&typeof at.animate!="boolean"&&this.fire(new e.j(new e.a2(`sources.${z}`,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.${z}`,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.${z}`,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(z){this.map=z,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let z=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,z=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,z=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let at=this.map.painter.context,xt=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?(z||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new h(at,this.canvas,xt.RGBA,{premultiply:!0});let kt=!1;for(let Lt in this.tiles){let le=this.tiles[Lt];le.state!=="loaded"&&(le.state="loaded",le.texture=this.texture,kt=!0)}kt&&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 z of[this.canvas.width,this.canvas.height])if(isNaN(z)||z<=0)return!0;return!1}}let Kt={},mt=Pt=>{switch(Pt){case"geojson":return Ct;case"image":return ee;case"raster":return wt;case"raster-dem":return It;case"vector":return Tt;case"video":return Jt;case"canvas":return te}return Kt[Pt]},bt="RTLPluginLoaded";class vt extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Q()}_syncState(z){return this.status=z,this.dispatcher.broadcast("SRPS",{pluginStatus:z,pluginURL:this.url}).catch(at=>{throw this.status="error",at})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(z){return e._(this,arguments,void 0,function*(at,xt=!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(!xt)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 re(){return Ut||(Ut=new vt),Ut}class Zt{constructor(z,at){this.timeAdded=0,this.fadeEndTime=0,this.tileID=z,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(z){let at=z+this.timeAdded;at<this.fadeEndTime||(this.fadeEndTime=at)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(z){this.demTexture&&z.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(z,at,xt){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",z){z.featureIndex&&(this.latestFeatureIndex=z.featureIndex,z.rawTileData?(this.latestRawTileData=z.rawTileData,this.latestFeatureIndex.rawTileData=z.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=z.collisionBoxArray,this.buckets=function(kt,Lt){let le={};if(!Lt)return le;for(let xe of kt){let Pe=xe.layerIds.map($e=>Lt.getLayer($e)).filter(Boolean);if(Pe.length!==0){xe.layers=Pe,xe.stateDependentLayerIds&&(xe.stateDependentLayers=xe.stateDependentLayerIds.map($e=>Pe.filter(hr=>hr.id===$e)[0]));for(let $e of Pe)le[$e.id]=xe}}return le}(z.buckets,at.style),this.hasSymbolBuckets=!1;for(let kt in this.buckets){let Lt=this.buckets[kt];if(Lt instanceof e.a6){if(this.hasSymbolBuckets=!0,!xt)break;Lt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let kt in this.buckets){let Lt=this.buckets[kt];if(Lt instanceof e.a6&&Lt.hasRTLText){this.hasRTLText=!0,re().lazyLoad();break}}this.queryPadding=0;for(let kt in this.buckets){let Lt=this.buckets[kt];this.queryPadding=Math.max(this.queryPadding,at.style.getLayer(kt).queryRadius(Lt))}z.imageAtlas&&(this.imageAtlas=z.imageAtlas),z.glyphAtlasImage&&(this.glyphAtlasImage=z.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(let z in this.buckets)this.buckets[z].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(z){return this.buckets[z.id]}upload(z){for(let xt in this.buckets){let kt=this.buckets[xt];kt.uploadPending()&&kt.upload(z)}let at=z.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new h(z,this.imageAtlas.image,at.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new h(z,this.glyphAtlasImage,at.ALPHA),this.glyphAtlasImage=null)}prepare(z){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(z,this.imageAtlasTexture)}queryRenderedFeatures(z,at,xt,kt,Lt,le,xe,Pe,$e,hr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:kt,cameraQueryGeometry:Lt,scale:le,tileSize:this.tileSize,pixelPosMatrix:hr,transform:Pe,params:xe,queryPadding:this.queryPadding*$e},z,at,xt):{}}querySourceFeatures(z,at){let xt=this.latestFeatureIndex;if(!xt||!xt.rawTileData)return;let kt=xt.loadVTLayers(),Lt=at&&at.sourceLayer?at.sourceLayer:"",le=kt._geojsonTileLayer||kt[Lt];if(!le)return;let xe=e.a7(at&&at.filter),{z:Pe,x:$e,y:hr}=this.tileID.canonical,pr={z:Pe,x:$e,y:hr};for(let Br=0;Br<le.length;Br++){let Jr=le.feature(Br);if(xe.needGeometry){let ae=e.a8(Jr,!0);if(!xe.filter(new e.z(this.tileID.overscaledZ),ae,this.tileID.canonical))continue}else if(!xe.filter(new e.z(this.tileID.overscaledZ),Jr))continue;let Rt=xt.getId(Jr,Lt),Gt=new e.a9(Jr,Pe,$e,hr,Rt);Gt.tile=pr,z.push(Gt)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(z){let at=this.expirationTime;if(z.cacheControl){let xt=e.aa(z.cacheControl);xt["max-age"]&&(this.expirationTime=Date.now()+1e3*xt["max-age"])}else z.expires&&(this.expirationTime=new Date(z.expires).getTime());if(this.expirationTime){let xt=Date.now(),kt=!1;if(this.expirationTime>xt)kt=!1;else if(at)if(this.expirationTime<at)kt=!0;else{let Lt=this.expirationTime-at;Lt?this.expirationTime=xt+Math.max(Lt,3e4):kt=!0}else kt=!0;kt?(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(z,at){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(z).length===0)return;let xt=this.latestFeatureIndex.loadVTLayers();for(let kt in this.buckets){if(!at.style.hasLayer(kt))continue;let Lt=this.buckets[kt],le=Lt.layers[0].sourceLayer||"_geojsonTileLayer",xe=xt[le],Pe=z[le];if(!xe||!Pe||Object.keys(Pe).length===0)continue;Lt.update(Pe,xe,this.imageAtlas&&this.imageAtlas.patternPositions||{});let $e=at&&at.style&&at.style.getLayer(kt);$e&&(this.queryPadding=Math.max(this.queryPadding,$e.queryRadius(Lt)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(z){this.symbolFadeHoldUntil=o.now()+z}setDependencies(z,at){let xt={};for(let kt of at)xt[kt]=!0;this.dependencies[z]=xt}hasDependency(z,at){for(let xt of z){let kt=this.dependencies[xt];if(kt){for(let Lt of at)if(kt[Lt])return!0}}return!1}}class ue{constructor(z,at){this.max=z,this.onRemove=at,this.reset()}reset(){for(let z in this.data)for(let at of this.data[z])at.timeout&&clearTimeout(at.timeout),this.onRemove(at.value);return this.data={},this.order=[],this}add(z,at,xt){let kt=z.wrapped().key;this.data[kt]===void 0&&(this.data[kt]=[]);let Lt={value:at,timeout:void 0};if(xt!==void 0&&(Lt.timeout=setTimeout(()=>{this.remove(z,Lt)},xt)),this.data[kt].push(Lt),this.order.push(kt),this.order.length>this.max){let le=this._getAndRemoveByKey(this.order[0]);le&&this.onRemove(le)}return this}has(z){return z.wrapped().key in this.data}getAndRemove(z){return this.has(z)?this._getAndRemoveByKey(z.wrapped().key):null}_getAndRemoveByKey(z){let at=this.data[z].shift();return at.timeout&&clearTimeout(at.timeout),this.data[z].length===0&&delete this.data[z],this.order.splice(this.order.indexOf(z),1),at.value}getByKey(z){let at=this.data[z];return at?at[0].value:null}get(z){return this.has(z)?this.data[z.wrapped().key][0].value:null}remove(z,at){if(!this.has(z))return this;let xt=z.wrapped().key,kt=at===void 0?0:this.data[xt].indexOf(at),Lt=this.data[xt][kt];return this.data[xt].splice(kt,1),Lt.timeout&&clearTimeout(Lt.timeout),this.data[xt].length===0&&delete this.data[xt],this.onRemove(Lt.value),this.order.splice(this.order.indexOf(xt),1),this}setMaxSize(z){for(this.max=z;this.order.length>this.max;){let at=this._getAndRemoveByKey(this.order[0]);at&&this.onRemove(at)}return this}filter(z){let at=[];for(let xt in this.data)for(let kt of this.data[xt])z(kt.value)||at.push(kt);for(let xt of at)this.remove(xt.value.tileID,xt)}}class Me{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(z,at,xt){let kt=String(at);if(this.stateChanges[z]=this.stateChanges[z]||{},this.stateChanges[z][kt]=this.stateChanges[z][kt]||{},e.e(this.stateChanges[z][kt],xt),this.deletedStates[z]===null){this.deletedStates[z]={};for(let Lt in this.state[z])Lt!==kt&&(this.deletedStates[z][Lt]=null)}else if(this.deletedStates[z]&&this.deletedStates[z][kt]===null){this.deletedStates[z][kt]={};for(let Lt in this.state[z][kt])xt[Lt]||(this.deletedStates[z][kt][Lt]=null)}else for(let Lt in xt)this.deletedStates[z]&&this.deletedStates[z][kt]&&this.deletedStates[z][kt][Lt]===null&&delete this.deletedStates[z][kt][Lt]}removeFeatureState(z,at,xt){if(this.deletedStates[z]===null)return;let kt=String(at);if(this.deletedStates[z]=this.deletedStates[z]||{},xt&&at!==void 0)this.deletedStates[z][kt]!==null&&(this.deletedStates[z][kt]=this.deletedStates[z][kt]||{},this.deletedStates[z][kt][xt]=null);else if(at!==void 0)if(this.stateChanges[z]&&this.stateChanges[z][kt])for(xt in this.deletedStates[z][kt]={},this.stateChanges[z][kt])this.deletedStates[z][kt][xt]=null;else this.deletedStates[z][kt]=null;else this.deletedStates[z]=null}getState(z,at){let xt=String(at),kt=e.e({},(this.state[z]||{})[xt],(this.stateChanges[z]||{})[xt]);if(this.deletedStates[z]===null)return{};if(this.deletedStates[z]){let Lt=this.deletedStates[z][at];if(Lt===null)return{};for(let le in Lt)delete kt[le]}return kt}initializeTileState(z,at){z.setFeatureState(this.state,at)}coalesceChanges(z,at){let xt={};for(let kt in this.stateChanges){this.state[kt]=this.state[kt]||{};let Lt={};for(let le in this.stateChanges[kt])this.state[kt][le]||(this.state[kt][le]={}),e.e(this.state[kt][le],this.stateChanges[kt][le]),Lt[le]=this.state[kt][le];xt[kt]=Lt}for(let kt in this.deletedStates){this.state[kt]=this.state[kt]||{};let Lt={};if(this.deletedStates[kt]===null)for(let le in this.state[kt])Lt[le]={},this.state[kt][le]={};else for(let le in this.deletedStates[kt]){if(this.deletedStates[kt][le]===null)this.state[kt][le]={};else for(let xe of Object.keys(this.deletedStates[kt][le]))delete this.state[kt][le][xe];Lt[le]=this.state[kt][le]}xt[kt]=xt[kt]||{},e.e(xt[kt],Lt)}if(this.stateChanges={},this.deletedStates={},Object.keys(xt).length!==0)for(let kt in z)z[kt].setFeatureState(xt,at)}}class Ce extends e.E{constructor(z,at,xt){super(),this.id=z,this.dispatcher=xt,this.on("data",kt=>this._dataHandler(kt)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((kt,Lt,le,xe)=>{let Pe=new(mt(Lt.type))(kt,Lt,le,xe);if(Pe.id!==kt)throw new Error(`Expected Source id to be ${kt} instead of ${Pe.id}`);return Pe})(z,at,xt,this),this._tiles={},this._cache=new ue(0,kt=>this._unloadTile(kt)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Me,this._didEmitContent=!1,this._updated=!1}onAdd(z){this.map=z,this._maxTileCacheSize=z?z._maxTileCacheSize:null,this._maxTileCacheZoomLevels=z?z._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(z)}onRemove(z){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(z)}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 z in this._tiles){let at=this._tiles[z];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 z=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,z&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(z,at,xt){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(z),this._tileLoaded(z,at,xt)}catch(kt){z.state="errored",kt.status!==404?this._source.fire(new e.j(kt,{tile:z})):this.update(this.transform,this.terrain)}})}_unloadTile(z){this._source.unloadTile&&this._source.unloadTile(z)}_abortTile(z){this._source.abortTile&&this._source.abortTile(z),this._source.fire(new e.k("dataabort",{tile:z,coord:z.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(z){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let at in this._tiles){let xt=this._tiles[at];xt.upload(z),xt.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(z=>z.tileID).sort(We).map(z=>z.key)}getRenderableIds(z){let at=[];for(let xt in this._tiles)this._isIdRenderable(xt,z)&&at.push(this._tiles[xt]);return z?at.sort((xt,kt)=>{let Lt=xt.tileID,le=kt.tileID,xe=new e.P(Lt.canonical.x,Lt.canonical.y)._rotate(this.transform.angle),Pe=new e.P(le.canonical.x,le.canonical.y)._rotate(this.transform.angle);return Lt.overscaledZ-le.overscaledZ||Pe.y-xe.y||Pe.x-xe.x}).map(xt=>xt.tileID.key):at.map(xt=>xt.tileID).sort(We).map(xt=>xt.key)}hasRenderableParent(z){let at=this.findLoadedParent(z,0);return!!at&&this._isIdRenderable(at.tileID.key)}_isIdRenderable(z,at){return this._tiles[z]&&this._tiles[z].hasData()&&!this._coveredTiles[z]&&(at||!this._tiles[z].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let z in this._tiles)this._tiles[z].state!=="errored"&&this._reloadTile(z,"reloading")}}_reloadTile(z,at){return e._(this,void 0,void 0,function*(){let xt=this._tiles[z];xt&&(xt.state!=="loading"&&(xt.state=at),yield this._loadTile(xt,z,at))})}_tileLoaded(z,at,xt){z.timeAdded=o.now(),xt==="expired"&&(z.refreshedUponExpiration=!0),this._setTileReloadTimer(at,z),this.getSource().type==="raster-dem"&&z.dem&&this._backfillDEM(z),this._state.initializeTileState(z,this.map?this.map.painter:null),z.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:z,coord:z.tileID}))}_backfillDEM(z){let at=this.getRenderableIds();for(let kt=0;kt<at.length;kt++){let Lt=at[kt];if(z.neighboringTiles&&z.neighboringTiles[Lt]){let le=this.getTileByID(Lt);xt(z,le),xt(le,z)}}function xt(kt,Lt){kt.needsHillshadePrepare=!0,kt.needsTerrainPrepare=!0;let le=Lt.tileID.canonical.x-kt.tileID.canonical.x,xe=Lt.tileID.canonical.y-kt.tileID.canonical.y,Pe=Math.pow(2,kt.tileID.canonical.z),$e=Lt.tileID.key;le===0&&xe===0||Math.abs(xe)>1||(Math.abs(le)>1&&(Math.abs(le+Pe)===1?le+=Pe:Math.abs(le-Pe)===1&&(le-=Pe)),Lt.dem&&kt.dem&&(kt.dem.backfillBorder(Lt.dem,le,xe),kt.neighboringTiles&&kt.neighboringTiles[$e]&&(kt.neighboringTiles[$e].backfilled=!0)))}}getTile(z){return this.getTileByID(z.key)}getTileByID(z){return this._tiles[z]}_retainLoadedChildren(z,at,xt,kt){for(let Lt in this._tiles){let le=this._tiles[Lt];if(kt[Lt]||!le.hasData()||le.tileID.overscaledZ<=at||le.tileID.overscaledZ>xt)continue;let xe=le.tileID;for(;le&&le.tileID.overscaledZ>at+1;){let $e=le.tileID.scaledTo(le.tileID.overscaledZ-1);le=this._tiles[$e.key],le&&le.hasData()&&(xe=$e)}let Pe=xe;for(;Pe.overscaledZ>at;)if(Pe=Pe.scaledTo(Pe.overscaledZ-1),z[Pe.key]){kt[xe.key]=xe;break}}}findLoadedParent(z,at){if(z.key in this._loadedParentTiles){let xt=this._loadedParentTiles[z.key];return xt&&xt.tileID.overscaledZ>=at?xt:null}for(let xt=z.overscaledZ-1;xt>=at;xt--){let kt=z.scaledTo(xt),Lt=this._getLoadedTile(kt);if(Lt)return Lt}}findLoadedSibling(z){return this._getLoadedTile(z)}_getLoadedTile(z){let at=this._tiles[z.key];return at&&at.hasData()?at:this._cache.getByKey(z.wrapped().key)}updateCacheSize(z){let at=Math.ceil(z.width/this._source.tileSize)+1,xt=Math.ceil(z.height/this._source.tileSize)+1,kt=Math.floor(at*xt*(this._maxTileCacheZoomLevels===null?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Lt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,kt):kt;this._cache.setMaxSize(Lt)}handleWrapJump(z){let at=Math.round((z-(this._prevLng===void 0?z:this._prevLng))/360);if(this._prevLng=z,at){let xt={};for(let kt in this._tiles){let Lt=this._tiles[kt];Lt.tileID=Lt.tileID.unwrapTo(Lt.tileID.wrap+at),xt[Lt.tileID.key]=Lt}this._tiles=xt;for(let kt in this._timers)clearTimeout(this._timers[kt]),delete this._timers[kt];for(let kt in this._tiles)this._setTileReloadTimer(kt,this._tiles[kt])}}_updateCoveredAndRetainedTiles(z,at,xt,kt,Lt,le){let xe={},Pe={},$e=Object.keys(z),hr=o.now();for(let pr of $e){let Br=z[pr],Jr=this._tiles[pr];if(!Jr||Jr.fadeEndTime!==0&&Jr.fadeEndTime<=hr)continue;let Rt=this.findLoadedParent(Br,at),Gt=this.findLoadedSibling(Br),ae=Rt||Gt||null;ae&&(this._addTile(ae.tileID),xe[ae.tileID.key]=ae.tileID),Pe[pr]=Br}this._retainLoadedChildren(Pe,kt,xt,z);for(let pr in xe)z[pr]||(this._coveredTiles[pr]=!0,z[pr]=xe[pr]);if(le){let pr={},Br={};for(let Jr of Lt)this._tiles[Jr.key].hasData()?pr[Jr.key]=Jr:Br[Jr.key]=Jr;for(let Jr in Br){let Rt=Br[Jr].children(this._source.maxzoom);this._tiles[Rt[0].key]&&this._tiles[Rt[1].key]&&this._tiles[Rt[2].key]&&this._tiles[Rt[3].key]&&(pr[Rt[0].key]=z[Rt[0].key]=Rt[0],pr[Rt[1].key]=z[Rt[1].key]=Rt[1],pr[Rt[2].key]=z[Rt[2].key]=Rt[2],pr[Rt[3].key]=z[Rt[3].key]=Rt[3],delete Br[Jr])}for(let Jr in Br){let Rt=Br[Jr],Gt=this.findLoadedParent(Rt,this._source.minzoom),ae=this.findLoadedSibling(Rt),ce=Gt||ae||null;if(ce){pr[ce.tileID.key]=z[ce.tileID.key]=ce.tileID;for(let Te in pr)pr[Te].isChildOf(ce.tileID)&&delete pr[Te]}}for(let Jr in this._tiles)pr[Jr]||(this._coveredTiles[Jr]=!0)}}update(z,at){if(!this._sourceLoaded||this._paused)return;let xt;this.transform=z,this.terrain=at,this.updateCacheSize(z),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?xt=z.getVisibleUnwrappedCoordinates(this._source.tileID).map(hr=>new e.S(hr.canonical.z,hr.wrap,hr.canonical.z,hr.canonical.x,hr.canonical.y)):(xt=z.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&&(xt=xt.filter(hr=>this._source.hasTile(hr)))):xt=[];let kt=z.coveringZoomLevel(this._source),Lt=Math.max(kt-Ce.maxOverzooming,this._source.minzoom),le=Math.max(kt+Ce.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let hr={};for(let pr of xt)if(pr.canonical.z>this._source.minzoom){let Br=pr.scaledTo(pr.canonical.z-1);hr[Br.key]=Br;let Jr=pr.scaledTo(Math.max(this._source.minzoom,Math.min(pr.canonical.z,5)));hr[Jr.key]=Jr}xt=xt.concat(Object.values(hr))}let xe=xt.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,xe&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let Pe=this._updateRetainedTiles(xt,kt);qe(this._source.type)&&this._updateCoveredAndRetainedTiles(Pe,Lt,le,kt,xt,at);for(let hr in Pe)this._tiles[hr].clearFadeHold();let $e=e.ab(this._tiles,Pe);for(let hr of $e){let pr=this._tiles[hr];pr.hasSymbolBuckets&&!pr.holdingForFade()?pr.setHoldDuration(this.map._fadeDuration):pr.hasSymbolBuckets&&!pr.symbolFadeFinished()||this._removeTile(hr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let z in this._tiles)this._tiles[z].holdingForFade()&&this._removeTile(z)}_updateRetainedTiles(z,at){var xt;let kt={},Lt={},le=Math.max(at-Ce.maxOverzooming,this._source.minzoom),xe=Math.max(at+Ce.maxUnderzooming,this._source.minzoom),Pe={};for(let $e of z){let hr=this._addTile($e);kt[$e.key]=$e,hr.hasData()||at<this._source.maxzoom&&(Pe[$e.key]=$e)}this._retainLoadedChildren(Pe,at,xe,kt);for(let $e of z){let hr=this._tiles[$e.key];if(hr.hasData())continue;if(at+1>this._source.maxzoom){let Br=$e.children(this._source.maxzoom)[0],Jr=this.getTile(Br);if(Jr&&Jr.hasData()){kt[Br.key]=Br;continue}}else{let Br=$e.children(this._source.maxzoom);if(kt[Br[0].key]&&kt[Br[1].key]&&kt[Br[2].key]&&kt[Br[3].key])continue}let pr=hr.wasRequested();for(let Br=$e.overscaledZ-1;Br>=le;--Br){let Jr=$e.scaledTo(Br);if(Lt[Jr.key])break;if(Lt[Jr.key]=!0,hr=this.getTile(Jr),!hr&&pr&&(hr=this._addTile(Jr)),hr){let Rt=hr.hasData();if((Rt||!(!((xt=this.map)===null||xt===void 0)&&xt.cancelPendingTileRequestsWhileZooming)||pr)&&(kt[Jr.key]=Jr),pr=hr.wasRequested(),Rt)break}}}return kt}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let z in this._tiles){let at=[],xt,kt=this._tiles[z].tileID;for(;kt.overscaledZ>0;){if(kt.key in this._loadedParentTiles){xt=this._loadedParentTiles[kt.key];break}at.push(kt.key);let Lt=kt.scaledTo(kt.overscaledZ-1);if(xt=this._getLoadedTile(Lt),xt)break;kt=Lt}for(let Lt of at)this._loadedParentTiles[Lt]=xt}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let z in this._tiles){let at=this._tiles[z].tileID,xt=this._getLoadedTile(at);this._loadedSiblingTiles[at.key]=xt}}_addTile(z){let at=this._tiles[z.key];if(at)return at;at=this._cache.getAndRemove(z),at&&(this._setTileReloadTimer(z.key,at),at.tileID=z,this._state.initializeTileState(at,this.map?this.map.painter:null),this._cacheTimers[z.key]&&(clearTimeout(this._cacheTimers[z.key]),delete this._cacheTimers[z.key],this._setTileReloadTimer(z.key,at)));let xt=at;return at||(at=new Zt(z,this._source.tileSize*z.overscaleFactor()),this._loadTile(at,z.key,at.state)),at.uses++,this._tiles[z.key]=at,xt||this._source.fire(new e.k("dataloading",{tile:at,coord:at.tileID,dataType:"source"})),at}_setTileReloadTimer(z,at){z in this._timers&&(clearTimeout(this._timers[z]),delete this._timers[z]);let xt=at.getExpiryTimeout();xt&&(this._timers[z]=setTimeout(()=>{this._reloadTile(z,"expired"),delete this._timers[z]},xt))}_removeTile(z){let at=this._tiles[z];at&&(at.uses--,delete this._tiles[z],this._timers[z]&&(clearTimeout(this._timers[z]),delete this._timers[z]),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(z){let at=z.sourceDataType;z.dataType==="source"&&at==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&z.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 z in this._tiles)this._removeTile(z);this._cache.reset()}tilesIn(z,at,xt){let kt=[],Lt=this.transform;if(!Lt)return kt;let le=xt?Lt.getCameraQueryGeometry(z):z,xe=z.map(Rt=>Lt.pointCoordinate(Rt,this.terrain)),Pe=le.map(Rt=>Lt.pointCoordinate(Rt,this.terrain)),$e=this.getIds(),hr=1/0,pr=1/0,Br=-1/0,Jr=-1/0;for(let Rt of Pe)hr=Math.min(hr,Rt.x),pr=Math.min(pr,Rt.y),Br=Math.max(Br,Rt.x),Jr=Math.max(Jr,Rt.y);for(let Rt=0;Rt<$e.length;Rt++){let Gt=this._tiles[$e[Rt]];if(Gt.holdingForFade())continue;let ae=Gt.tileID,ce=Math.pow(2,Lt.zoom-Gt.tileID.overscaledZ),Te=at*Gt.queryPadding*e.X/Gt.tileSize/ce,ye=[ae.getTilePoint(new e.Z(hr,pr)),ae.getTilePoint(new e.Z(Br,Jr))];if(ye[0].x-Te<e.X&&ye[0].y-Te<e.X&&ye[1].x+Te>=0&&ye[1].y+Te>=0){let ze=xe.map(fr=>ae.getTilePoint(fr)),rr=Pe.map(fr=>ae.getTilePoint(fr));kt.push({tile:Gt,tileID:ae,queryGeometry:ze,cameraQueryGeometry:rr,scale:ce})}}return kt}getVisibleCoordinates(z){let at=this.getRenderableIds(z).map(xt=>this._tiles[xt].tileID);for(let xt of at)xt.posMatrix=this.transform.calculatePosMatrix(xt.toUnwrapped());return at}hasTransition(){if(this._source.hasTransition())return!0;if(qe(this._source.type)){let z=o.now();for(let at in this._tiles)if(this._tiles[at].fadeEndTime>=z)return!0}return!1}setFeatureState(z,at,xt){this._state.updateState(z=z||"_geojsonTileLayer",at,xt)}removeFeatureState(z,at,xt){this._state.removeFeatureState(z=z||"_geojsonTileLayer",at,xt)}getFeatureState(z,at){return this._state.getState(z=z||"_geojsonTileLayer",at)}setDependencies(z,at,xt){let kt=this._tiles[z];kt&&kt.setDependencies(at,xt)}reloadTilesForDependencies(z,at){for(let xt in this._tiles)this._tiles[xt].hasDependency(z,at)&&this._reloadTile(xt,"reloading");this._cache.filter(xt=>!xt.hasDependency(z,at))}}function We(Pt,z){let at=Math.abs(2*Pt.wrap)-+(Pt.wrap<0),xt=Math.abs(2*z.wrap)-+(z.wrap<0);return Pt.overscaledZ-z.overscaledZ||xt-at||z.canonical.y-Pt.canonical.y||z.canonical.x-Pt.canonical.x}function qe(Pt){return Pt==="raster"||Pt==="image"||Pt==="video"}Ce.maxOverzooming=10,Ce.maxUnderzooming=3;class vr{constructor(z,at){this.reset(z,at)}reset(z,at){this.points=z||[],this._distances=[0];for(let xt=1;xt<this.points.length;xt++)this._distances[xt]=this._distances[xt-1]+this.points[xt].dist(this.points[xt-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(z){if(this.points.length===1)return this.points[0];z=e.ac(z,0,1);let at=1,xt=this._distances[at],kt=z*this.paddedLength+this.padding;for(;xt<kt&&at<this._distances.length;)xt=this._distances[++at];let Lt=at-1,le=this._distances[Lt],xe=xt-le,Pe=xe>0?(kt-le)/xe:0;return this.points[Lt].mult(1-Pe).add(this.points[at].mult(Pe))}}function _r(Pt,z){let at=!0;return Pt==="always"||Pt!=="never"&&z!=="never"||(at=!1),at}class er{constructor(z,at,xt){let kt=this.boxCells=[],Lt=this.circleCells=[];this.xCellCount=Math.ceil(z/xt),this.yCellCount=Math.ceil(at/xt);for(let le=0;le<this.xCellCount*this.yCellCount;le++)kt.push([]),Lt.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=z,this.height=at,this.xScale=this.xCellCount/z,this.yScale=this.yCellCount/at,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(z,at,xt,kt,Lt){this._forEachCell(at,xt,kt,Lt,this._insertBoxCell,this.boxUid++),this.boxKeys.push(z),this.bboxes.push(at),this.bboxes.push(xt),this.bboxes.push(kt),this.bboxes.push(Lt)}insertCircle(z,at,xt,kt){this._forEachCell(at-kt,xt-kt,at+kt,xt+kt,this._insertCircleCell,this.circleUid++),this.circleKeys.push(z),this.circles.push(at),this.circles.push(xt),this.circles.push(kt)}_insertBoxCell(z,at,xt,kt,Lt,le){this.boxCells[Lt].push(le)}_insertCircleCell(z,at,xt,kt,Lt,le){this.circleCells[Lt].push(le)}_query(z,at,xt,kt,Lt,le,xe){if(xt<0||z>this.width||kt<0||at>this.height)return[];let Pe=[];if(z<=0&&at<=0&&this.width<=xt&&this.height<=kt){if(Lt)return[{key:null,x1:z,y1:at,x2:xt,y2:kt}];for(let $e=0;$e<this.boxKeys.length;$e++)Pe.push({key:this.boxKeys[$e],x1:this.bboxes[4*$e],y1:this.bboxes[4*$e+1],x2:this.bboxes[4*$e+2],y2:this.bboxes[4*$e+3]});for(let $e=0;$e<this.circleKeys.length;$e++){let hr=this.circles[3*$e],pr=this.circles[3*$e+1],Br=this.circles[3*$e+2];Pe.push({key:this.circleKeys[$e],x1:hr-Br,y1:pr-Br,x2:hr+Br,y2:pr+Br})}}else this._forEachCell(z,at,xt,kt,this._queryCell,Pe,{hitTest:Lt,overlapMode:le,seenUids:{box:{},circle:{}}},xe);return Pe}query(z,at,xt,kt){return this._query(z,at,xt,kt,!1,null)}hitTest(z,at,xt,kt,Lt,le){return this._query(z,at,xt,kt,!0,Lt,le).length>0}hitTestCircle(z,at,xt,kt,Lt){let le=z-xt,xe=z+xt,Pe=at-xt,$e=at+xt;if(xe<0||le>this.width||$e<0||Pe>this.height)return!1;let hr=[];return this._forEachCell(le,Pe,xe,$e,this._queryCellCircle,hr,{hitTest:!0,overlapMode:kt,circle:{x:z,y:at,radius:xt},seenUids:{box:{},circle:{}}},Lt),hr.length>0}_queryCell(z,at,xt,kt,Lt,le,xe,Pe){let{seenUids:$e,hitTest:hr,overlapMode:pr}=xe,Br=this.boxCells[Lt];if(Br!==null){let Rt=this.bboxes;for(let Gt of Br)if(!$e.box[Gt]){$e.box[Gt]=!0;let ae=4*Gt,ce=this.boxKeys[Gt];if(z<=Rt[ae+2]&&at<=Rt[ae+3]&&xt>=Rt[ae+0]&&kt>=Rt[ae+1]&&(!Pe||Pe(ce))&&(!hr||!_r(pr,ce.overlapMode))&&(le.push({key:ce,x1:Rt[ae],y1:Rt[ae+1],x2:Rt[ae+2],y2:Rt[ae+3]}),hr))return!0}}let Jr=this.circleCells[Lt];if(Jr!==null){let Rt=this.circles;for(let Gt of Jr)if(!$e.circle[Gt]){$e.circle[Gt]=!0;let ae=3*Gt,ce=this.circleKeys[Gt];if(this._circleAndRectCollide(Rt[ae],Rt[ae+1],Rt[ae+2],z,at,xt,kt)&&(!Pe||Pe(ce))&&(!hr||!_r(pr,ce.overlapMode))){let Te=Rt[ae],ye=Rt[ae+1],ze=Rt[ae+2];if(le.push({key:ce,x1:Te-ze,y1:ye-ze,x2:Te+ze,y2:ye+ze}),hr)return!0}}}return!1}_queryCellCircle(z,at,xt,kt,Lt,le,xe,Pe){let{circle:$e,seenUids:hr,overlapMode:pr}=xe,Br=this.boxCells[Lt];if(Br!==null){let Rt=this.bboxes;for(let Gt of Br)if(!hr.box[Gt]){hr.box[Gt]=!0;let ae=4*Gt,ce=this.boxKeys[Gt];if(this._circleAndRectCollide($e.x,$e.y,$e.radius,Rt[ae+0],Rt[ae+1],Rt[ae+2],Rt[ae+3])&&(!Pe||Pe(ce))&&!_r(pr,ce.overlapMode))return le.push(!0),!0}}let Jr=this.circleCells[Lt];if(Jr!==null){let Rt=this.circles;for(let Gt of Jr)if(!hr.circle[Gt]){hr.circle[Gt]=!0;let ae=3*Gt,ce=this.circleKeys[Gt];if(this._circlesCollide(Rt[ae],Rt[ae+1],Rt[ae+2],$e.x,$e.y,$e.radius)&&(!Pe||Pe(ce))&&!_r(pr,ce.overlapMode))return le.push(!0),!0}}}_forEachCell(z,at,xt,kt,Lt,le,xe,Pe){let $e=this._convertToXCellCoord(z),hr=this._convertToYCellCoord(at),pr=this._convertToXCellCoord(xt),Br=this._convertToYCellCoord(kt);for(let Jr=$e;Jr<=pr;Jr++)for(let Rt=hr;Rt<=Br;Rt++)if(Lt.call(this,z,at,xt,kt,this.xCellCount*Rt+Jr,le,xe,Pe))return}_convertToXCellCoord(z){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(z*this.xScale)))}_convertToYCellCoord(z){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(z*this.yScale)))}_circlesCollide(z,at,xt,kt,Lt,le){let xe=kt-z,Pe=Lt-at,$e=xt+le;return $e*$e>xe*xe+Pe*Pe}_circleAndRectCollide(z,at,xt,kt,Lt,le,xe){let Pe=(le-kt)/2,$e=Math.abs(z-(kt+Pe));if($e>Pe+xt)return!1;let hr=(xe-Lt)/2,pr=Math.abs(at-(Lt+hr));if(pr>hr+xt)return!1;if($e<=Pe||pr<=hr)return!0;let Br=$e-Pe,Jr=pr-hr;return Br*Br+Jr*Jr<=xt*xt}}function Mr(Pt,z,at,xt,kt){let Lt=e.H();return z?(e.K(Lt,Lt,[1/kt,1/kt,1]),at||e.ad(Lt,Lt,xt.angle)):e.L(Lt,xt.labelPlaneMatrix,Pt),Lt}function Ir(Pt,z,at,xt,kt){if(z){let Lt=e.ae(Pt);return e.K(Lt,Lt,[kt,kt,1]),at||e.ad(Lt,Lt,-xt.angle),Lt}return xt.glCoordMatrix}function de(Pt,z,at,xt){let kt;xt?(kt=[Pt,z,xt(Pt,z),1],e.af(kt,kt,at)):(kt=[Pt,z,0,1],Ye(kt,kt,at));let Lt=kt[3];return{point:new e.P(kt[0]/Lt,kt[1]/Lt),signedDistanceFromCamera:Lt,isOccluded:!1}}function Dt(Pt,z){return .5+Pt/z*.5}function qt(Pt,z){return Pt.x>=-z[0]&&Pt.x<=z[0]&&Pt.y>=-z[1]&&Pt.y<=z[1]}function _t(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt){let Gt=xt?Pt.textSizeData:Pt.iconSizeData,ae=e.ag(Gt,at.transform.zoom),ce=[256/at.width*2+1,256/at.height*2+1],Te=xt?Pt.text.dynamicLayoutVertexArray:Pt.icon.dynamicLayoutVertexArray;Te.clear();let ye=Pt.lineVertexArray,ze=xt?Pt.text.placedSymbolArray:Pt.icon.placedSymbolArray,rr=at.transform.width/at.transform.height,fr=!1;for(let gr=0;gr<ze.length;gr++){let Lr=ze.get(gr);if(Lr.hidden||Lr.writingMode===e.ah.vertical&&!fr){ar(Lr.numGlyphs,Te);continue}fr=!1;let Hr=de(Lr.anchorX,Lr.anchorY,z,Rt);if(!qt(Hr.point,ce)){ar(Lr.numGlyphs,Te);continue}let nn=Dt(at.transform.cameraToCenterDistance,Hr.signedDistanceFromCamera),cn=e.ai(Gt,ae,Lr),Mn=le?cn/nn:cn*nn,Jn={getElevation:Rt,labelPlaneMatrix:kt,lineVertexArray:ye,pitchWithMap:le,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:$e,tileAnchorPoint:new e.P(Lr.anchorX,Lr.anchorY),unwrappedTileID:hr,width:pr,height:Br,translation:Jr},_a=St(Jn,Lr,Mn,!1,xe,z,Lt,Pt.glyphOffsetArray,Te,rr,Pe);fr=_a.useVertical,(_a.notEnoughRoom||fr||_a.needsFlipping&&St(Jn,Lr,Mn,!0,xe,z,Lt,Pt.glyphOffsetArray,Te,rr,Pe).notEnoughRoom)&&ar(Lr.numGlyphs,Te)}xt?Pt.text.dynamicLayoutVertexBuffer.updateData(Te):Pt.icon.dynamicLayoutVertexBuffer.updateData(Te)}function lt(Pt,z,at,xt,kt,Lt,le,xe){let Pe=Lt.glyphStartIndex+Lt.numGlyphs,$e=Lt.lineStartIndex,hr=Lt.lineStartIndex+Lt.lineLength,pr=z.getoffsetX(Lt.glyphStartIndex),Br=z.getoffsetX(Pe-1),Jr=Ue(Pt*pr,at,xt,kt,Lt.segment,$e,hr,xe,le);if(!Jr)return null;let Rt=Ue(Pt*Br,at,xt,kt,Lt.segment,$e,hr,xe,le);return Rt?xe.projectionCache.anyProjectionOccluded?null:{first:Jr,last:Rt}:null}function yt(Pt,z,at,xt){return Pt===e.ah.horizontal&&Math.abs(at.y-z.y)>Math.abs(at.x-z.x)*xt?{useVertical:!0}:(Pt===e.ah.vertical?z.y<at.y:z.x>at.x)?{needsFlipping:!0}:null}function St(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr){let pr=at/24,Br=z.lineOffsetX*pr,Jr=z.lineOffsetY*pr,Rt;if(z.numGlyphs>1){let Gt=z.glyphStartIndex+z.numGlyphs,ae=z.lineStartIndex,ce=z.lineStartIndex+z.lineLength,Te=lt(pr,xe,Br,Jr,xt,z,hr,Pt);if(!Te)return{notEnoughRoom:!0};let ye=de(Te.first.point.x,Te.first.point.y,le,Pt.getElevation).point,ze=de(Te.last.point.x,Te.last.point.y,le,Pt.getElevation).point;if(kt&&!xt){let rr=yt(z.writingMode,ye,ze,$e);if(rr)return rr}Rt=[Te.first];for(let rr=z.glyphStartIndex+1;rr<Gt-1;rr++)Rt.push(Ue(pr*xe.getoffsetX(rr),Br,Jr,xt,z.segment,ae,ce,Pt,hr));Rt.push(Te.last)}else{if(kt&&!xt){let ae=de(Pt.tileAnchorPoint.x,Pt.tileAnchorPoint.y,Lt,Pt.getElevation).point,ce=z.lineStartIndex+z.segment+1,Te=new e.P(Pt.lineVertexArray.getx(ce),Pt.lineVertexArray.gety(ce)),ye=de(Te.x,Te.y,Lt,Pt.getElevation),ze=ye.signedDistanceFromCamera>0?ye.point:function(fr,gr,Lr,Hr,nn,cn){return Ht(fr,gr,Lr,1,nn,cn)}(Pt.tileAnchorPoint,Te,ae,0,Lt,Pt),rr=yt(z.writingMode,ae,ze,$e);if(rr)return rr}let Gt=Ue(pr*xe.getoffsetX(z.glyphStartIndex),Br,Jr,xt,z.segment,z.lineStartIndex,z.lineStartIndex+z.lineLength,Pt,hr);if(!Gt||Pt.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Rt=[Gt]}for(let Gt of Rt)e.aj(Pe,Gt.point,Gt.angle);return{}}function Ht(Pt,z,at,xt,kt,Lt){let le=Pt.add(Pt.sub(z)._unit()),xe=kt!==void 0?de(le.x,le.y,kt,Lt.getElevation).point:se(le.x,le.y,Lt).point,Pe=at.sub(xe);return at.add(Pe._mult(xt/Pe.mag()))}function Yt(Pt,z,at){let xt=z.projectionCache;if(xt.projections[Pt])return xt.projections[Pt];let kt=new e.P(z.lineVertexArray.getx(Pt),z.lineVertexArray.gety(Pt)),Lt=se(kt.x,kt.y,z);if(Lt.signedDistanceFromCamera>0)return xt.projections[Pt]=Lt.point,xt.anyProjectionOccluded=xt.anyProjectionOccluded||Lt.isOccluded,Lt.point;let le=Pt-at.direction;return function(xe,Pe,$e,hr,pr){return Ht(xe,Pe,$e,hr,void 0,pr)}(at.distanceFromAnchor===0?z.tileAnchorPoint:new e.P(z.lineVertexArray.getx(le),z.lineVertexArray.gety(le)),kt,at.previousVertex,at.absOffsetX-at.distanceFromAnchor+1,z)}function se(Pt,z,at){let xt=Pt+at.translation[0],kt=z+at.translation[1],Lt;return!at.pitchWithMap&&at.projection.useSpecialProjectionForSymbols?(Lt=at.projection.projectTileCoordinates(xt,kt,at.unwrappedTileID,at.getElevation),Lt.point.x=(.5*Lt.point.x+.5)*at.width,Lt.point.y=(.5*-Lt.point.y+.5)*at.height):(Lt=de(xt,kt,at.labelPlaneMatrix,at.getElevation),Lt.isOccluded=!1),Lt}function ke(Pt,z,at){return Pt._unit()._perp()._mult(z*at)}function Ee(Pt,z,at,xt,kt,Lt,le,xe,Pe){if(xe.projectionCache.offsets[Pt])return xe.projectionCache.offsets[Pt];let $e=at.add(z);if(Pt+Pe.direction<xt||Pt+Pe.direction>=kt)return xe.projectionCache.offsets[Pt]=$e,$e;let hr=Yt(Pt+Pe.direction,xe,Pe),pr=ke(hr.sub(at),le,Pe.direction),Br=at.add(pr),Jr=hr.add(pr);return xe.projectionCache.offsets[Pt]=e.ak(Lt,$e,Br,Jr)||$e,xe.projectionCache.offsets[Pt]}function Ue(Pt,z,at,xt,kt,Lt,le,xe,Pe){let $e=xt?Pt-z:Pt+z,hr=$e>0?1:-1,pr=0;xt&&(hr*=-1,pr=Math.PI),hr<0&&(pr+=Math.PI);let Br,Jr=hr>0?Lt+kt:Lt+kt+1;xe.projectionCache.cachedAnchorPoint?Br=xe.projectionCache.cachedAnchorPoint:(Br=se(xe.tileAnchorPoint.x,xe.tileAnchorPoint.y,xe).point,xe.projectionCache.cachedAnchorPoint=Br);let Rt,Gt,ae=Br,ce=Br,Te=0,ye=0,ze=Math.abs($e),rr=[],fr;for(;Te+ye<=ze;){if(Jr+=hr,Jr<Lt||Jr>=le)return null;Te+=ye,ce=ae,Gt=Rt;let Hr={absOffsetX:ze,direction:hr,distanceFromAnchor:Te,previousVertex:ce};if(ae=Yt(Jr,xe,Hr),at===0)rr.push(ce),fr=ae.sub(ce);else{let nn,cn=ae.sub(ce);nn=cn.mag()===0?ke(Yt(Jr+hr,xe,Hr).sub(ae),at,hr):ke(cn,at,hr),Gt||(Gt=ce.add(nn)),Rt=Ee(Jr,nn,ae,Lt,le,Gt,at,xe,Hr),rr.push(Gt),fr=Rt.sub(Gt)}ye=fr.mag()}let gr=fr._mult((ze-Te)/ye)._add(Gt||ce),Lr=pr+Math.atan2(ae.y-ce.y,ae.x-ce.x);return rr.push(gr),{point:gr,angle:Pe?Lr:0,path:rr}}let ir=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ar(Pt,z){for(let at=0;at<Pt;at++){let xt=z.length;z.resize(xt+4),z.float32.set(ir,3*xt)}}function Ye(Pt,z,at){let xt=z[0],kt=z[1];return Pt[0]=at[0]*xt+at[4]*kt+at[12],Pt[1]=at[1]*xt+at[5]*kt+at[13],Pt[3]=at[3]*xt+at[7]*kt+at[15],Pt}let Er=100;class pn{constructor(z,at,xt=new er(z.width+200,z.height+200,25),kt=new er(z.width+200,z.height+200,25)){this.transform=z,this.mapProjection=at,this.grid=xt,this.ignoredGrid=kt,this.pitchFactor=Math.cos(z._pitch)*z.cameraToCenterDistance,this.screenRightBoundary=z.width+Er,this.screenBottomBoundary=z.height+Er,this.gridRightBoundary=z.width+200,this.gridBottomBoundary=z.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr){let Br=z.anchorPointX+Pe[0],Jr=z.anchorPointY+Pe[1],Rt=this.projectAndGetPerspectiveRatio(kt,Br,Jr,Lt,hr),Gt=xt*Rt.perspectiveRatio,ae;if(le||xe)ae=this._projectCollisionBox(z,Gt,kt,Lt,le,xe,Pe,Rt,hr,pr);else{let rr=Rt.point.x+(pr?pr.x*Gt:0),fr=Rt.point.y+(pr?pr.y*Gt:0);ae={allPointsOccluded:!1,box:[rr+z.x1*Gt,fr+z.y1*Gt,rr+z.x2*Gt,fr+z.y2*Gt]}}let[ce,Te,ye,ze]=ae.box;return this.mapProjection.useSpecialProjectionForSymbols&&(le?ae.allPointsOccluded:this.mapProjection.isOccluded(Br,Jr,Lt))||Rt.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(ce,Te,ye,ze)||at!=="always"&&this.grid.hitTest(ce,Te,ye,ze,at,$e)?{box:[ce,Te,ye,ze],placeable:!1,offscreen:!1}:{box:[ce,Te,ye,ze],placeable:!0,offscreen:this.isOffscreen(ce,Te,ye,ze)}}placeCollisionCircles(z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt,Gt,ae){let ce=[],Te=new e.P(at.anchorX,at.anchorY),ye=this.getPerspectiveRatio(le,Te.x,Te.y,xe,ae),ze=(pr?Lt/ye:Lt*ye)/e.ap,rr={getElevation:ae,labelPlaneMatrix:Pe,lineVertexArray:xt,pitchWithMap:pr,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:Te,unwrappedTileID:xe,width:this.transform.width,height:this.transform.height,translation:Gt},fr=lt(ze,kt,at.lineOffsetX*ze,at.lineOffsetY*ze,!1,at,!1,rr),gr=!1,Lr=!1,Hr=!0;if(fr){let nn=.5*Jr*ye+Rt,cn=new e.P(-100,-100),Mn=new e.P(this.screenRightBoundary,this.screenBottomBoundary),Jn=new vr,_a=fr.first,xa=fr.last,La=[];for(let mi=_a.path.length-1;mi>=1;mi--)La.push(_a.path[mi]);for(let mi=1;mi<xa.path.length;mi++)La.push(xa.path[mi]);let ai=2.5*nn;if($e){let mi=this.projectPathToScreenSpace(La,rr,$e);La=mi.some(Yi=>Yi.signedDistanceFromCamera<=0)?[]:mi.map(Yi=>Yi.point)}let Ai=[];if(La.length>0){let mi=La[0].clone(),Yi=La[0].clone();for(let Go=1;Go<La.length;Go++)mi.x=Math.min(mi.x,La[Go].x),mi.y=Math.min(mi.y,La[Go].y),Yi.x=Math.max(Yi.x,La[Go].x),Yi.y=Math.max(Yi.y,La[Go].y);Ai=mi.x>=cn.x&&Yi.x<=Mn.x&&mi.y>=cn.y&&Yi.y<=Mn.y?[La]:Yi.x<cn.x||mi.x>Mn.x||Yi.y<cn.y||mi.y>Mn.y?[]:e.al([La],cn.x,cn.y,Mn.x,Mn.y)}for(let mi of Ai){Jn.reset(mi,.25*nn);let Yi=0;Yi=Jn.length<=.5*nn?1:Math.ceil(Jn.paddedLength/ai)+1;for(let Go=0;Go<Yi;Go++){let Xo=Go/Math.max(Yi-1,1),po=Jn.lerp(Xo),Qo=po.x+Er,Js=po.y+Er;ce.push(Qo,Js,nn,0);let Us=Qo-nn,To=Js-nn,ko=Qo+nn,hl=Js+nn;if(Hr=Hr&&this.isOffscreen(Us,To,ko,hl),Lr=Lr||this.isInsideGrid(Us,To,ko,hl),z!=="always"&&this.grid.hitTestCircle(Qo,Js,nn,z,Br)&&(gr=!0,!hr))return{circles:[],offscreen:!1,collisionDetected:gr}}}}return{circles:!hr&&gr||!Lr||ye<this.perspectiveRatioCutoff?[]:ce,offscreen:Hr,collisionDetected:gr}}projectPathToScreenSpace(z,at,xt){return z.map(kt=>de(kt.x,kt.y,xt,at.getElevation))}queryRenderedSymbols(z){if(z.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let at=[],xt=1/0,kt=1/0,Lt=-1/0,le=-1/0;for(let hr of z){let pr=new e.P(hr.x+Er,hr.y+Er);xt=Math.min(xt,pr.x),kt=Math.min(kt,pr.y),Lt=Math.max(Lt,pr.x),le=Math.max(le,pr.y),at.push(pr)}let xe=this.grid.query(xt,kt,Lt,le).concat(this.ignoredGrid.query(xt,kt,Lt,le)),Pe={},$e={};for(let hr of xe){let pr=hr.key;if(Pe[pr.bucketInstanceId]===void 0&&(Pe[pr.bucketInstanceId]={}),Pe[pr.bucketInstanceId][pr.featureIndex])continue;let Br=[new e.P(hr.x1,hr.y1),new e.P(hr.x2,hr.y1),new e.P(hr.x2,hr.y2),new e.P(hr.x1,hr.y2)];e.am(at,Br)&&(Pe[pr.bucketInstanceId][pr.featureIndex]=!0,$e[pr.bucketInstanceId]===void 0&&($e[pr.bucketInstanceId]=[]),$e[pr.bucketInstanceId].push(pr.featureIndex))}return $e}insertCollisionBox(z,at,xt,kt,Lt,le){(xt?this.ignoredGrid:this.grid).insert({bucketInstanceId:kt,featureIndex:Lt,collisionGroupID:le,overlapMode:at},z[0],z[1],z[2],z[3])}insertCollisionCircles(z,at,xt,kt,Lt,le){let xe=xt?this.ignoredGrid:this.grid,Pe={bucketInstanceId:kt,featureIndex:Lt,collisionGroupID:le,overlapMode:at};for(let $e=0;$e<z.length;$e+=4)xe.insertCircle(Pe,z[$e],z[$e+1],z[$e+2])}projectAndGetPerspectiveRatio(z,at,xt,kt,Lt){let le;Lt?(le=[at,xt,Lt(at,xt),1],e.af(le,le,z)):(le=[at,xt,0,1],Ye(le,le,z));let xe=le[3];return{point:new e.P((le[0]/xe+1)/2*this.transform.width+Er,(-le[1]/xe+1)/2*this.transform.height+Er),perspectiveRatio:.5+this.transform.cameraToCenterDistance/xe*.5,isOccluded:!1,signedDistanceFromCamera:xe}}getPerspectiveRatio(z,at,xt,kt,Lt){let le=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(at,xt,kt,Lt):de(at,xt,z,Lt);return .5+this.transform.cameraToCenterDistance/le.signedDistanceFromCamera*.5}isOffscreen(z,at,xt,kt){return xt<Er||z>=this.screenRightBoundary||kt<Er||at>this.screenBottomBoundary}isInsideGrid(z,at,xt,kt){return xt>=0&&z<this.gridRightBoundary&&kt>=0&&at<this.gridBottomBoundary}getViewportMatrix(){let z=e.an([]);return e.J(z,z,[-100,-100,0]),z}_projectCollisionBox(z,at,xt,kt,Lt,le,xe,Pe,$e,hr){let pr=new e.P(1,0),Br=new e.P(0,1),Jr=new e.P(z.anchorPointX+xe[0],z.anchorPointY+xe[1]);if(le&&!Lt){let Hr=this.projectAndGetPerspectiveRatio(xt,Jr.x+1,Jr.y,kt,$e).point.sub(Pe.point).unit(),nn=Math.atan(Hr.y/Hr.x)+(Hr.x<0?Math.PI:0),cn=Math.sin(nn),Mn=Math.cos(nn);pr=new e.P(Mn,cn),Br=new e.P(-cn,Mn)}else if(!le&&Lt){let Hr=-this.transform.angle,nn=Math.sin(Hr),cn=Math.cos(Hr);pr=new e.P(cn,nn),Br=new e.P(-nn,cn)}let Rt=Pe.point,Gt=at;if(Lt){Rt=Jr;let Hr=this.transform.zoom-Math.floor(this.transform.zoom);Gt=Math.pow(2,-Hr),Gt*=this.mapProjection.getPitchedTextCorrection(this.transform,Jr,kt),hr||(Gt*=e.ac(.5+Pe.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}hr&&(Rt=Rt.add(pr.mult(hr.x*Gt)).add(Br.mult(hr.y*Gt)));let ae=z.x1*Gt,ce=z.x2*Gt,Te=(ae+ce)/2,ye=z.y1*Gt,ze=z.y2*Gt,rr=(ye+ze)/2,fr=[{offsetX:ae,offsetY:ye},{offsetX:Te,offsetY:ye},{offsetX:ce,offsetY:ye},{offsetX:ce,offsetY:rr},{offsetX:ce,offsetY:ze},{offsetX:Te,offsetY:ze},{offsetX:ae,offsetY:ze},{offsetX:ae,offsetY:rr}],gr=[];for(let{offsetX:Hr,offsetY:nn}of fr)gr.push(new e.P(Rt.x+pr.x*Hr+Br.x*nn,Rt.y+pr.y*Hr+Br.y*nn));let Lr=!1;if(Lt){let Hr=gr.map(nn=>this.projectAndGetPerspectiveRatio(xt,nn.x,nn.y,kt,$e));Lr=Hr.some(nn=>!nn.isOccluded),gr=Hr.map(nn=>nn.point)}else Lr=!0;return{box:e.ao(gr),allPointsOccluded:!Lr}}}function dn(Pt,z,at){return z*(e.X/(Pt.tileSize*Math.pow(2,at-Pt.tileID.overscaledZ)))}class bn{constructor(z,at,xt,kt){this.opacity=z?Math.max(0,Math.min(1,z.opacity+(z.placed?at:-at))):kt&&xt?1:0,this.placed=xt}isHidden(){return this.opacity===0&&!this.placed}}class Zn{constructor(z,at,xt,kt,Lt){this.text=new bn(z?z.text:null,at,xt,Lt),this.icon=new bn(z?z.icon:null,at,kt,Lt)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class En{constructor(z,at,xt){this.text=z,this.icon=at,this.skipFade=xt}}class gn{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class da{constructor(z,at,xt,kt,Lt){this.bucketInstanceId=z,this.featureIndex=at,this.sourceLayerIndex=xt,this.bucketIndex=kt,this.tileID=Lt}}class ra{constructor(z){this.crossSourceCollisions=z,this.maxGroupID=0,this.collisionGroups={}}get(z){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[z]){let at=++this.maxGroupID;this.collisionGroups[z]={ID:at,predicate:xt=>xt.collisionGroupID===at}}return this.collisionGroups[z]}}function Se(Pt,z,at,xt,kt){let{horizontalAlign:Lt,verticalAlign:le}=e.au(Pt);return new e.P(-(Lt-.5)*z+xt[0]*kt,-(le-.5)*at+xt[1]*kt)}class Re{constructor(z,at,xt,kt,Lt,le){this.transform=z.clone(),this.terrain=xt,this.collisionIndex=new pn(this.transform,at),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=kt,this.retainedQueryData={},this.collisionGroups=new ra(Lt),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=le,le&&(le.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(z){let at=this.terrain;return at?(xt,kt)=>at.getElevation(z,xt,kt):null}getBucketParts(z,at,xt,kt){let Lt=xt.getBucket(at),le=xt.latestFeatureIndex;if(!Lt||!le||at.id!==Lt.layerIds[0])return;let xe=xt.collisionBoxArray,Pe=Lt.layers[0].layout,$e=Lt.layers[0].paint,hr=Math.pow(2,this.transform.zoom-xt.tileID.overscaledZ),pr=xt.tileSize/e.X,Br=xt.tileID.toUnwrapped(),Jr=this.transform.calculatePosMatrix(Br),Rt=Pe.get("text-pitch-alignment")==="map",Gt=Pe.get("text-rotation-alignment")==="map",ae=dn(xt,1,this.transform.zoom),ce=this.collisionIndex.mapProjection.translatePosition(this.transform,xt,$e.get("text-translate"),$e.get("text-translate-anchor")),Te=this.collisionIndex.mapProjection.translatePosition(this.transform,xt,$e.get("icon-translate"),$e.get("icon-translate-anchor")),ye=Mr(Jr,Rt,Gt,this.transform,ae),ze=null;if(Rt){let fr=Ir(Jr,Rt,Gt,this.transform,ae);ze=e.L([],this.transform.labelPlaneMatrix,fr)}this.retainedQueryData[Lt.bucketInstanceId]=new da(Lt.bucketInstanceId,le,Lt.sourceLayerIndex,Lt.index,xt.tileID);let rr={bucket:Lt,layout:Pe,translationText:ce,translationIcon:Te,posMatrix:Jr,unwrappedTileID:Br,textLabelPlaneMatrix:ye,labelToScreenMatrix:ze,scale:hr,textPixelRatio:pr,holdingForFade:xt.holdingForFade(),collisionBoxArray:xe,partiallyEvaluatedTextSize:e.ag(Lt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Lt.sourceID)};if(kt)for(let fr of Lt.sortKeyRanges){let{sortKey:gr,symbolInstanceStart:Lr,symbolInstanceEnd:Hr}=fr;z.push({sortKey:gr,symbolInstanceStart:Lr,symbolInstanceEnd:Hr,parameters:rr})}else z.push({symbolInstanceStart:0,symbolInstanceEnd:Lt.symbolInstances.length,parameters:rr})}attemptAnchorPlacement(z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt,Gt,ae,ce,Te,ye){let ze=e.aq[z.textAnchor],rr=[z.textOffset0,z.textOffset1],fr=Se(ze,xt,kt,rr,Lt),gr=this.collisionIndex.placeCollisionBox(at,Br,Pe,$e,hr,xe,le,ae,pr.predicate,ye,fr);if((!Te||this.collisionIndex.placeCollisionBox(Te,Br,Pe,$e,hr,xe,le,ce,pr.predicate,ye,fr).placeable)&&gr.placeable){let Lr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Jr.crossTileID]&&this.prevPlacement.placements[Jr.crossTileID]&&this.prevPlacement.placements[Jr.crossTileID].text&&(Lr=this.prevPlacement.variableOffsets[Jr.crossTileID].anchor),Jr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Jr.crossTileID]={textOffset:rr,width:xt,height:kt,anchor:ze,textBoxScale:Lt,prevAnchor:Lr},this.markUsedJustification(Rt,ze,Jr,Gt),Rt.allowVerticalPlacement&&(this.markUsedOrientation(Rt,Gt,Jr),this.placedOrientations[Jr.crossTileID]=Gt),{shift:fr,placedGlyphBoxes:gr}}}placeLayerBucketPart(z,at,xt){let{bucket:kt,layout:Lt,translationText:le,translationIcon:xe,posMatrix:Pe,unwrappedTileID:$e,textLabelPlaneMatrix:hr,labelToScreenMatrix:pr,textPixelRatio:Br,holdingForFade:Jr,collisionBoxArray:Rt,partiallyEvaluatedTextSize:Gt,collisionGroup:ae}=z.parameters,ce=Lt.get("text-optional"),Te=Lt.get("icon-optional"),ye=e.ar(Lt,"text-overlap","text-allow-overlap"),ze=ye==="always",rr=e.ar(Lt,"icon-overlap","icon-allow-overlap"),fr=rr==="always",gr=Lt.get("text-rotation-alignment")==="map",Lr=Lt.get("text-pitch-alignment")==="map",Hr=Lt.get("icon-text-fit")!=="none",nn=Lt.get("symbol-z-order")==="viewport-y",cn=ze&&(fr||!kt.hasIconData()||Te),Mn=fr&&(ze||!kt.hasTextData()||ce);!kt.collisionArrays&&Rt&&kt.deserializeCollisionBoxes(Rt);let Jn=this._getTerrainElevationFunc(this.retainedQueryData[kt.bucketInstanceId].tileID),_a=(xa,La,ai)=>{var Ai,mi;if(at[xa.crossTileID])return;if(Jr)return void(this.placements[xa.crossTileID]=new En(!1,!1,!1));let Yi=!1,Go=!1,Xo=!0,po=null,Qo={box:null,placeable:!1,offscreen:null},Js={placeable:!1},Us=null,To=null,ko=null,hl=0,Sl=0,tu=0;La.textFeatureIndex?hl=La.textFeatureIndex:xa.useRuntimeCollisionCircles&&(hl=xa.featureIndex),La.verticalTextFeatureIndex&&(Sl=La.verticalTextFeatureIndex);let gt=La.textBox;if(gt){let me=or=>{let Cr=e.ah.horizontal;if(kt.allowVerticalPlacement&&!or&&this.prevPlacement){let Sr=this.prevPlacement.placedOrientations[xa.crossTileID];Sr&&(this.placedOrientations[xa.crossTileID]=Sr,Cr=Sr,this.markUsedOrientation(kt,Cr,xa))}return Cr},we=(or,Cr)=>{if(kt.allowVerticalPlacement&&xa.numVerticalGlyphVertices>0&&La.verticalTextBox){for(let Sr of kt.writingModes)if(Sr===e.ah.vertical?(Qo=Cr(),Js=Qo):Qo=or(),Qo&&Qo.placeable)break}else Qo=or()},Ve=xa.textAnchorOffsetStartIndex,je=xa.textAnchorOffsetEndIndex;if(je===Ve){let or=(Cr,Sr)=>{let Wr=this.collisionIndex.placeCollisionBox(Cr,ye,Br,Pe,$e,Lr,gr,le,ae.predicate,Jn);return Wr&&Wr.placeable&&(this.markUsedOrientation(kt,Sr,xa),this.placedOrientations[xa.crossTileID]=Sr),Wr};we(()=>or(gt,e.ah.horizontal),()=>{let Cr=La.verticalTextBox;return kt.allowVerticalPlacement&&xa.numVerticalGlyphVertices>0&&Cr?or(Cr,e.ah.vertical):{box:null,offscreen:null}}),me(Qo&&Qo.placeable)}else{let or=e.aq[(mi=(Ai=this.prevPlacement)===null||Ai===void 0?void 0:Ai.variableOffsets[xa.crossTileID])===null||mi===void 0?void 0:mi.anchor],Cr=(Wr,an,on)=>{let ta=Wr.x2-Wr.x1,hn=Wr.y2-Wr.y1,Bn=xa.textBoxScale,Hn=Hr&&rr==="never"?an:null,Yn=null,na=ye==="never"?1:2,_n="never";or&&na++;for(let Ha=0;Ha<na;Ha++){for(let Wa=Ve;Wa<je;Wa++){let ri=kt.textAnchorOffsets.get(Wa);if(or&&ri.textAnchor!==or)continue;let xi=this.attemptAnchorPlacement(ri,Wr,ta,hn,Bn,gr,Lr,Br,Pe,$e,ae,_n,xa,kt,on,le,xe,Hn,Jn);if(xi&&(Yn=xi.placedGlyphBoxes,Yn&&Yn.placeable))return Yi=!0,po=xi.shift,Yn}or?or=null:_n=ye}return xt&&!Yn&&(Yn={box:this.collisionIndex.placeCollisionBox(gt,"always",Br,Pe,$e,Lr,gr,le,ae.predicate,Jn,new e.P(0,0)).box,offscreen:!1,placeable:!1}),Yn};we(()=>Cr(gt,La.iconBox,e.ah.horizontal),()=>{let Wr=La.verticalTextBox;return kt.allowVerticalPlacement&&(!Qo||!Qo.placeable)&&xa.numVerticalGlyphVertices>0&&Wr?Cr(Wr,La.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Qo&&(Yi=Qo.placeable,Xo=Qo.offscreen);let Sr=me(Qo&&Qo.placeable);if(!Yi&&this.prevPlacement){let Wr=this.prevPlacement.variableOffsets[xa.crossTileID];Wr&&(this.variableOffsets[xa.crossTileID]=Wr,this.markUsedJustification(kt,Wr.anchor,xa,Sr))}}}if(Us=Qo,Yi=Us&&Us.placeable,Xo=Us&&Us.offscreen,xa.useRuntimeCollisionCircles){let me=kt.text.placedSymbolArray.get(xa.centerJustifiedTextSymbolIndex),we=e.ai(kt.textSizeData,Gt,me),Ve=Lt.get("text-padding");To=this.collisionIndex.placeCollisionCircles(ye,me,kt.lineVertexArray,kt.glyphOffsetArray,we,Pe,$e,hr,pr,xt,Lr,ae.predicate,xa.collisionCircleDiameter,Ve,le,Jn),To.circles.length&&To.collisionDetected&&!xt&&e.w("Collisions detected, but collision boxes are not shown"),Yi=ze||To.circles.length>0&&!To.collisionDetected,Xo=Xo&&To.offscreen}if(La.iconFeatureIndex&&(tu=La.iconFeatureIndex),La.iconBox){let me=we=>this.collisionIndex.placeCollisionBox(we,rr,Br,Pe,$e,Lr,gr,xe,ae.predicate,Jn,Hr&&po?po:void 0);Js&&Js.placeable&&La.verticalIconBox?(ko=me(La.verticalIconBox),Go=ko.placeable):(ko=me(La.iconBox),Go=ko.placeable),Xo=Xo&&ko.offscreen}let Et=ce||xa.numHorizontalGlyphVertices===0&&xa.numVerticalGlyphVertices===0,Xt=Te||xa.numIconVertices===0;Et||Xt?Xt?Et||(Go=Go&&Yi):Yi=Go&&Yi:Go=Yi=Go&&Yi;let fe=Go&&ko.placeable;if(Yi&&Us.placeable&&this.collisionIndex.insertCollisionBox(Us.box,ye,Lt.get("text-ignore-placement"),kt.bucketInstanceId,Js&&Js.placeable&&Sl?Sl:hl,ae.ID),fe&&this.collisionIndex.insertCollisionBox(ko.box,rr,Lt.get("icon-ignore-placement"),kt.bucketInstanceId,tu,ae.ID),To&&Yi&&this.collisionIndex.insertCollisionCircles(To.circles,ye,Lt.get("text-ignore-placement"),kt.bucketInstanceId,hl,ae.ID),xt&&this.storeCollisionData(kt.bucketInstanceId,ai,La,Us,ko,To),xa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(kt.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[xa.crossTileID]=new En(Yi||cn,Go||Mn,Xo||kt.justReloaded),at[xa.crossTileID]=!0};if(nn){if(z.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let xa=kt.getSortedSymbolIndexes(this.transform.angle);for(let La=xa.length-1;La>=0;--La){let ai=xa[La];_a(kt.symbolInstances.get(ai),kt.collisionArrays[ai],ai)}}else for(let xa=z.symbolInstanceStart;xa<z.symbolInstanceEnd;xa++)_a(kt.symbolInstances.get(xa),kt.collisionArrays[xa],xa);if(xt&&kt.bucketInstanceId in this.collisionCircleArrays){let xa=this.collisionCircleArrays[kt.bucketInstanceId];e.as(xa.invProjMatrix,Pe),xa.viewportMatrix=this.collisionIndex.getViewportMatrix()}kt.justReloaded=!1}storeCollisionData(z,at,xt,kt,Lt,le){if(xt.textBox||xt.iconBox){let xe,Pe;this.collisionBoxArrays.has(z)?xe=this.collisionBoxArrays.get(z):(xe=new Map,this.collisionBoxArrays.set(z,xe)),xe.has(at)?Pe=xe.get(at):(Pe={text:null,icon:null},xe.set(at,Pe)),xt.textBox&&(Pe.text=kt.box),xt.iconBox&&(Pe.icon=Lt.box)}if(le){let xe=this.collisionCircleArrays[z];xe===void 0&&(xe=this.collisionCircleArrays[z]=new gn);for(let Pe=0;Pe<le.circles.length;Pe+=4)xe.circles.push(le.circles[Pe+0]),xe.circles.push(le.circles[Pe+1]),xe.circles.push(le.circles[Pe+2]),xe.circles.push(le.collisionDetected?1:0)}}markUsedJustification(z,at,xt,kt){let Lt;Lt=kt===e.ah.vertical?xt.verticalPlacedTextSymbolIndex:{left:xt.leftJustifiedTextSymbolIndex,center:xt.centerJustifiedTextSymbolIndex,right:xt.rightJustifiedTextSymbolIndex}[e.at(at)];let le=[xt.leftJustifiedTextSymbolIndex,xt.centerJustifiedTextSymbolIndex,xt.rightJustifiedTextSymbolIndex,xt.verticalPlacedTextSymbolIndex];for(let xe of le)xe>=0&&(z.text.placedSymbolArray.get(xe).crossTileID=Lt>=0&&xe!==Lt?0:xt.crossTileID)}markUsedOrientation(z,at,xt){let kt=at===e.ah.horizontal||at===e.ah.horizontalOnly?at:0,Lt=at===e.ah.vertical?at:0,le=[xt.leftJustifiedTextSymbolIndex,xt.centerJustifiedTextSymbolIndex,xt.rightJustifiedTextSymbolIndex];for(let xe of le)z.text.placedSymbolArray.get(xe).placedOrientation=kt;xt.verticalPlacedTextSymbolIndex&&(z.text.placedSymbolArray.get(xt.verticalPlacedTextSymbolIndex).placedOrientation=Lt)}commit(z){this.commitTime=z,this.zoomAtLastRecencyCheck=this.transform.zoom;let at=this.prevPlacement,xt=!1;this.prevZoomAdjustment=at?at.zoomAdjustment(this.transform.zoom):0;let kt=at?at.symbolFadeChange(z):1,Lt=at?at.opacities:{},le=at?at.variableOffsets:{},xe=at?at.placedOrientations:{};for(let Pe in this.placements){let $e=this.placements[Pe],hr=Lt[Pe];hr?(this.opacities[Pe]=new Zn(hr,kt,$e.text,$e.icon),xt=xt||$e.text!==hr.text.placed||$e.icon!==hr.icon.placed):(this.opacities[Pe]=new Zn(null,kt,$e.text,$e.icon,$e.skipFade),xt=xt||$e.text||$e.icon)}for(let Pe in Lt){let $e=Lt[Pe];if(!this.opacities[Pe]){let hr=new Zn($e,kt,!1,!1);hr.isHidden()||(this.opacities[Pe]=hr,xt=xt||$e.text.placed||$e.icon.placed)}}for(let Pe in le)this.variableOffsets[Pe]||!this.opacities[Pe]||this.opacities[Pe].isHidden()||(this.variableOffsets[Pe]=le[Pe]);for(let Pe in xe)this.placedOrientations[Pe]||!this.opacities[Pe]||this.opacities[Pe].isHidden()||(this.placedOrientations[Pe]=xe[Pe]);if(at&&at.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");xt?this.lastPlacementChangeTime=z:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=at?at.lastPlacementChangeTime:z)}updateLayerOpacities(z,at){let xt={};for(let kt of at){let Lt=kt.getBucket(z);Lt&&kt.latestFeatureIndex&&z.id===Lt.layerIds[0]&&this.updateBucketOpacities(Lt,kt.tileID,xt,kt.collisionBoxArray)}}updateBucketOpacities(z,at,xt,kt){z.hasTextData()&&(z.text.opacityVertexArray.clear(),z.text.hasVisibleVertices=!1),z.hasIconData()&&(z.icon.opacityVertexArray.clear(),z.icon.hasVisibleVertices=!1),z.hasIconCollisionBoxData()&&z.iconCollisionBox.collisionVertexArray.clear(),z.hasTextCollisionBoxData()&&z.textCollisionBox.collisionVertexArray.clear();let Lt=z.layers[0],le=Lt.layout,xe=new Zn(null,0,!1,!1,!0),Pe=le.get("text-allow-overlap"),$e=le.get("icon-allow-overlap"),hr=Lt._unevaluatedLayout.hasValue("text-variable-anchor")||Lt._unevaluatedLayout.hasValue("text-variable-anchor-offset"),pr=le.get("text-rotation-alignment")==="map",Br=le.get("text-pitch-alignment")==="map",Jr=le.get("icon-text-fit")!=="none",Rt=new Zn(null,0,Pe&&($e||!z.hasIconData()||le.get("icon-optional")),$e&&(Pe||!z.hasTextData()||le.get("text-optional")),!0);!z.collisionArrays&&kt&&(z.hasIconCollisionBoxData()||z.hasTextCollisionBoxData())&&z.deserializeCollisionBoxes(kt);let Gt=(ce,Te,ye)=>{for(let ze=0;ze<Te/4;ze++)ce.opacityVertexArray.emplaceBack(ye);ce.hasVisibleVertices=ce.hasVisibleVertices||ye!==$n},ae=this.collisionBoxArrays.get(z.bucketInstanceId);for(let ce=0;ce<z.symbolInstances.length;ce++){let Te=z.symbolInstances.get(ce),{numHorizontalGlyphVertices:ye,numVerticalGlyphVertices:ze,crossTileID:rr}=Te,fr=this.opacities[rr];xt[rr]?fr=xe:fr||(fr=Rt,this.opacities[rr]=fr),xt[rr]=!0;let gr=Te.numIconVertices>0,Lr=this.placedOrientations[Te.crossTileID],Hr=Lr===e.ah.vertical,nn=Lr===e.ah.horizontal||Lr===e.ah.horizontalOnly;if(ye>0||ze>0){let Mn=Kn(fr.text);Gt(z.text,ye,Hr?$n:Mn),Gt(z.text,ze,nn?$n:Mn);let Jn=fr.text.isHidden();[Te.rightJustifiedTextSymbolIndex,Te.centerJustifiedTextSymbolIndex,Te.leftJustifiedTextSymbolIndex].forEach(La=>{La>=0&&(z.text.placedSymbolArray.get(La).hidden=Jn||Hr?1:0)}),Te.verticalPlacedTextSymbolIndex>=0&&(z.text.placedSymbolArray.get(Te.verticalPlacedTextSymbolIndex).hidden=Jn||nn?1:0);let _a=this.variableOffsets[Te.crossTileID];_a&&this.markUsedJustification(z,_a.anchor,Te,Lr);let xa=this.placedOrientations[Te.crossTileID];xa&&(this.markUsedJustification(z,"left",Te,xa),this.markUsedOrientation(z,xa,Te))}if(gr){let Mn=Kn(fr.icon),Jn=!(Jr&&Te.verticalPlacedIconSymbolIndex&&Hr);Te.placedIconSymbolIndex>=0&&(Gt(z.icon,Te.numIconVertices,Jn?Mn:$n),z.icon.placedSymbolArray.get(Te.placedIconSymbolIndex).hidden=fr.icon.isHidden()),Te.verticalPlacedIconSymbolIndex>=0&&(Gt(z.icon,Te.numVerticalIconVertices,Jn?$n:Mn),z.icon.placedSymbolArray.get(Te.verticalPlacedIconSymbolIndex).hidden=fr.icon.isHidden())}let cn=ae&&ae.has(ce)?ae.get(ce):{text:null,icon:null};if(z.hasIconCollisionBoxData()||z.hasTextCollisionBoxData()){let Mn=z.collisionArrays[ce];if(Mn){let Jn=new e.P(0,0);if(Mn.textBox||Mn.verticalTextBox){let _a=!0;if(hr){let xa=this.variableOffsets[rr];xa?(Jn=Se(xa.anchor,xa.width,xa.height,xa.textOffset,xa.textBoxScale),pr&&Jn._rotate(Br?this.transform.angle:-this.transform.angle)):_a=!1}if(Mn.textBox||Mn.verticalTextBox){let xa;Mn.textBox&&(xa=Hr),Mn.verticalTextBox&&(xa=nn),Ze(z.textCollisionBox.collisionVertexArray,fr.text.placed,!_a||xa,cn.text,Jn.x,Jn.y)}}if(Mn.iconBox||Mn.verticalIconBox){let _a=!!(!nn&&Mn.verticalIconBox),xa;Mn.iconBox&&(xa=_a),Mn.verticalIconBox&&(xa=!_a),Ze(z.iconCollisionBox.collisionVertexArray,fr.icon.placed,xa,cn.icon,Jr?Jn.x:0,Jr?Jn.y:0)}}}}if(z.sortFeatures(this.transform.angle),this.retainedQueryData[z.bucketInstanceId]&&(this.retainedQueryData[z.bucketInstanceId].featureSortOrder=z.featureSortOrder),z.hasTextData()&&z.text.opacityVertexBuffer&&z.text.opacityVertexBuffer.updateData(z.text.opacityVertexArray),z.hasIconData()&&z.icon.opacityVertexBuffer&&z.icon.opacityVertexBuffer.updateData(z.icon.opacityVertexArray),z.hasIconCollisionBoxData()&&z.iconCollisionBox.collisionVertexBuffer&&z.iconCollisionBox.collisionVertexBuffer.updateData(z.iconCollisionBox.collisionVertexArray),z.hasTextCollisionBoxData()&&z.textCollisionBox.collisionVertexBuffer&&z.textCollisionBox.collisionVertexBuffer.updateData(z.textCollisionBox.collisionVertexArray),z.text.opacityVertexArray.length!==z.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${z.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${z.text.layoutVertexArray.length}) / 4`);if(z.icon.opacityVertexArray.length!==z.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${z.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${z.icon.layoutVertexArray.length}) / 4`);if(z.bucketInstanceId in this.collisionCircleArrays){let ce=this.collisionCircleArrays[z.bucketInstanceId];z.placementInvProjMatrix=ce.invProjMatrix,z.placementViewportMatrix=ce.viewportMatrix,z.collisionCircleArray=ce.circles,delete this.collisionCircleArrays[z.bucketInstanceId]}}symbolFadeChange(z){return this.fadeDuration===0?1:(z-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(z){return Math.max(0,(this.transform.zoom-z)/1.5)}hasTransitions(z){return this.stale||z-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(z,at){let xt=this.zoomAtLastRecencyCheck===at?1-this.zoomAdjustment(at):1;return this.zoomAtLastRecencyCheck=at,this.commitTime+this.fadeDuration*xt>z}setStale(){this.stale=!0}}function Ze(Pt,z,at,xt,kt,Lt){xt&&xt.length!==0||(xt=[0,0,0,0]);let le=xt[0]-Er,xe=xt[1]-Er,Pe=xt[2]-Er,$e=xt[3]-Er;Pt.emplaceBack(z?1:0,at?1:0,kt||0,Lt||0,le,xe),Pt.emplaceBack(z?1:0,at?1:0,kt||0,Lt||0,Pe,xe),Pt.emplaceBack(z?1:0,at?1:0,kt||0,Lt||0,Pe,$e),Pt.emplaceBack(z?1:0,at?1:0,kt||0,Lt||0,le,$e)}let tr=Math.pow(2,25),zr=Math.pow(2,24),tn=Math.pow(2,17),Yr=Math.pow(2,16),$r=Math.pow(2,9),In=Math.pow(2,8),Nn=Math.pow(2,1);function Kn(Pt){if(Pt.opacity===0&&!Pt.placed)return 0;if(Pt.opacity===1&&Pt.placed)return 4294967295;let z=Pt.placed?1:0,at=Math.floor(127*Pt.opacity);return at*tr+z*zr+at*tn+z*Yr+at*$r+z*In+at*Nn+z}let $n=0;function ia(){return{isOccluded:(Pt,z,at)=>!1,getPitchedTextCorrection:(Pt,z,at)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Pt,z,at,xt){throw new Error("Not implemented.")},translatePosition:(Pt,z,at,xt)=>function(kt,Lt,le,xe,Pe=!1){if(!le[0]&&!le[1])return[0,0];let $e=Pe?xe==="map"?kt.angle:0:xe==="viewport"?-kt.angle:0;if($e){let hr=Math.sin($e),pr=Math.cos($e);le=[le[0]*pr-le[1]*hr,le[0]*hr+le[1]*pr]}return[Pe?le[0]:dn(Lt,le[0],kt.zoom),Pe?le[1]:dn(Lt,le[1],kt.zoom)]}(Pt,z,at,xt),getCircleRadiusCorrection:Pt=>1}}class Cn{constructor(z){this._sortAcrossTiles=z.layout.get("symbol-z-order")!=="viewport-y"&&!z.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(z,at,xt,kt,Lt){let le=this._bucketParts;for(;this._currentTileIndex<z.length;)if(at.getBucketParts(le,kt,z[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,Lt())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,le.sort((xe,Pe)=>xe.sortKey-Pe.sortKey));this._currentPartIndex<le.length;)if(at.placeLayerBucketPart(le[this._currentPartIndex],this._seenCrossTileIDs,xt),this._currentPartIndex++,Lt())return!0;return!1}}class Fa{constructor(z,at,xt,kt,Lt,le,xe,Pe){this.placement=new Re(z,ia(),at,le,xe,Pe),this._currentPlacementIndex=xt.length-1,this._forceFullPlacement=kt,this._showCollisionBoxes=Lt,this._done=!1}isDone(){return this._done}continuePlacement(z,at,xt){let kt=o.now(),Lt=()=>!this._forceFullPlacement&&o.now()-kt>2;for(;this._currentPlacementIndex>=0;){let le=at[z[this._currentPlacementIndex]],xe=this.placement.collisionIndex.transform.zoom;if(le.type==="symbol"&&(!le.minzoom||le.minzoom<=xe)&&(!le.maxzoom||le.maxzoom>xe)){if(this._inProgressLayer||(this._inProgressLayer=new Cn(le)),this._inProgressLayer.continuePlacement(xt[le.source],this.placement,this._showCollisionBoxes,le,Lt))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(z){return this.placement.commit(z),this.placement}}let Ga=512/e.X/2;class ve{constructor(z,at,xt){this.tileID=z,this.bucketInstanceId=xt,this._symbolsByKey={};let kt=new Map;for(let Lt=0;Lt<at.length;Lt++){let le=at.get(Lt),xe=le.key,Pe=kt.get(xe);Pe?Pe.push(le):kt.set(xe,[le])}for(let[Lt,le]of kt){let xe={positions:le.map(Pe=>({x:Math.floor(Pe.anchorX*Ga),y:Math.floor(Pe.anchorY*Ga)})),crossTileIDs:le.map(Pe=>Pe.crossTileID)};if(xe.positions.length>128){let Pe=new e.av(xe.positions.length,16,Uint16Array);for(let{x:$e,y:hr}of xe.positions)Pe.add($e,hr);Pe.finish(),delete xe.positions,xe.index=Pe}this._symbolsByKey[Lt]=xe}}getScaledCoordinates(z,at){let{x:xt,y:kt,z:Lt}=this.tileID.canonical,{x:le,y:xe,z:Pe}=at.canonical,$e=Ga/Math.pow(2,Pe-Lt),hr=(xe*e.X+z.anchorY)*$e,pr=kt*e.X*Ga;return{x:Math.floor((le*e.X+z.anchorX)*$e-xt*e.X*Ga),y:Math.floor(hr-pr)}}findMatches(z,at,xt){let kt=this.tileID.canonical.z<at.canonical.z?1:Math.pow(2,this.tileID.canonical.z-at.canonical.z);for(let Lt=0;Lt<z.length;Lt++){let le=z.get(Lt);if(le.crossTileID)continue;let xe=this._symbolsByKey[le.key];if(!xe)continue;let Pe=this.getScaledCoordinates(le,at);if(xe.index){let $e=xe.index.range(Pe.x-kt,Pe.y-kt,Pe.x+kt,Pe.y+kt).sort();for(let hr of $e){let pr=xe.crossTileIDs[hr];if(!xt[pr]){xt[pr]=!0,le.crossTileID=pr;break}}}else if(xe.positions)for(let $e=0;$e<xe.positions.length;$e++){let hr=xe.positions[$e],pr=xe.crossTileIDs[$e];if(Math.abs(hr.x-Pe.x)<=kt&&Math.abs(hr.y-Pe.y)<=kt&&!xt[pr]){xt[pr]=!0,le.crossTileID=pr;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:z})=>z)}}class ge{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class dr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(z){let at=Math.round((z-this.lng)/360);if(at!==0)for(let xt in this.indexes){let kt=this.indexes[xt],Lt={};for(let le in kt){let xe=kt[le];xe.tileID=xe.tileID.unwrapTo(xe.tileID.wrap+at),Lt[xe.tileID.key]=xe}this.indexes[xt]=Lt}this.lng=z}addBucket(z,at,xt){if(this.indexes[z.overscaledZ]&&this.indexes[z.overscaledZ][z.key]){if(this.indexes[z.overscaledZ][z.key].bucketInstanceId===at.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(z.overscaledZ,this.indexes[z.overscaledZ][z.key])}for(let Lt=0;Lt<at.symbolInstances.length;Lt++)at.symbolInstances.get(Lt).crossTileID=0;this.usedCrossTileIDs[z.overscaledZ]||(this.usedCrossTileIDs[z.overscaledZ]={});let kt=this.usedCrossTileIDs[z.overscaledZ];for(let Lt in this.indexes){let le=this.indexes[Lt];if(Number(Lt)>z.overscaledZ)for(let xe in le){let Pe=le[xe];Pe.tileID.isChildOf(z)&&Pe.findMatches(at.symbolInstances,z,kt)}else{let xe=le[z.scaledTo(Number(Lt)).key];xe&&xe.findMatches(at.symbolInstances,z,kt)}}for(let Lt=0;Lt<at.symbolInstances.length;Lt++){let le=at.symbolInstances.get(Lt);le.crossTileID||(le.crossTileID=xt.generate(),kt[le.crossTileID]=!0)}return this.indexes[z.overscaledZ]===void 0&&(this.indexes[z.overscaledZ]={}),this.indexes[z.overscaledZ][z.key]=new ve(z,at.symbolInstances,at.bucketInstanceId),!0}removeBucketCrossTileIDs(z,at){for(let xt of at.getCrossTileIDsLists())for(let kt of xt)delete this.usedCrossTileIDs[z][kt]}removeStaleBuckets(z){let at=!1;for(let xt in this.indexes){let kt=this.indexes[xt];for(let Lt in kt)z[kt[Lt].bucketInstanceId]||(this.removeBucketCrossTileIDs(xt,kt[Lt]),delete kt[Lt],at=!0)}return at}}class br{constructor(){this.layerIndexes={},this.crossTileIDs=new ge,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(z,at,xt){let kt=this.layerIndexes[z.id];kt===void 0&&(kt=this.layerIndexes[z.id]=new dr);let Lt=!1,le={};kt.handleWrapJump(xt);for(let xe of at){let Pe=xe.getBucket(z);Pe&&z.id===Pe.layerIds[0]&&(Pe.bucketInstanceId||(Pe.bucketInstanceId=++this.maxBucketInstanceId),kt.addBucket(xe.tileID,Pe,this.crossTileIDs)&&(Lt=!0),le[Pe.bucketInstanceId]=!0)}return kt.removeStaleBuckets(le)&&(Lt=!0),Lt}pruneUnusedLayers(z){let at={};z.forEach(xt=>{at[xt]=!0});for(let xt in this.layerIndexes)at[xt]||delete this.layerIndexes[xt]}}let Tr=(Pt,z)=>e.t(Pt,z&&z.filter(at=>at.identifier!=="source.canvas")),mr=e.aw();class kr extends e.E{constructor(z,at={}){super(),this._rtlPluginLoaded=()=>{for(let xt in this.sourceCaches){let kt=this.sourceCaches[xt].getSource().type;kt!=="vector"&&kt!=="geojson"||this.sourceCaches[xt].reload()}},this.map=z,this.dispatcher=new X(ot(),z._getMapId()),this.dispatcher.registerMessageHandler("GG",(xt,kt)=>this.getGlyphs(xt,kt)),this.dispatcher.registerMessageHandler("GI",(xt,kt)=>this.getImages(xt,kt)),this.imageManager=new _,this.imageManager.setEventedParent(this),this.glyphManager=new B(z._requestManager,at.localIdeographFontFamily),this.lineAtlas=new G(256,512),this.crossTileSymbolIndex=new br,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()),re().on(bt,this._rtlPluginLoaded),this.on("data",xt=>{if(xt.dataType!=="source"||xt.sourceDataType!=="metadata")return;let kt=this.sourceCaches[xt.sourceId];if(!kt)return;let Lt=kt.getSource();if(Lt&&Lt.vectorLayerIds)for(let le in this._layers){let xe=this._layers[le];xe.source===Lt.id&&this._validateLayer(xe)}})}loadURL(z,at={},xt){this.fire(new e.k("dataloading",{dataType:"style"})),at.validate=typeof at.validate!="boolean"||at.validate;let kt=this.map._requestManager.transformRequest(z,"Style");this._loadStyleRequest=new AbortController;let Lt=this._loadStyleRequest;e.h(kt,this._loadStyleRequest).then(le=>{this._loadStyleRequest=null,this._load(le.data,at,xt)}).catch(le=>{this._loadStyleRequest=null,le&&!Lt.signal.aborted&&this.fire(new e.j(le))})}loadJSON(z,at={},xt){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(z,at,xt)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(mr,{validate:!1})}_load(z,at,xt){var kt;let Lt=at.transformStyle?at.transformStyle(xt,z):z;if(!at.validate||!Tr(this,e.u(Lt))){this._loaded=!0,this.stylesheet=Lt;for(let le in Lt.sources)this.addSource(le,Lt.sources[le],{validate:!1});Lt.sprite?this._loadSprite(Lt.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Lt.glyphs),this._createLayers(),this.light=new F(this.stylesheet.light),this.sky=new j(this.stylesheet.sky),this.map.setTerrain((kt=this.stylesheet.terrain)!==null&&kt!==void 0?kt:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){let z=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",z),this._order=z.map(at=>at.id),this._layers={},this._serializedLayers=null;for(let at of z){let xt=e.aA(at);xt.setEventedParent(this,{layer:{id:at.id}}),this._layers[at.id]=xt}}_loadSprite(z,at=!1,xt=void 0){let kt;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Lt,le,xe,Pe){return e._(this,void 0,void 0,function*(){let $e=T(Lt),hr=xe>1?"@2x":"",pr={},Br={};for(let{id:Jr,url:Rt}of $e){let Gt=le.transformRequest(c(Rt,hr,".json"),"SpriteJSON");pr[Jr]=e.h(Gt,Pe);let ae=le.transformRequest(c(Rt,hr,".png"),"SpriteImage");Br[Jr]=l.getImage(ae,Pe)}return yield Promise.all([...Object.values(pr),...Object.values(Br)]),function(Jr,Rt){return e._(this,void 0,void 0,function*(){let Gt={};for(let ae in Jr){Gt[ae]={};let ce=o.getImageCanvasContext((yield Rt[ae]).data),Te=(yield Jr[ae]).data;for(let ye in Te){let{width:ze,height:rr,x:fr,y:gr,sdf:Lr,pixelRatio:Hr,stretchX:nn,stretchY:cn,content:Mn,textFitWidth:Jn,textFitHeight:_a}=Te[ye];Gt[ae][ye]={data:null,pixelRatio:Hr,sdf:Lr,stretchX:nn,stretchY:cn,content:Mn,textFitWidth:Jn,textFitHeight:_a,spriteData:{width:ze,height:rr,x:fr,y:gr,context:ce}}}}return Gt})}(pr,Br)})}(z,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Lt=>{if(this._spriteRequest=null,Lt)for(let le in Lt){this._spritesImagesIds[le]=[];let xe=this._spritesImagesIds[le]?this._spritesImagesIds[le].filter(Pe=>!(Pe in Lt)):[];for(let Pe of xe)this.imageManager.removeImage(Pe),this._changedImages[Pe]=!0;for(let Pe in Lt[le]){let $e=le==="default"?Pe:`${le}:${Pe}`;this._spritesImagesIds[le].push($e),$e in this.imageManager.images?this.imageManager.updateImage($e,Lt[le][Pe],!1):this.imageManager.addImage($e,Lt[le][Pe]),at&&(this._changedImages[$e]=!0)}}}).catch(Lt=>{this._spriteRequest=null,kt=Lt,this.fire(new e.j(kt))}).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"})),xt&&xt(kt)})}_unloadSprite(){for(let z of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(z),this._changedImages[z]=!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(z){let at=this.sourceCaches[z.source];if(!at)return;let xt=z.sourceLayer;if(!xt)return;let kt=at.getSource();(kt.type==="geojson"||kt.vectorLayerIds&&kt.vectorLayerIds.indexOf(xt)===-1)&&this.fire(new e.j(new Error(`Source layer "${xt}" does not exist on source "${kt.id}" as specified by style layer "${z.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let z in this.sourceCaches)if(!this.sourceCaches[z].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(z,at=!1){let xt=this._serializedAllLayers();if(!z||z.length===0)return Object.values(at?e.aB(xt):xt);let kt=[];for(let Lt of z)if(xt[Lt]){let le=at?e.aB(xt[Lt]):xt[Lt];kt.push(le)}return kt}_serializedAllLayers(){let z=this._serializedLayers;if(z)return z;z=this._serializedLayers={};let at=Object.keys(this._layers);for(let xt of at){let kt=this._layers[xt];kt.type!=="custom"&&(z[xt]=kt.serialize())}return z}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let z in this.sourceCaches)if(this.sourceCaches[z].hasTransition())return!0;for(let z in this._layers)if(this._layers[z].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(z){if(!this._loaded)return;let at=this._changed;if(at){let kt=Object.keys(this._updatedLayers),Lt=Object.keys(this._removedLayers);(kt.length||Lt.length)&&this._updateWorkerLayers(kt,Lt);for(let le in this._updatedSources){let xe=this._updatedSources[le];if(xe==="reload")this._reloadSource(le);else{if(xe!=="clear")throw new Error(`Invalid action ${xe}`);this._clearSource(le)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let le in this._updatedPaintProps)this._layers[le].updateTransitions(z);this.light.updateTransitions(z),this.sky.updateTransitions(z),this._resetUpdates()}let xt={};for(let kt in this.sourceCaches){let Lt=this.sourceCaches[kt];xt[kt]=Lt.used,Lt.used=!1}for(let kt of this._order){let Lt=this._layers[kt];Lt.recalculate(z,this._availableImages),!Lt.isHidden(z.zoom)&&Lt.source&&(this.sourceCaches[Lt.source].used=!0)}for(let kt in xt){let Lt=this.sourceCaches[kt];!!xt[kt]!=!!Lt.used&&Lt.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:kt}))}this.light.recalculate(z),this.sky.recalculate(z),this.z=z.zoom,at&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let z=Object.keys(this._changedImages);if(z.length){for(let at in this.sourceCaches)this.sourceCaches[at].reloadTilesForDependencies(["icons","patterns"],z);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let z in this.sourceCaches)this.sourceCaches[z].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(z,at){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(z,!1),removedIds:at})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(z,at={}){var xt;this._checkLoaded();let kt=this.serialize();if(z=at.transformStyle?at.transformStyle(kt,z):z,((xt=at.validate)===null||xt===void 0||xt)&&Tr(this,e.u(z)))return!1;(z=e.aB(z)).layers=e.az(z.layers);let Lt=e.aC(kt,z),le=this._getOperationsToPerform(Lt);if(le.unimplemented.length>0)throw new Error(`Unimplemented: ${le.unimplemented.join(", ")}.`);if(le.operations.length===0)return!1;for(let xe of le.operations)xe();return this.stylesheet=z,this._serializedLayers=null,!0}_getOperationsToPerform(z){let at=[],xt=[];for(let kt of z)switch(kt.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":at.push(()=>this.addLayer.apply(this,kt.args));break;case"removeLayer":at.push(()=>this.removeLayer.apply(this,kt.args));break;case"setPaintProperty":at.push(()=>this.setPaintProperty.apply(this,kt.args));break;case"setLayoutProperty":at.push(()=>this.setLayoutProperty.apply(this,kt.args));break;case"setFilter":at.push(()=>this.setFilter.apply(this,kt.args));break;case"addSource":at.push(()=>this.addSource.apply(this,kt.args));break;case"removeSource":at.push(()=>this.removeSource.apply(this,kt.args));break;case"setLayerZoomRange":at.push(()=>this.setLayerZoomRange.apply(this,kt.args));break;case"setLight":at.push(()=>this.setLight.apply(this,kt.args));break;case"setGeoJSONSourceData":at.push(()=>this.setGeoJSONSourceData.apply(this,kt.args));break;case"setGlyphs":at.push(()=>this.setGlyphs.apply(this,kt.args));break;case"setSprite":at.push(()=>this.setSprite.apply(this,kt.args));break;case"setSky":at.push(()=>this.setSky.apply(this,kt.args));break;case"setTerrain":at.push(()=>this.map.setTerrain.apply(this,kt.args));break;case"setTransition":at.push(()=>{});break;default:xt.push(kt.command)}return{operations:at,unimplemented:xt}}addImage(z,at){if(this.getImage(z))return this.fire(new e.j(new Error(`An image named "${z}" already exists.`)));this.imageManager.addImage(z,at),this._afterImageUpdated(z)}updateImage(z,at){this.imageManager.updateImage(z,at)}getImage(z){return this.imageManager.getImage(z)}removeImage(z){if(!this.getImage(z))return this.fire(new e.j(new Error(`An image named "${z}" does not exist.`)));this.imageManager.removeImage(z),this._afterImageUpdated(z)}_afterImageUpdated(z){this._availableImages=this.imageManager.listImages(),this._changedImages[z]=!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(z,at,xt={}){if(this._checkLoaded(),this.sourceCaches[z]!==void 0)throw new Error(`Source "${z}" 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.${z}`,at,null,xt))return;this.map&&this.map._collectResourceTiming&&(at.collectResourceTiming=!0);let kt=this.sourceCaches[z]=new Ce(z,at,this.dispatcher);kt.style=this,kt.setEventedParent(this,()=>({isSourceLoaded:kt.loaded(),source:kt.serialize(),sourceId:z})),kt.onAdd(this.map),this._changed=!0}removeSource(z){if(this._checkLoaded(),this.sourceCaches[z]===void 0)throw new Error("There is no source with this ID");for(let xt in this._layers)if(this._layers[xt].source===z)return this.fire(new e.j(new Error(`Source "${z}" cannot be removed while layer "${xt}" is using it.`)));let at=this.sourceCaches[z];delete this.sourceCaches[z],delete this._updatedSources[z],at.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:z})),at.setEventedParent(null),at.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(z,at){if(this._checkLoaded(),this.sourceCaches[z]===void 0)throw new Error(`There is no source with this ID=${z}`);let xt=this.sourceCaches[z].getSource();if(xt.type!=="geojson")throw new Error(`geojsonSource.type is ${xt.type}, which is !== 'geojson`);xt.setData(at),this._changed=!0}getSource(z){return this.sourceCaches[z]&&this.sourceCaches[z].getSource()}addLayer(z,at,xt={}){this._checkLoaded();let kt=z.id;if(this.getLayer(kt))return void this.fire(new e.j(new Error(`Layer "${kt}" already exists on this map.`)));let Lt;if(z.type==="custom"){if(Tr(this,e.aD(z)))return;Lt=e.aA(z)}else{if("source"in z&&typeof z.source=="object"&&(this.addSource(kt,z.source),z=e.aB(z),z=e.e(z,{source:kt})),this._validate(e.u.layer,`layers.${kt}`,z,{arrayIndex:-1},xt))return;Lt=e.aA(z),this._validateLayer(Lt),Lt.setEventedParent(this,{layer:{id:kt}})}let le=at?this._order.indexOf(at):this._order.length;if(at&&le===-1)this.fire(new e.j(new Error(`Cannot add layer "${kt}" before non-existing layer "${at}".`)));else{if(this._order.splice(le,0,kt),this._layerOrderChanged=!0,this._layers[kt]=Lt,this._removedLayers[kt]&&Lt.source&&Lt.type!=="custom"){let xe=this._removedLayers[kt];delete this._removedLayers[kt],xe.type!==Lt.type?this._updatedSources[Lt.source]="clear":(this._updatedSources[Lt.source]="reload",this.sourceCaches[Lt.source].pause())}this._updateLayer(Lt),Lt.onAdd&&Lt.onAdd(this.map)}}moveLayer(z,at){if(this._checkLoaded(),this._changed=!0,!this._layers[z])return void this.fire(new e.j(new Error(`The layer '${z}' does not exist in the map's style and cannot be moved.`)));if(z===at)return;let xt=this._order.indexOf(z);this._order.splice(xt,1);let kt=at?this._order.indexOf(at):this._order.length;at&&kt===-1?this.fire(new e.j(new Error(`Cannot move layer "${z}" before non-existing layer "${at}".`))):(this._order.splice(kt,0,z),this._layerOrderChanged=!0)}removeLayer(z){this._checkLoaded();let at=this._layers[z];if(!at)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${z}".`)));at.setEventedParent(null);let xt=this._order.indexOf(z);this._order.splice(xt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[z]=at,delete this._layers[z],this._serializedLayers&&delete this._serializedLayers[z],delete this._updatedLayers[z],delete this._updatedPaintProps[z],at.onRemove&&at.onRemove(this.map)}getLayer(z){return this._layers[z]}getLayersOrder(){return[...this._order]}hasLayer(z){return z in this._layers}setLayerZoomRange(z,at,xt){this._checkLoaded();let kt=this.getLayer(z);kt?kt.minzoom===at&&kt.maxzoom===xt||(at!=null&&(kt.minzoom=at),xt!=null&&(kt.maxzoom=xt),this._updateLayer(kt)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${z}".`)))}setFilter(z,at,xt={}){this._checkLoaded();let kt=this.getLayer(z);if(kt){if(!e.aE(kt.filter,at))return at==null?(kt.filter=void 0,void this._updateLayer(kt)):void(this._validate(e.u.filter,`layers.${kt.id}.filter`,at,null,xt)||(kt.filter=e.aB(at),this._updateLayer(kt)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${z}".`)))}getFilter(z){return e.aB(this.getLayer(z).filter)}setLayoutProperty(z,at,xt,kt={}){this._checkLoaded();let Lt=this.getLayer(z);Lt?e.aE(Lt.getLayoutProperty(at),xt)||(Lt.setLayoutProperty(at,xt,kt),this._updateLayer(Lt)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${z}".`)))}getLayoutProperty(z,at){let xt=this.getLayer(z);if(xt)return xt.getLayoutProperty(at);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${z}".`)))}setPaintProperty(z,at,xt,kt={}){this._checkLoaded();let Lt=this.getLayer(z);Lt?e.aE(Lt.getPaintProperty(at),xt)||(Lt.setPaintProperty(at,xt,kt)&&this._updateLayer(Lt),this._changed=!0,this._updatedPaintProps[z]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${z}".`)))}getPaintProperty(z,at){return this.getLayer(z).getPaintProperty(at)}setFeatureState(z,at){this._checkLoaded();let xt=z.source,kt=z.sourceLayer,Lt=this.sourceCaches[xt];if(Lt===void 0)return void this.fire(new e.j(new Error(`The source '${xt}' does not exist in the map's style.`)));let le=Lt.getSource().type;le==="geojson"&&kt?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):le!=="vector"||kt?(z.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),Lt.setFeatureState(kt,z.id,at)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(z,at){this._checkLoaded();let xt=z.source,kt=this.sourceCaches[xt];if(kt===void 0)return void this.fire(new e.j(new Error(`The source '${xt}' does not exist in the map's style.`)));let Lt=kt.getSource().type,le=Lt==="vector"?z.sourceLayer:void 0;Lt!=="vector"||le?at&&typeof z.id!="string"&&typeof z.id!="number"?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):kt.removeFeatureState(le,z.id,at):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(z){this._checkLoaded();let at=z.source,xt=z.sourceLayer,kt=this.sourceCaches[at];if(kt!==void 0)return kt.getSource().type!=="vector"||xt?(z.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),kt.getFeatureState(xt,z.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 z=e.aF(this.sourceCaches,Lt=>Lt.serialize()),at=this._serializeByIds(this._order,!0),xt=this.map.getTerrain()||void 0,kt=this.stylesheet;return e.aG({version:kt.version,name:kt.name,metadata:kt.metadata,light:kt.light,sky:kt.sky,center:kt.center,zoom:kt.zoom,bearing:kt.bearing,pitch:kt.pitch,sprite:kt.sprite,glyphs:kt.glyphs,transition:kt.transition,sources:z,layers:at,terrain:xt},Lt=>Lt!==void 0)}_updateLayer(z){this._updatedLayers[z.id]=!0,z.source&&!this._updatedSources[z.source]&&this.sourceCaches[z.source].getSource().type!=="raster"&&(this._updatedSources[z.source]="reload",this.sourceCaches[z.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(z){let at=le=>this._layers[le].type==="fill-extrusion",xt={},kt=[];for(let le=this._order.length-1;le>=0;le--){let xe=this._order[le];if(at(xe)){xt[xe]=le;for(let Pe of z){let $e=Pe[xe];if($e)for(let hr of $e)kt.push(hr)}}}kt.sort((le,xe)=>xe.intersectionZ-le.intersectionZ);let Lt=[];for(let le=this._order.length-1;le>=0;le--){let xe=this._order[le];if(at(xe))for(let Pe=kt.length-1;Pe>=0;Pe--){let $e=kt[Pe].feature;if(xt[$e.layer.id]<le)break;Lt.push($e),kt.pop()}else for(let Pe of z){let $e=Pe[xe];if($e)for(let hr of $e)Lt.push(hr.feature)}}return Lt}queryRenderedFeatures(z,at,xt){at&&at.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",at.filter,null,at);let kt={};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 xe of at.layers){let Pe=this._layers[xe];if(!Pe)return this.fire(new e.j(new Error(`The layer '${xe}' does not exist in the map's style and cannot be queried for features.`))),[];kt[Pe.source]=!0}}let Lt=[];at.availableImages=this._availableImages;let le=this._serializedAllLayers();for(let xe in this.sourceCaches)at.layers&&!kt[xe]||Lt.push(J(this.sourceCaches[xe],this._layers,le,z,at,xt));return this.placement&&Lt.push(function(xe,Pe,$e,hr,pr,Br,Jr){let Rt={},Gt=Br.queryRenderedSymbols(hr),ae=[];for(let ce of Object.keys(Gt).map(Number))ae.push(Jr[ce]);ae.sort(q);for(let ce of ae){let Te=ce.featureIndex.lookupSymbolFeatures(Gt[ce.bucketInstanceId],Pe,ce.bucketIndex,ce.sourceLayerIndex,pr.filter,pr.layers,pr.availableImages,xe);for(let ye in Te){let ze=Rt[ye]=Rt[ye]||[],rr=Te[ye];rr.sort((fr,gr)=>{let Lr=ce.featureSortOrder;if(Lr){let Hr=Lr.indexOf(fr.featureIndex);return Lr.indexOf(gr.featureIndex)-Hr}return gr.featureIndex-fr.featureIndex});for(let fr of rr)ze.push(fr)}}for(let ce in Rt)Rt[ce].forEach(Te=>{let ye=Te.feature,ze=$e[xe[ce].source].getFeatureState(ye.layer["source-layer"],ye.id);ye.source=ye.layer.source,ye.layer["source-layer"]&&(ye.sourceLayer=ye.layer["source-layer"]),ye.state=ze});return Rt}(this._layers,le,this.sourceCaches,z,at,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Lt)}querySourceFeatures(z,at){at&&at.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",at.filter,null,at);let xt=this.sourceCaches[z];return xt?function(kt,Lt){let le=kt.getRenderableIds().map($e=>kt.getTileByID($e)),xe=[],Pe={};for(let $e=0;$e<le.length;$e++){let hr=le[$e],pr=hr.tileID.canonical.key;Pe[pr]||(Pe[pr]=!0,hr.querySourceFeatures(xe,Lt))}return xe}(xt,at):[]}getLight(){return this.light.getLight()}setLight(z,at={}){this._checkLoaded();let xt=this.light.getLight(),kt=!1;for(let le in z)if(!e.aE(z[le],xt[le])){kt=!0;break}if(!kt)return;let Lt={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(z,at),this.light.updateTransitions(Lt)}getSky(){var z;return(z=this.stylesheet)===null||z===void 0?void 0:z.sky}setSky(z,at={}){let xt=this.getSky(),kt=!1;if(!z&&!xt)return;if(z&&!xt)kt=!0;else if(!z&&xt)kt=!0;else for(let le in z)if(!e.aE(z[le],xt[le])){kt=!0;break}if(!kt)return;let Lt={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=z,this.sky.setSky(z,at),this.sky.updateTransitions(Lt)}_validate(z,at,xt,kt,Lt={}){return(!Lt||Lt.validate!==!1)&&Tr(this,z.call(e.u,e.e({key:at,style:this.serialize(),value:xt,styleSpec:e.v},kt)))}_remove(z=!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),re().off(bt,this._rtlPluginLoaded);for(let at in this._layers)this._layers[at].setEventedParent(null);for(let at in this.sourceCaches){let xt=this.sourceCaches[at];xt.setEventedParent(null),xt.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),z&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(z)}_clearSource(z){this.sourceCaches[z].clearTiles()}_reloadSource(z){this.sourceCaches[z].resume(),this.sourceCaches[z].reload()}_updateSources(z){for(let at in this.sourceCaches)this.sourceCaches[at].update(z,this.map.terrain)}_generateCollisionBoxes(){for(let z in this.sourceCaches)this._reloadSource(z)}_updatePlacement(z,at,xt,kt,Lt=!1){let le=!1,xe=!1,Pe={};for(let $e of this._order){let hr=this._layers[$e];if(hr.type!=="symbol")continue;if(!Pe[hr.source]){let Br=this.sourceCaches[hr.source];Pe[hr.source]=Br.getRenderableIds(!0).map(Jr=>Br.getTileByID(Jr)).sort((Jr,Rt)=>Rt.tileID.overscaledZ-Jr.tileID.overscaledZ||(Jr.tileID.isLessThan(Rt.tileID)?-1:1))}let pr=this.crossTileSymbolIndex.addLayer(hr,Pe[hr.source],z.center.lng);le=le||pr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Lt=Lt||this._layerOrderChanged||xt===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.now(),z.zoom))&&(this.pauseablePlacement=new Fa(z,this.map.terrain,this._order,Lt,at,xt,kt,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Pe),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.now()),xe=!0),le&&this.pauseablePlacement.placement.setStale()),xe||le)for(let $e of this._order){let hr=this._layers[$e];hr.type==="symbol"&&this.placement.updateLayerOpacities(hr,Pe[hr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.now())}_releaseSymbolFadeTiles(){for(let z in this.sourceCaches)this.sourceCaches[z].releaseSymbolFadeTiles()}getImages(z,at){return e._(this,void 0,void 0,function*(){let xt=yield this.imageManager.getImages(at.icons);this._updateTilesForChangedImages();let kt=this.sourceCaches[at.source];return kt&&kt.setDependencies(at.tileID.key,at.type,at.icons),xt})}getGlyphs(z,at){return e._(this,void 0,void 0,function*(){let xt=yield this.glyphManager.getGlyphs(at.stacks),kt=this.sourceCaches[at.source];return kt&&kt.setDependencies(at.tileID.key,at.type,[""]),xt})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(z,at={}){this._checkLoaded(),z&&this._validate(e.u.glyphs,"glyphs",z,null,at)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=z,this.glyphManager.entries={},this.glyphManager.setURL(z))}addSprite(z,at,xt={},kt){this._checkLoaded();let Lt=[{id:z,url:at}],le=[...T(this.stylesheet.sprite),...Lt];this._validate(e.u.sprite,"sprite",le,null,xt)||(this.stylesheet.sprite=le,this._loadSprite(Lt,!0,kt))}removeSprite(z){this._checkLoaded();let at=T(this.stylesheet.sprite);if(at.find(xt=>xt.id===z)){if(this._spritesImagesIds[z])for(let xt of this._spritesImagesIds[z])this.imageManager.removeImage(xt),this._changedImages[xt]=!0;at.splice(at.findIndex(xt=>xt.id===z),1),this.stylesheet.sprite=at.length>0?at:void 0,delete this._spritesImagesIds[z],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 "${z}" doesn't exists on this map.`)))}getSprite(){return T(this.stylesheet.sprite)}setSprite(z,at={},xt){this._checkLoaded(),z&&this._validate(e.u.sprite,"sprite",z,null,at)||(this.stylesheet.sprite=z,z?this._loadSprite(z,!0,xt):(this._unloadSprite(),xt&&xt(null)))}}var Ur=e.Y([{name:"a_pos",type:"Int16",components:2}]);let Or={prelude:pe(`#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:pe(`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:pe(`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:pe(`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:pe("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:pe(`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:pe(`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:pe("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:pe("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:pe("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:pe(`#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:pe(`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:pe(`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:pe(`#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:pe(`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:pe(`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:pe(`#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:pe(`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:pe(`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:pe(`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:pe(`#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:pe(`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:pe(`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:pe(`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:pe(`#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:pe(`#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:pe("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:pe("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:pe("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:pe("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 pe(Pt,z){let at=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,xt=z.match(/attribute ([\w]+) ([\w]+)/g),kt=Pt.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Lt=z.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),le=Lt?Lt.concat(kt):kt,xe={};return{fragmentSource:Pt=Pt.replace(at,(Pe,$e,hr,pr,Br)=>(xe[Br]=!0,$e==="define"?`
#ifndef HAS_UNIFORM_u_${Br}
varying ${hr} ${pr} ${Br};
#else
uniform ${hr} ${pr} u_${Br};
#endif
`:`
#ifdef HAS_UNIFORM_u_${Br}
${hr} ${pr} ${Br} = u_${Br};
#endif
`)),vertexSource:z=z.replace(at,(Pe,$e,hr,pr,Br)=>{let Jr=pr==="float"?"vec2":"vec4",Rt=Br.match(/color/)?"color":Jr;return xe[Br]?$e==="define"?`
#ifndef HAS_UNIFORM_u_${Br}
uniform lowp float u_${Br}_t;
attribute ${hr} ${Jr} a_${Br};
varying ${hr} ${pr} ${Br};
#else
uniform ${hr} ${pr} u_${Br};
#endif
`:Rt==="vec4"?`
#ifndef HAS_UNIFORM_u_${Br}
${Br} = a_${Br};
#else
${hr} ${pr} ${Br} = u_${Br};
#endif
`:`
#ifndef HAS_UNIFORM_u_${Br}
${Br} = unpack_mix_${Rt}(a_${Br}, u_${Br}_t);
#else
${hr} ${pr} ${Br} = u_${Br};
#endif
`:$e==="define"?`
#ifndef HAS_UNIFORM_u_${Br}
uniform lowp float u_${Br}_t;
attribute ${hr} ${Jr} a_${Br};
#else
uniform ${hr} ${pr} u_${Br};
#endif
`:Rt==="vec4"?`
#ifndef HAS_UNIFORM_u_${Br}
${hr} ${pr} ${Br} = a_${Br};
#else
${hr} ${pr} ${Br} = u_${Br};
#endif
`:`
#ifndef HAS_UNIFORM_u_${Br}
${hr} ${pr} ${Br} = unpack_mix_${Rt}(a_${Br}, u_${Br}_t);
#else
${hr} ${pr} ${Br} = u_${Br};
#endif
`}),staticAttributes:xt,staticUniforms:le}}class Ke{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(z,at,xt,kt,Lt,le,xe,Pe,$e){this.context=z;let hr=this.boundPaintVertexBuffers.length!==kt.length;for(let pr=0;!hr&&pr<kt.length;pr++)this.boundPaintVertexBuffers[pr]!==kt[pr]&&(hr=!0);!this.vao||this.boundProgram!==at||this.boundLayoutVertexBuffer!==xt||hr||this.boundIndexBuffer!==Lt||this.boundVertexOffset!==le||this.boundDynamicVertexBuffer!==xe||this.boundDynamicVertexBuffer2!==Pe||this.boundDynamicVertexBuffer3!==$e?this.freshBind(at,xt,kt,Lt,le,xe,Pe,$e):(z.bindVertexArray.set(this.vao),xe&&xe.bind(),Lt&&Lt.dynamicDraw&&Lt.bind(),Pe&&Pe.bind(),$e&&$e.bind())}freshBind(z,at,xt,kt,Lt,le,xe,Pe){let $e=z.numAttributes,hr=this.context,pr=hr.gl;this.vao&&this.destroy(),this.vao=hr.createVertexArray(),hr.bindVertexArray.set(this.vao),this.boundProgram=z,this.boundLayoutVertexBuffer=at,this.boundPaintVertexBuffers=xt,this.boundIndexBuffer=kt,this.boundVertexOffset=Lt,this.boundDynamicVertexBuffer=le,this.boundDynamicVertexBuffer2=xe,this.boundDynamicVertexBuffer3=Pe,at.enableAttributes(pr,z);for(let Br of xt)Br.enableAttributes(pr,z);le&&le.enableAttributes(pr,z),xe&&xe.enableAttributes(pr,z),Pe&&Pe.enableAttributes(pr,z),at.bind(),at.setVertexAttribPointers(pr,z,Lt);for(let Br of xt)Br.bind(),Br.setVertexAttribPointers(pr,z,Lt);le&&(le.bind(),le.setVertexAttribPointers(pr,z,Lt)),kt&&kt.bind(),xe&&(xe.bind(),xe.setVertexAttribPointers(pr,z,Lt)),Pe&&(Pe.bind(),Pe.setVertexAttribPointers(pr,z,Lt)),hr.currentNumAttributes=$e}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let xr=(Pt,z,at,xt,kt)=>({u_matrix:Pt,u_texture:0,u_ele_delta:z,u_fog_matrix:at,u_fog_color:xt?xt.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:xt?xt.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:xt?xt.calculateFogBlendOpacity(kt):0,u_horizon_color:xt?xt.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:xt?xt.properties.get("horizon-fog-blend"):1});function Gr(Pt){let z=[];for(let at=0;at<Pt.length;at++){if(Pt[at]===null)continue;let xt=Pt[at].split(" ");z.push(xt.pop())}return z}class ln{constructor(z,at,xt,kt,Lt,le){let xe=z.gl;this.program=xe.createProgram();let Pe=Gr(at.staticAttributes),$e=xt?xt.getBinderAttributes():[],hr=Pe.concat($e),pr=Or.prelude.staticUniforms?Gr(Or.prelude.staticUniforms):[],Br=at.staticUniforms?Gr(at.staticUniforms):[],Jr=xt?xt.getBinderUniforms():[],Rt=pr.concat(Br).concat(Jr),Gt=[];for(let fr of Rt)Gt.indexOf(fr)<0&&Gt.push(fr);let ae=xt?xt.defines():[];Lt&&ae.push("#define OVERDRAW_INSPECTOR;"),le&&ae.push("#define TERRAIN3D;");let ce=ae.concat(Or.prelude.fragmentSource,at.fragmentSource).join(`
`),Te=ae.concat(Or.prelude.vertexSource,at.vertexSource).join(`
`),ye=xe.createShader(xe.FRAGMENT_SHADER);if(xe.isContextLost())return void(this.failedToCreate=!0);if(xe.shaderSource(ye,ce),xe.compileShader(ye),!xe.getShaderParameter(ye,xe.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${xe.getShaderInfoLog(ye)}`);xe.attachShader(this.program,ye);let ze=xe.createShader(xe.VERTEX_SHADER);if(xe.isContextLost())return void(this.failedToCreate=!0);if(xe.shaderSource(ze,Te),xe.compileShader(ze),!xe.getShaderParameter(ze,xe.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${xe.getShaderInfoLog(ze)}`);xe.attachShader(this.program,ze),this.attributes={};let rr={};this.numAttributes=hr.length;for(let fr=0;fr<this.numAttributes;fr++)hr[fr]&&(xe.bindAttribLocation(this.program,fr,hr[fr]),this.attributes[hr[fr]]=fr);if(xe.linkProgram(this.program),!xe.getProgramParameter(this.program,xe.LINK_STATUS))throw new Error(`Program failed to link: ${xe.getProgramInfoLog(this.program)}`);xe.deleteShader(ze),xe.deleteShader(ye);for(let fr=0;fr<Gt.length;fr++){let gr=Gt[fr];if(gr&&!rr[gr]){let Lr=xe.getUniformLocation(this.program,gr);Lr&&(rr[gr]=Lr)}}this.fixedUniforms=kt(z,rr),this.terrainUniforms=((fr,gr)=>({u_depth:new e.aH(fr,gr.u_depth),u_terrain:new e.aH(fr,gr.u_terrain),u_terrain_dim:new e.aI(fr,gr.u_terrain_dim),u_terrain_matrix:new e.aJ(fr,gr.u_terrain_matrix),u_terrain_unpack:new e.aK(fr,gr.u_terrain_unpack),u_terrain_exaggeration:new e.aI(fr,gr.u_terrain_exaggeration)}))(z,rr),this.binderUniforms=xt?xt.getUniforms(z,rr):[]}draw(z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt,Gt,ae,ce,Te){let ye=z.gl;if(this.failedToCreate)return;if(z.program.set(this.program),z.setDepthMode(xt),z.setStencilMode(kt),z.setColorMode(Lt),z.setCullFace(le),Pe){z.activeTexture.set(ye.TEXTURE2),ye.bindTexture(ye.TEXTURE_2D,Pe.depthTexture),z.activeTexture.set(ye.TEXTURE3),ye.bindTexture(ye.TEXTURE_2D,Pe.texture);for(let rr in this.terrainUniforms)this.terrainUniforms[rr].set(Pe[rr])}for(let rr in this.fixedUniforms)this.fixedUniforms[rr].set(xe[rr]);Gt&&Gt.setUniforms(z,this.binderUniforms,Jr,{zoom:Rt});let ze=0;switch(at){case ye.LINES:ze=2;break;case ye.TRIANGLES:ze=3;break;case ye.LINE_STRIP:ze=1}for(let rr of Br.get()){let fr=rr.vaos||(rr.vaos={});(fr[$e]||(fr[$e]=new Ke)).bind(z,this,hr,Gt?Gt.getPaintVertexBuffers():[],pr,rr.vertexOffset,ae,ce,Te),ye.drawElements(at,rr.primitiveLength*ze,ye.UNSIGNED_SHORT,rr.primitiveOffset*ze*2)}}}function wn(Pt,z,at){let xt=1/dn(at,1,z.transform.tileZoom),kt=Math.pow(2,at.tileID.overscaledZ),Lt=at.tileSize*Math.pow(2,z.transform.tileZoom)/kt,le=Lt*(at.tileID.canonical.x+at.tileID.wrap*kt),xe=Lt*at.tileID.canonical.y;return{u_image:0,u_texsize:at.imageAtlasTexture.size,u_scale:[xt,Pt.fromScale,Pt.toScale],u_fade:Pt.t,u_pixel_coord_upper:[le>>16,xe>>16],u_pixel_coord_lower:[65535&le,65535&xe]}}let rn=(Pt,z,at,xt)=>{let kt=z.style.light,Lt=kt.properties.get("position"),le=[Lt.x,Lt.y,Lt.z],xe=function(){var $e=new e.A(9);return e.A!=Float32Array&&($e[1]=0,$e[2]=0,$e[3]=0,$e[5]=0,$e[6]=0,$e[7]=0),$e[0]=1,$e[4]=1,$e[8]=1,$e}();kt.properties.get("anchor")==="viewport"&&function($e,hr){var pr=Math.sin(hr),Br=Math.cos(hr);$e[0]=Br,$e[1]=pr,$e[2]=0,$e[3]=-pr,$e[4]=Br,$e[5]=0,$e[6]=0,$e[7]=0,$e[8]=1}(xe,-z.transform.angle),function($e,hr,pr){var Br=hr[0],Jr=hr[1],Rt=hr[2];$e[0]=Br*pr[0]+Jr*pr[3]+Rt*pr[6],$e[1]=Br*pr[1]+Jr*pr[4]+Rt*pr[7],$e[2]=Br*pr[2]+Jr*pr[5]+Rt*pr[8]}(le,le,xe);let Pe=kt.properties.get("color");return{u_matrix:Pt,u_lightpos:le,u_lightintensity:kt.properties.get("intensity"),u_lightcolor:[Pe.r,Pe.g,Pe.b],u_vertical_gradient:+at,u_opacity:xt}},Qr=(Pt,z,at,xt,kt,Lt,le)=>e.e(rn(Pt,z,at,xt),wn(Lt,z,le),{u_height_factor:-Math.pow(2,kt.overscaledZ)/le.tileSize/8}),vn=Pt=>({u_matrix:Pt}),Oa=(Pt,z,at,xt)=>e.e(vn(Pt),wn(at,z,xt)),Qn=(Pt,z)=>({u_matrix:Pt,u_world:z}),Qa=(Pt,z,at,xt,kt)=>e.e(Oa(Pt,z,at,xt),{u_world:kt}),Ja=(Pt,z,at,xt)=>{let kt=Pt.transform,Lt,le;if(xt.paint.get("circle-pitch-alignment")==="map"){let xe=dn(at,1,kt.zoom);Lt=!0,le=[xe,xe]}else Lt=!1,le=kt.pixelsToGLUnits;return{u_camera_to_center_distance:kt.cameraToCenterDistance,u_scale_with_map:+(xt.paint.get("circle-pitch-scale")==="map"),u_matrix:Pt.translatePosMatrix(z.posMatrix,at,xt.paint.get("circle-translate"),xt.paint.get("circle-translate-anchor")),u_pitch_with_map:+Lt,u_device_pixel_ratio:Pt.pixelRatio,u_extrude_scale:le}},wi=(Pt,z,at)=>({u_matrix:Pt,u_inv_matrix:z,u_camera_to_center_distance:at.cameraToCenterDistance,u_viewport_size:[at.width,at.height]}),ci=(Pt,z,at=1)=>({u_matrix:Pt,u_color:z,u_overlay:0,u_overlay_scale:at}),Ti=Pt=>({u_matrix:Pt}),Ra=(Pt,z,at,xt)=>({u_matrix:Pt,u_extrude_scale:dn(z,1,at),u_intensity:xt}),Qi=(Pt,z,at,xt)=>{let kt=e.H();e.aP(kt,0,Pt.width,Pt.height,0,0,1);let Lt=Pt.context.gl;return{u_matrix:kt,u_world:[Lt.drawingBufferWidth,Lt.drawingBufferHeight],u_image:at,u_color_ramp:xt,u_opacity:z.paint.get("heatmap-opacity")}};function Hi(Pt,z){let at=Math.pow(2,z.canonical.z),xt=z.canonical.y;return[new e.Z(0,xt/at).toLngLat().lat,new e.Z(0,(xt+1)/at).toLngLat().lat]}let Ho=(Pt,z,at,xt)=>{let kt=Pt.transform;return{u_matrix:Po(Pt,z,at,xt),u_ratio:1/dn(z,1,kt.zoom),u_device_pixel_ratio:Pt.pixelRatio,u_units_to_pixels:[1/kt.pixelsToGLUnits[0],1/kt.pixelsToGLUnits[1]]}},Ci=(Pt,z,at,xt,kt)=>e.e(Ho(Pt,z,at,kt),{u_image:0,u_image_height:xt}),zo=(Pt,z,at,xt,kt)=>{let Lt=Pt.transform,le=qo(z,Lt);return{u_matrix:Po(Pt,z,at,kt),u_texsize:z.imageAtlasTexture.size,u_ratio:1/dn(z,1,Lt.zoom),u_device_pixel_ratio:Pt.pixelRatio,u_image:0,u_scale:[le,xt.fromScale,xt.toScale],u_fade:xt.t,u_units_to_pixels:[1/Lt.pixelsToGLUnits[0],1/Lt.pixelsToGLUnits[1]]}},qi=(Pt,z,at,xt,kt,Lt)=>{let le=Pt.lineAtlas,xe=qo(z,Pt.transform),Pe=at.layout.get("line-cap")==="round",$e=le.getDash(xt.from,Pe),hr=le.getDash(xt.to,Pe),pr=$e.width*kt.fromScale,Br=hr.width*kt.toScale;return e.e(Ho(Pt,z,at,Lt),{u_patternscale_a:[xe/pr,-$e.height/2],u_patternscale_b:[xe/Br,-hr.height/2],u_sdfgamma:le.width/(256*Math.min(pr,Br)*Pt.pixelRatio)/2,u_image:0,u_tex_y_a:$e.y,u_tex_y_b:hr.y,u_mix:kt.t})};function qo(Pt,z){return 1/dn(Pt,1,z.tileZoom)}function Po(Pt,z,at,xt){return Pt.translatePosMatrix(xt?xt.posMatrix:z.tileID.posMatrix,z,at.paint.get("line-translate"),at.paint.get("line-translate-anchor"))}let hs=(Pt,z,at,xt,kt)=>{return{u_matrix:Pt,u_tl_parent:z,u_scale_parent:at,u_buffer_scale:1,u_fade_t:xt.mix,u_opacity:xt.opacity*kt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:kt.paint.get("raster-brightness-min"),u_brightness_high:kt.paint.get("raster-brightness-max"),u_saturation_factor:(le=kt.paint.get("raster-saturation"),le>0?1-1/(1.001-le):-le),u_contrast_factor:(Lt=kt.paint.get("raster-contrast"),Lt>0?1/(1-Lt):1+Lt),u_spin_weights:Gi(kt.paint.get("raster-hue-rotate"))};var Lt,le};function Gi(Pt){Pt*=Math.PI/180;let z=Math.sin(Pt),at=Math.cos(Pt);return[(2*at+1)/3,(-Math.sqrt(3)*z-at+1)/3,(Math.sqrt(3)*z-at+1)/3]}let uo=(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr)=>{let Rt=le.transform;return{u_is_size_zoom_constant:+(Pt==="constant"||Pt==="source"),u_is_size_feature_constant:+(Pt==="constant"||Pt==="camera"),u_size_t:z?z.uSizeT:0,u_size:z?z.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:le.options.fadeDuration?le.symbolFadeChange:1,u_matrix:xe,u_label_plane_matrix:Pe,u_coord_matrix:$e,u_is_text:+pr,u_pitch_with_map:+xt,u_is_along_line:kt,u_is_variable_anchor:Lt,u_texsize:Br,u_texture:0,u_translation:hr,u_pitched_scale:Jr}},yi=(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr,Rt)=>{let Gt=le.transform;return e.e(uo(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Rt),{u_gamma_scale:xt?Math.cos(Gt._pitch)*Gt.cameraToCenterDistance:1,u_device_pixel_ratio:le.pixelRatio,u_is_halo:1})},ao=(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr)=>e.e(yi(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,!0,pr,!0,Jr),{u_texsize_icon:Br,u_texture_icon:1}),ts=(Pt,z,at)=>({u_matrix:Pt,u_opacity:z,u_color:at}),vs=(Pt,z,at,xt,kt,Lt)=>e.e(function(le,xe,Pe,$e){let hr=Pe.imageManager.getPattern(le.from.toString()),pr=Pe.imageManager.getPattern(le.to.toString()),{width:Br,height:Jr}=Pe.imageManager.getPixelSize(),Rt=Math.pow(2,$e.tileID.overscaledZ),Gt=$e.tileSize*Math.pow(2,Pe.transform.tileZoom)/Rt,ae=Gt*($e.tileID.canonical.x+$e.tileID.wrap*Rt),ce=Gt*$e.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:hr.tl,u_pattern_br_a:hr.br,u_pattern_tl_b:pr.tl,u_pattern_br_b:pr.br,u_texsize:[Br,Jr],u_mix:xe.t,u_pattern_size_a:hr.displaySize,u_pattern_size_b:pr.displaySize,u_scale_a:xe.fromScale,u_scale_b:xe.toScale,u_tile_units_to_pixels:1/dn($e,1,Pe.transform.tileZoom),u_pixel_coord_upper:[ae>>16,ce>>16],u_pixel_coord_lower:[65535&ae,65535&ce]}}(xt,Lt,at,kt),{u_matrix:Pt,u_opacity:z}),As={fillExtrusion:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_lightpos:new e.aN(Pt,z.u_lightpos),u_lightintensity:new e.aI(Pt,z.u_lightintensity),u_lightcolor:new e.aN(Pt,z.u_lightcolor),u_vertical_gradient:new e.aI(Pt,z.u_vertical_gradient),u_opacity:new e.aI(Pt,z.u_opacity)}),fillExtrusionPattern:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_lightpos:new e.aN(Pt,z.u_lightpos),u_lightintensity:new e.aI(Pt,z.u_lightintensity),u_lightcolor:new e.aN(Pt,z.u_lightcolor),u_vertical_gradient:new e.aI(Pt,z.u_vertical_gradient),u_height_factor:new e.aI(Pt,z.u_height_factor),u_image:new e.aH(Pt,z.u_image),u_texsize:new e.aO(Pt,z.u_texsize),u_pixel_coord_upper:new e.aO(Pt,z.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,z.u_pixel_coord_lower),u_scale:new e.aN(Pt,z.u_scale),u_fade:new e.aI(Pt,z.u_fade),u_opacity:new e.aI(Pt,z.u_opacity)}),fill:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix)}),fillPattern:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_image:new e.aH(Pt,z.u_image),u_texsize:new e.aO(Pt,z.u_texsize),u_pixel_coord_upper:new e.aO(Pt,z.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,z.u_pixel_coord_lower),u_scale:new e.aN(Pt,z.u_scale),u_fade:new e.aI(Pt,z.u_fade)}),fillOutline:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_world:new e.aO(Pt,z.u_world)}),fillOutlinePattern:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_world:new e.aO(Pt,z.u_world),u_image:new e.aH(Pt,z.u_image),u_texsize:new e.aO(Pt,z.u_texsize),u_pixel_coord_upper:new e.aO(Pt,z.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,z.u_pixel_coord_lower),u_scale:new e.aN(Pt,z.u_scale),u_fade:new e.aI(Pt,z.u_fade)}),circle:(Pt,z)=>({u_camera_to_center_distance:new e.aI(Pt,z.u_camera_to_center_distance),u_scale_with_map:new e.aH(Pt,z.u_scale_with_map),u_pitch_with_map:new e.aH(Pt,z.u_pitch_with_map),u_extrude_scale:new e.aO(Pt,z.u_extrude_scale),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_matrix:new e.aJ(Pt,z.u_matrix)}),collisionBox:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_pixel_extrude_scale:new e.aO(Pt,z.u_pixel_extrude_scale)}),collisionCircle:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_inv_matrix:new e.aJ(Pt,z.u_inv_matrix),u_camera_to_center_distance:new e.aI(Pt,z.u_camera_to_center_distance),u_viewport_size:new e.aO(Pt,z.u_viewport_size)}),debug:(Pt,z)=>({u_color:new e.aL(Pt,z.u_color),u_matrix:new e.aJ(Pt,z.u_matrix),u_overlay:new e.aH(Pt,z.u_overlay),u_overlay_scale:new e.aI(Pt,z.u_overlay_scale)}),clippingMask:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix)}),heatmap:(Pt,z)=>({u_extrude_scale:new e.aI(Pt,z.u_extrude_scale),u_intensity:new e.aI(Pt,z.u_intensity),u_matrix:new e.aJ(Pt,z.u_matrix)}),heatmapTexture:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_world:new e.aO(Pt,z.u_world),u_image:new e.aH(Pt,z.u_image),u_color_ramp:new e.aH(Pt,z.u_color_ramp),u_opacity:new e.aI(Pt,z.u_opacity)}),hillshade:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_image:new e.aH(Pt,z.u_image),u_latrange:new e.aO(Pt,z.u_latrange),u_light:new e.aO(Pt,z.u_light),u_shadow:new e.aL(Pt,z.u_shadow),u_highlight:new e.aL(Pt,z.u_highlight),u_accent:new e.aL(Pt,z.u_accent)}),hillshadePrepare:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_image:new e.aH(Pt,z.u_image),u_dimension:new e.aO(Pt,z.u_dimension),u_zoom:new e.aI(Pt,z.u_zoom),u_unpack:new e.aK(Pt,z.u_unpack)}),line:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_ratio:new e.aI(Pt,z.u_ratio),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Pt,z.u_units_to_pixels)}),lineGradient:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_ratio:new e.aI(Pt,z.u_ratio),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Pt,z.u_units_to_pixels),u_image:new e.aH(Pt,z.u_image),u_image_height:new e.aI(Pt,z.u_image_height)}),linePattern:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_texsize:new e.aO(Pt,z.u_texsize),u_ratio:new e.aI(Pt,z.u_ratio),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_image:new e.aH(Pt,z.u_image),u_units_to_pixels:new e.aO(Pt,z.u_units_to_pixels),u_scale:new e.aN(Pt,z.u_scale),u_fade:new e.aI(Pt,z.u_fade)}),lineSDF:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_ratio:new e.aI(Pt,z.u_ratio),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_units_to_pixels:new e.aO(Pt,z.u_units_to_pixels),u_patternscale_a:new e.aO(Pt,z.u_patternscale_a),u_patternscale_b:new e.aO(Pt,z.u_patternscale_b),u_sdfgamma:new e.aI(Pt,z.u_sdfgamma),u_image:new e.aH(Pt,z.u_image),u_tex_y_a:new e.aI(Pt,z.u_tex_y_a),u_tex_y_b:new e.aI(Pt,z.u_tex_y_b),u_mix:new e.aI(Pt,z.u_mix)}),raster:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_tl_parent:new e.aO(Pt,z.u_tl_parent),u_scale_parent:new e.aI(Pt,z.u_scale_parent),u_buffer_scale:new e.aI(Pt,z.u_buffer_scale),u_fade_t:new e.aI(Pt,z.u_fade_t),u_opacity:new e.aI(Pt,z.u_opacity),u_image0:new e.aH(Pt,z.u_image0),u_image1:new e.aH(Pt,z.u_image1),u_brightness_low:new e.aI(Pt,z.u_brightness_low),u_brightness_high:new e.aI(Pt,z.u_brightness_high),u_saturation_factor:new e.aI(Pt,z.u_saturation_factor),u_contrast_factor:new e.aI(Pt,z.u_contrast_factor),u_spin_weights:new e.aN(Pt,z.u_spin_weights)}),symbolIcon:(Pt,z)=>({u_is_size_zoom_constant:new e.aH(Pt,z.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Pt,z.u_is_size_feature_constant),u_size_t:new e.aI(Pt,z.u_size_t),u_size:new e.aI(Pt,z.u_size),u_camera_to_center_distance:new e.aI(Pt,z.u_camera_to_center_distance),u_pitch:new e.aI(Pt,z.u_pitch),u_rotate_symbol:new e.aH(Pt,z.u_rotate_symbol),u_aspect_ratio:new e.aI(Pt,z.u_aspect_ratio),u_fade_change:new e.aI(Pt,z.u_fade_change),u_matrix:new e.aJ(Pt,z.u_matrix),u_label_plane_matrix:new e.aJ(Pt,z.u_label_plane_matrix),u_coord_matrix:new e.aJ(Pt,z.u_coord_matrix),u_is_text:new e.aH(Pt,z.u_is_text),u_pitch_with_map:new e.aH(Pt,z.u_pitch_with_map),u_is_along_line:new e.aH(Pt,z.u_is_along_line),u_is_variable_anchor:new e.aH(Pt,z.u_is_variable_anchor),u_texsize:new e.aO(Pt,z.u_texsize),u_texture:new e.aH(Pt,z.u_texture),u_translation:new e.aO(Pt,z.u_translation),u_pitched_scale:new e.aI(Pt,z.u_pitched_scale)}),symbolSDF:(Pt,z)=>({u_is_size_zoom_constant:new e.aH(Pt,z.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Pt,z.u_is_size_feature_constant),u_size_t:new e.aI(Pt,z.u_size_t),u_size:new e.aI(Pt,z.u_size),u_camera_to_center_distance:new e.aI(Pt,z.u_camera_to_center_distance),u_pitch:new e.aI(Pt,z.u_pitch),u_rotate_symbol:new e.aH(Pt,z.u_rotate_symbol),u_aspect_ratio:new e.aI(Pt,z.u_aspect_ratio),u_fade_change:new e.aI(Pt,z.u_fade_change),u_matrix:new e.aJ(Pt,z.u_matrix),u_label_plane_matrix:new e.aJ(Pt,z.u_label_plane_matrix),u_coord_matrix:new e.aJ(Pt,z.u_coord_matrix),u_is_text:new e.aH(Pt,z.u_is_text),u_pitch_with_map:new e.aH(Pt,z.u_pitch_with_map),u_is_along_line:new e.aH(Pt,z.u_is_along_line),u_is_variable_anchor:new e.aH(Pt,z.u_is_variable_anchor),u_texsize:new e.aO(Pt,z.u_texsize),u_texture:new e.aH(Pt,z.u_texture),u_gamma_scale:new e.aI(Pt,z.u_gamma_scale),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_is_halo:new e.aH(Pt,z.u_is_halo),u_translation:new e.aO(Pt,z.u_translation),u_pitched_scale:new e.aI(Pt,z.u_pitched_scale)}),symbolTextAndIcon:(Pt,z)=>({u_is_size_zoom_constant:new e.aH(Pt,z.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(Pt,z.u_is_size_feature_constant),u_size_t:new e.aI(Pt,z.u_size_t),u_size:new e.aI(Pt,z.u_size),u_camera_to_center_distance:new e.aI(Pt,z.u_camera_to_center_distance),u_pitch:new e.aI(Pt,z.u_pitch),u_rotate_symbol:new e.aH(Pt,z.u_rotate_symbol),u_aspect_ratio:new e.aI(Pt,z.u_aspect_ratio),u_fade_change:new e.aI(Pt,z.u_fade_change),u_matrix:new e.aJ(Pt,z.u_matrix),u_label_plane_matrix:new e.aJ(Pt,z.u_label_plane_matrix),u_coord_matrix:new e.aJ(Pt,z.u_coord_matrix),u_is_text:new e.aH(Pt,z.u_is_text),u_pitch_with_map:new e.aH(Pt,z.u_pitch_with_map),u_is_along_line:new e.aH(Pt,z.u_is_along_line),u_is_variable_anchor:new e.aH(Pt,z.u_is_variable_anchor),u_texsize:new e.aO(Pt,z.u_texsize),u_texsize_icon:new e.aO(Pt,z.u_texsize_icon),u_texture:new e.aH(Pt,z.u_texture),u_texture_icon:new e.aH(Pt,z.u_texture_icon),u_gamma_scale:new e.aI(Pt,z.u_gamma_scale),u_device_pixel_ratio:new e.aI(Pt,z.u_device_pixel_ratio),u_is_halo:new e.aH(Pt,z.u_is_halo),u_translation:new e.aO(Pt,z.u_translation),u_pitched_scale:new e.aI(Pt,z.u_pitched_scale)}),background:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_opacity:new e.aI(Pt,z.u_opacity),u_color:new e.aL(Pt,z.u_color)}),backgroundPattern:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_opacity:new e.aI(Pt,z.u_opacity),u_image:new e.aH(Pt,z.u_image),u_pattern_tl_a:new e.aO(Pt,z.u_pattern_tl_a),u_pattern_br_a:new e.aO(Pt,z.u_pattern_br_a),u_pattern_tl_b:new e.aO(Pt,z.u_pattern_tl_b),u_pattern_br_b:new e.aO(Pt,z.u_pattern_br_b),u_texsize:new e.aO(Pt,z.u_texsize),u_mix:new e.aI(Pt,z.u_mix),u_pattern_size_a:new e.aO(Pt,z.u_pattern_size_a),u_pattern_size_b:new e.aO(Pt,z.u_pattern_size_b),u_scale_a:new e.aI(Pt,z.u_scale_a),u_scale_b:new e.aI(Pt,z.u_scale_b),u_pixel_coord_upper:new e.aO(Pt,z.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(Pt,z.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(Pt,z.u_tile_units_to_pixels)}),terrain:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_texture:new e.aH(Pt,z.u_texture),u_ele_delta:new e.aI(Pt,z.u_ele_delta),u_fog_matrix:new e.aJ(Pt,z.u_fog_matrix),u_fog_color:new e.aL(Pt,z.u_fog_color),u_fog_ground_blend:new e.aI(Pt,z.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(Pt,z.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(Pt,z.u_horizon_color),u_horizon_fog_blend:new e.aI(Pt,z.u_horizon_fog_blend)}),terrainDepth:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_ele_delta:new e.aI(Pt,z.u_ele_delta)}),terrainCoords:(Pt,z)=>({u_matrix:new e.aJ(Pt,z.u_matrix),u_texture:new e.aH(Pt,z.u_texture),u_terrain_coords_id:new e.aI(Pt,z.u_terrain_coords_id),u_ele_delta:new e.aI(Pt,z.u_ele_delta)}),sky:(Pt,z)=>({u_sky_color:new e.aL(Pt,z.u_sky_color),u_horizon_color:new e.aL(Pt,z.u_horizon_color),u_horizon:new e.aI(Pt,z.u_horizon),u_sky_horizon_blend:new e.aI(Pt,z.u_sky_horizon_blend)})};class _o{constructor(z,at,xt){this.context=z;let kt=z.gl;this.buffer=kt.createBuffer(),this.dynamicDraw=!!xt,this.context.unbindVAO(),z.bindElementBuffer.set(this.buffer),kt.bufferData(kt.ELEMENT_ARRAY_BUFFER,at.arrayBuffer,this.dynamicDraw?kt.DYNAMIC_DRAW:kt.STATIC_DRAW),this.dynamicDraw||delete at.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(z){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,z.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Da={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class li{constructor(z,at,xt,kt){this.length=at.length,this.attributes=xt,this.itemSize=at.bytesPerElement,this.dynamicDraw=kt,this.context=z;let Lt=z.gl;this.buffer=Lt.createBuffer(),z.bindVertexBuffer.set(this.buffer),Lt.bufferData(Lt.ARRAY_BUFFER,at.arrayBuffer,this.dynamicDraw?Lt.DYNAMIC_DRAW:Lt.STATIC_DRAW),this.dynamicDraw||delete at.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(z){if(z.length!==this.length)throw new Error(`Length of new data is ${z.length}, which doesn't match current length of ${this.length}`);let at=this.context.gl;this.bind(),at.bufferSubData(at.ARRAY_BUFFER,0,z.arrayBuffer)}enableAttributes(z,at){for(let xt=0;xt<this.attributes.length;xt++){let kt=at.attributes[this.attributes[xt].name];kt!==void 0&&z.enableVertexAttribArray(kt)}}setVertexAttribPointers(z,at,xt){for(let kt=0;kt<this.attributes.length;kt++){let Lt=this.attributes[kt],le=at.attributes[Lt.name];le!==void 0&&z.vertexAttribPointer(le,Lt.components,z[Da[Lt.type]],!1,this.itemSize,Lt.offset+this.itemSize*(xt||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let wo=new WeakMap;function Ms(Pt){var z;if(wo.has(Pt))return wo.get(Pt);{let at=(z=Pt.getParameter(Pt.VERSION))===null||z===void 0?void 0:z.startsWith("WebGL 2.0");return wo.set(Pt,at),at}}class Di{constructor(z){this.gl=z.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(z){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class _s extends Di{getDefault(){return e.aM.transparent}set(z){let at=this.current;(z.r!==at.r||z.g!==at.g||z.b!==at.b||z.a!==at.a||this.dirty)&&(this.gl.clearColor(z.r,z.g,z.b,z.a),this.current=z,this.dirty=!1)}}class No extends Di{getDefault(){return 1}set(z){(z!==this.current||this.dirty)&&(this.gl.clearDepth(z),this.current=z,this.dirty=!1)}}class is extends Di{getDefault(){return 0}set(z){(z!==this.current||this.dirty)&&(this.gl.clearStencil(z),this.current=z,this.dirty=!1)}}class al extends Di{getDefault(){return[!0,!0,!0,!0]}set(z){let at=this.current;(z[0]!==at[0]||z[1]!==at[1]||z[2]!==at[2]||z[3]!==at[3]||this.dirty)&&(this.gl.colorMask(z[0],z[1],z[2],z[3]),this.current=z,this.dirty=!1)}}class ii extends Di{getDefault(){return!0}set(z){(z!==this.current||this.dirty)&&(this.gl.depthMask(z),this.current=z,this.dirty=!1)}}class io extends Di{getDefault(){return 255}set(z){(z!==this.current||this.dirty)&&(this.gl.stencilMask(z),this.current=z,this.dirty=!1)}}class co extends Di{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(z){let at=this.current;(z.func!==at.func||z.ref!==at.ref||z.mask!==at.mask||this.dirty)&&(this.gl.stencilFunc(z.func,z.ref,z.mask),this.current=z,this.dirty=!1)}}class Is extends Di{getDefault(){let z=this.gl;return[z.KEEP,z.KEEP,z.KEEP]}set(z){let at=this.current;(z[0]!==at[0]||z[1]!==at[1]||z[2]!==at[2]||this.dirty)&&(this.gl.stencilOp(z[0],z[1],z[2]),this.current=z,this.dirty=!1)}}class Wo extends Di{getDefault(){return!1}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;z?at.enable(at.STENCIL_TEST):at.disable(at.STENCIL_TEST),this.current=z,this.dirty=!1}}class Bi extends Di{getDefault(){return[0,1]}set(z){let at=this.current;(z[0]!==at[0]||z[1]!==at[1]||this.dirty)&&(this.gl.depthRange(z[0],z[1]),this.current=z,this.dirty=!1)}}class $s extends Di{getDefault(){return!1}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;z?at.enable(at.DEPTH_TEST):at.disable(at.DEPTH_TEST),this.current=z,this.dirty=!1}}class fl extends Di{getDefault(){return this.gl.LESS}set(z){(z!==this.current||this.dirty)&&(this.gl.depthFunc(z),this.current=z,this.dirty=!1)}}class Jo extends Di{getDefault(){return!1}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;z?at.enable(at.BLEND):at.disable(at.BLEND),this.current=z,this.dirty=!1}}class us extends Di{getDefault(){let z=this.gl;return[z.ONE,z.ZERO]}set(z){let at=this.current;(z[0]!==at[0]||z[1]!==at[1]||this.dirty)&&(this.gl.blendFunc(z[0],z[1]),this.current=z,this.dirty=!1)}}class Ss extends Di{getDefault(){return e.aM.transparent}set(z){let at=this.current;(z.r!==at.r||z.g!==at.g||z.b!==at.b||z.a!==at.a||this.dirty)&&(this.gl.blendColor(z.r,z.g,z.b,z.a),this.current=z,this.dirty=!1)}}class Ls extends Di{getDefault(){return this.gl.FUNC_ADD}set(z){(z!==this.current||this.dirty)&&(this.gl.blendEquation(z),this.current=z,this.dirty=!1)}}class yl extends Di{getDefault(){return!1}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;z?at.enable(at.CULL_FACE):at.disable(at.CULL_FACE),this.current=z,this.dirty=!1}}class bu extends Di{getDefault(){return this.gl.BACK}set(z){(z!==this.current||this.dirty)&&(this.gl.cullFace(z),this.current=z,this.dirty=!1)}}class au extends Di{getDefault(){return this.gl.CCW}set(z){(z!==this.current||this.dirty)&&(this.gl.frontFace(z),this.current=z,this.dirty=!1)}}class fu extends Di{getDefault(){return null}set(z){(z!==this.current||this.dirty)&&(this.gl.useProgram(z),this.current=z,this.dirty=!1)}}class Ec extends Di{getDefault(){return this.gl.TEXTURE0}set(z){(z!==this.current||this.dirty)&&(this.gl.activeTexture(z),this.current=z,this.dirty=!1)}}class xc extends Di{getDefault(){let z=this.gl;return[0,0,z.drawingBufferWidth,z.drawingBufferHeight]}set(z){let at=this.current;(z[0]!==at[0]||z[1]!==at[1]||z[2]!==at[2]||z[3]!==at[3]||this.dirty)&&(this.gl.viewport(z[0],z[1],z[2],z[3]),this.current=z,this.dirty=!1)}}class cs extends Di{getDefault(){return null}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.bindFramebuffer(at.FRAMEBUFFER,z),this.current=z,this.dirty=!1}}class Gl extends Di{getDefault(){return null}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.bindRenderbuffer(at.RENDERBUFFER,z),this.current=z,this.dirty=!1}}class zc extends Di{getDefault(){return null}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.bindTexture(at.TEXTURE_2D,z),this.current=z,this.dirty=!1}}class Al extends Di{getDefault(){return null}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.bindBuffer(at.ARRAY_BUFFER,z),this.current=z,this.dirty=!1}}class xl extends Di{getDefault(){return null}set(z){let at=this.gl;at.bindBuffer(at.ELEMENT_ARRAY_BUFFER,z),this.current=z,this.dirty=!1}}class Ml extends Di{getDefault(){return null}set(z){var at;if(z===this.current&&!this.dirty)return;let xt=this.gl;Ms(xt)?xt.bindVertexArray(z):(at=xt.getExtension("OES_vertex_array_object"))===null||at===void 0||at.bindVertexArrayOES(z),this.current=z,this.dirty=!1}}class hu extends Di{getDefault(){return 4}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.pixelStorei(at.UNPACK_ALIGNMENT,z),this.current=z,this.dirty=!1}}class Fs extends Di{getDefault(){return!1}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.pixelStorei(at.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z),this.current=z,this.dirty=!1}}class _l extends Di{getDefault(){return!1}set(z){if(z===this.current&&!this.dirty)return;let at=this.gl;at.pixelStorei(at.UNPACK_FLIP_Y_WEBGL,z),this.current=z,this.dirty=!1}}class Fo extends Di{constructor(z,at){super(z),this.context=z,this.parent=at}getDefault(){return null}}class bs extends Fo{setDirty(){this.dirty=!0}set(z){if(z===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,z,0),this.current=z,this.dirty=!1}}class Iu extends Fo{set(z){if(z===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let at=this.gl;at.framebufferRenderbuffer(at.FRAMEBUFFER,at.DEPTH_ATTACHMENT,at.RENDERBUFFER,z),this.current=z,this.dirty=!1}}class Nl extends Fo{set(z){if(z===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,z),this.current=z,this.dirty=!1}}class Hu{constructor(z,at,xt,kt,Lt){this.context=z,this.width=at,this.height=xt;let le=z.gl,xe=this.framebuffer=le.createFramebuffer();if(this.colorAttachment=new bs(z,xe),kt)this.depthAttachment=Lt?new Nl(z,xe):new Iu(z,xe);else if(Lt)throw new Error("Stencil cannot be set without depth");if(le.checkFramebufferStatus(le.FRAMEBUFFER)!==le.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let z=this.context.gl,at=this.colorAttachment.get();if(at&&z.deleteTexture(at),this.depthAttachment){let xt=this.depthAttachment.get();xt&&z.deleteRenderbuffer(xt)}z.deleteFramebuffer(this.framebuffer)}}class qs{constructor(z,at,xt){this.blendFunction=z,this.blendColor=at,this.mask=xt}}qs.Replace=[1,0],qs.disabled=new qs(qs.Replace,e.aM.transparent,[!1,!1,!1,!1]),qs.unblended=new qs(qs.Replace,e.aM.transparent,[!0,!0,!0,!0]),qs.alphaBlended=new qs([1,771],e.aM.transparent,[!0,!0,!0,!0]);class of{constructor(z){var at,xt;if(this.gl=z,this.clearColor=new _s(this),this.clearDepth=new No(this),this.clearStencil=new is(this),this.colorMask=new al(this),this.depthMask=new ii(this),this.stencilMask=new io(this),this.stencilFunc=new co(this),this.stencilOp=new Is(this),this.stencilTest=new Wo(this),this.depthRange=new Bi(this),this.depthTest=new $s(this),this.depthFunc=new fl(this),this.blend=new Jo(this),this.blendFunc=new us(this),this.blendColor=new Ss(this),this.blendEquation=new Ls(this),this.cullFace=new yl(this),this.cullFaceSide=new bu(this),this.frontFace=new au(this),this.program=new fu(this),this.activeTexture=new Ec(this),this.viewport=new xc(this),this.bindFramebuffer=new cs(this),this.bindRenderbuffer=new Gl(this),this.bindTexture=new zc(this),this.bindVertexBuffer=new Al(this),this.bindElementBuffer=new xl(this),this.bindVertexArray=new Ml(this),this.pixelStoreUnpack=new hu(this),this.pixelStoreUnpackPremultiplyAlpha=new Fs(this),this.pixelStoreUnpackFlipY=new _l(this),this.extTextureFilterAnisotropic=z.getExtension("EXT_texture_filter_anisotropic")||z.getExtension("MOZ_EXT_texture_filter_anisotropic")||z.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=z.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=z.getParameter(z.MAX_TEXTURE_SIZE),Ms(z)){this.HALF_FLOAT=z.HALF_FLOAT;let kt=z.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(at=z.RGBA16F)!==null&&at!==void 0?at:kt?.RGBA16F_EXT,this.RGB16F=(xt=z.RGB16F)!==null&&xt!==void 0?xt:kt?.RGB16F_EXT,z.getExtension("EXT_color_buffer_float")}else{z.getExtension("EXT_color_buffer_half_float"),z.getExtension("OES_texture_half_float_linear");let kt=z.getExtension("OES_texture_half_float");this.HALF_FLOAT=kt?.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(z,at){return new _o(this,z,at)}createVertexBuffer(z,at,xt){return new li(this,z,at,xt)}createRenderbuffer(z,at,xt){let kt=this.gl,Lt=kt.createRenderbuffer();return this.bindRenderbuffer.set(Lt),kt.renderbufferStorage(kt.RENDERBUFFER,z,at,xt),this.bindRenderbuffer.set(null),Lt}createFramebuffer(z,at,xt,kt){return new Hu(this,z,at,xt,kt)}clear({color:z,depth:at,stencil:xt}){let kt=this.gl,Lt=0;z&&(Lt|=kt.COLOR_BUFFER_BIT,this.clearColor.set(z),this.colorMask.set([!0,!0,!0,!0])),at!==void 0&&(Lt|=kt.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(at),this.depthMask.set(!0)),xt!==void 0&&(Lt|=kt.STENCIL_BUFFER_BIT,this.clearStencil.set(xt),this.stencilMask.set(255)),kt.clear(Lt)}setCullFace(z){z.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(z.mode),this.frontFace.set(z.frontFace))}setDepthMode(z){z.func!==this.gl.ALWAYS||z.mask?(this.depthTest.set(!0),this.depthFunc.set(z.func),this.depthMask.set(z.mask),this.depthRange.set(z.range)):this.depthTest.set(!1)}setStencilMode(z){z.test.func!==this.gl.ALWAYS||z.mask?(this.stencilTest.set(!0),this.stencilMask.set(z.mask),this.stencilOp.set([z.fail,z.depthFail,z.pass]),this.stencilFunc.set({func:z.test.func,ref:z.ref,mask:z.test.mask})):this.stencilTest.set(!1)}setColorMode(z){e.aE(z.blendFunction,qs.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(z.blendFunction),this.blendColor.set(z.blendColor)),this.colorMask.set(z.mask)}createVertexArray(){var z;return Ms(this.gl)?this.gl.createVertexArray():(z=this.gl.getExtension("OES_vertex_array_object"))===null||z===void 0?void 0:z.createVertexArrayOES()}deleteVertexArray(z){var at;return Ms(this.gl)?this.gl.deleteVertexArray(z):(at=this.gl.getExtension("OES_vertex_array_object"))===null||at===void 0?void 0:at.deleteVertexArrayOES(z)}unbindVAO(){this.bindVertexArray.set(null)}}class Oo{constructor(z,at,xt){this.func=z,this.mask=at,this.range=xt}}Oo.ReadOnly=!1,Oo.ReadWrite=!0,Oo.disabled=new Oo(519,Oo.ReadOnly,[0,1]);let vf=7680;class os{constructor(z,at,xt,kt,Lt,le){this.test=z,this.ref=at,this.mask=xt,this.fail=kt,this.depthFail=Lt,this.pass=le}}os.disabled=new os({func:519,mask:0},0,0,vf,vf,vf);class Fi{constructor(z,at,xt){this.enable=z,this.mode=at,this.frontFace=xt}}let nc;function pu(Pt,z,at,xt,kt){let Lt=Pt.context,le=Lt.gl,xe=Pt.useProgram("collisionBox"),Pe=[],$e=0,hr=0;for(let ce=0;ce<xt.length;ce++){let Te=xt[ce],ye=z.getTile(Te).getBucket(at);if(!ye)continue;let ze=kt?ye.textCollisionBox:ye.iconCollisionBox,rr=ye.collisionCircleArray;if(rr.length>0){let fr=e.H();e.aQ(fr,ye.placementInvProjMatrix,Pt.transform.glCoordMatrix),e.aQ(fr,fr,ye.placementViewportMatrix),Pe.push({circleArray:rr,circleOffset:hr,transform:Te.posMatrix,invTransform:fr,coord:Te}),$e+=rr.length/4,hr=$e}ze&&xe.draw(Lt,le.LINES,Oo.disabled,os.disabled,Pt.colorModeForRenderPass(),Fi.disabled,{u_matrix:Te.posMatrix,u_pixel_extrude_scale:[1/(pr=Pt.transform).width,1/pr.height]},Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Te),at.id,ze.layoutVertexBuffer,ze.indexBuffer,ze.segments,null,Pt.transform.zoom,null,null,ze.collisionVertexBuffer)}var pr;if(!kt||!Pe.length)return;let Br=Pt.useProgram("collisionCircle"),Jr=new e.aR;Jr.resize(4*$e),Jr._trim();let Rt=0;for(let ce of Pe)for(let Te=0;Te<ce.circleArray.length/4;Te++){let ye=4*Te,ze=ce.circleArray[ye+0],rr=ce.circleArray[ye+1],fr=ce.circleArray[ye+2],gr=ce.circleArray[ye+3];Jr.emplace(Rt++,ze,rr,fr,gr,0),Jr.emplace(Rt++,ze,rr,fr,gr,1),Jr.emplace(Rt++,ze,rr,fr,gr,2),Jr.emplace(Rt++,ze,rr,fr,gr,3)}(!nc||nc.length<2*$e)&&(nc=function(ce){let Te=2*ce,ye=new e.aT;ye.resize(Te),ye._trim();for(let ze=0;ze<Te;ze++){let rr=6*ze;ye.uint16[rr+0]=4*ze+0,ye.uint16[rr+1]=4*ze+1,ye.uint16[rr+2]=4*ze+2,ye.uint16[rr+3]=4*ze+2,ye.uint16[rr+4]=4*ze+3,ye.uint16[rr+5]=4*ze+0}return ye}($e));let Gt=Lt.createIndexBuffer(nc,!0),ae=Lt.createVertexBuffer(Jr,e.aS.members,!0);for(let ce of Pe){let Te=wi(ce.transform,ce.invTransform,Pt.transform);Br.draw(Lt,le.TRIANGLES,Oo.disabled,os.disabled,Pt.colorModeForRenderPass(),Fi.disabled,Te,Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(ce.coord),at.id,ae,Gt,e.a0.simpleSegment(0,2*ce.circleOffset,ce.circleArray.length,ce.circleArray.length/2),null,Pt.transform.zoom,null,null,null)}ae.destroy(),Gt.destroy()}Fi.disabled=new Fi(!1,1029,2305),Fi.backCCW=new Fi(!0,1029,2305);let ml=e.an(new Float32Array(16));function Lc(Pt,z,at,xt,kt,Lt){let{horizontalAlign:le,verticalAlign:xe}=e.au(Pt);return new e.P((-(le-.5)*z/kt+xt[0])*Lt,(-(xe-.5)*at/kt+xt[1])*Lt)}function qu(Pt,z,at,xt,kt,Lt){let le=z.tileAnchorPoint.add(new e.P(z.translation[0],z.translation[1]));if(z.pitchWithMap){let xe=xt.mult(Lt);at||(xe=xe.rotate(-kt));let Pe=le.add(xe);return de(Pe.x,Pe.y,z.labelPlaneMatrix,z.getElevation).point}if(at){let xe=se(z.tileAnchorPoint.x+1,z.tileAnchorPoint.y,z).point.sub(Pt),Pe=Math.atan(xe.y/xe.x)+(xe.x<0?Math.PI:0);return Pt.add(xt.rotate(Pe))}return Pt.add(xt)}function dc(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr,Br,Jr){let Rt=Pt.text.placedSymbolArray,Gt=Pt.text.dynamicLayoutVertexArray,ae=Pt.icon.dynamicLayoutVertexArray,ce={};Gt.clear();for(let Te=0;Te<Rt.length;Te++){let ye=Rt.get(Te),ze=ye.hidden||!ye.crossTileID||Pt.allowVerticalPlacement&&!ye.placedOrientation?null:xt[ye.crossTileID];if(ze){let rr=new e.P(ye.anchorX,ye.anchorY),fr={getElevation:Jr,width:kt.width,height:kt.height,labelPlaneMatrix:Lt,pitchWithMap:at,projection:hr,tileAnchorPoint:rr,translation:pr,unwrappedTileID:Br},gr=at?de(rr.x,rr.y,le,Jr):se(rr.x,rr.y,fr),Lr=Dt(kt.cameraToCenterDistance,gr.signedDistanceFromCamera),Hr=e.ai(Pt.textSizeData,Pe,ye)*Lr/e.ap;at&&(Hr*=Pt.tilePixelRatio/xe);let{width:nn,height:cn,anchor:Mn,textOffset:Jn,textBoxScale:_a}=ze,xa=Lc(Mn,nn,cn,Jn,_a,Hr),La=hr.getPitchedTextCorrection(kt,rr.add(new e.P(pr[0],pr[1])),Br),ai=qu(gr.point,fr,z,xa,kt.angle,La),Ai=Pt.allowVerticalPlacement&&ye.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let mi=0;mi<ye.numGlyphs;mi++)e.aj(Gt,ai,Ai);$e&&ye.associatedIconIndex>=0&&(ce[ye.associatedIconIndex]={shiftedAnchor:ai,angle:Ai})}else ar(ye.numGlyphs,Gt)}if($e){ae.clear();let Te=Pt.icon.placedSymbolArray;for(let ye=0;ye<Te.length;ye++){let ze=Te.get(ye);if(ze.hidden)ar(ze.numGlyphs,ae);else{let rr=ce[ye];if(rr)for(let fr=0;fr<ze.numGlyphs;fr++)e.aj(ae,rr.shiftedAnchor,rr.angle);else ar(ze.numGlyphs,ae)}}Pt.icon.dynamicLayoutVertexBuffer.updateData(ae)}Pt.text.dynamicLayoutVertexBuffer.updateData(Gt)}function bl(Pt,z,at){return at.iconsInText&&z?"symbolTextAndIcon":Pt?"symbolSDF":"symbolIcon"}function Yc(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e,hr,pr){let Br=Pt.context,Jr=Br.gl,Rt=Pt.transform,Gt=ia(),ae=xe==="map",ce=Pe==="map",Te=xe!=="viewport"&&at.layout.get("symbol-placement")!=="point",ye=ae&&!ce&&!Te,ze=!ce&&Te,rr=!at.layout.get("symbol-sort-key").isConstant(),fr=!1,gr=Pt.depthModeForSublayer(0,Oo.ReadOnly),Lr=at._unevaluatedLayout.hasValue("text-variable-anchor")||at._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Hr=[],nn=Gt.getCircleRadiusCorrection(Rt);for(let cn of xt){let Mn=z.getTile(cn),Jn=Mn.getBucket(at);if(!Jn)continue;let _a=kt?Jn.text:Jn.icon;if(!_a||!_a.segments.get().length||!_a.hasVisibleVertices)continue;let xa=_a.programConfigurations.get(at.id),La=kt||Jn.sdfIcons,ai=kt?Jn.textSizeData:Jn.iconSizeData,Ai=ce||Rt.pitch!==0,mi=Pt.useProgram(bl(La,kt,Jn),xa),Yi=e.ag(ai,Rt.zoom),Go=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(cn),Xo,po,Qo,Js,Us=[0,0],To=null;if(kt)po=Mn.glyphAtlasTexture,Qo=Jr.LINEAR,Xo=Mn.glyphAtlasTexture.size,Jn.iconsInText&&(Us=Mn.imageAtlasTexture.size,To=Mn.imageAtlasTexture,Js=Ai||Pt.options.rotating||Pt.options.zooming||ai.kind==="composite"||ai.kind==="camera"?Jr.LINEAR:Jr.NEAREST);else{let Wr=at.layout.get("icon-size").constantOr(0)!==1||Jn.iconsNeedLinear;po=Mn.imageAtlasTexture,Qo=La||Pt.options.rotating||Pt.options.zooming||Wr||Ai?Jr.LINEAR:Jr.NEAREST,Xo=Mn.imageAtlasTexture.size}let ko=dn(Mn,1,Pt.transform.zoom),hl=ze?cn.posMatrix:ml,Sl=Mr(hl,ce,ae,Pt.transform,ko),tu=Ir(hl,ce,ae,Pt.transform,ko),gt=Ir(cn.posMatrix,ce,ae,Pt.transform,ko),Et=Gt.translatePosition(Pt.transform,Mn,Lt,le),Xt=Lr&&Jn.hasTextData(),fe=at.layout.get("icon-text-fit")!=="none"&&Xt&&Jn.hasIconData();if(Te){let Wr=Pt.style.map.terrain?(on,ta)=>Pt.style.map.terrain.getElevation(cn,on,ta):null,an=at.layout.get("text-rotation-alignment")==="map";_t(Jn,cn.posMatrix,Pt,kt,Sl,gt,ce,$e,an,Gt,cn.toUnwrapped(),Rt.width,Rt.height,Et,Wr)}let me=cn.posMatrix,we=kt&&Lr||fe,Ve=Te||we?ml:Sl,je=tu,or=La&&at.paint.get(kt?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Cr;Cr=La?Jn.iconsInText?ao(ai.kind,Yi,ye,ce,Te,we,Pt,me,Ve,je,Et,Xo,Us,nn):yi(ai.kind,Yi,ye,ce,Te,we,Pt,me,Ve,je,Et,kt,Xo,!0,nn):uo(ai.kind,Yi,ye,ce,Te,we,Pt,me,Ve,je,Et,kt,Xo,nn);let Sr={program:mi,buffers:_a,uniformValues:Cr,atlasTexture:po,atlasTextureIcon:To,atlasInterpolation:Qo,atlasInterpolationIcon:Js,isSDF:La,hasHalo:or};if(rr&&Jn.canOverlap){fr=!0;let Wr=_a.segments.get();for(let an of Wr)Hr.push({segments:new e.a0([an]),sortKey:an.sortKey,state:Sr,terrainData:Go})}else Hr.push({segments:_a.segments,sortKey:0,state:Sr,terrainData:Go})}fr&&Hr.sort((cn,Mn)=>cn.sortKey-Mn.sortKey);for(let cn of Hr){let Mn=cn.state;if(Br.activeTexture.set(Jr.TEXTURE0),Mn.atlasTexture.bind(Mn.atlasInterpolation,Jr.CLAMP_TO_EDGE),Mn.atlasTextureIcon&&(Br.activeTexture.set(Jr.TEXTURE1),Mn.atlasTextureIcon&&Mn.atlasTextureIcon.bind(Mn.atlasInterpolationIcon,Jr.CLAMP_TO_EDGE)),Mn.isSDF){let Jn=Mn.uniformValues;Mn.hasHalo&&(Jn.u_is_halo=1,Fc(Mn.buffers,cn.segments,at,Pt,Mn.program,gr,hr,pr,Jn,cn.terrainData)),Jn.u_is_halo=0}Fc(Mn.buffers,cn.segments,at,Pt,Mn.program,gr,hr,pr,Mn.uniformValues,cn.terrainData)}}function Fc(Pt,z,at,xt,kt,Lt,le,xe,Pe,$e){let hr=xt.context;kt.draw(hr,hr.gl.TRIANGLES,Lt,le,xe,Fi.disabled,Pe,$e,at.id,Pt.layoutVertexBuffer,Pt.indexBuffer,z,at.paint,xt.transform.zoom,Pt.programConfigurations.get(at.id),Pt.dynamicLayoutVertexBuffer,Pt.opacityVertexBuffer)}function mc(Pt,z,at,xt){let kt=Pt.context,Lt=kt.gl,le=os.disabled,xe=new qs([Lt.ONE,Lt.ONE],e.aM.transparent,[!0,!0,!0,!0]),Pe=z.getBucket(at);if(!Pe)return;let $e=xt.key,hr=at.heatmapFbos.get($e);hr||(hr=Cc(kt,z.tileSize,z.tileSize),at.heatmapFbos.set($e,hr)),kt.bindFramebuffer.set(hr.framebuffer),kt.viewport.set([0,0,z.tileSize,z.tileSize]),kt.clear({color:e.aM.transparent});let pr=Pe.programConfigurations.get(at.id),Br=Pt.useProgram("heatmap",pr),Jr=Pt.style.map.terrain.getTerrainData(xt);Br.draw(kt,Lt.TRIANGLES,Oo.disabled,le,xe,Fi.disabled,Ra(xt.posMatrix,z,Pt.transform.zoom,at.paint.get("heatmap-intensity")),Jr,at.id,Pe.layoutVertexBuffer,Pe.indexBuffer,Pe.segments,at.paint,Pt.transform.zoom,pr)}function Wu(Pt,z,at){let xt=Pt.context,kt=xt.gl;xt.setColorMode(Pt.colorModeForRenderPass());let Lt=Ic(xt,z),le=at.key,xe=z.heatmapFbos.get(le);xe&&(xt.activeTexture.set(kt.TEXTURE0),kt.bindTexture(kt.TEXTURE_2D,xe.colorAttachment.get()),xt.activeTexture.set(kt.TEXTURE1),Lt.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),Pt.useProgram("heatmapTexture").draw(xt,kt.TRIANGLES,Oo.disabled,os.disabled,Pt.colorModeForRenderPass(),Fi.disabled,Qi(Pt,z,0,1),null,z.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments,z.paint,Pt.transform.zoom),xe.destroy(),z.heatmapFbos.delete(le))}function Cc(Pt,z,at){var xt,kt;let Lt=Pt.gl,le=Lt.createTexture();Lt.bindTexture(Lt.TEXTURE_2D,le),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_S,Lt.CLAMP_TO_EDGE),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_WRAP_T,Lt.CLAMP_TO_EDGE),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MIN_FILTER,Lt.LINEAR),Lt.texParameteri(Lt.TEXTURE_2D,Lt.TEXTURE_MAG_FILTER,Lt.LINEAR);let xe=(xt=Pt.HALF_FLOAT)!==null&&xt!==void 0?xt:Lt.UNSIGNED_BYTE,Pe=(kt=Pt.RGBA16F)!==null&&kt!==void 0?kt:Lt.RGBA;Lt.texImage2D(Lt.TEXTURE_2D,0,Pe,z,at,0,Lt.RGBA,xe,null);let $e=Pt.createFramebuffer(z,at,!1,!1);return $e.colorAttachment.set(le),$e}function Ic(Pt,z){return z.colorRampTexture||(z.colorRampTexture=new h(Pt,z.colorRamp,Pt.gl.RGBA)),z.colorRampTexture}function du(Pt,z,at,xt,kt){if(!at||!xt||!xt.imageAtlas)return;let Lt=xt.imageAtlas.patternPositions,le=Lt[at.to.toString()],xe=Lt[at.from.toString()];if(!le&&xe&&(le=xe),!xe&&le&&(xe=le),!le||!xe){let Pe=kt.getPaintProperty(z);le=Lt[Pe],xe=Lt[Pe]}le&&xe&&Pt.setConstantPatternPositions(le,xe)}function Bc(Pt,z,at,xt,kt,Lt,le){let xe=Pt.context.gl,Pe="fill-pattern",$e=at.paint.get(Pe),hr=$e&&$e.constantOr(1),pr=at.getCrossfadeParameters(),Br,Jr,Rt,Gt,ae;le?(Jr=hr&&!at.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Br=xe.LINES):(Jr=hr?"fillPattern":"fill",Br=xe.TRIANGLES);let ce=$e.constantOr(null);for(let Te of xt){let ye=z.getTile(Te);if(hr&&!ye.patternsLoaded())continue;let ze=ye.getBucket(at);if(!ze)continue;let rr=ze.programConfigurations.get(at.id),fr=Pt.useProgram(Jr,rr),gr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Te);hr&&(Pt.context.activeTexture.set(xe.TEXTURE0),ye.imageAtlasTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE),rr.updatePaintBuffers(pr)),du(rr,Pe,ce,ye,at);let Lr=gr?Te:null,Hr=Pt.translatePosMatrix(Lr?Lr.posMatrix:Te.posMatrix,ye,at.paint.get("fill-translate"),at.paint.get("fill-translate-anchor"));if(le){Gt=ze.indexBuffer2,ae=ze.segments2;let nn=[xe.drawingBufferWidth,xe.drawingBufferHeight];Rt=Jr==="fillOutlinePattern"&&hr?Qa(Hr,Pt,pr,ye,nn):Qn(Hr,nn)}else Gt=ze.indexBuffer,ae=ze.segments,Rt=hr?Oa(Hr,Pt,pr,ye):vn(Hr);fr.draw(Pt.context,Br,kt,Pt.stencilModeForClipping(Te),Lt,Fi.disabled,Rt,gr,at.id,ze.layoutVertexBuffer,Gt,ae,at.paint,Pt.transform.zoom,rr)}}function Pu(Pt,z,at,xt,kt,Lt,le){let xe=Pt.context,Pe=xe.gl,$e="fill-extrusion-pattern",hr=at.paint.get($e),pr=hr.constantOr(1),Br=at.getCrossfadeParameters(),Jr=at.paint.get("fill-extrusion-opacity"),Rt=hr.constantOr(null);for(let Gt of xt){let ae=z.getTile(Gt),ce=ae.getBucket(at);if(!ce)continue;let Te=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(Gt),ye=ce.programConfigurations.get(at.id),ze=Pt.useProgram(pr?"fillExtrusionPattern":"fillExtrusion",ye);pr&&(Pt.context.activeTexture.set(Pe.TEXTURE0),ae.imageAtlasTexture.bind(Pe.LINEAR,Pe.CLAMP_TO_EDGE),ye.updatePaintBuffers(Br)),du(ye,$e,Rt,ae,at);let rr=Pt.translatePosMatrix(Gt.posMatrix,ae,at.paint.get("fill-extrusion-translate"),at.paint.get("fill-extrusion-translate-anchor")),fr=at.paint.get("fill-extrusion-vertical-gradient"),gr=pr?Qr(rr,Pt,fr,Jr,Gt,Br,ae):rn(rr,Pt,fr,Jr);ze.draw(xe,xe.gl.TRIANGLES,kt,Lt,le,Fi.backCCW,gr,Te,at.id,ce.layoutVertexBuffer,ce.indexBuffer,ce.segments,at.paint,Pt.transform.zoom,ye,Pt.style.map.terrain&&ce.centroidVertexBuffer)}}function wu(Pt,z,at,xt,kt,Lt,le){let xe=Pt.context,Pe=xe.gl,$e=at.fbo;if(!$e)return;let hr=Pt.useProgram("hillshade"),pr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(z);xe.activeTexture.set(Pe.TEXTURE0),Pe.bindTexture(Pe.TEXTURE_2D,$e.colorAttachment.get()),hr.draw(xe,Pe.TRIANGLES,kt,Lt,le,Fi.disabled,((Br,Jr,Rt,Gt)=>{let ae=Rt.paint.get("hillshade-shadow-color"),ce=Rt.paint.get("hillshade-highlight-color"),Te=Rt.paint.get("hillshade-accent-color"),ye=Rt.paint.get("hillshade-illumination-direction")*(Math.PI/180);Rt.paint.get("hillshade-illumination-anchor")==="viewport"&&(ye-=Br.transform.angle);let ze=!Br.options.moving;return{u_matrix:Gt?Gt.posMatrix:Br.transform.calculatePosMatrix(Jr.tileID.toUnwrapped(),ze),u_image:0,u_latrange:Hi(0,Jr.tileID),u_light:[Rt.paint.get("hillshade-exaggeration"),ye],u_shadow:ae,u_highlight:ce,u_accent:Te}})(Pt,at,xt,pr?z:null),pr,xt.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments)}function wl(Pt,z,at,xt,kt,Lt){let le=Pt.context,xe=le.gl,Pe=z.dem;if(Pe&&Pe.data){let $e=Pe.dim,hr=Pe.stride,pr=Pe.getPixels();if(le.activeTexture.set(xe.TEXTURE1),le.pixelStoreUnpackPremultiplyAlpha.set(!1),z.demTexture=z.demTexture||Pt.getTileTexture(hr),z.demTexture){let Jr=z.demTexture;Jr.update(pr,{premultiply:!1}),Jr.bind(xe.NEAREST,xe.CLAMP_TO_EDGE)}else z.demTexture=new h(le,pr,xe.RGBA,{premultiply:!1}),z.demTexture.bind(xe.NEAREST,xe.CLAMP_TO_EDGE);le.activeTexture.set(xe.TEXTURE0);let Br=z.fbo;if(!Br){let Jr=new h(le,{width:$e,height:$e,data:null},xe.RGBA);Jr.bind(xe.LINEAR,xe.CLAMP_TO_EDGE),Br=z.fbo=le.createFramebuffer($e,$e,!0,!1),Br.colorAttachment.set(Jr.texture)}le.bindFramebuffer.set(Br.framebuffer),le.viewport.set([0,0,$e,$e]),Pt.useProgram("hillshadePrepare").draw(le,xe.TRIANGLES,xt,kt,Lt,Fi.disabled,((Jr,Rt)=>{let Gt=Rt.stride,ae=e.H();return e.aP(ae,0,e.X,-e.X,0,0,1),e.J(ae,ae,[0,-e.X,0]),{u_matrix:ae,u_image:1,u_dimension:[Gt,Gt],u_zoom:Jr.overscaledZ,u_unpack:Rt.getUnpackVector()}})(z.tileID,Pe),null,at.id,Pt.rasterBoundsBuffer,Pt.quadTriangleIndexBuffer,Pt.rasterBoundsSegments),z.needsHillshadePrepare=!1}}function Ju(Pt,z,at,xt,kt,Lt){let le=xt.paint.get("raster-fade-duration");if(!Lt&&le>0){let xe=o.now(),Pe=(xe-Pt.timeAdded)/le,$e=z?(xe-z.timeAdded)/le:-1,hr=at.getSource(),pr=kt.coveringZoomLevel({tileSize:hr.tileSize,roundZoom:hr.roundZoom}),Br=!z||Math.abs(z.tileID.overscaledZ-pr)>Math.abs(Pt.tileID.overscaledZ-pr),Jr=Br&&Pt.refreshedUponExpiration?1:e.ac(Br?Pe:1-$e,0,1);return Pt.refreshedUponExpiration&&Pe>=1&&(Pt.refreshedUponExpiration=!1),z?{opacity:1,mix:1-Jr}:{opacity:Jr,mix:0}}return{opacity:1,mix:0}}let Pc=new e.aM(1,0,0,1),Es=new e.aM(0,1,0,1),_c=new e.aM(0,0,1,1),sf=new e.aM(1,0,1,1),Rc=new e.aM(0,1,1,1);function gc(Pt,z,at,xt){Zl(Pt,0,z+at/2,Pt.transform.width,at,xt)}function Nc(Pt,z,at,xt){Zl(Pt,z-at/2,0,at,Pt.transform.height,xt)}function Zl(Pt,z,at,xt,kt,Lt){let le=Pt.context,xe=le.gl;xe.enable(xe.SCISSOR_TEST),xe.scissor(z*Pt.pixelRatio,at*Pt.pixelRatio,xt*Pt.pixelRatio,kt*Pt.pixelRatio),le.clear({color:Lt}),xe.disable(xe.SCISSOR_TEST)}function jc(Pt,z,at){let xt=Pt.context,kt=xt.gl,Lt=at.posMatrix,le=Pt.useProgram("debug"),xe=Oo.disabled,Pe=os.disabled,$e=Pt.colorModeForRenderPass(),hr="$debug",pr=Pt.style.map.terrain&&Pt.style.map.terrain.getTerrainData(at);xt.activeTexture.set(kt.TEXTURE0);let Br=z.getTileByID(at.key).latestRawTileData,Jr=Math.floor((Br&&Br.byteLength||0)/1024),Rt=z.getTile(at).tileSize,Gt=512/Math.min(Rt,512)*(at.overscaledZ/Pt.transform.zoom)*.5,ae=at.canonical.toString();at.overscaledZ!==at.canonical.z&&(ae+=` => ${at.overscaledZ}`),function(ce,Te){ce.initDebugOverlayCanvas();let ye=ce.debugOverlayCanvas,ze=ce.context.gl,rr=ce.debugOverlayCanvas.getContext("2d");rr.clearRect(0,0,ye.width,ye.height),rr.shadowColor="white",rr.shadowBlur=2,rr.lineWidth=1.5,rr.strokeStyle="white",rr.textBaseline="top",rr.font="bold 36px Open Sans, sans-serif",rr.fillText(Te,5,5),rr.strokeText(Te,5,5),ce.debugOverlayTexture.update(ye),ce.debugOverlayTexture.bind(ze.LINEAR,ze.CLAMP_TO_EDGE)}(Pt,`${ae} ${Jr}kB`),le.draw(xt,kt.TRIANGLES,xe,Pe,qs.alphaBlended,Fi.disabled,ci(Lt,e.aM.transparent,Gt),null,hr,Pt.debugBuffer,Pt.quadTriangleIndexBuffer,Pt.debugSegments),le.draw(xt,kt.LINE_STRIP,xe,Pe,$e,Fi.disabled,ci(Lt,e.aM.red),pr,hr,Pt.debugBuffer,Pt.tileBorderIndexBuffer,Pt.debugSegments)}function rl(Pt,z,at){let xt=Pt.context,kt=xt.gl,Lt=Pt.colorModeForRenderPass(),le=new Oo(kt.LEQUAL,Oo.ReadWrite,Pt.depthRangeFor3D),xe=Pt.useProgram("terrain"),Pe=z.getTerrainMesh();xt.bindFramebuffer.set(null),xt.viewport.set([0,0,Pt.width,Pt.height]);for(let $e of at){let hr=Pt.renderToTexture.getTexture($e),pr=z.getTerrainData($e.tileID);xt.activeTexture.set(kt.TEXTURE0),kt.bindTexture(kt.TEXTURE_2D,hr.texture);let Br=Pt.transform.calculatePosMatrix($e.tileID.toUnwrapped()),Jr=z.getMeshFrameDelta(Pt.transform.zoom),Rt=Pt.transform.calculateFogMatrix($e.tileID.toUnwrapped()),Gt=xr(Br,Jr,Rt,Pt.style.sky,Pt.transform.pitch);xe.draw(xt,kt.TRIANGLES,le,os.disabled,Lt,Fi.backCCW,Gt,pr,"terrain",Pe.vertexBuffer,Pe.indexBuffer,Pe.segments)}}class Kl{constructor(z,at,xt){this.vertexBuffer=z,this.indexBuffer=at,this.segments=xt}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Gu{constructor(z,at){this.context=new of(z),this.transform=at,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ce.maxUnderzooming+Ce.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new br}resize(z,at,xt){if(this.width=Math.floor(z*xt),this.height=Math.floor(at*xt),this.pixelRatio=xt,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let kt of this.style._order)this.style._layers[kt].resize()}setup(){let z=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=z.createVertexBuffer(at,Ur.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);let xt=new e.aX;xt.emplaceBack(0,0),xt.emplaceBack(e.X,0),xt.emplaceBack(0,e.X),xt.emplaceBack(e.X,e.X),this.debugBuffer=z.createVertexBuffer(xt,Ur.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);let kt=new e.$;kt.emplaceBack(0,0,0,0),kt.emplaceBack(e.X,0,e.X,0),kt.emplaceBack(0,e.X,0,e.X),kt.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=z.createVertexBuffer(kt,Nt.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);let Lt=new e.aX;Lt.emplaceBack(0,0),Lt.emplaceBack(1,0),Lt.emplaceBack(0,1),Lt.emplaceBack(1,1),this.viewportBuffer=z.createVertexBuffer(Lt,Ur.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);let le=new e.aZ;le.emplaceBack(0),le.emplaceBack(1),le.emplaceBack(3),le.emplaceBack(2),le.emplaceBack(0),this.tileBorderIndexBuffer=z.createIndexBuffer(le);let xe=new e.aY;xe.emplaceBack(0,1,2),xe.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=z.createIndexBuffer(xe);let Pe=this.context.gl;this.stencilClearMode=new os({func:Pe.ALWAYS,mask:0},0,255,Pe.ZERO,Pe.ZERO,Pe.ZERO)}clearStencil(){let z=this.context,at=z.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let xt=e.H();e.aP(xt,0,this.width,this.height,0,0,1),e.K(xt,xt,[at.drawingBufferWidth,at.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(z,at.TRIANGLES,Oo.disabled,this.stencilClearMode,qs.disabled,Fi.disabled,Ti(xt),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(z,at){if(this.currentStencilSource===z.source||!z.isTileClipped()||!at||!at.length)return;this.currentStencilSource=z.source;let xt=this.context,kt=xt.gl;this.nextStencilID+at.length>256&&this.clearStencil(),xt.setColorMode(qs.disabled),xt.setDepthMode(Oo.disabled);let Lt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let le of at){let xe=this._tileClippingMaskIDs[le.key]=this.nextStencilID++,Pe=this.style.map.terrain&&this.style.map.terrain.getTerrainData(le);Lt.draw(xt,kt.TRIANGLES,Oo.disabled,new os({func:kt.ALWAYS,mask:0},xe,255,kt.KEEP,kt.KEEP,kt.REPLACE),qs.disabled,Fi.disabled,Ti(le.posMatrix),Pe,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let z=this.nextStencilID++,at=this.context.gl;return new os({func:at.NOTEQUAL,mask:255},z,255,at.KEEP,at.KEEP,at.REPLACE)}stencilModeForClipping(z){let at=this.context.gl;return new os({func:at.EQUAL,mask:255},this._tileClippingMaskIDs[z.key],0,at.KEEP,at.KEEP,at.REPLACE)}stencilConfigForOverlap(z){let at=this.context.gl,xt=z.sort((le,xe)=>xe.overscaledZ-le.overscaledZ),kt=xt[xt.length-1].overscaledZ,Lt=xt[0].overscaledZ-kt+1;if(Lt>1){this.currentStencilSource=void 0,this.nextStencilID+Lt>256&&this.clearStencil();let le={};for(let xe=0;xe<Lt;xe++)le[xe+kt]=new os({func:at.GEQUAL,mask:255},xe+this.nextStencilID,255,at.KEEP,at.KEEP,at.REPLACE);return this.nextStencilID+=Lt,[le,xt]}return[{[kt]:os.disabled},xt]}colorModeForRenderPass(){let z=this.context.gl;return this._showOverdrawInspector?new qs([z.CONSTANT_COLOR,z.ONE],new e.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?qs.unblended:qs.alphaBlended}depthModeForSublayer(z,at,xt){if(!this.opaquePassEnabledForLayer())return Oo.disabled;let kt=1-((1+this.currentLayer)*this.numSublayers+z)*this.depthEpsilon;return new Oo(xt||this.context.gl.LEQUAL,at,[kt,kt])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(z,at){this.style=z,this.options=at,this.lineAtlas=z.lineAtlas,this.imageManager=z.imageManager,this.glyphManager=z.glyphManager,this.symbolFadeChange=z.placement.symbolFadeChange(o.now()),this.imageManager.beginFrame();let xt=this.style._order,kt=this.style.sourceCaches,Lt={},le={},xe={};for(let Pe in kt){let $e=kt[Pe];$e.used&&$e.prepare(this.context),Lt[Pe]=$e.getVisibleCoordinates(),le[Pe]=Lt[Pe].slice().reverse(),xe[Pe]=$e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Pe=0;Pe<xt.length;Pe++)if(this.style._layers[xt[Pe]].is3D()){this.opaquePassCutoff=Pe;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let Pe of xt){let $e=this.style._layers[Pe];if(!$e.hasOffscreenPass()||$e.isHidden(this.transform.zoom))continue;let hr=le[$e.source];($e.type==="custom"||hr.length)&&this.renderLayer(this,kt[$e.source],$e,hr)}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(Pe,$e){let hr=Pe.context,pr=hr.gl,Br=((ce,Te,ye)=>({u_sky_color:ce.properties.get("sky-color"),u_horizon_color:ce.properties.get("horizon-color"),u_horizon:(Te.height/2+Te.getHorizon())*ye,u_sky_horizon_blend:ce.properties.get("sky-horizon-blend")*Te.height/2*ye}))($e,Pe.style.map.transform,Pe.pixelRatio),Jr=new Oo(pr.LEQUAL,Oo.ReadWrite,[0,1]),Rt=os.disabled,Gt=Pe.colorModeForRenderPass(),ae=Pe.useProgram("sky");if(!$e.mesh){let ce=new e.aX;ce.emplaceBack(-1,-1),ce.emplaceBack(1,-1),ce.emplaceBack(1,1),ce.emplaceBack(-1,1);let Te=new e.aY;Te.emplaceBack(0,1,2),Te.emplaceBack(0,2,3),$e.mesh=new Kl(hr.createVertexBuffer(ce,Ur.members),hr.createIndexBuffer(Te),e.a0.simpleSegment(0,0,ce.length,Te.length))}ae.draw(hr,pr.TRIANGLES,Jr,Rt,Gt,Fi.disabled,Br,void 0,"sky",$e.mesh.vertexBuffer,$e.mesh.indexBuffer,$e.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=at.showOverdrawInspector,this.depthRangeFor3D=[0,1-(z._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=xt.length-1;this.currentLayer>=0;this.currentLayer--){let Pe=this.style._layers[xt[this.currentLayer]],$e=kt[Pe.source],hr=Lt[Pe.source];this._renderTileClippingMasks(Pe,hr),this.renderLayer(this,$e,Pe,hr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<xt.length;this.currentLayer++){let Pe=this.style._layers[xt[this.currentLayer]],$e=kt[Pe.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Pe))continue;let hr=(Pe.type==="symbol"?xe:le)[Pe.source];this._renderTileClippingMasks(Pe,Lt[Pe.source]),this.renderLayer(this,$e,Pe,hr)}if(this.options.showTileBoundaries){let Pe=function($e,hr){let pr=null,Br=Object.values($e._layers).flatMap(ae=>ae.source&&!ae.isHidden(hr)?[$e.sourceCaches[ae.source]]:[]),Jr=Br.filter(ae=>ae.getSource().type==="vector"),Rt=Br.filter(ae=>ae.getSource().type!=="vector"),Gt=ae=>{(!pr||pr.getSource().maxzoom<ae.getSource().maxzoom)&&(pr=ae)};return Jr.forEach(ae=>Gt(ae)),pr||Rt.forEach(ae=>Gt(ae)),pr}(this.style,this.transform.zoom);Pe&&function($e,hr,pr){for(let Br=0;Br<pr.length;Br++)jc($e,hr,pr[Br])}(this,Pe,Pe.getVisibleCoordinates())}this.options.showPadding&&function(Pe){let $e=Pe.transform.padding;gc(Pe,Pe.transform.height-($e.top||0),3,Pc),gc(Pe,$e.bottom||0,3,Es),Nc(Pe,$e.left||0,3,_c),Nc(Pe,Pe.transform.width-($e.right||0),3,sf);let hr=Pe.transform.centerPoint;(function(pr,Br,Jr,Rt){Zl(pr,Br-1,Jr-10,2,20,Rt),Zl(pr,Br-10,Jr-1,20,2,Rt)})(Pe,hr.x,Pe.transform.height-hr.y,Rc)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(z){if(!this.style||!this.style.map||!this.style.map.terrain)return;let at=this.terrainFacilitator.matrix,xt=this.transform.modelViewProjectionMatrix,kt=this.terrainFacilitator.dirty;kt||(kt=z?!e.a_(at,xt):!e.a$(at,xt)),kt||(kt=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),kt&&(e.b0(at,xt),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Lt,le){let xe=Lt.context,Pe=xe.gl,$e=qs.unblended,hr=new Oo(Pe.LEQUAL,Oo.ReadWrite,[0,1]),pr=le.getTerrainMesh(),Br=le.sourceCache.getRenderableTiles(),Jr=Lt.useProgram("terrainDepth");xe.bindFramebuffer.set(le.getFramebuffer("depth").framebuffer),xe.viewport.set([0,0,Lt.width/devicePixelRatio,Lt.height/devicePixelRatio]),xe.clear({color:e.aM.transparent,depth:1});for(let Rt of Br){let Gt=le.getTerrainData(Rt.tileID),ae={u_matrix:Lt.transform.calculatePosMatrix(Rt.tileID.toUnwrapped()),u_ele_delta:le.getMeshFrameDelta(Lt.transform.zoom)};Jr.draw(xe,Pe.TRIANGLES,hr,os.disabled,$e,Fi.backCCW,ae,Gt,"terrain",pr.vertexBuffer,pr.indexBuffer,pr.segments)}xe.bindFramebuffer.set(null),xe.viewport.set([0,0,Lt.width,Lt.height])}(this,this.style.map.terrain),function(Lt,le){let xe=Lt.context,Pe=xe.gl,$e=qs.unblended,hr=new Oo(Pe.LEQUAL,Oo.ReadWrite,[0,1]),pr=le.getTerrainMesh(),Br=le.getCoordsTexture(),Jr=le.sourceCache.getRenderableTiles(),Rt=Lt.useProgram("terrainCoords");xe.bindFramebuffer.set(le.getFramebuffer("coords").framebuffer),xe.viewport.set([0,0,Lt.width/devicePixelRatio,Lt.height/devicePixelRatio]),xe.clear({color:e.aM.transparent,depth:1}),le.coordsIndex=[];for(let Gt of Jr){let ae=le.getTerrainData(Gt.tileID);xe.activeTexture.set(Pe.TEXTURE0),Pe.bindTexture(Pe.TEXTURE_2D,Br.texture);let ce={u_matrix:Lt.transform.calculatePosMatrix(Gt.tileID.toUnwrapped()),u_terrain_coords_id:(255-le.coordsIndex.length)/255,u_texture:0,u_ele_delta:le.getMeshFrameDelta(Lt.transform.zoom)};Rt.draw(xe,Pe.TRIANGLES,hr,os.disabled,$e,Fi.backCCW,ce,ae,"terrain",pr.vertexBuffer,pr.indexBuffer,pr.segments),le.coordsIndex.push(Gt.tileID.key)}xe.bindFramebuffer.set(null),xe.viewport.set([0,0,Lt.width,Lt.height])}(this,this.style.map.terrain))}renderLayer(z,at,xt,kt){if(!xt.isHidden(this.transform.zoom)&&(xt.type==="background"||xt.type==="custom"||(kt||[]).length))switch(this.id=xt.id,xt.type){case"symbol":(function(Lt,le,xe,Pe,$e){if(Lt.renderPass!=="translucent")return;let hr=os.disabled,pr=Lt.colorModeForRenderPass();(xe._unevaluatedLayout.hasValue("text-variable-anchor")||xe._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Br,Jr,Rt,Gt,ae,ce,Te,ye,ze){let rr=Jr.transform,fr=ia(),gr=ae==="map",Lr=ce==="map";for(let Hr of Br){let nn=Gt.getTile(Hr),cn=nn.getBucket(Rt);if(!cn||!cn.text||!cn.text.segments.get().length)continue;let Mn=e.ag(cn.textSizeData,rr.zoom),Jn=dn(nn,1,Jr.transform.zoom),_a=Mr(Hr.posMatrix,Lr,gr,Jr.transform,Jn),xa=Rt.layout.get("icon-text-fit")!=="none"&&cn.hasIconData();if(Mn){let La=Math.pow(2,rr.zoom-nn.tileID.overscaledZ),ai=Jr.style.map.terrain?(mi,Yi)=>Jr.style.map.terrain.getElevation(Hr,mi,Yi):null,Ai=fr.translatePosition(rr,nn,Te,ye);dc(cn,gr,Lr,ze,rr,_a,Hr.posMatrix,La,Mn,xa,fr,Ai,Hr.toUnwrapped(),ai)}}}(Pe,Lt,xe,le,xe.layout.get("text-rotation-alignment"),xe.layout.get("text-pitch-alignment"),xe.paint.get("text-translate"),xe.paint.get("text-translate-anchor"),$e),xe.paint.get("icon-opacity").constantOr(1)!==0&&Yc(Lt,le,xe,Pe,!1,xe.paint.get("icon-translate"),xe.paint.get("icon-translate-anchor"),xe.layout.get("icon-rotation-alignment"),xe.layout.get("icon-pitch-alignment"),xe.layout.get("icon-keep-upright"),hr,pr),xe.paint.get("text-opacity").constantOr(1)!==0&&Yc(Lt,le,xe,Pe,!0,xe.paint.get("text-translate"),xe.paint.get("text-translate-anchor"),xe.layout.get("text-rotation-alignment"),xe.layout.get("text-pitch-alignment"),xe.layout.get("text-keep-upright"),hr,pr),le.map.showCollisionBoxes&&(pu(Lt,le,xe,Pe,!0),pu(Lt,le,xe,Pe,!1))})(z,at,xt,kt,this.style.placement.variableOffsets);break;case"circle":(function(Lt,le,xe,Pe){if(Lt.renderPass!=="translucent")return;let $e=xe.paint.get("circle-opacity"),hr=xe.paint.get("circle-stroke-width"),pr=xe.paint.get("circle-stroke-opacity"),Br=!xe.layout.get("circle-sort-key").isConstant();if($e.constantOr(1)===0&&(hr.constantOr(1)===0||pr.constantOr(1)===0))return;let Jr=Lt.context,Rt=Jr.gl,Gt=Lt.depthModeForSublayer(0,Oo.ReadOnly),ae=os.disabled,ce=Lt.colorModeForRenderPass(),Te=[];for(let ye=0;ye<Pe.length;ye++){let ze=Pe[ye],rr=le.getTile(ze),fr=rr.getBucket(xe);if(!fr)continue;let gr=fr.programConfigurations.get(xe.id),Lr=Lt.useProgram("circle",gr),Hr=fr.layoutVertexBuffer,nn=fr.indexBuffer,cn=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(ze),Mn={programConfiguration:gr,program:Lr,layoutVertexBuffer:Hr,indexBuffer:nn,uniformValues:Ja(Lt,ze,rr,xe),terrainData:cn};if(Br){let Jn=fr.segments.get();for(let _a of Jn)Te.push({segments:new e.a0([_a]),sortKey:_a.sortKey,state:Mn})}else Te.push({segments:fr.segments,sortKey:0,state:Mn})}Br&&Te.sort((ye,ze)=>ye.sortKey-ze.sortKey);for(let ye of Te){let{programConfiguration:ze,program:rr,layoutVertexBuffer:fr,indexBuffer:gr,uniformValues:Lr,terrainData:Hr}=ye.state;rr.draw(Jr,Rt.TRIANGLES,Gt,ae,ce,Fi.disabled,Lr,Hr,xe.id,fr,gr,ye.segments,xe.paint,Lt.transform.zoom,ze)}})(z,at,xt,kt);break;case"heatmap":(function(Lt,le,xe,Pe){if(xe.paint.get("heatmap-opacity")===0)return;let $e=Lt.context;if(Lt.style.map.terrain){for(let hr of Pe){let pr=le.getTile(hr);le.hasRenderableParent(hr)||(Lt.renderPass==="offscreen"?mc(Lt,pr,xe,hr):Lt.renderPass==="translucent"&&Wu(Lt,xe,hr))}$e.viewport.set([0,0,Lt.width,Lt.height])}else Lt.renderPass==="offscreen"?function(hr,pr,Br,Jr){let Rt=hr.context,Gt=Rt.gl,ae=os.disabled,ce=new qs([Gt.ONE,Gt.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(Te,ye,ze){let rr=Te.gl;Te.activeTexture.set(rr.TEXTURE1),Te.viewport.set([0,0,ye.width/4,ye.height/4]);let fr=ze.heatmapFbos.get(e.aU);fr?(rr.bindTexture(rr.TEXTURE_2D,fr.colorAttachment.get()),Te.bindFramebuffer.set(fr.framebuffer)):(fr=Cc(Te,ye.width/4,ye.height/4),ze.heatmapFbos.set(e.aU,fr))})(Rt,hr,Br),Rt.clear({color:e.aM.transparent});for(let Te=0;Te<Jr.length;Te++){let ye=Jr[Te];if(pr.hasRenderableParent(ye))continue;let ze=pr.getTile(ye),rr=ze.getBucket(Br);if(!rr)continue;let fr=rr.programConfigurations.get(Br.id),gr=hr.useProgram("heatmap",fr),{zoom:Lr}=hr.transform;gr.draw(Rt,Gt.TRIANGLES,Oo.disabled,ae,ce,Fi.disabled,Ra(ye.posMatrix,ze,Lr,Br.paint.get("heatmap-intensity")),null,Br.id,rr.layoutVertexBuffer,rr.indexBuffer,rr.segments,Br.paint,hr.transform.zoom,fr)}Rt.viewport.set([0,0,hr.width,hr.height])}(Lt,le,xe,Pe):Lt.renderPass==="translucent"&&function(hr,pr){let Br=hr.context,Jr=Br.gl;Br.setColorMode(hr.colorModeForRenderPass());let Rt=pr.heatmapFbos.get(e.aU);Rt&&(Br.activeTexture.set(Jr.TEXTURE0),Jr.bindTexture(Jr.TEXTURE_2D,Rt.colorAttachment.get()),Br.activeTexture.set(Jr.TEXTURE1),Ic(Br,pr).bind(Jr.LINEAR,Jr.CLAMP_TO_EDGE),hr.useProgram("heatmapTexture").draw(Br,Jr.TRIANGLES,Oo.disabled,os.disabled,hr.colorModeForRenderPass(),Fi.disabled,Qi(hr,pr,0,1),null,pr.id,hr.viewportBuffer,hr.quadTriangleIndexBuffer,hr.viewportSegments,pr.paint,hr.transform.zoom))}(Lt,xe)})(z,at,xt,kt);break;case"line":(function(Lt,le,xe,Pe){if(Lt.renderPass!=="translucent")return;let $e=xe.paint.get("line-opacity"),hr=xe.paint.get("line-width");if($e.constantOr(1)===0||hr.constantOr(1)===0)return;let pr=Lt.depthModeForSublayer(0,Oo.ReadOnly),Br=Lt.colorModeForRenderPass(),Jr=xe.paint.get("line-dasharray"),Rt=xe.paint.get("line-pattern"),Gt=Rt.constantOr(1),ae=xe.paint.get("line-gradient"),ce=xe.getCrossfadeParameters(),Te=Gt?"linePattern":Jr?"lineSDF":ae?"lineGradient":"line",ye=Lt.context,ze=ye.gl,rr=!0;for(let fr of Pe){let gr=le.getTile(fr);if(Gt&&!gr.patternsLoaded())continue;let Lr=gr.getBucket(xe);if(!Lr)continue;let Hr=Lr.programConfigurations.get(xe.id),nn=Lt.context.program.get(),cn=Lt.useProgram(Te,Hr),Mn=rr||cn.program!==nn,Jn=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(fr),_a=Rt.constantOr(null);if(_a&&gr.imageAtlas){let ai=gr.imageAtlas,Ai=ai.patternPositions[_a.to.toString()],mi=ai.patternPositions[_a.from.toString()];Ai&&mi&&Hr.setConstantPatternPositions(Ai,mi)}let xa=Jn?fr:null,La=Gt?zo(Lt,gr,xe,ce,xa):Jr?qi(Lt,gr,xe,Jr,ce,xa):ae?Ci(Lt,gr,xe,Lr.lineClipsArray.length,xa):Ho(Lt,gr,xe,xa);if(Gt)ye.activeTexture.set(ze.TEXTURE0),gr.imageAtlasTexture.bind(ze.LINEAR,ze.CLAMP_TO_EDGE),Hr.updatePaintBuffers(ce);else if(Jr&&(Mn||Lt.lineAtlas.dirty))ye.activeTexture.set(ze.TEXTURE0),Lt.lineAtlas.bind(ye);else if(ae){let ai=Lr.gradients[xe.id],Ai=ai.texture;if(xe.gradientVersion!==ai.version){let mi=256;if(xe.stepInterpolant){let Yi=le.getSource().maxzoom,Go=fr.canonical.z===Yi?Math.ceil(1<<Lt.transform.maxZoom-fr.canonical.z):1;mi=e.ac(e.aV(Lr.maxLineLength/e.X*1024*Go),256,ye.maxTextureSize)}ai.gradient=e.aW({expression:xe.gradientExpression(),evaluationKey:"lineProgress",resolution:mi,image:ai.gradient||void 0,clips:Lr.lineClipsArray}),ai.texture?ai.texture.update(ai.gradient):ai.texture=new h(ye,ai.gradient,ze.RGBA),ai.version=xe.gradientVersion,Ai=ai.texture}ye.activeTexture.set(ze.TEXTURE0),Ai.bind(xe.stepInterpolant?ze.NEAREST:ze.LINEAR,ze.CLAMP_TO_EDGE)}cn.draw(ye,ze.TRIANGLES,pr,Lt.stencilModeForClipping(fr),Br,Fi.disabled,La,Jn,xe.id,Lr.layoutVertexBuffer,Lr.indexBuffer,Lr.segments,xe.paint,Lt.transform.zoom,Hr,Lr.layoutVertexBuffer2),rr=!1}})(z,at,xt,kt);break;case"fill":(function(Lt,le,xe,Pe){let $e=xe.paint.get("fill-color"),hr=xe.paint.get("fill-opacity");if(hr.constantOr(1)===0)return;let pr=Lt.colorModeForRenderPass(),Br=xe.paint.get("fill-pattern"),Jr=Lt.opaquePassEnabledForLayer()&&!Br.constantOr(1)&&$e.constantOr(e.aM.transparent).a===1&&hr.constantOr(0)===1?"opaque":"translucent";if(Lt.renderPass===Jr){let Rt=Lt.depthModeForSublayer(1,Lt.renderPass==="opaque"?Oo.ReadWrite:Oo.ReadOnly);Bc(Lt,le,xe,Pe,Rt,pr,!1)}if(Lt.renderPass==="translucent"&&xe.paint.get("fill-antialias")){let Rt=Lt.depthModeForSublayer(xe.getPaintProperty("fill-outline-color")?2:0,Oo.ReadOnly);Bc(Lt,le,xe,Pe,Rt,pr,!0)}})(z,at,xt,kt);break;case"fill-extrusion":(function(Lt,le,xe,Pe){let $e=xe.paint.get("fill-extrusion-opacity");if($e!==0&&Lt.renderPass==="translucent"){let hr=new Oo(Lt.context.gl.LEQUAL,Oo.ReadWrite,Lt.depthRangeFor3D);if($e!==1||xe.paint.get("fill-extrusion-pattern").constantOr(1))Pu(Lt,le,xe,Pe,hr,os.disabled,qs.disabled),Pu(Lt,le,xe,Pe,hr,Lt.stencilModeFor3D(),Lt.colorModeForRenderPass());else{let pr=Lt.colorModeForRenderPass();Pu(Lt,le,xe,Pe,hr,os.disabled,pr)}}})(z,at,xt,kt);break;case"hillshade":(function(Lt,le,xe,Pe){if(Lt.renderPass!=="offscreen"&&Lt.renderPass!=="translucent")return;let $e=Lt.context,hr=Lt.depthModeForSublayer(0,Oo.ReadOnly),pr=Lt.colorModeForRenderPass(),[Br,Jr]=Lt.renderPass==="translucent"?Lt.stencilConfigForOverlap(Pe):[{},Pe];for(let Rt of Jr){let Gt=le.getTile(Rt);Gt.needsHillshadePrepare!==void 0&&Gt.needsHillshadePrepare&&Lt.renderPass==="offscreen"?wl(Lt,Gt,xe,hr,os.disabled,pr):Lt.renderPass==="translucent"&&wu(Lt,Rt,Gt,xe,hr,Br[Rt.overscaledZ],pr)}$e.viewport.set([0,0,Lt.width,Lt.height])})(z,at,xt,kt);break;case"raster":(function(Lt,le,xe,Pe){if(Lt.renderPass!=="translucent"||xe.paint.get("raster-opacity")===0||!Pe.length)return;let $e=Lt.context,hr=$e.gl,pr=le.getSource(),Br=Lt.useProgram("raster"),Jr=Lt.colorModeForRenderPass(),[Rt,Gt]=pr instanceof ee?[{},Pe]:Lt.stencilConfigForOverlap(Pe),ae=Gt[Gt.length-1].overscaledZ,ce=!Lt.options.moving;for(let Te of Gt){let ye=Lt.depthModeForSublayer(Te.overscaledZ-ae,xe.paint.get("raster-opacity")===1?Oo.ReadWrite:Oo.ReadOnly,hr.LESS),ze=le.getTile(Te);ze.registerFadeDuration(xe.paint.get("raster-fade-duration"));let rr=le.findLoadedParent(Te,0),fr=le.findLoadedSibling(Te),gr=Ju(ze,rr||fr||null,le,xe,Lt.transform,Lt.style.map.terrain),Lr,Hr,nn=xe.paint.get("raster-resampling")==="nearest"?hr.NEAREST:hr.LINEAR;$e.activeTexture.set(hr.TEXTURE0),ze.texture.bind(nn,hr.CLAMP_TO_EDGE,hr.LINEAR_MIPMAP_NEAREST),$e.activeTexture.set(hr.TEXTURE1),rr?(rr.texture.bind(nn,hr.CLAMP_TO_EDGE,hr.LINEAR_MIPMAP_NEAREST),Lr=Math.pow(2,rr.tileID.overscaledZ-ze.tileID.overscaledZ),Hr=[ze.tileID.canonical.x*Lr%1,ze.tileID.canonical.y*Lr%1]):ze.texture.bind(nn,hr.CLAMP_TO_EDGE,hr.LINEAR_MIPMAP_NEAREST),ze.texture.useMipmap&&$e.extTextureFilterAnisotropic&&Lt.transform.pitch>20&&hr.texParameterf(hr.TEXTURE_2D,$e.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$e.extTextureFilterAnisotropicMax);let cn=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(Te),Mn=cn?Te:null,Jn=Mn?Mn.posMatrix:Lt.transform.calculatePosMatrix(Te.toUnwrapped(),ce),_a=hs(Jn,Hr||[0,0],Lr||1,gr,xe);pr instanceof ee?Br.draw($e,hr.TRIANGLES,ye,os.disabled,Jr,Fi.disabled,_a,cn,xe.id,pr.boundsBuffer,Lt.quadTriangleIndexBuffer,pr.boundsSegments):Br.draw($e,hr.TRIANGLES,ye,Rt[Te.overscaledZ],Jr,Fi.disabled,_a,cn,xe.id,Lt.rasterBoundsBuffer,Lt.quadTriangleIndexBuffer,Lt.rasterBoundsSegments)}})(z,at,xt,kt);break;case"background":(function(Lt,le,xe,Pe){let $e=xe.paint.get("background-color"),hr=xe.paint.get("background-opacity");if(hr===0)return;let pr=Lt.context,Br=pr.gl,Jr=Lt.transform,Rt=Jr.tileSize,Gt=xe.paint.get("background-pattern");if(Lt.isPatternMissing(Gt))return;let ae=!Gt&&$e.a===1&&hr===1&&Lt.opaquePassEnabledForLayer()?"opaque":"translucent";if(Lt.renderPass!==ae)return;let ce=os.disabled,Te=Lt.depthModeForSublayer(0,ae==="opaque"?Oo.ReadWrite:Oo.ReadOnly),ye=Lt.colorModeForRenderPass(),ze=Lt.useProgram(Gt?"backgroundPattern":"background"),rr=Pe||Jr.coveringTiles({tileSize:Rt,terrain:Lt.style.map.terrain});Gt&&(pr.activeTexture.set(Br.TEXTURE0),Lt.imageManager.bind(Lt.context));let fr=xe.getCrossfadeParameters();for(let gr of rr){let Lr=Pe?gr.posMatrix:Lt.transform.calculatePosMatrix(gr.toUnwrapped()),Hr=Gt?vs(Lr,hr,Lt,Gt,{tileID:gr,tileSize:Rt},fr):ts(Lr,hr,$e),nn=Lt.style.map.terrain&&Lt.style.map.terrain.getTerrainData(gr);ze.draw(pr,Br.TRIANGLES,Te,ce,ye,Fi.disabled,Hr,nn,xe.id,Lt.tileExtentBuffer,Lt.quadTriangleIndexBuffer,Lt.tileExtentSegments)}})(z,0,xt,kt);break;case"custom":(function(Lt,le,xe){let Pe=Lt.context,$e=xe.implementation;if(Lt.renderPass==="offscreen"){let hr=$e.prerender;hr&&(Lt.setCustomLayerDefaults(),Pe.setColorMode(Lt.colorModeForRenderPass()),hr.call($e,Pe.gl,Lt.transform.customLayerMatrix()),Pe.setDirty(),Lt.setBaseState())}else if(Lt.renderPass==="translucent"){Lt.setCustomLayerDefaults(),Pe.setColorMode(Lt.colorModeForRenderPass()),Pe.setStencilMode(os.disabled);let hr=$e.renderingMode==="3d"?new Oo(Lt.context.gl.LEQUAL,Oo.ReadWrite,Lt.depthRangeFor3D):Lt.depthModeForSublayer(0,Oo.ReadOnly);Pe.setDepthMode(hr),$e.render(Pe.gl,Lt.transform.customLayerMatrix(),{farZ:Lt.transform.farZ,nearZ:Lt.transform.nearZ,fov:Lt.transform._fov,modelViewProjectionMatrix:Lt.transform.modelViewProjectionMatrix,projectionMatrix:Lt.transform.projectionMatrix}),Pe.setDirty(),Lt.setBaseState(),Pe.bindFramebuffer.set(null)}})(z,0,xt)}}translatePosMatrix(z,at,xt,kt,Lt){if(!xt[0]&&!xt[1])return z;let le=Lt?kt==="map"?this.transform.angle:0:kt==="viewport"?-this.transform.angle:0;if(le){let $e=Math.sin(le),hr=Math.cos(le);xt=[xt[0]*hr-xt[1]*$e,xt[0]*$e+xt[1]*hr]}let xe=[Lt?xt[0]:dn(at,xt[0],this.transform.zoom),Lt?xt[1]:dn(at,xt[1],this.transform.zoom),0],Pe=new Float32Array(16);return e.J(Pe,z,xe),Pe}saveTileTexture(z){let at=this._tileTextures[z.size[0]];at?at.push(z):this._tileTextures[z.size[0]]=[z]}getTileTexture(z){let at=this._tileTextures[z];return at&&at.length>0?at.pop():null}isPatternMissing(z){if(!z)return!1;if(!z.from||!z.to)return!0;let at=this.imageManager.getPattern(z.from.toString()),xt=this.imageManager.getPattern(z.to.toString());return!at||!xt}useProgram(z,at){this.cache=this.cache||{};let xt=z+(at?at.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[xt]||(this.cache[xt]=new ln(this.context,Or[z],at,As[z],this._showOverdrawInspector,this.style.map.terrain)),this.cache[xt]}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 z=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(z.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new h(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:z,drawingBufferHeight:at}=this.context.gl;return this.width!==z||this.height!==at}}class Bs{constructor(z,at){this.points=z,this.planes=at}static fromInvProjectionMatrix(z,at,xt){let kt=Math.pow(2,xt),Lt=[[-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(xe=>{let Pe=1/(xe=e.af([],xe,z))[3]/at*kt;return e.b1(xe,xe,[Pe,Pe,1/xe[3],Pe])}),le=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(xe=>{let Pe=function(Br,Jr){var Rt=Jr[0],Gt=Jr[1],ae=Jr[2],ce=Rt*Rt+Gt*Gt+ae*ae;return ce>0&&(ce=1/Math.sqrt(ce)),Br[0]=Jr[0]*ce,Br[1]=Jr[1]*ce,Br[2]=Jr[2]*ce,Br}([],function(Br,Jr,Rt){var Gt=Jr[0],ae=Jr[1],ce=Jr[2],Te=Rt[0],ye=Rt[1],ze=Rt[2];return Br[0]=ae*ze-ce*ye,Br[1]=ce*Te-Gt*ze,Br[2]=Gt*ye-ae*Te,Br}([],k([],Lt[xe[0]],Lt[xe[1]]),k([],Lt[xe[2]],Lt[xe[1]]))),$e=-((hr=Pe)[0]*(pr=Lt[xe[1]])[0]+hr[1]*pr[1]+hr[2]*pr[2]);var hr,pr;return Pe.concat($e)});return new Bs(Lt,le)}}class Ou{constructor(z,at){this.min=z,this.max=at,this.center=function(xt,kt,Lt){return xt[0]=.5*kt[0],xt[1]=.5*kt[1],xt[2]=.5*kt[2],xt}([],function(xt,kt,Lt){return xt[0]=kt[0]+Lt[0],xt[1]=kt[1]+Lt[1],xt[2]=kt[2]+Lt[2],xt}([],this.min,this.max))}quadrant(z){let at=[z%2==0,z<2],xt=y(this.min),kt=y(this.max);for(let Lt=0;Lt<at.length;Lt++)xt[Lt]=at[Lt]?this.min[Lt]:this.center[Lt],kt[Lt]=at[Lt]?this.center[Lt]:this.max[Lt];return kt[2]=this.max[2],new Ou(xt,kt)}distanceX(z){return Math.max(Math.min(this.max[0],z[0]),this.min[0])-z[0]}distanceY(z){return Math.max(Math.min(this.max[1],z[1]),this.min[1])-z[1]}intersects(z){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]],xt=!0;for(let kt=0;kt<z.planes.length;kt++){let Lt=z.planes[kt],le=0;for(let xe=0;xe<at.length;xe++)e.b2(Lt,at[xe])>=0&&le++;if(le===0)return 0;le!==at.length&&(xt=!1)}if(xt)return 2;for(let kt=0;kt<3;kt++){let Lt=Number.MAX_VALUE,le=-Number.MAX_VALUE;for(let xe=0;xe<z.points.length;xe++){let Pe=z.points[xe][kt]-this.min[kt];Lt=Math.min(Lt,Pe),le=Math.max(le,Pe)}if(le<0||Lt>this.max[kt]-this.min[kt])return 0}return 1}}class Rl{constructor(z=0,at=0,xt=0,kt=0){if(isNaN(z)||z<0||isNaN(at)||at<0||isNaN(xt)||xt<0||isNaN(kt)||kt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=z,this.bottom=at,this.left=xt,this.right=kt}interpolate(z,at,xt){return at.top!=null&&z.top!=null&&(this.top=e.y.number(z.top,at.top,xt)),at.bottom!=null&&z.bottom!=null&&(this.bottom=e.y.number(z.bottom,at.bottom,xt)),at.left!=null&&z.left!=null&&(this.left=e.y.number(z.left,at.left,xt)),at.right!=null&&z.right!=null&&(this.right=e.y.number(z.right,at.right,xt)),this}getCenter(z,at){let xt=e.ac((this.left+z-this.right)/2,0,z),kt=e.ac((this.top+at-this.bottom)/2,0,at);return new e.P(xt,kt)}equals(z){return this.top===z.top&&this.bottom===z.bottom&&this.left===z.left&&this.right===z.right}clone(){return new Rl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Yl=85.051129;class Ws{constructor(z,at,xt,kt,Lt){this.tileSize=512,this._renderWorldCopies=Lt===void 0||!!Lt,this._minZoom=z||0,this._maxZoom=at||22,this._minPitch=xt??0,this._maxPitch=kt??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 Rl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let z=new Ws(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return z.apply(this),z}apply(z){this.tileSize=z.tileSize,this.latRange=z.latRange,this.lngRange=z.lngRange,this.width=z.width,this.height=z.height,this._center=z._center,this._elevation=z._elevation,this.minElevationForCurrentTile=z.minElevationForCurrentTile,this.zoom=z.zoom,this.angle=z.angle,this._fov=z._fov,this._pitch=z._pitch,this._unmodified=z._unmodified,this._edgeInsets=z._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(z){this._minZoom!==z&&(this._minZoom=z,this.zoom=Math.max(this.zoom,z))}get maxZoom(){return this._maxZoom}set maxZoom(z){this._maxZoom!==z&&(this._maxZoom=z,this.zoom=Math.min(this.zoom,z))}get minPitch(){return this._minPitch}set minPitch(z){this._minPitch!==z&&(this._minPitch=z,this.pitch=Math.max(this.pitch,z))}get maxPitch(){return this._maxPitch}set maxPitch(z){this._maxPitch!==z&&(this._maxPitch=z,this.pitch=Math.min(this.pitch,z))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(z){z===void 0?z=!0:z===null&&(z=!1),this._renderWorldCopies=z}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(z){let at=-e.b3(z,-180,180)*Math.PI/180;this.angle!==at&&(this._unmodified=!1,this.angle=at,this._calcMatrices(),this.rotationMatrix=function(){var xt=new e.A(4);return e.A!=Float32Array&&(xt[1]=0,xt[2]=0),xt[0]=1,xt[3]=1,xt}(),function(xt,kt,Lt){var le=kt[0],xe=kt[1],Pe=kt[2],$e=kt[3],hr=Math.sin(Lt),pr=Math.cos(Lt);xt[0]=le*pr+Pe*hr,xt[1]=xe*pr+$e*hr,xt[2]=le*-hr+Pe*pr,xt[3]=xe*-hr+$e*pr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(z){let at=e.ac(z,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(z){z=Math.max(.01,Math.min(60,z)),this._fov!==z&&(this._unmodified=!1,this._fov=z/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(z){let at=Math.min(Math.max(z,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(z){z.lat===this._center.lat&&z.lng===this._center.lng||(this._unmodified=!1,this._center=z,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(z){z!==this._elevation&&(this._elevation=z,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(z){this._edgeInsets.equals(z)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,z,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(z){return this._edgeInsets.equals(z)}interpolatePadding(z,at,xt){this._unmodified=!1,this._edgeInsets.interpolate(z,at,xt),this._constrain(),this._calcMatrices()}coveringZoomLevel(z){let at=(z.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/z.tileSize));return Math.max(0,at)}getVisibleUnwrappedCoordinates(z){let at=[new e.b4(0,z)];if(this._renderWorldCopies){let xt=this.pointCoordinate(new e.P(0,0)),kt=this.pointCoordinate(new e.P(this.width,0)),Lt=this.pointCoordinate(new e.P(this.width,this.height)),le=this.pointCoordinate(new e.P(0,this.height)),xe=Math.floor(Math.min(xt.x,kt.x,Lt.x,le.x)),Pe=Math.floor(Math.max(xt.x,kt.x,Lt.x,le.x)),$e=1;for(let hr=xe-$e;hr<=Pe+$e;hr++)hr!==0&&at.push(new e.b4(hr,z))}return at}coveringTiles(z){var at,xt;let kt=this.coveringZoomLevel(z),Lt=kt;if(z.minzoom!==void 0&&kt<z.minzoom)return[];z.maxzoom!==void 0&&kt>z.maxzoom&&(kt=z.maxzoom);let le=this.pointCoordinate(this.getCameraPoint()),xe=e.Z.fromLngLat(this.center),Pe=Math.pow(2,kt),$e=[Pe*le.x,Pe*le.y,0],hr=[Pe*xe.x,Pe*xe.y,0],pr=Bs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,kt),Br=z.minzoom||0;!z.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Br=kt);let Jr=z.terrain?2/Math.min(this.tileSize,z.tileSize)*this.tileSize:3,Rt=ye=>({aabb:new Ou([ye*Pe,0,0],[(ye+1)*Pe,Pe,0]),zoom:0,x:0,y:0,wrap:ye,fullyVisible:!1}),Gt=[],ae=[],ce=kt,Te=z.reparseOverscaled?Lt:kt;if(this._renderWorldCopies)for(let ye=1;ye<=3;ye++)Gt.push(Rt(-ye)),Gt.push(Rt(ye));for(Gt.push(Rt(0));Gt.length>0;){let ye=Gt.pop(),ze=ye.x,rr=ye.y,fr=ye.fullyVisible;if(!fr){let cn=ye.aabb.intersects(pr);if(cn===0)continue;fr=cn===2}let gr=z.terrain?$e:hr,Lr=ye.aabb.distanceX(gr),Hr=ye.aabb.distanceY(gr),nn=Math.max(Math.abs(Lr),Math.abs(Hr));if(ye.zoom===ce||nn>Jr+(1<<ce-ye.zoom)-2&&ye.zoom>=Br){let cn=ce-ye.zoom,Mn=$e[0]-.5-(ze<<cn),Jn=$e[1]-.5-(rr<<cn);ae.push({tileID:new e.S(ye.zoom===ce?Te:ye.zoom,ye.wrap,ye.zoom,ze,rr),distanceSq:M([hr[0]-.5-ze,hr[1]-.5-rr]),tileDistanceToCamera:Math.sqrt(Mn*Mn+Jn*Jn)})}else for(let cn=0;cn<4;cn++){let Mn=(ze<<1)+cn%2,Jn=(rr<<1)+(cn>>1),_a=ye.zoom+1,xa=ye.aabb.quadrant(cn);if(z.terrain){let La=new e.S(_a,ye.wrap,_a,Mn,Jn),ai=z.terrain.getMinMaxElevation(La),Ai=(at=ai.minElevation)!==null&&at!==void 0?at:this.elevation,mi=(xt=ai.maxElevation)!==null&&xt!==void 0?xt:this.elevation;xa=new Ou([xa.min[0],xa.min[1],Ai],[xa.max[0],xa.max[1],mi])}Gt.push({aabb:xa,zoom:_a,x:Mn,y:Jn,wrap:ye.wrap,fullyVisible:fr})}}return ae.sort((ye,ze)=>ye.distanceSq-ze.distanceSq).map(ye=>ye.tileID)}resize(z,at){this.width=z,this.height=at,this.pixelsToGLUnits=[2/z,-2/at],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(z){return Math.pow(2,z)}scaleZoom(z){return Math.log(z)/Math.LN2}project(z){let at=e.ac(z.lat,-85.051129,Yl);return new e.P(e.O(z.lng)*this.worldSize,e.Q(at)*this.worldSize)}unproject(z){return new e.Z(z.x/this.worldSize,z.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(z){let at=this.elevation,xt=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,kt=this.pointLocation(this.centerPoint,z),Lt=z.getElevationForLngLatZoom(kt,this.tileZoom);if(!(this.elevation-Lt))return;let le=xt+at-Lt,xe=Math.cos(this._pitch)*this.cameraToCenterDistance/le/e.b5(1,kt.lat),Pe=this.scaleZoom(xe/this.tileSize);this._elevation=Lt,this._center=kt,this.zoom=Pe}setLocationAtPoint(z,at){let xt=this.pointCoordinate(at),kt=this.pointCoordinate(this.centerPoint),Lt=this.locationCoordinate(z),le=new e.Z(Lt.x-(xt.x-kt.x),Lt.y-(xt.y-kt.y));this.center=this.coordinateLocation(le),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(z,at){return at?this.coordinatePoint(this.locationCoordinate(z),at.getElevationForLngLatZoom(z,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(z))}pointLocation(z,at){return this.coordinateLocation(this.pointCoordinate(z,at))}locationCoordinate(z){return e.Z.fromLngLat(z)}coordinateLocation(z){return z&&z.toLngLat()}pointCoordinate(z,at){if(at){let Br=at.pointCoordinate(z);if(Br!=null)return Br}let xt=[z.x,z.y,0,1],kt=[z.x,z.y,1,1];e.af(xt,xt,this.pixelMatrixInverse),e.af(kt,kt,this.pixelMatrixInverse);let Lt=xt[3],le=kt[3],xe=xt[1]/Lt,Pe=kt[1]/le,$e=xt[2]/Lt,hr=kt[2]/le,pr=$e===hr?0:(0-$e)/(hr-$e);return new e.Z(e.y.number(xt[0]/Lt,kt[0]/le,pr)/this.worldSize,e.y.number(xe,Pe,pr)/this.worldSize)}coordinatePoint(z,at=0,xt=this.pixelMatrix){let kt=[z.x*this.worldSize,z.y*this.worldSize,at,1];return e.af(kt,kt,xt),new e.P(kt[0]/kt[3],kt[1]/kt[3])}getBounds(){let z=Math.max(0,this.height/2-this.getHorizon());return new nt().extend(this.pointLocation(new e.P(0,z))).extend(this.pointLocation(new e.P(this.width,z))).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 nt([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(z){z?(this.lngRange=[z.getWest(),z.getEast()],this.latRange=[z.getSouth(),z.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Yl])}calculateTileMatrix(z){let at=z.canonical,xt=this.worldSize/this.zoomScale(at.z),kt=at.x+Math.pow(2,at.z)*z.wrap,Lt=e.an(new Float64Array(16));return e.J(Lt,Lt,[kt*xt,at.y*xt,0]),e.K(Lt,Lt,[xt/e.X,xt/e.X,1]),Lt}calculatePosMatrix(z,at=!1){let xt=z.key,kt=at?this._alignedPosMatrixCache:this._posMatrixCache;if(kt[xt])return kt[xt];let Lt=this.calculateTileMatrix(z);return e.L(Lt,at?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Lt),kt[xt]=new Float32Array(Lt),kt[xt]}calculateFogMatrix(z){let at=z.key,xt=this._fogMatrixCache;if(xt[at])return xt[at];let kt=this.calculateTileMatrix(z);return e.L(kt,this.fogMatrix,kt),xt[at]=new Float32Array(kt),xt[at]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(z,at){at=e.ac(+at,this.minZoom,this.maxZoom);let xt={center:new e.N(z.lng,z.lat),zoom:at},kt=this.lngRange;if(!this._renderWorldCopies&&kt===null){let ye=179.9999999999;kt=[-ye,ye]}let Lt=this.tileSize*this.zoomScale(xt.zoom),le=0,xe=Lt,Pe=0,$e=Lt,hr=0,pr=0,{x:Br,y:Jr}=this.size;if(this.latRange){let ye=this.latRange;le=e.Q(ye[1])*Lt,xe=e.Q(ye[0])*Lt,xe-le<Jr&&(hr=Jr/(xe-le))}kt&&(Pe=e.b3(e.O(kt[0])*Lt,0,Lt),$e=e.b3(e.O(kt[1])*Lt,0,Lt),$e<Pe&&($e+=Lt),$e-Pe<Br&&(pr=Br/($e-Pe)));let{x:Rt,y:Gt}=this.project.call({worldSize:Lt},z),ae,ce,Te=Math.max(pr||0,hr||0);if(Te){let ye=new e.P(pr?($e+Pe)/2:Rt,hr?(xe+le)/2:Gt);return xt.center=this.unproject.call({worldSize:Lt},ye).wrap(),xt.zoom+=this.scaleZoom(Te),xt}if(this.latRange){let ye=Jr/2;Gt-ye<le&&(ce=le+ye),Gt+ye>xe&&(ce=xe-ye)}if(kt){let ye=(Pe+$e)/2,ze=Rt;this._renderWorldCopies&&(ze=e.b3(Rt,ye-Lt/2,ye+Lt/2));let rr=Br/2;ze-rr<Pe&&(ae=Pe+rr),ze+rr>$e&&(ae=$e-rr)}if(ae!==void 0||ce!==void 0){let ye=new e.P(ae??Rt,ce??Gt);xt.center=this.unproject.call({worldSize:Lt},ye).wrap()}return xt}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let z=this._unmodified,{center:at,zoom:xt}=this.getConstrained(this.center,this.zoom);this.center=at,this.zoom=xt,this._unmodified=z,this._constraining=!1}_calcMatrices(){if(!this.height)return;let z=this.centerOffset,at=this.point.x,xt=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let kt=e.an(new Float64Array(16));e.K(kt,kt,[this.width/2,-this.height/2,1]),e.J(kt,kt,[1,-1,0]),this.labelPlaneMatrix=kt,kt=e.an(new Float64Array(16)),e.K(kt,kt,[1,-1,1]),e.J(kt,kt,[-1,-1,0]),e.K(kt,kt,[2/this.width,2/this.height,1]),this.glCoordMatrix=kt;let Lt=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),le=Math.min(this.elevation,this.minElevationForCurrentTile),xe=Lt-le*this._pixelPerMeter/Math.cos(this._pitch),Pe=le<0?xe:Lt,$e=Math.PI/2+this._pitch,hr=this._fov*(.5+z.y/this.height),pr=Math.sin(hr)*Pe/Math.sin(e.ac(Math.PI-$e-hr,.01,Math.PI-.01)),Br=this.getHorizon(),Jr=2*Math.atan(Br/this.cameraToCenterDistance)*(.5+z.y/(2*Br)),Rt=Math.sin(Jr)*Pe/Math.sin(e.ac(Math.PI-$e-Jr,.01,Math.PI-.01)),Gt=Math.min(pr,Rt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Gt+Pe),this.nearZ=this.height/50,kt=new Float64Array(16),e.b6(kt,this._fov,this.width/this.height,this.nearZ,this.farZ),kt[8]=2*-z.x/this.width,kt[9]=2*z.y/this.height,this.projectionMatrix=e.ae(kt),e.K(kt,kt,[1,-1,1]),e.J(kt,kt,[0,0,-this.cameraToCenterDistance]),e.b7(kt,kt,this._pitch),e.ad(kt,kt,this.angle),e.J(kt,kt,[-at,-xt,0]),this.mercatorMatrix=e.K([],kt,[this.worldSize,this.worldSize,this.worldSize]),e.K(kt,kt,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,kt),e.J(kt,kt,[0,0,-this.elevation]),this.modelViewProjectionMatrix=kt,this.invModelViewProjectionMatrix=e.as([],kt),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,Lt,this.farZ),this.fogMatrix[8]=2*-z.x/this.width,this.fogMatrix[9]=2*z.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,-xt,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,kt);let ae=this.width%2/2,ce=this.height%2/2,Te=Math.cos(this.angle),ye=Math.sin(this.angle),ze=at-Math.round(at)+Te*ae+ye*ce,rr=xt-Math.round(xt)+Te*ce+ye*ae,fr=new Float64Array(kt);if(e.J(fr,fr,[ze>.5?ze-1:ze,rr>.5?rr-1:rr,0]),this.alignedModelViewProjectionMatrix=fr,kt=e.as(new Float64Array(16),this.pixelMatrix),!kt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=kt,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let z=this.pointCoordinate(new e.P(0,0)),at=[z.x*this.worldSize,z.y*this.worldSize,0,1];return e.af(at,at,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let z=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,z))}getCameraQueryGeometry(z){let at=this.getCameraPoint();if(z.length===1)return[z[0],at];{let xt=at.x,kt=at.y,Lt=at.x,le=at.y;for(let xe of z)xt=Math.min(xt,xe.x),kt=Math.min(kt,xe.y),Lt=Math.max(Lt,xe.x),le=Math.max(le,xe.y);return[new e.P(xt,kt),new e.P(Lt,kt),new e.P(Lt,le),new e.P(xt,le),new e.P(xt,kt)]}}lngLatToCameraDepth(z,at){let xt=this.locationCoordinate(z),kt=[xt.x*this.worldSize,xt.y*this.worldSize,at,1];return e.af(kt,kt,this.modelViewProjectionMatrix),kt[2]/kt[3]}}function ac(Pt,z){let at,xt=!1,kt=null,Lt=null,le=()=>{kt=null,xt&&(Pt.apply(Lt,at),kt=setTimeout(le,z),xt=!1)};return(...xe)=>(xt=!0,Lt=this,at=xe,kt||le(),kt)}class Tu{constructor(z){this._getCurrentHash=()=>{let at=window.location.hash.replace("#","");if(this._hashName){let xt;return at.split("&").map(kt=>kt.split("=")).forEach(kt=>{kt[0]===this._hashName&&(xt=kt)}),(xt&&xt[1]||"").split("/")}return at.split("/")},this._onHashChange=()=>{let at=this._getCurrentHash();if(at.length>=3&&!at.some(xt=>isNaN(xt))){let xt=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:xt,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 xt=at.join("/"),kt=xt;kt.split("&").length>0&&(kt=kt.split("&")[0]),this._hashName&&(kt=`${this._hashName}=${xt}`);let Lt=window.location.hash.replace(kt,"");Lt.startsWith("#&")?Lt=Lt.slice(0,1)+Lt.slice(2):Lt==="#"&&(Lt="");let le=window.location.href.replace(/(#.+)?$/,Lt);le=le.replace("&&","&"),window.history.replaceState(window.history.state,null,le)},this._updateHash=ac(this._updateHashUnthrottled,300),this._hashName=z&&encodeURIComponent(z)}addTo(z){return this._map=z,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(z){let at=this._map.getCenter(),xt=Math.round(100*this._map.getZoom())/100,kt=Math.ceil((xt*Math.LN2+Math.log(512/360/.5))/Math.LN10),Lt=Math.pow(10,kt),le=Math.round(at.lng*Lt)/Lt,xe=Math.round(at.lat*Lt)/Lt,Pe=this._map.getBearing(),$e=this._map.getPitch(),hr="";if(hr+=z?`/${le}/${xe}/${xt}`:`${xt}/${xe}/${le}`,(Pe||$e)&&(hr+="/"+Math.round(10*Pe)/10),$e&&(hr+=`/${Math.round($e)}`),this._hashName){let pr=this._hashName,Br=!1,Jr=window.location.hash.slice(1).split("&").map(Rt=>{let Gt=Rt.split("=")[0];return Gt===pr?(Br=!0,`${Gt}=${hr}`):Rt}).filter(Rt=>Rt);return Br||Jr.push(`${pr}=${hr}`),`#${Jr.join("&")}`}return`#${hr}`}}let Zu={linearity:.3,easing:e.b8(0,0,.3,1)},bc=e.e({deceleration:2500,maxSpeed:1400},Zu),lf=e.e({deceleration:20,maxSpeed:1400},Zu),Mf=e.e({deceleration:1e3,maxSpeed:360},Zu),ic=e.e({deceleration:1e3,maxSpeed:90},Zu);class wc{constructor(z){this._map=z,this.clear()}clear(){this._inertiaBuffer=[]}record(z){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.now(),settings:z})}_drainInertiaBuffer(){let z=this._inertiaBuffer,at=o.now();for(;z.length>0&&at-z[0].time>160;)z.shift()}_onMoveEnd(z){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:Lt}of this._inertiaBuffer)at.zoom+=Lt.zoomDelta||0,at.bearing+=Lt.bearingDelta||0,at.pitch+=Lt.pitchDelta||0,Lt.panDelta&&at.pan._add(Lt.panDelta),Lt.around&&(at.around=Lt.around),Lt.pinchAround&&(at.pinchAround=Lt.pinchAround);let xt=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,kt={};if(at.pan.mag()){let Lt=oc(at.pan.mag(),xt,e.e({},bc,z||{}));kt.offset=at.pan.mult(Lt.amount/at.pan.mag()),kt.center=this._map.transform.center,Fl(kt,Lt)}if(at.zoom){let Lt=oc(at.zoom,xt,lf);kt.zoom=this._map.transform.zoom+Lt.amount,Fl(kt,Lt)}if(at.bearing){let Lt=oc(at.bearing,xt,Mf);kt.bearing=this._map.transform.bearing+e.ac(Lt.amount,-179,179),Fl(kt,Lt)}if(at.pitch){let Lt=oc(at.pitch,xt,ic);kt.pitch=this._map.transform.pitch+Lt.amount,Fl(kt,Lt)}if(kt.zoom||kt.bearing){let Lt=at.pinchAround===void 0?at.around:at.pinchAround;kt.around=Lt?this._map.unproject(Lt):this._map.getCenter()}return this.clear(),e.e(kt,{noMoveStart:!0})}}function Fl(Pt,z){(!Pt.duration||Pt.duration<z.duration)&&(Pt.duration=z.duration,Pt.easing=z.easing)}function oc(Pt,z,at){let{maxSpeed:xt,linearity:kt,deceleration:Lt}=at,le=e.ac(Pt*kt/(z/1e3),-xt,xt),xe=Math.abs(le)/(Lt*kt);return{easing:at.easing,duration:1e3*xe,amount:le*(xe/2)}}class iu extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(z,at,xt,kt={}){let Lt=a.mousePos(at.getCanvas(),xt),le=at.unproject(Lt);super(z,e.e({point:Lt,lngLat:le,originalEvent:xt},kt)),this._defaultPrevented=!1,this.target=at}}class sc extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(z,at,xt){let kt=z==="touchend"?xt.changedTouches:xt.touches,Lt=a.touchPos(at.getCanvasContainer(),kt),le=Lt.map(Pe=>at.unproject(Pe)),xe=Lt.reduce((Pe,$e,hr,pr)=>Pe.add($e.div(pr.length)),new e.P(0,0));super(z,{points:Lt,point:xe,lngLats:le,lngLat:at.unproject(xe),originalEvent:xt}),this._defaultPrevented=!1}}class Tc extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(z,at,xt){super(z,{originalEvent:xt}),this._defaultPrevented=!1}}class ku{constructor(z,at){this._map=z,this._clickTolerance=at.clickTolerance}reset(){delete this._mousedownPos}wheel(z){return this._firePreventable(new Tc(z.type,this._map,z))}mousedown(z,at){return this._mousedownPos=at,this._firePreventable(new iu(z.type,this._map,z))}mouseup(z){this._map.fire(new iu(z.type,this._map,z))}click(z,at){this._mousedownPos&&this._mousedownPos.dist(at)>=this._clickTolerance||this._map.fire(new iu(z.type,this._map,z))}dblclick(z){return this._firePreventable(new iu(z.type,this._map,z))}mouseover(z){this._map.fire(new iu(z.type,this._map,z))}mouseout(z){this._map.fire(new iu(z.type,this._map,z))}touchstart(z){return this._firePreventable(new sc(z.type,this._map,z))}touchmove(z){this._map.fire(new sc(z.type,this._map,z))}touchend(z){this._map.fire(new sc(z.type,this._map,z))}touchcancel(z){this._map.fire(new sc(z.type,this._map,z))}_firePreventable(z){if(this._map.fire(z),z.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gs{constructor(z){this._map=z}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(z){this._map.fire(new iu(z.type,this._map,z))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new iu("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(z){this._delayContextMenu?this._contextMenuEvent=z:this._ignoreContextMenu||this._map.fire(new iu(z.type,this._map,z)),this._map.listens("contextmenu")&&z.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Du{constructor(z){this._map=z}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(z){return this.transform.pointLocation(e.P.convert(z),this._map.terrain)}}class Xl{constructor(z,at){this._map=z,this._tr=new Du(z),this._el=z.getCanvasContainer(),this._container=z.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(z,at){this.isEnabled()&&z.shiftKey&&z.button===0&&(a.disableDrag(),this._startPos=this._lastPos=at,this._active=!0)}mousemoveWindow(z,at){if(!this._active)return;let xt=at;if(this._lastPos.equals(xt)||!this._box&&xt.dist(this._startPos)<this._clickTolerance)return;let kt=this._startPos;this._lastPos=xt,this._box||(this._box=a.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",z));let Lt=Math.min(kt.x,xt.x),le=Math.max(kt.x,xt.x),xe=Math.min(kt.y,xt.y),Pe=Math.max(kt.y,xt.y);a.setTransform(this._box,`translate(${Lt}px,${xe}px)`),this._box.style.width=le-Lt+"px",this._box.style.height=Pe-xe+"px"}mouseupWindow(z,at){if(!this._active||z.button!==0)return;let xt=this._startPos,kt=at;if(this.reset(),a.suppressClick(),xt.x!==kt.x||xt.y!==kt.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:z})),{cameraAnimation:Lt=>Lt.fitScreenCoordinates(xt,kt,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",z)}keydown(z){this._active&&z.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",z))}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(z,at){return this._map.fire(new e.k(z,{originalEvent:at}))}}function Xc(Pt,z){if(Pt.length!==z.length)throw new Error(`The number of touches and points are not equal - touches ${Pt.length}, points ${z.length}`);let at={};for(let xt=0;xt<Pt.length;xt++)at[Pt[xt].identifier]=z[xt];return at}class Vs{constructor(z){this.reset(),this.numTouches=z.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(z,at,xt){(this.centroid||xt.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=z.timeStamp),xt.length===this.numTouches&&(this.centroid=function(kt){let Lt=new e.P(0,0);for(let le of kt)Lt._add(le);return Lt.div(kt.length)}(at),this.touches=Xc(xt,at)))}touchmove(z,at,xt){if(this.aborted||!this.centroid)return;let kt=Xc(xt,at);for(let Lt in this.touches){let le=kt[Lt];(!le||le.dist(this.touches[Lt])>30)&&(this.aborted=!0)}}touchend(z,at,xt){if((!this.centroid||z.timeStamp-this.startTime>500)&&(this.aborted=!0),xt.length===0){let kt=!this.aborted&&this.centroid;if(this.reset(),kt)return kt}}}class vc{constructor(z){this.singleTap=new Vs(z),this.numTaps=z.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(z,at,xt){this.singleTap.touchstart(z,at,xt)}touchmove(z,at,xt){this.singleTap.touchmove(z,at,xt)}touchend(z,at,xt){let kt=this.singleTap.touchend(z,at,xt);if(kt){let Lt=z.timeStamp-this.lastTime<500,le=!this.lastTap||this.lastTap.dist(kt)<30;if(Lt&&le||this.reset(),this.count++,this.lastTime=z.timeStamp,this.lastTap=kt,this.count===this.numTaps)return this.reset(),kt}}}class Ku{constructor(z){this._tr=new Du(z),this._zoomIn=new vc({numTouches:1,numTaps:2}),this._zoomOut=new vc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(z,at,xt){this._zoomIn.touchstart(z,at,xt),this._zoomOut.touchstart(z,at,xt)}touchmove(z,at,xt){this._zoomIn.touchmove(z,at,xt),this._zoomOut.touchmove(z,at,xt)}touchend(z,at,xt){let kt=this._zoomIn.touchend(z,at,xt),Lt=this._zoomOut.touchend(z,at,xt),le=this._tr;return kt?(this._active=!0,z.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:xe=>xe.easeTo({duration:300,zoom:le.zoom+1,around:le.unproject(kt)},{originalEvent:z})}):Lt?(this._active=!0,z.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:xe=>xe.easeTo({duration:300,zoom:le.zoom-1,around:le.unproject(Lt)},{originalEvent:z})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ou{constructor(z){this._enabled=!!z.enable,this._moveStateManager=z.moveStateManager,this._clickTolerance=z.clickTolerance||1,this._moveFunction=z.move,this._activateOnStart=!!z.activateOnStart,z.assignEvents(this),this.reset()}reset(z){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(z)}_move(...z){let at=this._moveFunction(...z);if(at.bearingDelta||at.pitchDelta||at.around||at.panDelta)return this._active=!0,at}dragStart(z,at){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(z)&&(this._moveStateManager.startMove(z),this._lastPoint=at.length?at[0]:at,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(z,at){if(!this.isEnabled())return;let xt=this._lastPoint;if(!xt)return;if(z.preventDefault(),!this._moveStateManager.isValidMoveEvent(z))return void this.reset(z);let kt=at.length?at[0]:at;return!this._moved&&kt.dist(xt)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=kt,this._move(xt,kt))}dragEnd(z){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(z)&&(this._moved&&a.suppressClick(),this.reset(z))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let Qu={0:1,2:2};class Yu{constructor(z){this._correctEvent=z.checkCorrectEvent}startMove(z){let at=a.mouseButton(z);this._eventButton=at}endMove(z){delete this._eventButton}isValidStartEvent(z){return this._correctEvent(z)}isValidMoveEvent(z){return!function(at,xt){let kt=Qu[xt];return at.buttons===void 0||(at.buttons&kt)!==kt}(z,this._eventButton)}isValidEndEvent(z){return a.mouseButton(z)===this._eventButton}}class yc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(z){return z.targetTouches.length===1}_isSameTouchEvent(z){return z.targetTouches[0].identifier===this._firstTouch}startMove(z){this._firstTouch=z.targetTouches[0].identifier}endMove(z){delete this._firstTouch}isValidStartEvent(z){return this._isOneFingerTouch(z)}isValidMoveEvent(z){return this._isOneFingerTouch(z)&&this._isSameTouchEvent(z)}isValidEndEvent(z){return this._isOneFingerTouch(z)&&this._isSameTouchEvent(z)}}let uf=Pt=>{Pt.mousedown=Pt.dragStart,Pt.mousemoveWindow=Pt.dragMove,Pt.mouseup=Pt.dragEnd,Pt.contextmenu=z=>{z.preventDefault()}},zl=({enable:Pt,clickTolerance:z,bearingDegreesPerPixelMoved:at=.8})=>{let xt=new Yu({checkCorrectEvent:kt=>a.mouseButton(kt)===0&&kt.ctrlKey||a.mouseButton(kt)===2});return new ou({clickTolerance:z,move:(kt,Lt)=>({bearingDelta:(Lt.x-kt.x)*at}),moveStateManager:xt,enable:Pt,assignEvents:uf})},Uc=({enable:Pt,clickTolerance:z,pitchDegreesPerPixelMoved:at=-.5})=>{let xt=new Yu({checkCorrectEvent:kt=>a.mouseButton(kt)===0&&kt.ctrlKey||a.mouseButton(kt)===2});return new ou({clickTolerance:z,move:(kt,Lt)=>({pitchDelta:(Lt.y-kt.y)*at}),moveStateManager:xt,enable:Pt,assignEvents:uf})};class su{constructor(z,at){this._clickTolerance=z.clickTolerance||1,this._map=at,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(z){return z<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(z,at,xt){return this._calculateTransform(z,at,xt)}touchmove(z,at,xt){if(this._active){if(!this._shouldBePrevented(xt.length))return z.preventDefault(),this._calculateTransform(z,at,xt);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",z)}}touchend(z,at,xt){this._calculateTransform(z,at,xt),this._active&&this._shouldBePrevented(xt.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(z,at,xt){xt.length>0&&(this._active=!0);let kt=Xc(xt,at),Lt=new e.P(0,0),le=new e.P(0,0),xe=0;for(let $e in kt){let hr=kt[$e],pr=this._touches[$e];pr&&(Lt._add(hr),le._add(hr.sub(pr)),xe++,kt[$e]=hr)}if(this._touches=kt,this._shouldBePrevented(xe)||!le.mag())return;let Pe=le.div(xe);return this._sum._add(Pe),this._sum.mag()<this._clickTolerance?void 0:{around:Lt.div(xe),panDelta:Pe}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fu{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(z,at,xt){this._firstTwoTouches||xt.length<2||(this._firstTwoTouches=[xt[0].identifier,xt[1].identifier],this._start([at[0],at[1]]))}touchmove(z,at,xt){if(!this._firstTwoTouches)return;z.preventDefault();let[kt,Lt]=this._firstTwoTouches,le=Au(xt,at,kt),xe=Au(xt,at,Lt);if(!le||!xe)return;let Pe=this._aroundCenter?null:le.add(xe).div(2);return this._move([le,xe],Pe,z)}touchend(z,at,xt){if(!this._firstTwoTouches)return;let[kt,Lt]=this._firstTwoTouches,le=Au(xt,at,kt),xe=Au(xt,at,Lt);le&&xe||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(z){this._enabled=!0,this._aroundCenter=!!z&&z.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Au(Pt,z,at){for(let xt=0;xt<Pt.length;xt++)if(Pt[xt].identifier===at)return z[xt]}function il(Pt,z){return Math.log(Pt/z)/Math.LN2}class Cs extends Fu{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(z){this._startDistance=this._distance=z[0].dist(z[1])}_move(z,at){let xt=this._distance;if(this._distance=z[0].dist(z[1]),this._active||!(Math.abs(il(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:il(this._distance,xt),pinchAround:at}}}function Mu(Pt,z){return 180*Pt.angleWith(z)/Math.PI}class lc extends Fu{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(z){this._startVector=this._vector=z[0].sub(z[1]),this._minDiameter=z[0].dist(z[1])}_move(z,at,xt){let kt=this._vector;if(this._vector=z[0].sub(z[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Mu(this._vector,kt),pinchAround:at}}_isBelowThreshold(z){this._minDiameter=Math.min(this._minDiameter,z.mag());let at=25/(Math.PI*this._minDiameter)*360,xt=Mu(z,this._startVector);return Math.abs(xt)<at}}function Su(Pt){return Math.abs(Pt.y)>Math.abs(Pt.x)}class Oc extends Fu{constructor(z){super(),this._currentTouchCount=0,this._map=z}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(z,at,xt){super.touchstart(z,at,xt),this._currentTouchCount=xt.length}_start(z){this._lastPoints=z,Su(z[0].sub(z[1]))&&(this._valid=!1)}_move(z,at,xt){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let kt=z[0].sub(this._lastPoints[0]),Lt=z[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(kt,Lt,xt.timeStamp),this._valid?(this._lastPoints=z,this._active=!0,{pitchDelta:(kt.y+Lt.y)/2*-.5}):void 0}gestureBeginsVertically(z,at,xt){if(this._valid!==void 0)return this._valid;let kt=z.mag()>=2,Lt=at.mag()>=2;if(!kt&&!Lt)return;if(!kt||!Lt)return this._firstMove===void 0&&(this._firstMove=xt),xt-this._firstMove<100&&void 0;let le=z.y>0==at.y>0;return Su(z)&&Su(at)&&le}}let Xe={panStep:100,bearingStep:15,pitchStep:10};class yr{constructor(z){this._tr=new Du(z);let at=Xe;this._panStep=at.panStep,this._bearingStep=at.bearingStep,this._pitchStep=at.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(z){if(z.altKey||z.ctrlKey||z.metaKey)return;let at=0,xt=0,kt=0,Lt=0,le=0;switch(z.keyCode){case 61:case 107:case 171:case 187:at=1;break;case 189:case 109:case 173:at=-1;break;case 37:z.shiftKey?xt=-1:(z.preventDefault(),Lt=-1);break;case 39:z.shiftKey?xt=1:(z.preventDefault(),Lt=1);break;case 38:z.shiftKey?kt=1:(z.preventDefault(),le=-1);break;case 40:z.shiftKey?kt=-1:(z.preventDefault(),le=1);break;default:return}return this._rotationDisabled&&(xt=0,kt=0),{cameraAnimation:xe=>{let Pe=this._tr;xe.easeTo({duration:300,easeId:"keyboardHandler",easing:Kr,zoom:at?Math.round(Pe.zoom)+at*(z.shiftKey?2:1):Pe.zoom,bearing:Pe.bearing+xt*this._bearingStep,pitch:Pe.pitch+kt*this._pitchStep,offset:[-Lt*this._panStep,-le*this._panStep],center:Pe.center},{originalEvent:z})}}}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 Kr(Pt){return Pt*(2-Pt)}let Rr=4.000244140625;class mn{constructor(z,at){this._onTimeout=xt=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(xt)},this._map=z,this._tr=new Du(z),this._triggerRenderFrame=at,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(z){this._defaultZoomRate=z}setWheelZoomRate(z){this._wheelZoomRate=z}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(z){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!z&&z.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(z){return!!this._map.cooperativeGestures.isEnabled()&&!(z.ctrlKey||this._map.cooperativeGestures.isBypassed(z))}wheel(z){if(!this.isEnabled())return;if(this._shouldBePrevented(z))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",z);let at=z.deltaMode===WheelEvent.DOM_DELTA_LINE?40*z.deltaY:z.deltaY,xt=o.now(),kt=xt-(this._lastWheelEventTime||0);this._lastWheelEventTime=xt,at!==0&&at%Rr==0?this._type="wheel":at!==0&&Math.abs(at)<4?this._type="trackpad":kt>400?(this._type=null,this._lastValue=at,this._timeout=setTimeout(this._onTimeout,40,z)):this._type||(this._type=Math.abs(kt*at)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,at+=this._lastValue)),z.shiftKey&&at&&(at/=4),this._type&&(this._lastWheelEvent=z,this._delta-=at,this._active||this._start(z)),z.preventDefault()}_start(z){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(),z),xt=this._tr;this._around=at.y>xt.transform.height/2-xt.transform.getHorizon()?e.N.convert(this._aroundCenter?xt.center:xt.unproject(at)):e.N.convert(xt.center),this._aroundPoint=xt.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let z=this._tr.transform;if(this._delta!==0){let Pe=this._type==="wheel"&&Math.abs(this._delta)>Rr?this._wheelZoomRate:this._defaultZoomRate,$e=2/(1+Math.exp(-Math.abs(this._delta*Pe)));this._delta<0&&$e!==0&&($e=1/$e);let hr=typeof this._targetZoom=="number"?z.zoomScale(this._targetZoom):z.scale;this._targetZoom=Math.min(z.maxZoom,Math.max(z.minZoom,z.scaleZoom(hr*$e))),this._type==="wheel"&&(this._startZoom=z.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let at=typeof this._targetZoom=="number"?this._targetZoom:z.zoom,xt=this._startZoom,kt=this._easing,Lt,le=!1,xe=o.now()-this._lastWheelEventTime;if(this._type==="wheel"&&xt&&kt&&xe){let Pe=Math.min(xe/200,1),$e=kt(Pe);Lt=e.y.number(xt,at,$e),Pe<1?this._frameId||(this._frameId=!0):le=!0}else Lt=at,le=!0;return this._active=!0,le&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!le,zoomDelta:Lt-z.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(z){let at=e.b9;if(this._prevEase){let xt=this._prevEase,kt=(o.now()-xt.start)/xt.duration,Lt=xt.easing(kt+.01)-xt.easing(kt),le=.27/Math.sqrt(Lt*Lt+1e-4)*.01,xe=Math.sqrt(.0729-le*le);at=e.b8(le,xe,.25,1)}return this._prevEase={start:o.now(),duration:z,easing:at},at}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Pn{constructor(z,at){this._clickZoom=z,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 ha{constructor(z){this._tr=new Du(z),this.reset()}reset(){this._active=!1}dblclick(z,at){return z.preventDefault(),{cameraAnimation:xt=>{xt.easeTo({duration:300,zoom:this._tr.zoom+(z.shiftKey?-1:1),around:this._tr.unproject(at)},{originalEvent:z})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ta{constructor(){this._tap=new vc({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(z,at,xt){if(!this._swipePoint)if(this._tapTime){let kt=at[0],Lt=z.timeStamp-this._tapTime<500,le=this._tapPoint.dist(kt)<30;Lt&&le?xt.length>0&&(this._swipePoint=kt,this._swipeTouch=xt[0].identifier):this.reset()}else this._tap.touchstart(z,at,xt)}touchmove(z,at,xt){if(this._tapTime){if(this._swipePoint){if(xt[0].identifier!==this._swipeTouch)return;let kt=at[0],Lt=kt.y-this._swipePoint.y;return this._swipePoint=kt,z.preventDefault(),this._active=!0,{zoomDelta:Lt/128}}}else this._tap.touchmove(z,at,xt)}touchend(z,at,xt){if(this._tapTime)this._swipePoint&&xt.length===0&&this.reset();else{let kt=this._tap.touchend(z,at,xt);kt&&(this._tapTime=z.timeStamp,this._tapPoint=kt)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ua{constructor(z,at,xt){this._el=z,this._mousePan=at,this._touchPan=xt}enable(z){this._inertiaOptions=z||{},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 Ya{constructor(z,at,xt){this._pitchWithRotate=z.pitchWithRotate,this._mouseRotate=at,this._mousePitch=xt}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 va{constructor(z,at,xt,kt){this._el=z,this._touchZoom=at,this._touchRotate=xt,this._tapDragZoom=kt,this._rotationDisabled=!1,this._enabled=!0}enable(z){this._touchZoom.enable(z),this._rotationDisabled||this._touchRotate.enable(z),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 Ba{constructor(z,at){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=z,this._options=at,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let z=this._map.getCanvasContainer();z.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",z);let at=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(at=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let xt=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),kt=document.createElement("div");kt.className="maplibregl-desktop-message",kt.textContent=at,this._container.appendChild(kt);let Lt=document.createElement("div");Lt.className="maplibregl-mobile-message",Lt.textContent=xt,this._container.appendChild(Lt),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(z){return z[this._bypassKey]}notifyGestureBlocked(z,at){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:z,originalEvent:at})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let za=Pt=>Pt.zoom||Pt.drag||Pt.pitch||Pt.rotate;class ca extends e.k{}function ei(Pt){return Pt.panDelta&&Pt.panDelta.mag()||Pt.zoomDelta||Pt.bearingDelta||Pt.pitchDelta}class Vi{constructor(z,at){this.handleWindowEvent=kt=>{this.handleEvent(kt,`${kt.type}Window`)},this.handleEvent=(kt,Lt)=>{if(kt.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let le=kt.type==="renderFrame"?void 0:kt,xe={needsRenderFrame:!1},Pe={},$e={},hr=kt.touches,pr=hr?this._getMapTouches(hr):void 0,Br=pr?a.touchPos(this._map.getCanvas(),pr):a.mousePos(this._map.getCanvas(),kt);for(let{handlerName:Gt,handler:ae,allowed:ce}of this._handlers){if(!ae.isEnabled())continue;let Te;this._blockedByActive($e,ce,Gt)?ae.reset():ae[Lt||kt.type]&&(Te=ae[Lt||kt.type](kt,Br,pr),this.mergeHandlerResult(xe,Pe,Te,Gt,le),Te&&Te.needsRenderFrame&&this._triggerRenderFrame()),(Te||ae.isActive())&&($e[Gt]=ae)}let Jr={};for(let Gt in this._previousActiveHandlers)$e[Gt]||(Jr[Gt]=le);this._previousActiveHandlers=$e,(Object.keys(Jr).length||ei(xe))&&(this._changes.push([xe,Pe,Jr]),this._triggerRenderFrame()),(Object.keys($e).length||ei(xe))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:Rt}=xe;Rt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Rt(this._map))},this._map=z,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new wc(z),this._bearingSnap=at.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(at);let xt=this._el;this._listeners=[[xt,"touchstart",{passive:!0}],[xt,"touchmove",{passive:!1}],[xt,"touchend",void 0],[xt,"touchcancel",void 0],[xt,"mousedown",void 0],[xt,"mousemove",void 0],[xt,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[xt,"mouseover",void 0],[xt,"mouseout",void 0],[xt,"dblclick",void 0],[xt,"click",void 0],[xt,"keydown",{capture:!1}],[xt,"keyup",void 0],[xt,"wheel",{passive:!1}],[xt,"contextmenu",void 0],[window,"blur",void 0]];for(let[kt,Lt,le]of this._listeners)a.addEventListener(kt,Lt,kt===document?this.handleWindowEvent:this.handleEvent,le)}destroy(){for(let[z,at,xt]of this._listeners)a.removeEventListener(z,at,z===document?this.handleWindowEvent:this.handleEvent,xt)}_addDefaultHandlers(z){let at=this._map,xt=at.getCanvasContainer();this._add("mapEvent",new ku(at,z));let kt=at.boxZoom=new Xl(at,z);this._add("boxZoom",kt),z.interactive&&z.boxZoom&&kt.enable();let Lt=at.cooperativeGestures=new Ba(at,z.cooperativeGestures);this._add("cooperativeGestures",Lt),z.cooperativeGestures&&Lt.enable();let le=new Ku(at),xe=new ha(at);at.doubleClickZoom=new Pn(xe,le),this._add("tapZoom",le),this._add("clickZoom",xe),z.interactive&&z.doubleClickZoom&&at.doubleClickZoom.enable();let Pe=new Ta;this._add("tapDragZoom",Pe);let $e=at.touchPitch=new Oc(at);this._add("touchPitch",$e),z.interactive&&z.touchPitch&&at.touchPitch.enable(z.touchPitch);let hr=zl(z),pr=Uc(z);at.dragRotate=new Ya(z,hr,pr),this._add("mouseRotate",hr,["mousePitch"]),this._add("mousePitch",pr,["mouseRotate"]),z.interactive&&z.dragRotate&&at.dragRotate.enable();let Br=(({enable:Te,clickTolerance:ye})=>{let ze=new Yu({checkCorrectEvent:rr=>a.mouseButton(rr)===0&&!rr.ctrlKey});return new ou({clickTolerance:ye,move:(rr,fr)=>({around:fr,panDelta:fr.sub(rr)}),activateOnStart:!0,moveStateManager:ze,enable:Te,assignEvents:uf})})(z),Jr=new su(z,at);at.dragPan=new Ua(xt,Br,Jr),this._add("mousePan",Br),this._add("touchPan",Jr,["touchZoom","touchRotate"]),z.interactive&&z.dragPan&&at.dragPan.enable(z.dragPan);let Rt=new lc,Gt=new Cs;at.touchZoomRotate=new va(xt,Gt,Rt,Pe),this._add("touchRotate",Rt,["touchPan","touchZoom"]),this._add("touchZoom",Gt,["touchPan","touchRotate"]),z.interactive&&z.touchZoomRotate&&at.touchZoomRotate.enable(z.touchZoomRotate);let ae=at.scrollZoom=new mn(at,()=>this._triggerRenderFrame());this._add("scrollZoom",ae,["mousePan"]),z.interactive&&z.scrollZoom&&at.scrollZoom.enable(z.scrollZoom);let ce=at.keyboard=new yr(at);this._add("keyboard",ce),z.interactive&&z.keyboard&&at.keyboard.enable(),this._add("blockableMapEvent",new Gs(at))}_add(z,at,xt){this._handlers.push({handlerName:z,handler:at,allowed:xt}),this._handlersById[z]=at}stop(z){if(!this._updatingCamera){for(let{handler:at}of this._handlers)at.reset();this._inertia.clear(),this._fireEvents({},{},z),this._changes=[]}}isActive(){for(let{handler:z}of this._handlers)if(z.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!za(this._eventsInProgress)||this.isZooming()}_blockedByActive(z,at,xt){for(let kt in z)if(kt!==xt&&(!at||at.indexOf(kt)<0))return!0;return!1}_getMapTouches(z){let at=[];for(let xt of z)this._el.contains(xt.target)&&at.push(xt);return at}mergeHandlerResult(z,at,xt,kt,Lt){if(!xt)return;e.e(z,xt);let le={handlerName:kt,originalEvent:xt.originalEvent||Lt};xt.zoomDelta!==void 0&&(at.zoom=le),xt.panDelta!==void 0&&(at.drag=le),xt.pitchDelta!==void 0&&(at.pitch=le),xt.bearingDelta!==void 0&&(at.rotate=le)}_applyChanges(){let z={},at={},xt={};for(let[kt,Lt,le]of this._changes)kt.panDelta&&(z.panDelta=(z.panDelta||new e.P(0,0))._add(kt.panDelta)),kt.zoomDelta&&(z.zoomDelta=(z.zoomDelta||0)+kt.zoomDelta),kt.bearingDelta&&(z.bearingDelta=(z.bearingDelta||0)+kt.bearingDelta),kt.pitchDelta&&(z.pitchDelta=(z.pitchDelta||0)+kt.pitchDelta),kt.around!==void 0&&(z.around=kt.around),kt.pinchAround!==void 0&&(z.pinchAround=kt.pinchAround),kt.noInertia&&(z.noInertia=kt.noInertia),e.e(at,Lt),e.e(xt,le);this._updateMapTransform(z,at,xt),this._changes=[]}_updateMapTransform(z,at,xt){let kt=this._map,Lt=kt._getTransformForUpdate(),le=kt.terrain;if(!(ei(z)||le&&this._terrainMovement))return this._fireEvents(at,xt,!0);let{panDelta:xe,zoomDelta:Pe,bearingDelta:$e,pitchDelta:hr,around:pr,pinchAround:Br}=z;Br!==void 0&&(pr=Br),kt._stop(!0),pr=pr||kt.transform.centerPoint;let Jr=Lt.pointLocation(xe?pr.sub(xe):pr);$e&&(Lt.bearing+=$e),hr&&(Lt.pitch+=hr),Pe&&(Lt.zoom+=Pe),le?this._terrainMovement||!at.drag&&!at.zoom?at.drag&&this._terrainMovement?Lt.center=Lt.pointLocation(Lt.centerPoint.sub(xe)):Lt.setLocationAtPoint(Jr,pr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Lt.setLocationAtPoint(Jr,pr)):Lt.setLocationAtPoint(Jr,pr),kt._applyUpdatedTransform(Lt),this._map._update(),z.noInertia||this._inertia.record(z),this._fireEvents(at,xt,!0)}_fireEvents(z,at,xt){let kt=za(this._eventsInProgress),Lt=za(z),le={};for(let pr in z){let{originalEvent:Br}=z[pr];this._eventsInProgress[pr]||(le[`${pr}start`]=Br),this._eventsInProgress[pr]=z[pr]}!kt&&Lt&&this._fireEvent("movestart",Lt.originalEvent);for(let pr in le)this._fireEvent(pr,le[pr]);Lt&&this._fireEvent("move",Lt.originalEvent);for(let pr in z){let{originalEvent:Br}=z[pr];this._fireEvent(pr,Br)}let xe={},Pe;for(let pr in this._eventsInProgress){let{handlerName:Br,originalEvent:Jr}=this._eventsInProgress[pr];this._handlersById[Br].isActive()||(delete this._eventsInProgress[pr],Pe=at[Br]||Jr,xe[`${pr}end`]=Pe)}for(let pr in xe)this._fireEvent(pr,xe[pr]);let $e=za(this._eventsInProgress),hr=(kt||Lt)&&!$e;if(hr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let pr=this._map._getTransformForUpdate();pr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(pr)}if(xt&&hr){this._updatingCamera=!0;let pr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Br=Jr=>Jr!==0&&-this._bearingSnap<Jr&&Jr<this._bearingSnap;!pr||!pr.essential&&o.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:Pe})),Br(this._map.getBearing())&&this._map.resetNorth()):(Br(pr.bearing||this._map.getBearing())&&(pr.bearing=0),pr.freezeElevation=!0,this._map.easeTo(pr,{originalEvent:Pe})),this._updatingCamera=!1}}_fireEvent(z,at){this._map.fire(new e.k(z,at?{originalEvent:at}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(z=>{delete this._frameId,this.handleEvent(new ca("renderFrame",{timeStamp:z})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Oi extends e.E{constructor(z,at){super(),this._renderFrameCallback=()=>{let xt=Math.min((o.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(xt)),xt<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=z,this._bearingSnap=at.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(z,at){return this.jumpTo({center:z},at)}panBy(z,at,xt){return z=e.P.convert(z).mult(-1),this.panTo(this.transform.center,e.e({offset:z},at),xt)}panTo(z,at,xt){return this.easeTo(e.e({center:z},at),xt)}getZoom(){return this.transform.zoom}setZoom(z,at){return this.jumpTo({zoom:z},at),this}zoomTo(z,at,xt){return this.easeTo(e.e({zoom:z},at),xt)}zoomIn(z,at){return this.zoomTo(this.getZoom()+1,z,at),this}zoomOut(z,at){return this.zoomTo(this.getZoom()-1,z,at),this}getBearing(){return this.transform.bearing}setBearing(z,at){return this.jumpTo({bearing:z},at),this}getPadding(){return this.transform.padding}setPadding(z,at){return this.jumpTo({padding:z},at),this}rotateTo(z,at,xt){return this.easeTo(e.e({bearing:z},at),xt)}resetNorth(z,at){return this.rotateTo(0,e.e({duration:1e3},z),at),this}resetNorthPitch(z,at){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},z),at),this}snapToNorth(z,at){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(z,at):this}getPitch(){return this.transform.pitch}setPitch(z,at){return this.jumpTo({pitch:z},at),this}cameraForBounds(z,at){z=nt.convert(z).adjustAntiMeridian();let xt=at&&at.bearing||0;return this._cameraForBoxAndBearing(z.getNorthWest(),z.getSouthEast(),xt,at)}_cameraForBoxAndBearing(z,at,xt,kt){let Lt={top:0,bottom:0,right:0,left:0};if(typeof(kt=e.e({padding:Lt,offset:[0,0],maxZoom:this.transform.maxZoom},kt)).padding=="number"){let cn=kt.padding;kt.padding={top:cn,bottom:cn,right:cn,left:cn}}kt.padding=e.e(Lt,kt.padding);let le=this.transform,xe=le.padding,Pe=new nt(z,at),$e=le.project(Pe.getNorthWest()),hr=le.project(Pe.getNorthEast()),pr=le.project(Pe.getSouthEast()),Br=le.project(Pe.getSouthWest()),Jr=e.ba(-xt),Rt=$e.rotate(Jr),Gt=hr.rotate(Jr),ae=pr.rotate(Jr),ce=Br.rotate(Jr),Te=new e.P(Math.max(Rt.x,Gt.x,ce.x,ae.x),Math.max(Rt.y,Gt.y,ce.y,ae.y)),ye=new e.P(Math.min(Rt.x,Gt.x,ce.x,ae.x),Math.min(Rt.y,Gt.y,ce.y,ae.y)),ze=Te.sub(ye),rr=(le.width-(xe.left+xe.right+kt.padding.left+kt.padding.right))/ze.x,fr=(le.height-(xe.top+xe.bottom+kt.padding.top+kt.padding.bottom))/ze.y;if(fr<0||rr<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let gr=Math.min(le.scaleZoom(le.scale*Math.min(rr,fr)),kt.maxZoom),Lr=e.P.convert(kt.offset),Hr=new e.P((kt.padding.left-kt.padding.right)/2,(kt.padding.top-kt.padding.bottom)/2).rotate(e.ba(xt)),nn=Lr.add(Hr).mult(le.scale/le.zoomScale(gr));return{center:le.unproject($e.add(pr).div(2).sub(nn)),zoom:gr,bearing:xt}}fitBounds(z,at,xt){return this._fitInternal(this.cameraForBounds(z,at),at,xt)}fitScreenCoordinates(z,at,xt,kt,Lt){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(z)),this.transform.pointLocation(e.P.convert(at)),xt,kt),kt,Lt)}_fitInternal(z,at,xt){return z?(delete(at=e.e(z,at)).padding,at.linear?this.easeTo(at,xt):this.flyTo(at,xt)):this}jumpTo(z,at){this.stop();let xt=this._getTransformForUpdate(),kt=!1,Lt=!1,le=!1;return"zoom"in z&&xt.zoom!==+z.zoom&&(kt=!0,xt.zoom=+z.zoom),z.center!==void 0&&(xt.center=e.N.convert(z.center)),"bearing"in z&&xt.bearing!==+z.bearing&&(Lt=!0,xt.bearing=+z.bearing),"pitch"in z&&xt.pitch!==+z.pitch&&(le=!0,xt.pitch=+z.pitch),z.padding==null||xt.isPaddingEqual(z.padding)||(xt.padding=z.padding),this._applyUpdatedTransform(xt),this.fire(new e.k("movestart",at)).fire(new e.k("move",at)),kt&&this.fire(new e.k("zoomstart",at)).fire(new e.k("zoom",at)).fire(new e.k("zoomend",at)),Lt&&this.fire(new e.k("rotatestart",at)).fire(new e.k("rotate",at)).fire(new e.k("rotateend",at)),le&&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(z,at,xt,kt=0){let Lt=e.Z.fromLngLat(z,at),le=e.Z.fromLngLat(xt,kt),xe=le.x-Lt.x,Pe=le.y-Lt.y,$e=le.z-Lt.z,hr=Math.hypot(xe,Pe,$e);if(hr===0)throw new Error("Can't calculate camera options with same From and To");let pr=Math.hypot(xe,Pe),Br=this.transform.scaleZoom(this.transform.cameraToCenterDistance/hr/this.transform.tileSize),Jr=180*Math.atan2(xe,-Pe)/Math.PI,Rt=180*Math.acos(pr/hr)/Math.PI;return Rt=$e<0?90-Rt:90+Rt,{center:le.toLngLat(),zoom:Br,pitch:Rt,bearing:Jr}}easeTo(z,at){var xt;this._stop(!1,z.easeId),((z=e.e({offset:[0,0],duration:500,easing:e.b9},z)).animate===!1||!z.essential&&o.prefersReducedMotion)&&(z.duration=0);let kt=this._getTransformForUpdate(),Lt=kt.zoom,le=kt.bearing,xe=kt.pitch,Pe=kt.padding,$e="bearing"in z?this._normalizeBearing(z.bearing,le):le,hr="pitch"in z?+z.pitch:xe,pr="padding"in z?z.padding:kt.padding,Br=e.P.convert(z.offset),Jr=kt.centerPoint.add(Br),Rt=kt.pointLocation(Jr),{center:Gt,zoom:ae}=kt.getConstrained(e.N.convert(z.center||Rt),(xt=z.zoom)!==null&&xt!==void 0?xt:Lt);this._normalizeCenter(Gt,kt);let ce=kt.project(Rt),Te=kt.project(Gt).sub(ce),ye=kt.zoomScale(ae-Lt),ze,rr;z.around&&(ze=e.N.convert(z.around),rr=kt.locationPoint(ze));let fr={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ae!==Lt,this._rotating=this._rotating||le!==$e,this._pitching=this._pitching||hr!==xe,this._padding=!kt.isPaddingEqual(pr),this._easeId=z.easeId,this._prepareEase(at,z.noMoveStart,fr),this.terrain&&this._prepareElevation(Gt),this._ease(gr=>{if(this._zooming&&(kt.zoom=e.y.number(Lt,ae,gr)),this._rotating&&(kt.bearing=e.y.number(le,$e,gr)),this._pitching&&(kt.pitch=e.y.number(xe,hr,gr)),this._padding&&(kt.interpolatePadding(Pe,pr,gr),Jr=kt.centerPoint.add(Br)),this.terrain&&!z.freezeElevation&&this._updateElevation(gr),ze)kt.setLocationAtPoint(ze,rr);else{let Lr=kt.zoomScale(kt.zoom-Lt),Hr=ae>Lt?Math.min(2,ye):Math.max(.5,ye),nn=Math.pow(Hr,1-gr),cn=kt.unproject(ce.add(Te.mult(gr*nn)).mult(Lr));kt.setLocationAtPoint(kt.renderWorldCopies?cn.wrap():cn,Jr)}this._applyUpdatedTransform(kt),this._fireMoveEvents(at)},gr=>{this.terrain&&z.freezeElevation&&this._finalizeElevation(),this._afterEase(at,gr)},z),this}_prepareEase(z,at,xt={}){this._moving=!0,at||xt.moving||this.fire(new e.k("movestart",z)),this._zooming&&!xt.zooming&&this.fire(new e.k("zoomstart",z)),this._rotating&&!xt.rotating&&this.fire(new e.k("rotatestart",z)),this._pitching&&!xt.pitching&&this.fire(new e.k("pitchstart",z))}_prepareElevation(z){this._elevationCenter=z,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(z,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(z){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let at=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(z<1&&at!==this._elevationTarget){let xt=this._elevationTarget-this._elevationStart;this._elevationStart+=z*(xt-(at-(xt*z+this._elevationStart))/(1-z)),this._elevationTarget=at}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,z)}_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(z){let at=z.getCameraPosition(),xt=this.terrain.getElevationForLngLatZoom(at.lngLat,z.zoom);if(at.altitude<xt){let kt=this.calculateCameraOptionsFromTo(at.lngLat,xt,z.center,z.elevation);return{pitch:kt.pitch,zoom:kt.zoom}}return{}}_applyUpdatedTransform(z){let at=[];if(this.terrain&&at.push(kt=>this._elevateCameraIfInsideTerrain(kt)),this.transformCameraUpdate&&at.push(kt=>this.transformCameraUpdate(kt)),!at.length)return;let xt=z.clone();for(let kt of at){let Lt=xt.clone(),{center:le,zoom:xe,pitch:Pe,bearing:$e,elevation:hr}=kt(Lt);le&&(Lt.center=le),xe!==void 0&&(Lt.zoom=xe),Pe!==void 0&&(Lt.pitch=Pe),$e!==void 0&&(Lt.bearing=$e),hr!==void 0&&(Lt.elevation=hr),xt.apply(Lt)}this.transform.apply(xt)}_fireMoveEvents(z){this.fire(new e.k("move",z)),this._zooming&&this.fire(new e.k("zoom",z)),this._rotating&&this.fire(new e.k("rotate",z)),this._pitching&&this.fire(new e.k("pitch",z))}_afterEase(z,at){if(this._easeId&&at&&this._easeId===at)return;delete this._easeId;let xt=this._zooming,kt=this._rotating,Lt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,xt&&this.fire(new e.k("zoomend",z)),kt&&this.fire(new e.k("rotateend",z)),Lt&&this.fire(new e.k("pitchend",z)),this.fire(new e.k("moveend",z))}flyTo(z,at){var xt;if(!z.essential&&o.prefersReducedMotion){let La=e.M(z,["center","zoom","bearing","pitch","around"]);return this.jumpTo(La,at)}this.stop(),z=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},z);let kt=this._getTransformForUpdate(),Lt=kt.zoom,le=kt.bearing,xe=kt.pitch,Pe=kt.padding,$e="bearing"in z?this._normalizeBearing(z.bearing,le):le,hr="pitch"in z?+z.pitch:xe,pr="padding"in z?z.padding:kt.padding,Br=e.P.convert(z.offset),Jr=kt.centerPoint.add(Br),Rt=kt.pointLocation(Jr),{center:Gt,zoom:ae}=kt.getConstrained(e.N.convert(z.center||Rt),(xt=z.zoom)!==null&&xt!==void 0?xt:Lt);this._normalizeCenter(Gt,kt);let ce=kt.zoomScale(ae-Lt),Te=kt.project(Rt),ye=kt.project(Gt).sub(Te),ze=z.curve,rr=Math.max(kt.width,kt.height),fr=rr/ce,gr=ye.mag();if("minZoom"in z){let La=e.ac(Math.min(z.minZoom,Lt,ae),kt.minZoom,kt.maxZoom),ai=rr/kt.zoomScale(La-Lt);ze=Math.sqrt(ai/gr*2)}let Lr=ze*ze;function Hr(La){let ai=(fr*fr-rr*rr+(La?-1:1)*Lr*Lr*gr*gr)/(2*(La?fr:rr)*Lr*gr);return Math.log(Math.sqrt(ai*ai+1)-ai)}function nn(La){return(Math.exp(La)-Math.exp(-La))/2}function cn(La){return(Math.exp(La)+Math.exp(-La))/2}let Mn=Hr(!1),Jn=function(La){return cn(Mn)/cn(Mn+ze*La)},_a=function(La){return rr*((cn(Mn)*(nn(ai=Mn+ze*La)/cn(ai))-nn(Mn))/Lr)/gr;var ai},xa=(Hr(!0)-Mn)/ze;if(Math.abs(gr)<1e-6||!isFinite(xa)){if(Math.abs(rr-fr)<1e-6)return this.easeTo(z,at);let La=fr<rr?-1:1;xa=Math.abs(Math.log(fr/rr))/ze,_a=()=>0,Jn=ai=>Math.exp(La*ze*ai)}return z.duration="duration"in z?+z.duration:1e3*xa/("screenSpeed"in z?+z.screenSpeed/ze:+z.speed),z.maxDuration&&z.duration>z.maxDuration&&(z.duration=0),this._zooming=!0,this._rotating=le!==$e,this._pitching=hr!==xe,this._padding=!kt.isPaddingEqual(pr),this._prepareEase(at,!1),this.terrain&&this._prepareElevation(Gt),this._ease(La=>{let ai=La*xa,Ai=1/Jn(ai);kt.zoom=La===1?ae:Lt+kt.scaleZoom(Ai),this._rotating&&(kt.bearing=e.y.number(le,$e,La)),this._pitching&&(kt.pitch=e.y.number(xe,hr,La)),this._padding&&(kt.interpolatePadding(Pe,pr,La),Jr=kt.centerPoint.add(Br)),this.terrain&&!z.freezeElevation&&this._updateElevation(La);let mi=La===1?Gt:kt.unproject(Te.add(ye.mult(_a(ai))).mult(Ai));kt.setLocationAtPoint(kt.renderWorldCopies?mi.wrap():mi,Jr),this._applyUpdatedTransform(kt),this._fireMoveEvents(at)},()=>{this.terrain&&z.freezeElevation&&this._finalizeElevation(),this._afterEase(at)},z),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(z,at){var xt;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let kt=this._onEaseEnd;delete this._onEaseEnd,kt.call(this,at)}return z||(xt=this.handlers)===null||xt===void 0||xt.stop(!1),this}_ease(z,at,xt){xt.animate===!1||xt.duration===0?(z(1),at()):(this._easeStart=o.now(),this._easeOptions=xt,this._onEaseFrame=z,this._onEaseEnd=at,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(z,at){z=e.b3(z,-180,180);let xt=Math.abs(z-at);return Math.abs(z-360-at)<xt&&(z-=360),Math.abs(z+360-at)<xt&&(z+=360),z}_normalizeCenter(z,at){if(!at.renderWorldCopies||at.lngRange)return;let xt=z.lng-at.center.lng;z.lng+=xt>180?-360:xt<-180?360:0}queryTerrainElevation(z){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(z),this.transform.tileZoom)-this.transform.elevation:null}}let Wi={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Xi{constructor(z=Wi){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=z}getDefaultPosition(){return"bottom-right"}onAdd(z){return this._map=z,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(z,at){let xt=this._map._getUIString(`AttributionControl.${at}`);z.title=xt,z.setAttribute("aria-label",xt)}_updateAttributions(){if(!this._map.style)return;let z=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?z=z.concat(this.options.customAttribution.map(kt=>typeof kt!="string"?"":kt)):typeof this.options.customAttribution=="string"&&z.push(this.options.customAttribution)),this._map.style.stylesheet){let kt=this._map.style.stylesheet;this.styleOwner=kt.owner,this.styleId=kt.id}let at=this._map.style.sourceCaches;for(let kt in at){let Lt=at[kt];if(Lt.used||Lt.usedForTerrain){let le=Lt.getSource();le.attribution&&z.indexOf(le.attribution)<0&&z.push(le.attribution)}}z=z.filter(kt=>String(kt).trim()),z.sort((kt,Lt)=>kt.length-Lt.length),z=z.filter((kt,Lt)=>{for(let le=Lt+1;le<z.length;le++)if(z[le].indexOf(kt)>=0)return!1;return!0});let xt=z.join(" | ");xt!==this._attribHTML&&(this._attribHTML=xt,z.length?(this._innerContainer.innerHTML=xt,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ni{constructor(z={}){this._updateCompact=()=>{let at=this._container.children;if(at.length){let xt=at[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&xt.classList.add("maplibregl-compact"):xt.classList.remove("maplibregl-compact")}},this.options=z}getDefaultPosition(){return"bottom-left"}onAdd(z){this._map=z,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 Za{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(z){let at=++this._id;return this._queue.push({callback:z,id:at,cancelled:!1}),at}remove(z){let at=this._currentlyRunning,xt=at?this._queue.concat(at):this._queue;for(let kt of xt)if(kt.id===z)return void(kt.cancelled=!0)}run(z=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let at=this._currentlyRunning=this._queue;this._queue=[];for(let xt of at)if(!xt.cancelled&&(xt.callback(z),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 Do extends e.E{constructor(z){super(),this.sourceCache=z,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,z.usedForTerrain=!0,z.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(z,at){this.sourceCache.update(z,at),this._renderableTilesKeys=[];let xt={};for(let kt of z.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:at}))xt[kt.key]=!0,this._renderableTilesKeys.push(kt.key),this._tiles[kt.key]||(kt.posMatrix=new Float64Array(16),e.aP(kt.posMatrix,0,e.X,0,e.X,0,1),this._tiles[kt.key]=new Zt(kt,this.tileSize));for(let kt in this._tiles)xt[kt]||delete this._tiles[kt]}freeRtt(z){for(let at in this._tiles){let xt=this._tiles[at];(!z||xt.tileID.equals(z)||xt.tileID.isChildOf(z)||z.isChildOf(xt.tileID))&&(xt.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(z=>this.getTileByID(z))}getTileByID(z){return this._tiles[z]}getTerrainCoords(z){let at={};for(let xt of this._renderableTilesKeys){let kt=this._tiles[xt].tileID;if(kt.canonical.equals(z.canonical)){let Lt=z.clone();Lt.posMatrix=new Float64Array(16),e.aP(Lt.posMatrix,0,e.X,0,e.X,0,1),at[xt]=Lt}else if(kt.canonical.isChildOf(z.canonical)){let Lt=z.clone();Lt.posMatrix=new Float64Array(16);let le=kt.canonical.z-z.canonical.z,xe=kt.canonical.x-(kt.canonical.x>>le<<le),Pe=kt.canonical.y-(kt.canonical.y>>le<<le),$e=e.X>>le;e.aP(Lt.posMatrix,0,$e,0,$e,0,1),e.J(Lt.posMatrix,Lt.posMatrix,[-xe*$e,-Pe*$e,0]),at[xt]=Lt}else if(z.canonical.isChildOf(kt.canonical)){let Lt=z.clone();Lt.posMatrix=new Float64Array(16);let le=z.canonical.z-kt.canonical.z,xe=z.canonical.x-(z.canonical.x>>le<<le),Pe=z.canonical.y-(z.canonical.y>>le<<le),$e=e.X>>le;e.aP(Lt.posMatrix,0,e.X,0,e.X,0,1),e.J(Lt.posMatrix,Lt.posMatrix,[xe*$e,Pe*$e,0]),e.K(Lt.posMatrix,Lt.posMatrix,[1/2**le,1/2**le,0]),at[xt]=Lt}}return at}getSourceTile(z,at){let xt=this.sourceCache._source,kt=z.overscaledZ-this.deltaZoom;if(kt>xt.maxzoom&&(kt=xt.maxzoom),kt<xt.minzoom)return null;this._sourceTileCache[z.key]||(this._sourceTileCache[z.key]=z.scaledTo(kt).key);let Lt=this.sourceCache.getTileByID(this._sourceTileCache[z.key]);if((!Lt||!Lt.dem)&&at)for(;kt>=xt.minzoom&&(!Lt||!Lt.dem);)Lt=this.sourceCache.getTileByID(z.scaledTo(kt--).key);return Lt}tilesAfterTime(z=Date.now()){return Object.values(this._tiles).filter(at=>at.timeAdded>=z)}}class ss{constructor(z,at,xt){this.painter=z,this.sourceCache=new Do(at),this.options=xt,this.exaggeration=typeof xt.exaggeration=="number"?xt.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(z,at,xt,kt=e.X){var Lt;if(!(at>=0&&at<kt&&xt>=0&&xt<kt))return 0;let le=this.getTerrainData(z),xe=(Lt=le.tile)===null||Lt===void 0?void 0:Lt.dem;if(!xe)return 0;let Pe=function(Rt,Gt,ae){var ce=Gt[0],Te=Gt[1];return Rt[0]=ae[0]*ce+ae[4]*Te+ae[12],Rt[1]=ae[1]*ce+ae[5]*Te+ae[13],Rt}([],[at/kt*e.X,xt/kt*e.X],le.u_terrain_matrix),$e=[Pe[0]*xe.dim,Pe[1]*xe.dim],hr=Math.floor($e[0]),pr=Math.floor($e[1]),Br=$e[0]-hr,Jr=$e[1]-pr;return xe.get(hr,pr)*(1-Br)*(1-Jr)+xe.get(hr+1,pr)*Br*(1-Jr)+xe.get(hr,pr+1)*(1-Br)*Jr+xe.get(hr+1,pr+1)*Br*Jr}getElevationForLngLatZoom(z,at){if(!e.bb(at,z.wrap()))return 0;let{tileID:xt,mercatorX:kt,mercatorY:Lt}=this._getOverscaledTileIDFromLngLatZoom(z,at);return this.getElevation(xt,kt%e.X,Lt%e.X,e.X)}getElevation(z,at,xt,kt=e.X){return this.getDEMElevation(z,at,xt,kt)*this.exaggeration}getTerrainData(z){if(!this._emptyDemTexture){let kt=this.painter.context,Lt=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new h(kt,Lt,kt.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new h(kt,new e.R({width:1,height:1}),kt.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(kt.gl.NEAREST,kt.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}let at=this.sourceCache.getSourceTile(z,!0);if(at&&at.dem&&(!at.demTexture||at.needsTerrainPrepare)){let kt=this.painter.context;at.demTexture=this.painter.getTileTexture(at.dem.stride),at.demTexture?at.demTexture.update(at.dem.getPixels(),{premultiply:!1}):at.demTexture=new h(kt,at.dem.getPixels(),kt.gl.RGBA,{premultiply:!1}),at.demTexture.bind(kt.gl.NEAREST,kt.gl.CLAMP_TO_EDGE),at.needsTerrainPrepare=!1}let xt=at&&at+at.tileID.key+z.key;if(xt&&!this._demMatrixCache[xt]){let kt=this.sourceCache.sourceCache._source.maxzoom,Lt=z.canonical.z-at.tileID.canonical.z;z.overscaledZ>z.canonical.z&&(z.canonical.z>=kt?Lt=z.canonical.z-kt:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let le=z.canonical.x-(z.canonical.x>>Lt<<Lt),xe=z.canonical.y-(z.canonical.y>>Lt<<Lt),Pe=e.bc(new Float64Array(16),[1/(e.X<<Lt),1/(e.X<<Lt),0]);e.J(Pe,Pe,[le*e.X,xe*e.X,0]),this._demMatrixCache[z.key]={matrix:Pe,coord:z}}return{u_depth:2,u_terrain:3,u_terrain_dim:at&&at.dem&&at.dem.dim||1,u_terrain_matrix:xt?this._demMatrixCache[z.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(z){let at=this.painter,xt=at.width/devicePixelRatio,kt=at.height/devicePixelRatio;return!this._fbo||this._fbo.width===xt&&this._fbo.height===kt||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new h(at.context,{width:xt,height:kt,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 h(at.context,{width:xt,height:kt,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(xt,kt,!0,!1),this._fbo.depthAttachment.set(at.context.createRenderbuffer(at.context.gl.DEPTH_COMPONENT16,xt,kt))),this._fbo.colorAttachment.set(z==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let z=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let at=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Lt=0,le=0;Lt<this._coordsTextureSize;Lt++)for(let xe=0;xe<this._coordsTextureSize;xe++,le+=4)at[le+0]=255&xe,at[le+1]=255&Lt,at[le+2]=xe>>8<<4|Lt>>8,at[le+3]=0;let xt=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(at.buffer)),kt=new h(z,xt,z.gl.RGBA,{premultiply:!1});return kt.bind(z.gl.NEAREST,z.gl.CLAMP_TO_EDGE),this._coordsTexture=kt,kt}pointCoordinate(z){this.painter.maybeDrawDepthAndCoords(!0);let at=new Uint8Array(4),xt=this.painter.context,kt=xt.gl,Lt=Math.round(z.x*this.painter.pixelRatio/devicePixelRatio),le=Math.round(z.y*this.painter.pixelRatio/devicePixelRatio),xe=Math.round(this.painter.height/devicePixelRatio);xt.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),kt.readPixels(Lt,xe-le-1,1,1,kt.RGBA,kt.UNSIGNED_BYTE,at),xt.bindFramebuffer.set(null);let Pe=at[0]+(at[2]>>4<<8),$e=at[1]+((15&at[2])<<8),hr=this.coordsIndex[255-at[3]],pr=hr&&this.sourceCache.getTileByID(hr);if(!pr)return null;let Br=this._coordsTextureSize,Jr=(1<<pr.tileID.canonical.z)*Br;return new e.Z((pr.tileID.canonical.x*Br+Pe)/Jr+pr.tileID.wrap,(pr.tileID.canonical.y*Br+$e)/Jr,this.getElevation(pr.tileID,Pe,$e,Br))}depthAtPoint(z){let at=new Uint8Array(4),xt=this.painter.context,kt=xt.gl;return xt.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),kt.readPixels(z.x,this.painter.height/devicePixelRatio-z.y-1,1,1,kt.RGBA,kt.UNSIGNED_BYTE,at),xt.bindFramebuffer.set(null),(at[0]/16777216+at[1]/65536+at[2]/256+at[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let z=this.painter.context,at=new e.bd,xt=new e.aY,kt=this.meshSize,Lt=e.X/kt,le=kt*kt;for(let pr=0;pr<=kt;pr++)for(let Br=0;Br<=kt;Br++)at.emplaceBack(Br*Lt,pr*Lt,0);for(let pr=0;pr<le;pr+=kt+1)for(let Br=0;Br<kt;Br++)xt.emplaceBack(Br+pr,kt+Br+pr+1,kt+Br+pr+2),xt.emplaceBack(Br+pr,kt+Br+pr+2,Br+pr+1);let xe=at.length,Pe=xe+2*(kt+1);for(let pr of[0,1])for(let Br=0;Br<=kt;Br++)for(let Jr of[0,1])at.emplaceBack(Br*Lt,pr*e.X,Jr);for(let pr=0;pr<2*kt;pr+=2)xt.emplaceBack(Pe+pr,Pe+pr+1,Pe+pr+3),xt.emplaceBack(Pe+pr,Pe+pr+3,Pe+pr+2),xt.emplaceBack(xe+pr,xe+pr+3,xe+pr+1),xt.emplaceBack(xe+pr,xe+pr+2,xe+pr+3);let $e=at.length,hr=$e+2*(kt+1);for(let pr of[0,1])for(let Br=0;Br<=kt;Br++)for(let Jr of[0,1])at.emplaceBack(pr*e.X,Br*Lt,Jr);for(let pr=0;pr<2*kt;pr+=2)xt.emplaceBack($e+pr,$e+pr+1,$e+pr+3),xt.emplaceBack($e+pr,$e+pr+3,$e+pr+2),xt.emplaceBack(hr+pr,hr+pr+3,hr+pr+1),xt.emplaceBack(hr+pr,hr+pr+2,hr+pr+3);return this._mesh=new Kl(z.createVertexBuffer(at,$i.members),z.createIndexBuffer(xt),e.a0.simpleSegment(0,0,at.length,xt.length)),this._mesh}getMeshFrameDelta(z){return 2*Math.PI*e.be/Math.pow(2,z)/5}getMinTileElevationForLngLatZoom(z,at){var xt;let{tileID:kt}=this._getOverscaledTileIDFromLngLatZoom(z,at);return(xt=this.getMinMaxElevation(kt).minElevation)!==null&&xt!==void 0?xt:0}getMinMaxElevation(z){let at=this.getTerrainData(z).tile,xt={minElevation:null,maxElevation:null};return at&&at.dem&&(xt.minElevation=at.dem.min*this.exaggeration,xt.maxElevation=at.dem.max*this.exaggeration),xt}_getOverscaledTileIDFromLngLatZoom(z,at){let xt=e.Z.fromLngLat(z.wrap()),kt=(1<<at)*e.X,Lt=xt.x*kt,le=xt.y*kt,xe=Math.floor(Lt/e.X),Pe=Math.floor(le/e.X);return{tileID:new e.S(at,0,at,xe,Pe),mercatorX:Lt,mercatorY:le}}}class Ps{constructor(z,at,xt){this._context=z,this._size=at,this._tileSize=xt,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let z of this._objects)z.texture.destroy(),z.fbo.destroy()}_createObject(z){let at=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),xt=new h(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return xt.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(xt.texture),{id:z,fbo:at,texture:xt,stamp:-1,inUse:!1}}getObjectForId(z){return this._objects[z]}useObject(z){z.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(at=>z.id!==at),this._recentlyUsed.push(z.id)}stampObject(z){z.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 z=this._createObject(this._objects.length);return this._objects.push(z),z}freeObject(z){z.inUse=!1}freeAllObjects(){for(let z of this._objects)this.freeObject(z)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(z=>!z.inUse)===!1}}let ys={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Os{constructor(z,at){this.painter=z,this.terrain=at,this.pool=new Ps(z.context,30,at.sourceCache.tileSize*at.qualityFactor)}destruct(){this.pool.destruct()}getTexture(z){return this.pool.getObjectForId(z.rtt[this._stacks.length-1].id).texture}prepareForRender(z,at){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=z._order.filter(xt=>!z._layers[xt].isHidden(at)),this._coordsDescendingInv={};for(let xt in z.sourceCaches){this._coordsDescendingInv[xt]={};let kt=z.sourceCaches[xt].getVisibleCoordinates();for(let Lt of kt){let le=this.terrain.sourceCache.getTerrainCoords(Lt);for(let xe in le)this._coordsDescendingInv[xt][xe]||(this._coordsDescendingInv[xt][xe]=[]),this._coordsDescendingInv[xt][xe].push(le[xe])}}this._coordsDescendingInvStr={};for(let xt of z._order){let kt=z._layers[xt],Lt=kt.source;if(ys[kt.type]&&!this._coordsDescendingInvStr[Lt]){this._coordsDescendingInvStr[Lt]={};for(let le in this._coordsDescendingInv[Lt])this._coordsDescendingInvStr[Lt][le]=this._coordsDescendingInv[Lt][le].map(xe=>xe.key).sort().join()}}for(let xt of this._renderableTiles)for(let kt in this._coordsDescendingInvStr){let Lt=this._coordsDescendingInvStr[kt][xt.tileID.key];Lt&&Lt!==xt.rttCoords[kt]&&(xt.rtt=[])}}renderLayer(z){if(z.isHidden(this.painter.transform.zoom))return!1;let at=z.type,xt=this.painter,kt=this._renderableLayerIds[this._renderableLayerIds.length-1]===z.id;if(ys[at]&&(this._prevType&&ys[this._prevType]||this._stacks.push([]),this._prevType=at,this._stacks[this._stacks.length-1].push(z.id),!kt))return!0;if(ys[this._prevType]||ys[at]&&kt){this._prevType=at;let Lt=this._stacks.length-1,le=this._stacks[Lt]||[];for(let xe of this._renderableTiles){if(this.pool.isFull()&&(rl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(xe),xe.rtt[Lt]){let $e=this.pool.getObjectForId(xe.rtt[Lt].id);if($e.stamp===xe.rtt[Lt].stamp){this.pool.useObject($e);continue}}let Pe=this.pool.getOrCreateFreeObject();this.pool.useObject(Pe),this.pool.stampObject(Pe),xe.rtt[Lt]={id:Pe.id,stamp:Pe.stamp},xt.context.bindFramebuffer.set(Pe.fbo.framebuffer),xt.context.clear({color:e.aM.transparent,stencil:0}),xt.currentStencilSource=void 0;for(let $e=0;$e<le.length;$e++){let hr=xt.style._layers[le[$e]],pr=hr.source?this._coordsDescendingInv[hr.source][xe.tileID.key]:[xe.tileID];xt.context.viewport.set([0,0,Pe.fbo.width,Pe.fbo.height]),xt._renderTileClippingMasks(hr,pr),xt.renderLayer(xt,xt.style.sourceCaches[hr.source],hr,pr),hr.source&&(xe.rttCoords[hr.source]=this._coordsDescendingInvStr[hr.source][xe.tileID.key])}}return rl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),ys[at]}return!1}}let Yo={"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"},ll=r,el={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Wi,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},Rs=Pt=>{Pt.touchstart=Pt.dragStart,Pt.touchmoveWindow=Pt.dragMove,Pt.touchend=Pt.dragEnd},bi={showCompass:!0,showZoom:!0,visualizePitch:!1};class so{constructor(z,at,xt=!1){this.mousedown=le=>{this.startMouse(e.e({},le,{ctrlKey:!0,preventDefault:()=>le.preventDefault()}),a.mousePos(this.element,le)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=le=>{this.moveMouse(le,a.mousePos(this.element,le))},this.mouseup=le=>{this.mouseRotate.dragEnd(le),this.mousePitch&&this.mousePitch.dragEnd(le),this.offTemp()},this.touchstart=le=>{le.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,le.targetTouches)[0],this.startTouch(le,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=le=>{le.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,le.targetTouches)[0],this.moveTouch(le,this._lastPos))},this.touchend=le=>{le.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 kt=z.dragRotate._mouseRotate.getClickTolerance(),Lt=z.dragRotate._mousePitch.getClickTolerance();this.element=at,this.mouseRotate=zl({clickTolerance:kt,enable:!0}),this.touchRotate=(({enable:le,clickTolerance:xe,bearingDegreesPerPixelMoved:Pe=.8})=>{let $e=new yc;return new ou({clickTolerance:xe,move:(hr,pr)=>({bearingDelta:(pr.x-hr.x)*Pe}),moveStateManager:$e,enable:le,assignEvents:Rs})})({clickTolerance:kt,enable:!0}),this.map=z,xt&&(this.mousePitch=Uc({clickTolerance:Lt,enable:!0}),this.touchPitch=(({enable:le,clickTolerance:xe,pitchDegreesPerPixelMoved:Pe=-.5})=>{let $e=new yc;return new ou({clickTolerance:xe,move:(hr,pr)=>({pitchDelta:(pr.y-hr.y)*Pe}),moveStateManager:$e,enable:le,assignEvents:Rs})})({clickTolerance:Lt,enable:!0})),a.addEventListener(at,"mousedown",this.mousedown),a.addEventListener(at,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(at,"touchcancel",this.reset)}startMouse(z,at){this.mouseRotate.dragStart(z,at),this.mousePitch&&this.mousePitch.dragStart(z,at),a.disableDrag()}startTouch(z,at){this.touchRotate.dragStart(z,at),this.touchPitch&&this.touchPitch.dragStart(z,at),a.disableDrag()}moveMouse(z,at){let xt=this.map,{bearingDelta:kt}=this.mouseRotate.dragMove(z,at)||{};if(kt&&xt.setBearing(xt.getBearing()+kt),this.mousePitch){let{pitchDelta:Lt}=this.mousePitch.dragMove(z,at)||{};Lt&&xt.setPitch(xt.getPitch()+Lt)}}moveTouch(z,at){let xt=this.map,{bearingDelta:kt}=this.touchRotate.dragMove(z,at)||{};if(kt&&xt.setBearing(xt.getBearing()+kt),this.touchPitch){let{pitchDelta:Lt}=this.touchPitch.dragMove(z,at)||{};Lt&&xt.setPitch(xt.getPitch()+Lt)}}off(){let z=this.element;a.removeEventListener(z,"mousedown",this.mousedown),a.removeEventListener(z,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(z,"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 ws;function fs(Pt,z,at){let xt=new e.N(Pt.lng,Pt.lat);if(Pt=new e.N(Pt.lng,Pt.lat),z){let kt=new e.N(Pt.lng-360,Pt.lat),Lt=new e.N(Pt.lng+360,Pt.lat),le=at.locationPoint(Pt).distSqr(z);at.locationPoint(kt).distSqr(z)<le?Pt=kt:at.locationPoint(Lt).distSqr(z)<le&&(Pt=Lt)}for(;Math.abs(Pt.lng-at.center.lng)>180;){let kt=at.locationPoint(Pt);if(kt.x>=0&&kt.y>=0&&kt.x<=at.width&&kt.y<=at.height)break;Pt.lng>at.center.lng?Pt.lng-=360:Pt.lng+=360}return Pt.lng!==xt.lng&&at.locationPoint(Pt).y>at.height/2-at.getHorizon()?Pt:xt}let Ll={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 $l(Pt,z,at){let xt=Pt.classList;for(let kt in Ll)xt.remove(`maplibregl-${at}-anchor-${kt}`);xt.add(`maplibregl-${at}-anchor-${z}`)}class jl extends e.E{constructor(z){if(super(),this._onKeyPress=at=>{let xt=at.code,kt=at.charCode||at.keyCode;xt!=="Space"&&xt!=="Enter"&&kt!==32&&kt!==13||this.togglePopup()},this._onMapClick=at=>{let xt=at.originalEvent.target,kt=this._element;this._popup&&(xt===kt||kt.contains(xt))&&this.togglePopup()},this._update=at=>{var xt;if(!this._map)return;let kt=this._map.loaded()&&!this._map.isMoving();(at?.type==="terrain"||at?.type==="render"&&!kt)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?fs(this._lngLat,this._flatPos,this._map.transform):(xt=this._lngLat)===null||xt===void 0?void 0:xt.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 Lt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Lt=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Lt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let le="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?le="rotateX(0deg)":this._pitchAlignment==="map"&&(le=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||at&&at.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${Ll[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${le} ${Lt}`),o.frameAsync(new AbortController).then(()=>{this._updateOpacity(at&&at.type==="moveend")}).catch(()=>{})},this._onMove=at=>{if(!this._isDragging){let xt=this._clickTolerance||this._map._clickTolerance;this._isDragging=at.point.dist(this._pointerdownPos)>=xt}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=z&&z.anchor||"center",this._color=z&&z.color||"#3FB1CE",this._scale=z&&z.scale||1,this._draggable=z&&z.draggable||!1,this._clickTolerance=z&&z.clickTolerance||0,this._subpixelPositioning=z&&z.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=z&&z.rotation||0,this._rotationAlignment=z&&z.rotationAlignment||"auto",this._pitchAlignment=z&&z.pitchAlignment&&z.pitchAlignment!=="auto"?z.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(z?.opacity,z?.opacityWhenCovered),z&&z.element)this._element=z.element,this._offset=e.P.convert(z&&z.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");let at=a.createNS("http://www.w3.org/2000/svg","svg"),xt=41,kt=27;at.setAttributeNS(null,"display","block"),at.setAttributeNS(null,"height",`${xt}px`),at.setAttributeNS(null,"width",`${kt}px`),at.setAttributeNS(null,"viewBox",`0 0 ${kt} ${xt}`);let Lt=a.createNS("http://www.w3.org/2000/svg","g");Lt.setAttributeNS(null,"stroke","none"),Lt.setAttributeNS(null,"stroke-width","1"),Lt.setAttributeNS(null,"fill","none"),Lt.setAttributeNS(null,"fill-rule","evenodd");let le=a.createNS("http://www.w3.org/2000/svg","g");le.setAttributeNS(null,"fill-rule","nonzero");let xe=a.createNS("http://www.w3.org/2000/svg","g");xe.setAttributeNS(null,"transform","translate(3.0, 29.0)"),xe.setAttributeNS(null,"fill","#000000");let Pe=[{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 ce of Pe){let Te=a.createNS("http://www.w3.org/2000/svg","ellipse");Te.setAttributeNS(null,"opacity","0.04"),Te.setAttributeNS(null,"cx","10.5"),Te.setAttributeNS(null,"cy","5.80029008"),Te.setAttributeNS(null,"rx",ce.rx),Te.setAttributeNS(null,"ry",ce.ry),xe.appendChild(Te)}let $e=a.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"fill",this._color);let hr=a.createNS("http://www.w3.org/2000/svg","path");hr.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"),$e.appendChild(hr);let pr=a.createNS("http://www.w3.org/2000/svg","g");pr.setAttributeNS(null,"opacity","0.25"),pr.setAttributeNS(null,"fill","#000000");let Br=a.createNS("http://www.w3.org/2000/svg","path");Br.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"),pr.appendChild(Br);let Jr=a.createNS("http://www.w3.org/2000/svg","g");Jr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Jr.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 ae=a.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#FFFFFF"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962"),Rt.appendChild(Gt),Rt.appendChild(ae),le.appendChild(xe),le.appendChild($e),le.appendChild(pr),le.appendChild(Jr),le.appendChild(Rt),at.appendChild(le),at.setAttributeNS(null,"height",xt*this._scale+"px"),at.setAttributeNS(null,"width",kt*this._scale+"px"),this._element.appendChild(at),this._offset=e.P.convert(z&&z.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",at=>{at.preventDefault()}),this._element.addEventListener("mousedown",at=>{at.preventDefault()}),$l(this._element,this._anchor,"marker"),z&&z.className)for(let at of z.className.split(" "))this._element.classList.add(at);this._popup=null}addTo(z){return this.remove(),this._map=z,this._element.setAttribute("aria-label",z._getUIString("Marker.Title")),z.getCanvasContainer().appendChild(this._element),z.on("move",this._update),z.on("moveend",this._update),z.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(z){return this._lngLat=e.N.convert(z),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(z){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),z){if(!("offset"in z.options)){let at=Math.abs(13.5)/Math.SQRT2;z.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=z,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(z){return this._subpixelPositioning=z,this}getPopup(){return this._popup}togglePopup(){let z=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:z?(z.isOpen()?z.remove():(z.setLngLat(this._lngLat),z.addTo(this._map)),this):this}_updateOpacity(z=!1){var at,xt;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(z)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let kt=this._map,Lt=kt.terrain.depthAtPoint(this._pos),le=kt.terrain.getElevationForLngLatZoom(this._lngLat,kt.transform.tileZoom);if(kt.transform.lngLatToCameraDepth(this._lngLat,le)-Lt<.006)return void(this._element.style.opacity=this._opacity);let xe=-this._offset.y/kt.transform._pixelPerMeter,Pe=Math.sin(kt.getPitch()*Math.PI/180)*xe,$e=kt.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),hr=kt.transform.lngLatToCameraDepth(this._lngLat,le+Pe)-$e>.006;!((xt=this._popup)===null||xt===void 0)&&xt.isOpen()&&hr&&this._popup.remove(),this._element.style.opacity=hr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(z){return this._offset=e.P.convert(z),this._update(),this}addClassName(z){this._element.classList.add(z)}removeClassName(z){this._element.classList.remove(z)}toggleClassName(z){return this._element.classList.toggle(z)}setDraggable(z){return this._draggable=!!z,this._map&&(z?(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(z){return this._rotation=z||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(z){return this._rotationAlignment=z||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(z){return this._pitchAlignment=z&&z!=="auto"?z:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(z,at){return z===void 0&&at===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),z!==void 0&&(this._opacity=z),at!==void 0&&(this._opacityWhenCovered=at),this._map&&this._updateOpacity(!0),this}}let Bu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Jl=0,Ru=!1,nl={maxWidth:100,unit:"metric"};function Nu(Pt,z,at){let xt=at&&at.maxWidth||100,kt=Pt._container.clientHeight/2,Lt=Pt.unproject([0,kt]),le=Pt.unproject([xt,kt]),xe=Lt.distanceTo(le);if(at&&at.unit==="imperial"){let Pe=3.2808*xe;Pe>5280?Ui(z,xt,Pe/5280,Pt._getUIString("ScaleControl.Miles")):Ui(z,xt,Pe,Pt._getUIString("ScaleControl.Feet"))}else at&&at.unit==="nautical"?Ui(z,xt,xe/1852,Pt._getUIString("ScaleControl.NauticalMiles")):xe>=1e3?Ui(z,xt,xe/1e3,Pt._getUIString("ScaleControl.Kilometers")):Ui(z,xt,xe,Pt._getUIString("ScaleControl.Meters"))}function Ui(Pt,z,at,xt){let kt=function(Lt){let le=Math.pow(10,`${Math.floor(Lt)}`.length-1),xe=Lt/le;return xe=xe>=10?10:xe>=5?5:xe>=3?3:xe>=2?2:xe>=1?1:function(Pe){let $e=Math.pow(10,Math.ceil(-Math.log(Pe)/Math.LN10));return Math.round(Pe*$e)/$e}(xe),le*xe}(at);Pt.style.width=z*(kt/at)+"px",Pt.innerHTML=`${kt}&nbsp;${xt}`}let fo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Ql=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ul(Pt){if(Pt){if(typeof Pt=="number"){let z=Math.round(Math.abs(Pt)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,Pt),"top-left":new e.P(z,z),"top-right":new e.P(-z,z),bottom:new e.P(0,-Pt),"bottom-left":new e.P(z,-z),"bottom-right":new e.P(-z,-z),left:new e.P(Pt,0),right:new e.P(-Pt,0)}}if(Pt instanceof e.P||Array.isArray(Pt)){let z=e.P.convert(Pt);return{center:z,top:z,"top-left":z,"top-right":z,bottom:z,"bottom-left":z,"bottom-right":z,left:z,right:z}}return{center:e.P.convert(Pt.center||[0,0]),top:e.P.convert(Pt.top||[0,0]),"top-left":e.P.convert(Pt["top-left"]||[0,0]),"top-right":e.P.convert(Pt["top-right"]||[0,0]),bottom:e.P.convert(Pt.bottom||[0,0]),"bottom-left":e.P.convert(Pt["bottom-left"]||[0,0]),"bottom-right":e.P.convert(Pt["bottom-right"]||[0,0]),left:e.P.convert(Pt.left||[0,0]),right:e.P.convert(Pt.right||[0,0])}}return ul(new e.P(0,0))}let Dc=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=Xi,t.BoxZoomHandler=Xl,t.CanvasSource=te,t.CooperativeGesturesHandler=Ba,t.DoubleClickZoomHandler=Pn,t.DragPanHandler=Ua,t.DragRotateHandler=Ya,t.EdgeInsets=Rl,t.FullscreenControl=class extends e.E{constructor(Pt={}){super(),this._onFullscreenChange=()=>{var z;let at=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((z=at?.shadowRoot)===null||z===void 0)&&z.fullscreenElement;)at=at.shadowRoot.fullscreenElement;at===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Pt&&Pt.container&&(Pt.container instanceof HTMLElement?this._container=Pt.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(Pt){return this._map=Pt,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 Pt=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Pt).setAttribute("aria-hidden","true"),Pt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Pt=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Pt),this._fullscreenButton.title=Pt}_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=Ct,t.GeolocateControl=class extends e.E{constructor(Pt){super(),this._onSuccess=z=>{if(this._map){if(this._isOutOfMapMaxBounds(z))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",z)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=z,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(z),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(z),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",z)),this._finish()}},this._updateCamera=z=>{let at=new e.N(z.coords.longitude,z.coords.latitude),xt=z.coords.accuracy,kt=this._map.getBearing(),Lt=e.e({bearing:kt},this.options.fitBoundsOptions),le=nt.fromLngLat(at,xt);this._map.fitBounds(le,Lt,{geolocateSource:!0})},this._updateMarker=z=>{if(z){let at=new e.N(z.coords.longitude,z.coords.latitude);this._accuracyCircleMarker.setLngLat(at).addTo(this._map),this._userLocationDotMarker.setLngLat(at).addTo(this._map),this._accuracy=z.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=z=>{if(this._map){if(this.options.trackUserLocation)if(z.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(z.code===3&&Ru)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",z)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",z=>z.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=z=>{if(this._map){if(z===!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 jl({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new jl({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({},Bu,Pt)}onAdd(Pt){return this._map=Pt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(z=!1){if(ws!==void 0&&!z)return ws;if(window.navigator.permissions===void 0)return ws=!!window.navigator.geolocation,ws;try{ws=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ws=!!window.navigator.geolocation}return ws})}().then(z=>this._finishSetupUI(z)),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,Jl=0,Ru=!1}_isOutOfMapMaxBounds(Pt){let z=this._map.getMaxBounds(),at=Pt.coords;return z&&(at.longitude<z.getWest()||at.longitude>z.getEast()||at.latitude<z.getSouth()||at.latitude>z.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 Pt=this._map.getBounds(),z=Pt.getSouthEast(),at=Pt.getNorthEast(),xt=z.distanceTo(at),kt=Math.ceil(this._accuracy/(xt/this._map._container.clientHeight)*2);this._circleElement.style.width=`${kt}px`,this._circleElement.style.height=`${kt}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":Jl--,Ru=!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 Pt;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Jl++,Jl>1?(Pt={maximumAge:6e5,timeout:0},Ru=!0):(Pt=this.options.positionOptions,Ru=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Pt)}}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=Tu,t.ImageSource=ee,t.KeyboardHandler=yr,t.LngLatBounds=nt,t.LogoControl=ni,t.Map=class extends Oi{constructor(Pt){e.bf.mark(e.bg.create);let z=Object.assign(Object.assign({},el),Pt);if(z.minZoom!=null&&z.maxZoom!=null&&z.minZoom>z.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(z.minPitch!=null&&z.maxPitch!=null&&z.minPitch>z.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(z.minPitch!=null&&z.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(z.maxPitch!=null&&z.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ws(z.minZoom,z.maxZoom,z.minPitch,z.maxPitch,z.renderWorldCopies),{bearingSnap:z.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Za,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=z.interactive,this._maxTileCacheSize=z.maxTileCacheSize,this._maxTileCacheZoomLevels=z.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=z.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=z.preserveDrawingBuffer===!0,this._antialias=z.antialias===!0,this._trackResize=z.trackResize===!0,this._bearingSnap=z.bearingSnap,this._refreshExpiredTiles=z.refreshExpiredTiles===!0,this._fadeDuration=z.fadeDuration,this._crossSourceCollisions=z.crossSourceCollisions===!0,this._collectResourceTiming=z.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Yo),z.locale),this._clickTolerance=z.clickTolerance,this._overridePixelRatio=z.pixelRatio,this._maxCanvasSize=z.maxCanvasSize,this.transformCameraUpdate=z.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=z.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new x(z.transformRequest),typeof z.container=="string"){if(this._container=document.getElementById(z.container),!this._container)throw new Error(`Container '${z.container}' not found.`)}else{if(!(z.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=z.container}if(z.maxBounds&&this.setMaxBounds(z.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,xt=ac(kt=>{this._trackResize&&!this._removed&&(this.resize(kt),this.redraw())},50);this._resizeObserver=new ResizeObserver(kt=>{at?xt(kt):at=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Vi(this,z),this._hash=z.hash&&new Tu(typeof z.hash=="string"&&z.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:z.center,zoom:z.zoom,bearing:z.bearing,pitch:z.pitch}),z.bounds&&(this.resize(),this.fitBounds(z.bounds,e.e({},z.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=z.localIdeographFontFamily,this._validateStyle=z.validateStyle,z.style&&this.setStyle(z.style,{localIdeographFontFamily:z.localIdeographFontFamily}),z.attributionControl&&this.addControl(new Xi(typeof z.attributionControl=="boolean"?void 0:z.attributionControl)),z.maplibreLogo&&this.addControl(new ni,z.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(Pt,z){if(z===void 0&&(z=Pt.getDefaultPosition?Pt.getDefaultPosition():"top-right"),!Pt||!Pt.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=Pt.onAdd(this);this._controls.push(Pt);let xt=this._controlPositions[z];return z.indexOf("bottom")!==-1?xt.insertBefore(at,xt.firstChild):xt.appendChild(at),this}removeControl(Pt){if(!Pt||!Pt.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 z=this._controls.indexOf(Pt);return z>-1&&this._controls.splice(z,1),Pt.onRemove(this),this}hasControl(Pt){return this._controls.indexOf(Pt)>-1}calculateCameraOptionsFromTo(Pt,z,at,xt){return xt==null&&this.terrain&&(xt=this.terrain.getElevationForLngLatZoom(at,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Pt,z,at,xt)}resize(Pt){var z;let at=this._containerDimensions(),xt=at[0],kt=at[1],Lt=this._getClampedPixelRatio(xt,kt);if(this._resizeCanvas(xt,kt,Lt),this.painter.resize(xt,kt,Lt),this.painter.overLimit()){let xe=this.painter.context.gl;this._maxCanvasSize=[xe.drawingBufferWidth,xe.drawingBufferHeight];let Pe=this._getClampedPixelRatio(xt,kt);this._resizeCanvas(xt,kt,Pe),this.painter.resize(xt,kt,Pe)}this.transform.resize(xt,kt),(z=this._requestedCameraState)===null||z===void 0||z.resize(xt,kt);let le=!this._moving;return le&&(this.stop(),this.fire(new e.k("movestart",Pt)).fire(new e.k("move",Pt))),this.fire(new e.k("resize",Pt)),le&&this.fire(new e.k("moveend",Pt)),this}_getClampedPixelRatio(Pt,z){let{0:at,1:xt}=this._maxCanvasSize,kt=this.getPixelRatio(),Lt=Pt*kt,le=z*kt;return Math.min(Lt>at?at/Lt:1,le>xt?xt/le:1)*kt}getPixelRatio(){var Pt;return(Pt=this._overridePixelRatio)!==null&&Pt!==void 0?Pt:devicePixelRatio}setPixelRatio(Pt){this._overridePixelRatio=Pt,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Pt){return this.transform.setMaxBounds(nt.convert(Pt)),this._update()}setMinZoom(Pt){if((Pt=Pt??-2)>=-2&&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 -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(Pt){if((Pt=Pt??22)>=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")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Pt){if((Pt=Pt??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Pt>=0&&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 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(Pt){if((Pt=Pt??60)>85)throw new Error("maxPitch must be less than or equal to 85");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")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Pt){return this.transform.renderWorldCopies=Pt,this._update()}project(Pt){return this.transform.locationPoint(e.N.convert(Pt),this.style&&this.terrain)}unproject(Pt){return this.transform.pointLocation(e.P.convert(Pt),this.terrain)}isMoving(){var Pt;return this._moving||((Pt=this.handlers)===null||Pt===void 0?void 0:Pt.isMoving())}isZooming(){var Pt;return this._zooming||((Pt=this.handlers)===null||Pt===void 0?void 0:Pt.isZooming())}isRotating(){var Pt;return this._rotating||((Pt=this.handlers)===null||Pt===void 0?void 0:Pt.isRotating())}_createDelegatedListener(Pt,z,at){if(Pt==="mouseenter"||Pt==="mouseover"){let xt=!1;return{layers:z,listener:at,delegates:{mousemove:kt=>{let Lt=z.filter(xe=>this.getLayer(xe)),le=Lt.length!==0?this.queryRenderedFeatures(kt.point,{layers:Lt}):[];le.length?xt||(xt=!0,at.call(this,new iu(Pt,this,kt.originalEvent,{features:le}))):xt=!1},mouseout:()=>{xt=!1}}}}if(Pt==="mouseleave"||Pt==="mouseout"){let xt=!1;return{layers:z,listener:at,delegates:{mousemove:kt=>{let Lt=z.filter(le=>this.getLayer(le));(Lt.length!==0?this.queryRenderedFeatures(kt.point,{layers:Lt}):[]).length?xt=!0:xt&&(xt=!1,at.call(this,new iu(Pt,this,kt.originalEvent)))},mouseout:kt=>{xt&&(xt=!1,at.call(this,new iu(Pt,this,kt.originalEvent)))}}}}{let xt=kt=>{let Lt=z.filter(xe=>this.getLayer(xe)),le=Lt.length!==0?this.queryRenderedFeatures(kt.point,{layers:Lt}):[];le.length&&(kt.features=le,at.call(this,kt),delete kt.features)};return{layers:z,listener:at,delegates:{[Pt]:xt}}}}_saveDelegatedListener(Pt,z){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Pt]=this._delegatedListeners[Pt]||[],this._delegatedListeners[Pt].push(z)}_removeDelegatedListener(Pt,z,at){if(!this._delegatedListeners||!this._delegatedListeners[Pt])return;let xt=this._delegatedListeners[Pt];for(let kt=0;kt<xt.length;kt++){let Lt=xt[kt];if(Lt.listener===at&&Lt.layers.length===z.length&&Lt.layers.every(le=>z.includes(le))){for(let le in Lt.delegates)this.off(le,Lt.delegates[le]);return void xt.splice(kt,1)}}}on(Pt,z,at){if(at===void 0)return super.on(Pt,z);let xt=this._createDelegatedListener(Pt,typeof z=="string"?[z]:z,at);this._saveDelegatedListener(Pt,xt);for(let kt in xt.delegates)this.on(kt,xt.delegates[kt]);return this}once(Pt,z,at){if(at===void 0)return super.once(Pt,z);let xt=typeof z=="string"?[z]:z,kt=this._createDelegatedListener(Pt,xt,at);for(let Lt in kt.delegates){let le=kt.delegates[Lt];kt.delegates[Lt]=(...xe)=>{this._removeDelegatedListener(Pt,xt,at),le(...xe)}}this._saveDelegatedListener(Pt,kt);for(let Lt in kt.delegates)this.once(Lt,kt.delegates[Lt]);return this}off(Pt,z,at){return at===void 0?super.off(Pt,z):(this._removeDelegatedListener(Pt,typeof z=="string"?[z]:z,at),this)}queryRenderedFeatures(Pt,z){if(!this.style)return[];let at,xt=Pt instanceof e.P||Array.isArray(Pt),kt=xt?Pt:[[0,0],[this.transform.width,this.transform.height]];if(z=z||(xt?{}:Pt)||{},kt instanceof e.P||typeof kt[0]=="number")at=[e.P.convert(kt)];else{let Lt=e.P.convert(kt[0]),le=e.P.convert(kt[1]);at=[Lt,new e.P(le.x,Lt.y),le,new e.P(Lt.x,le.y),Lt]}return this.style.queryRenderedFeatures(at,z,this.transform)}querySourceFeatures(Pt,z){return this.style.querySourceFeatures(Pt,z)}setStyle(Pt,z){return(z=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},z)).diff!==!1&&z.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Pt?(this._diffStyle(Pt,z),this):(this._localIdeographFontFamily=z.localIdeographFontFamily,this._updateStyle(Pt,z))}setTransformRequest(Pt){return this._requestManager.setTransformRequest(Pt),this}_getUIString(Pt){let z=this._locale[Pt];if(z==null)throw new Error(`Missing UI string '${Pt}'`);return z}_updateStyle(Pt,z){if(z.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Pt,z));let at=this.style&&z.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Pt)),Pt?(this.style=new kr(this,z||{}),this.style.setEventedParent(this,{style:this.style}),typeof Pt=="string"?this.style.loadURL(Pt,z,at):this.style.loadJSON(Pt,z,at),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new kr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Pt,z){if(typeof Pt=="string"){let at=this._requestManager.transformRequest(Pt,"Style");e.h(at,new AbortController).then(xt=>{this._updateDiff(xt.data,z)}).catch(xt=>{xt&&this.fire(new e.j(xt))})}else typeof Pt=="object"&&this._updateDiff(Pt,z)}_updateDiff(Pt,z){try{this.style.setState(Pt,z)&&this._update(!0)}catch(at){e.w(`Unable to perform style diff: ${at.message||at.error||at}. Rebuilding the style from scratch.`),this._updateStyle(Pt,z)}}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(Pt,z){return this._lazyInitEmptyStyle(),this.style.addSource(Pt,z),this._update(!0)}isSourceLoaded(Pt){let z=this.style&&this.style.sourceCaches[Pt];if(z!==void 0)return z.loaded();this.fire(new e.j(new Error(`There is no source with ID '${Pt}'`)))}setTerrain(Pt){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Pt){let z=this.style.sourceCaches[Pt.source];if(!z)throw new Error(`cannot load terrain, because there exists no source with ID: ${Pt.source}`);this.terrain===null&&z.reload();for(let at in this.style._layers){let xt=this.style._layers[at];xt.type==="hillshade"&&xt.source===Pt.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 ss(this.painter,z,Pt),this.painter.renderToTexture=new Os(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!==Pt.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:Pt})),this}getTerrain(){var Pt,z;return(z=(Pt=this.terrain)===null||Pt===void 0?void 0:Pt.options)!==null&&z!==void 0?z:null}areTilesLoaded(){let Pt=this.style&&this.style.sourceCaches;for(let z in Pt){let at=Pt[z]._tiles;for(let xt in at){let kt=at[xt];if(kt.state!=="loaded"&&kt.state!=="errored")return!1}}return!0}removeSource(Pt){return this.style.removeSource(Pt),this._update(!0)}getSource(Pt){return this.style.getSource(Pt)}addImage(Pt,z,at={}){let{pixelRatio:xt=1,sdf:kt=!1,stretchX:Lt,stretchY:le,content:xe,textFitWidth:Pe,textFitHeight:$e}=at;if(this._lazyInitEmptyStyle(),!(z instanceof HTMLImageElement||e.b(z))){if(z.width===void 0||z.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:hr,height:pr,data:Br}=z,Jr=z;return this.style.addImage(Pt,{data:new e.R({width:hr,height:pr},new Uint8Array(Br)),pixelRatio:xt,stretchX:Lt,stretchY:le,content:xe,textFitWidth:Pe,textFitHeight:$e,sdf:kt,version:0,userImage:Jr}),Jr.onAdd&&Jr.onAdd(this,Pt),this}}{let{width:hr,height:pr,data:Br}=o.getImageData(z);this.style.addImage(Pt,{data:new e.R({width:hr,height:pr},Br),pixelRatio:xt,stretchX:Lt,stretchY:le,content:xe,textFitWidth:Pe,textFitHeight:$e,sdf:kt,version:0})}}updateImage(Pt,z){let at=this.style.getImage(Pt);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 xt=z instanceof HTMLImageElement||e.b(z)?o.getImageData(z):z,{width:kt,height:Lt,data:le}=xt;if(kt===void 0||Lt===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(kt!==at.data.width||Lt!==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 xe=!(z instanceof HTMLImageElement||e.b(z));return at.data.replace(le,xe),this.style.updateImage(Pt,at),this}getImage(Pt){return this.style.getImage(Pt)}hasImage(Pt){return Pt?!!this.style.getImage(Pt):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(Pt){this.style.removeImage(Pt)}loadImage(Pt){return l.getImage(this._requestManager.transformRequest(Pt,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Pt,z){return this._lazyInitEmptyStyle(),this.style.addLayer(Pt,z),this._update(!0)}moveLayer(Pt,z){return this.style.moveLayer(Pt,z),this._update(!0)}removeLayer(Pt){return this.style.removeLayer(Pt),this._update(!0)}getLayer(Pt){return this.style.getLayer(Pt)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Pt,z,at){return this.style.setLayerZoomRange(Pt,z,at),this._update(!0)}setFilter(Pt,z,at={}){return this.style.setFilter(Pt,z,at),this._update(!0)}getFilter(Pt){return this.style.getFilter(Pt)}setPaintProperty(Pt,z,at,xt={}){return this.style.setPaintProperty(Pt,z,at,xt),this._update(!0)}getPaintProperty(Pt,z){return this.style.getPaintProperty(Pt,z)}setLayoutProperty(Pt,z,at,xt={}){return this.style.setLayoutProperty(Pt,z,at,xt),this._update(!0)}getLayoutProperty(Pt,z){return this.style.getLayoutProperty(Pt,z)}setGlyphs(Pt,z={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Pt,z),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Pt,z,at={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Pt,z,at,xt=>{xt||this._update(!0)}),this}removeSprite(Pt){return this._lazyInitEmptyStyle(),this.style.removeSprite(Pt),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Pt,z={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Pt,z,at=>{at||this._update(!0)}),this}setLight(Pt,z={}){return this._lazyInitEmptyStyle(),this.style.setLight(Pt,z),this._update(!0)}getLight(){return this.style.getLight()}setSky(Pt){return this._lazyInitEmptyStyle(),this.style.setSky(Pt),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Pt,z){return this.style.setFeatureState(Pt,z),this._update()}removeFeatureState(Pt,z){return this.style.removeFeatureState(Pt,z),this._update()}getFeatureState(Pt){return this.style.getFeatureState(Pt)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Pt=0,z=0;return this._container&&(Pt=this._container.clientWidth||400,z=this._container.clientHeight||300),[Pt,z]}_setupContainer(){let Pt=this._container;Pt.classList.add("maplibregl-map");let z=this._canvasContainer=a.create("div","maplibregl-canvas-container",Pt);this._interactive&&z.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",z),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(),xt=this._getClampedPixelRatio(at[0],at[1]);this._resizeCanvas(at[0],at[1],xt);let kt=this._controlContainer=a.create("div","maplibregl-control-container",Pt),Lt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(le=>{Lt[le]=a.create("div",`maplibregl-ctrl-${le} `,kt)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Pt,z,at){this._canvas.width=Math.floor(at*Pt),this._canvas.height=Math.floor(at*z),this._canvas.style.width=`${Pt}px`,this._canvas.style.height=`${z}px`}_setupPainter(){let Pt={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},z=null;this._canvas.addEventListener("webglcontextcreationerror",xt=>{z={requestedAttributes:Pt},xt&&(z.statusMessage=xt.statusMessage,z.type=xt.type)},{once:!0});let at=this._canvas.getContext("webgl2",Pt)||this._canvas.getContext("webgl",Pt);if(!at){let xt="Failed to initialize WebGL";throw z?(z.message=xt,new Error(JSON.stringify(z))):new Error(xt)}this.painter=new Gu(at,this.transform),s.testSupport(at)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Pt){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Pt,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Pt){return this._update(),this._renderTaskQueue.add(Pt)}_cancelRenderFrame(Pt){this._renderTaskQueue.remove(Pt)}_render(Pt){let z=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Pt),this._removed)return;let at=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let kt=this.transform.zoom,Lt=o.now();this.style.zoomHistory.update(kt,Lt);let le=new e.z(kt,{now:Lt,fadeDuration:z,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),xe=le.crossFadingFactor();xe===1&&xe===this._crossFadingFactor||(at=!0,this._crossFadingFactor=xe),this.style.update(le)}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,z,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:z,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 xt=this._sourcesDirty||this._styleDirty||this._placementDirty;return xt||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||xt||(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 Pt;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),(Pt=this._resizeObserver)===null||Pt===void 0||Pt.disconnect();let z=this.painter.context.gl.getExtension("WEBGL_lose_context");z!=null&&z.loseContext&&z.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(Pt=>{e.bf.frame(Pt),this._frameRequest=null,this._render(Pt)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Pt){this._showTileBoundaries!==Pt&&(this._showTileBoundaries=Pt,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Pt){this._showPadding!==Pt&&(this._showPadding=Pt,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Pt){this._showCollisionBoxes!==Pt&&(this._showCollisionBoxes=Pt,Pt?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Pt){this._showOverdrawInspector!==Pt&&(this._showOverdrawInspector=Pt,this._update())}get repaint(){return!!this._repaint}set repaint(Pt){this._repaint!==Pt&&(this._repaint=Pt,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Pt){this._vertices=Pt,this._update()}get version(){return ll}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=iu,t.MapTouchEvent=sc,t.MapWheelEvent=Tc,t.Marker=jl,t.NavigationControl=class{constructor(Pt){this._updateZoomButtons=()=>{let z=this._map.getZoom(),at=z===this._map.getMaxZoom(),xt=z===this._map.getMinZoom();this._zoomInButton.disabled=at,this._zoomOutButton.disabled=xt,this._zoomInButton.setAttribute("aria-disabled",at.toString()),this._zoomOutButton.setAttribute("aria-disabled",xt.toString())},this._rotateCompassArrow=()=>{let z=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=z},this._setButtonTitle=(z,at)=>{let xt=this._map._getUIString(`NavigationControl.${at}`);z.title=xt,z.setAttribute("aria-label",xt)},this.options=e.e({},bi,Pt),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",z=>z.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",z=>this._map.zoomIn({},{originalEvent:z})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",z=>this._map.zoomOut({},{originalEvent:z})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",z=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:z}):this._map.resetNorth({},{originalEvent:z})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Pt){return this._map=Pt,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 so(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(Pt,z){let at=a.create("button",Pt,this._container);return at.type="button",at.addEventListener("click",z),at}},t.Popup=class extends e.E{constructor(Pt){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=z=>{this._update(z.point)},this._onMouseMove=z=>{this._update(z.point)},this._onDrag=z=>{this._update(z.point)},this._update=z=>{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 xe of this.options.className.split(" "))this._container.classList.add(xe);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?fs(this._lngLat,this._flatPos,this._map.transform):(at=this._lngLat)===null||at===void 0?void 0:at.wrap(),this._trackPointer&&!z)return;let xt=this._flatPos=this._pos=this._trackPointer&&z?z:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&z?z:this._map.transform.locationPoint(this._lngLat));let kt=this.options.anchor,Lt=ul(this.options.offset);if(!kt){let xe=this._container.offsetWidth,Pe=this._container.offsetHeight,$e;$e=xt.y+Lt.bottom.y<Pe?["top"]:xt.y>this._map.transform.height-Pe?["bottom"]:[],xt.x<xe/2?$e.push("left"):xt.x>this._map.transform.width-xe/2&&$e.push("right"),kt=$e.length===0?"bottom":$e.join("-")}let le=xt.add(Lt[kt]);this.options.subpixelPositioning||(le=le.round()),a.setTransform(this._container,`${Ll[kt]} translate(${le.x}px,${le.y}px)`),$l(this._container,kt,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(fo),Pt)}addTo(Pt){return this._map&&this.remove(),this._map=Pt,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(Pt){return this._lngLat=e.N.convert(Pt),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(Pt){return this.setDOMContent(document.createTextNode(Pt))}setHTML(Pt){let z=document.createDocumentFragment(),at=document.createElement("body"),xt;for(at.innerHTML=Pt;xt=at.firstChild,xt;)z.appendChild(xt);return this.setDOMContent(z)}getMaxWidth(){var Pt;return(Pt=this._container)===null||Pt===void 0?void 0:Pt.style.maxWidth}setMaxWidth(Pt){return this.options.maxWidth=Pt,this._update(),this}setDOMContent(Pt){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(Pt),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Pt){return this._container&&this._container.classList.add(Pt),this}removeClassName(Pt){return this._container&&this._container.classList.remove(Pt),this}setOffset(Pt){return this.options.offset=Pt,this._update(),this}toggleClassName(Pt){if(this._container)return this._container.classList.toggle(Pt)}setSubpixelPositioning(Pt){this.options.subpixelPositioning=Pt}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Pt=this._container.querySelector(Ql);Pt&&Pt.focus()}},t.RasterDEMTileSource=It,t.RasterTileSource=wt,t.ScaleControl=class{constructor(Pt){this._onMove=()=>{Nu(this._map,this._container,this.options)},this.setUnit=z=>{this.options.unit=z,Nu(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},nl),Pt)}getDefaultPosition(){return"bottom-left"}onAdd(Pt){return this._map=Pt,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Pt.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=mn,t.Style=kr,t.TerrainControl=class{constructor(Pt){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=Pt}onAdd(Pt){return this._map=Pt,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=Oc,t.TwoFingersTouchRotateHandler=lc,t.TwoFingersTouchZoomHandler=Cs,t.TwoFingersTouchZoomRotateHandler=va,t.VectorTileSource=Tt,t.VideoSource=Jt,t.addSourceType=(Pt,z)=>e._(void 0,void 0,void 0,function*(){if(mt(Pt))throw new Error(`A source type called "${Pt}" already exists.`);((at,xt)=>{Kt[at]=xt})(Pt,z)}),t.clearPrewarmedResources=function(){let Pt=et;Pt&&(Pt.isPreloaded()&&Pt.numActive()===1?(Pt.release(rt),et=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 re().getRTLTextPluginStatus()},t.getVersion=function(){return Dc},t.getWorkerCount=function(){return ct.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(Pt){return Q().broadcast("IS",Pt)},t.prewarm=function(){ot().acquire(rt)},t.setMaxParallelImageRequests=function(Pt){e.a.MAX_PARALLEL_IMAGE_REQUESTS=Pt},t.setRTLTextPlugin=function(Pt,z){return re().setRTLTextPlugin(Pt,z)},t.setWorkerCount=function(Pt){ct.workerCount=Pt},t.setWorkerUrl=function(Pt){e.a.WORKER_URL=Pt}});var A=u;return A})}),Az=Vt((Z,V)=>{var u=Xr(),d=Dl().sanitizeHTML,E=C5(),A=qd();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 f=a[s].id;if(typeof f=="string"&&f.indexOf(A.traceLayerPrefix)===0){o=f;break}}return o},e.updateLayer=function(o){var a=this.subplot,s=i(o),f=this.lookupBelow(),v=this.findFollowingMapLayerId(f);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=f},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 u.isPlainObject(a)||typeof a=="string"&&a.length>0}function i(o){var a={},s={};switch(o.type){case"circle":u.extendFlat(s,{"circle-radius":o.circle.radius,"circle-color":o.color,"circle-opacity":o.opacity});break;case"line":u.extendFlat(s,{"line-width":o.line.width,"line-color":o.color,"line-opacity":o.opacity,"line-dasharray":o.line.dash});break;case"fill":u.extendFlat(s,{"fill-color":o.color,"fill-outline-color":o.fill.outlinecolor,"fill-opacity":o.opacity});break;case"symbol":var f=o.symbol,v=E(f.textposition,f.iconsize);u.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":v.anchor,"text-offset":v.offset,"symbol-placement":f.placement}),u.extendFlat(s,{"icon-color":o.color,"text-color":f.textfont.color,"text-opacity":o.opacity});break;case"raster":u.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,f={type:a},v;return a==="geojson"?v="data":a==="vector"?v=typeof s=="string"?"url":"tiles":a==="raster"?(v="tiles",f.tileSize=256):a==="image"&&(v="url",f.coordinates=o.coordinates),f[v]=s,o.sourceattribution&&(f.attribution=d(o.sourceattribution)),f}V.exports=function(o,a,s){var f=new t(o,a);return f.update(s),f}}),Mz=Vt((Z,V)=>{var u=kz(),d=Xr(),E=jd(),A=ji(),t=yo(),e=ih(),r=hc(),i=Jh(),n=i.drawMode,o=i.selectMode,a=Sc().prepSelect,s=Sc().clearOutline,f=Sc().clearSelectionsCache,v=Sc().selectOnClick,g=qd(),m=Az();function w(M,T){this.id=T,this.gd=M;var c=M._fullLayout,h=M._context;this.container=c._glcontainer.node(),this.isStatic=h.staticPlot,this.uid=c._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(c),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=w.prototype;l.plot=function(M,T,c){var h=this,b;h.map?b=new Promise(function(_,P){h.updateMap(M,T,_,P)}):b=new Promise(function(_,P){h.createMap(M,T,_,P)}),c.push(b)},l.createMap=function(M,T,c,h){var b=this,_=T[b.id],P=b.styleObj=y(_.style),L=_.bounds,D=L?[[L.west,L.south],[L.east,L.north]]:null,B=b.map=new u.Map({container:b.div,style:P.style,center:k(_.center),zoom:_.zoom,bearing:_.bearing,pitch:_.pitch,maxBounds:D,interactive:!b.isStatic,preserveDrawingBuffer:b.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new u.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",b.rejectOnError(h),b.isStatic||b.initFx(M,T);var I=[];I.push(new Promise(function(F){B.once("load",F)})),I=I.concat(E.fetchTraceGeoData(M)),Promise.all(I).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.updateMap=function(M,T,c,h){var b=this,_=b.map,P=T[this.id];b.rejectOnError(h);var L=[],D=y(P.style);JSON.stringify(b.styleObj)!==JSON.stringify(D)&&(b.styleObj=D,_.setStyle(D.style),b.traceHash={},L.push(new Promise(function(B){_.once("styledata",B)}))),L=L.concat(E.fetchTraceGeoData(M)),Promise.all(L).then(function(){b.fillBelowLookup(M,T),b.updateData(M),b.updateLayout(T),b.resolveOnRender(c)}).catch(h)},l.fillBelowLookup=function(M,T){var c=T[this.id],h=c.layers,b,_,P=this.belowLookup={},L=!1;for(b=0;b<M.length;b++){var D=M[b][0].trace,B=D._module;typeof D.below=="string"?_=D.below:B.getBelow&&(_=B.getBelow(D,this)),_===""&&(L=!0),P["trace-"+D.uid]=_||""}for(b=0;b<h.length;b++){var R=h[b];typeof R.below=="string"?_=R.below:L?_="traces":_="",P["layout-"+b]=_}var I={},F,N;for(F in P)_=P[F],I[_]?I[_].push(F):I[_]=[F];for(_ in I){var j=I[_];if(j.length>1)for(b=0;b<j.length;b++)F=j[b],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 T=this.traceHash,c,h,b,_,P=M.slice().sort(function(I,F){return x[I[0].trace.type]-x[F[0].trace.type]});for(b=0;b<P.length;b++){var L=P[b];h=L[0].trace,c=T[h.uid];var D=!1;c&&(c.type===h.type?(c.update(L),D=!0):c.dispose()),!D&&h._module&&(T[h.uid]=h._module.plot(this,L))}var B=Object.keys(T);t:for(b=0;b<B.length;b++){var R=B[b];for(_=0;_<M.length;_++)if(h=M[_][0].trace,R===h.uid)continue t;c=T[R],c.dispose(),delete T[R]}},l.updateLayout=function(M){var T=this.map,c=M[this.id];!this.dragging&&!this.wheeling&&(T.setCenter(k(c.center)),T.setZoom(c.zoom),T.setBearing(c.bearing),T.setPitch(c.pitch)),this.updateLayers(M),this.updateFramework(M),this.updateFx(M),this.map.resize(),this.gd._context._scrollZoom.map?T.scrollZoom.enable():T.scrollZoom.disable()},l.resolveOnRender=function(M){var T=this.map;T.on("render",function c(){T.loaded()&&(T.off("render",c),setTimeout(M,10))})},l.rejectOnError=function(M){var T=this.map;function c(){M(new Error(g.mapOnErrorMsg))}T.once("error",c),T.once("style.error",c),T.once("source.error",c),T.once("tile.error",c),T.once("layer.error",c)},l.createFramework=function(M){var T=this,c=T.div=document.createElement("div");c.id=T.uid,c.style.position="absolute",T.container.appendChild(c),T.xaxis={_id:"x",c2p:function(h){return T.project(h).x}},T.yaxis={_id:"y",c2p:function(h){return T.project(h).y}},T.updateFramework(M),T.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},t.setConvert(T.mockAxis,M)},l.initFx=function(M,T){var c=this,h=c.gd,b=c.map;b.on("moveend",function(L){if(c.map){var D=h._fullLayout;if(L.originalEvent||c.wheeling){var B=D[c.id];A.call("_storeDirectGUIEdit",h.layout,D._preGUI,c.getViewEdits(B));var R=c.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,h.emit("plotly_relayout",c.getViewEditsWithDerived(R))}L.originalEvent&&L.originalEvent.type==="mouseup"?c.dragging=!1:c.wheeling&&(c.wheeling=!1),D&&D._rehover&&D._rehover()}}),b.on("wheel",function(){c.wheeling=!0}),b.on("mousemove",function(L){var D=c.div.getBoundingClientRect(),B=[L.originalEvent.offsetX,L.originalEvent.offsetY];L.target.getBoundingClientRect=function(){return D},c.xaxis.p2c=function(){return b.unproject(B).lng},c.yaxis.p2c=function(){return b.unproject(B).lat},h._fullLayout._rehover=function(){h._fullLayout._hoversubplot===c.id&&h._fullLayout[c.id]&&r.hover(h,L,c.id)},r.hover(h,L,c.id),h._fullLayout._hoversubplot=c.id});function _(){r.loneUnhover(T._hoverlayer)}b.on("dragstart",function(){c.dragging=!0,_()}),b.on("zoomstart",_),b.on("mouseout",function(){h._fullLayout._hoversubplot=null});function P(){var L=c.getView();h.emit("plotly_relayouting",c.getViewEditsWithDerived(L))}b.on("drag",P),b.on("zoom",P),b.on("dblclick",function(){var L=h._fullLayout[c.id];A.call("_storeDirectGUIEdit",h.layout,h._fullLayout._preGUI,c.getViewEdits(L));var D=c.viewInitial;b.setCenter(k(D.center)),b.setZoom(D.zoom),b.setBearing(D.bearing),b.setPitch(D.pitch);var B=c.getView();L._input.center=L.center=B.center,L._input.zoom=L.zoom=B.zoom,L._input.bearing=L.bearing=B.bearing,L._input.pitch=L.pitch=B.pitch,h.emit("plotly_doubleclick",null),h.emit("plotly_relayout",c.getViewEditsWithDerived(B))}),c.clearOutline=function(){f(c.dragOptions),s(c.dragOptions.gd)},c.onClickInPanFn=function(L){return function(D){var B=h._fullLayout.clickmode;B.indexOf("select")>-1&&v(D.originalEvent,h,[c.xaxis],[c.yaxis],c.id,L),B.indexOf("event")>-1&&r.click(h,D.originalEvent)}}},l.updateFx=function(M){var T=this,c=T.map,h=T.gd;if(T.isStatic)return;function b(D){var B=T.map.unproject(D);return[B.lng,B.lat]}var _=M.dragmode,P;P=function(D,B){if(B.isRect){var R=D.range={};R[T.id]=[b([B.xmin,B.ymin]),b([B.xmax,B.ymax])]}else{var I=D.lassoPoints={};I[T.id]=B.map(b)}};var L=T.dragOptions;T.dragOptions=d.extendDeep(L||{},{dragmode:M.dragmode,element:T.div,gd:h,plotinfo:{id:T.id,domain:M[T.id].domain,xaxis:T.xaxis,yaxis:T.yaxis,fillRangeItems:P},xaxes:[T.xaxis],yaxes:[T.yaxis],subplot:T.id}),c.off("click",T.onClickInPanHandler),o(_)||n(_)?(c.dragPan.disable(),c.on("zoomstart",T.clearOutline),T.dragOptions.prepFn=function(D,B,R){a(D,B,R,T.dragOptions,_)},e.init(T.dragOptions)):(c.dragPan.enable(),c.off("zoomstart",T.clearOutline),T.div.onmousedown=null,T.div.ontouchstart=null,T.div.removeEventListener("touchstart",T.div._ontouchstart),T.onClickInPanHandler=T.onClickInPanFn(T.dragOptions),c.on("click",T.onClickInPanHandler))},l.updateFramework=function(M){var T=M[this.id].domain,c=M._size,h=this.div.style;h.width=c.w*(T.x[1]-T.x[0])+"px",h.height=c.h*(T.y[1]-T.y[0])+"px",h.left=c.l+T.x[0]*c.w+"px",h.top=c.t+(1-T.y[1])*c.h+"px",this.xaxis._offset=c.l+T.x[0]*c.w,this.xaxis._length=c.w*(T.x[1]-T.x[0]),this.yaxis._offset=c.t+(1-T.y[1])*c.h,this.yaxis._length=c.h*(T.y[1]-T.y[0])},l.updateLayers=function(M){var T=M[this.id],c=T.layers,h=this.layerList,b;if(c.length!==h.length){for(b=0;b<h.length;b++)h[b].dispose();for(h=this.layerList=[],b=0;b<c.length;b++)h.push(m(this,b,c[b]))}else for(b=0;b<c.length;b++)h[b].update(c[b])},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,T,c){for(var h in c)this.map[T](M,h,c[h])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(M,T){var c=this.map;if(typeof T=="string"){if(T===""){c.addLayer(M,T);return}for(var h=this.getMapLayers(),b=0;b<h.length;b++)if(T===h[b].id){c.addLayer(M,T);return}d.warn(["Trying to add layer with *below* value",T,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}c.addLayer(M)},l.project=function(M){return this.map.project(new u.LngLat(M[0],M[1]))},l.getView=function(){var M=this.map,T=M.getCenter(),c=T.lng,h=T.lat,b={lon:c,lat:h},_=M.getCanvas(),P=parseInt(_.style.width),L=parseInt(_.style.height);return{center:b,zoom:M.getZoom(),bearing:M.getBearing(),pitch:M.getPitch(),_derived:{coordinates:[M.unproject([0,0]).toArray(),M.unproject([P,0]).toArray(),M.unproject([P,L]).toArray(),M.unproject([0,L]).toArray()]}}},l.getViewEdits=function(M){for(var T=this.id,c=["center","zoom","bearing","pitch"],h={},b=0;b<c.length;b++){var _=c[b];h[T+"."+_]=M[_]}return h},l.getViewEditsWithDerived=function(M){var T=this.id,c=this.getViewEdits(M);return c[T+"._derived"]=M._derived,c};function y(M){var T={};return d.isPlainObject(M)?(T.id=M.id,T.style=M):typeof M=="string"?(T.id=M,g.stylesMap[M]?T.style=g.stylesMap[M]:T.style=M):(T.id=g.styleValueDflt,T.style=S(g.styleValueDflt)),T.transition={duration:0,delay:0},T}function S(M){return g.styleUrlPrefix+M+"-"+g.styleUrlSuffix}function k(M){return[M.lon,M.lat]}V.exports=w}),Sz=Vt((Z,V)=>{var u=Xr(),d=zd(),E=Wf(),A=Ov();V.exports=function(r,i,n){d(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"),f=n("bounds.north");(o===void 0||a===void 0||s===void 0||f===void 0)&&delete i.bounds,E(r,i,{name:"layers",handleItemDefaults:e}),i._input=r}function e(r,i){function n(g,m){return u.coerce(r,i,A.layers,g,m)}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 f;s&&(f="raster");var v=n("type",f);s&&v!=="raster"&&(v=i.type="raster",u.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"),u.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}}),Yx=Vt(Z=>{var V=Xr(),u=V.strTranslate,d=V.strScale,E=If().getSubplotCalcData,A=Eh(),t=Ni(),e=Eo(),r=Dl(),i=Mz(),n="map";Z.name=n,Z.attr="subplot",Z.idRoot=n,Z.idRegex=Z.attrRegex=V.counterRegex(n),Z.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},Z.layoutAttributes=Ov(),Z.supplyLayoutDefaults=Sz(),Z.plot=function(o){for(var a=o._fullLayout,s=o.calcdata,f=a._subplots[n],v=0;v<f.length;v++){var g=f[v],m=E(s,n,g),w=a[g],l=w._subplot;l||(l=new i(o,g),a[g]._subplot=l),l.viewInitial||(l.viewInitial={center:V.extendFlat({},w.center),zoom:w.zoom,bearing:w.bearing,pitch:w.pitch}),l.plot(m,a,o._promises)}},Z.clean=function(o,a,s,f){for(var v=f._subplots[n]||[],g=0;g<v.length;g++){var m=v[g];!a[m]&&f[m]._subplot&&f[m]._subplot.destroy()}},Z.toSVG=function(o){for(var a=o._fullLayout,s=a._subplots[n],f=a._size,v=0;v<s.length;v++){var g=a[s[v]],m=g.domain,w=g._subplot,l=w.toImage("png"),x=a._glimages.append("svg:image");x.attr({xmlns:A.svg,"xlink:href":l,x:f.l+f.w*m.x[0],y:f.t+f.h*(1-m.y[1]),width:f.w*(m.x[1]-m.x[0]),height:f.h*(m.y[1]-m.y[0]),preserveAspectRatio:"none"});var y=t.select(g._subplot.div),S=y.select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),k=a._glimages.append("g"),M=k.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 T=e.bBox(M.node()),c=f.w*(m.x[1]-m.x[0]);if(T.width>c/2){var h=S.split("|").join("<br>");M.text(h).attr("data-unformatted",h).call(r.convertToTspans,o),T=e.bBox(M.node())}M.attr("transform",u(-3,-T.height+8)),k.insert("rect",".static-attribution").attr({x:-T.width-6,y:-T.height-3,width:T.width+6,height:T.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;T.width+6>c&&(b=c/(T.width+6));var _=[f.l+f.w*m.x[1],f.t+f.h*(1-m.y[0])];k.attr("transform",u(_[0],_[1])+d(b))}},Z.updateFx=function(o){for(var a=o._fullLayout,s=a._subplots[n],f=0;f<s.length;f++){var v=a[s[f]]._subplot;v.updateFx(a)}}}),Ez=Vt((Z,V)=>{V.exports={attributes:Zx(),supplyDefaults:xz(),colorbar:Gf(),formatLabels:L5(),calc:kx(),plot:bz(),hoverPoints:Kx().hoverPoints,eventData:wz(),selectPoints:Tz(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.update(d)}},moduleType:"trace",name:"scattermap",basePlotModule:Yx(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),zz=Vt((Z,V)=>{V.exports=Ez()}),I5=Vt((Z,V)=>{var u=qm(),d=Wl(),{hovertemplateAttrs:E,templatefallbackAttrs:A}=kl(),t=Tl(),e=So().extendFlat;V.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},u.featureidkey,{}),below:{valType:"string",editType:"plot"},text:u.text,hovertext:u.hovertext,marker:{line:{color:e({},u.marker.line.color,{editType:"plot"}),width:e({},u.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},u.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},u.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},u.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:u.hoverinfo,hovertemplate:E({},{keys:["properties"]}),hovertemplatefallback:A(),showlegend:e({},t.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),Lz=Vt((Z,V)=>{var u=Xr(),d=gf(),E=I5();V.exports=function(A,t,e,r){function i(f,v){return u.coerce(A,t,E,f,v)}var n=i("locations"),o=i("z"),a=i("geojson");if(!u.isArrayOrTypedArray(n)||!n.length||!u.isArrayOrTypedArray(o)||!o.length||!(typeof a=="string"&&a!==""||u.isPlainObject(a))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,o.length),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback");var s=i("marker.line.width");s&&i("marker.line.color"),i("marker.opacity"),d(A,t,r,i,{prefix:"",cLetter:"z"}),u.coerceSelectionMarkerOpacity(t,i)}}),P5=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=xu(),A=Eo(),t=Nd().makeBlank,e=jd();function r(n){var o=n[0].trace,a=o.visible===!0&&o._length!==0,s={layout:{visibility:"none"},paint:{}},f={layout:{visibility:"none"},paint:{}},v=o._opts={fill:s,line:f,geojson:t()};if(!a)return v;var g=e.extractTraceFeature(n);if(!g)return v;var m=E.makeColorScaleFuncFromTrace(o),w=o.marker,l=w.line||{},x;d.isArrayOrTypedArray(w.opacity)&&(x=function(b){var _=b.mo;return u(_)?+d.constrain(_,0,1):0});var y;d.isArrayOrTypedArray(l.color)&&(y=function(b){return b.mlc});var S;d.isArrayOrTypedArray(l.width)&&(S=function(b){return b.mlw});for(var k=0;k<n.length;k++){var M=n[k],T=M.fOut;if(T){var c=T.properties;c.fc=m(M.z),x&&(c.mo=x(M)),y&&(c.mlc=y(M)),S&&(c.mlw=S(M)),M.ct=c.ct,M._polygons=e.feature2polygons(T)}}var h=x?{type:"identity",property:"mo"}:w.opacity;return d.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":h}),d.extendFlat(f.paint,{"line-color":y?{type:"identity",property:"mlc"}:l.color,"line-width":S?{type:"identity",property:"mlw"}:l.width,"line-opacity":h}),s.layout.visibility="visible",f.layout.visibility="visible",v.geojson={type:"FeatureCollection",features:g},i(n),v}function i(n){var o=n[0].trace,a=o._opts,s;if(o.selectedpoints){for(var f=A.makeSelectedPointStyleFns(o),v=0;v<n.length;v++){var g=n[v];g.fOut&&(g.fOut.properties.mo2=f.selectedOpacityFn(g))}s={type:"identity",property:"mo2"}}else s=d.isArrayOrTypedArray(o.marker.opacity)?{type:"identity",property:"mo"}:o.marker.opacity;return d.extendFlat(a.fill.paint,{"fill-opacity":s}),d.extendFlat(a.line.paint,{"line-opacity":s}),a}V.exports={convert:r,convertOnSelect:i}}),Cz=Vt((Z,V)=>{var u=P5().convert,d=P5().convertOnSelect,E=qd().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(u(e)),e[0].trace._glTrace=this},t.updateOnSelect=function(e){this._update(d(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],f=a[1],v=e[s];r.setOptions(f,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&r.setOptions(f,"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],f=s[0],v=e[f];i.addLayer({type:f,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=u(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}}),Iz=Vt((Z,V)=>{V.exports={attributes:I5(),supplyDefaults:Lz(),colorbar:Ed(),calc:Ex(),plot:Cz(),hoverPoints:Lx(),eventData:Cx(),selectPoints:Ix(),styleOnSelect:function(u,d){if(d){var E=d[0].trace;E._glTrace.updateOnSelect(d)}},getBelow:function(u,d){for(var E=d.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:Yx(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}),Pz=Vt((Z,V)=>{V.exports=Iz()}),O5=Vt((Z,V)=>{var u=Wl(),{hovertemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=Tl(),t=Zx(),e=So().extendFlat;V.exports=e({lon:t.lon,lat:t.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:t.text,hovertext:t.hovertext,hoverinfo:e({},A.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:d(),hovertemplatefallback:E(),showlegend:e({},A.showlegend,{dflt:!1})},u("",{cLetter:"z",editTypeOverride:"calc"}))}),Oz=Vt((Z,V)=>{var u=Xr(),d=gf(),E=O5();V.exports=function(A,t,e,r){function i(s,f){return u.coerce(A,t,E,s,f)}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"),i("hovertemplatefallback"),d(A,t,r,i,{prefix:"",cLetter:"z"})}}),Dz=Vt((Z,V)=>{var u=Lo(),d=Xr().isArrayOrTypedArray,E=ks().BADNUM,A=ah(),t=Xr()._;V.exports=function(e,r){for(var i=r._length,n=new Array(i),o=r.z,a=d(o)&&o.length,s=0;s<i;s++){var f=n[s]={},v=r.lon[s],g=r.lat[s];if(f.lonlat=u(v)&&u(g)?[+v,+g]:[E,E],a){var m=o[s];f.z=u(m)?m: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}}),Fz=Vt((Z,V)=>{var u=Lo(),d=Xr(),E=Pi(),A=xu(),t=ks().BADNUM,e=Nd().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=[],f,v=i.z,g=i.radius,m=d.isArrayOrTypedArray(v)&&v.length,w=d.isArrayOrTypedArray(g);for(f=0;f<r.length;f++){var l=r[f],x=l.lonlat;if(x[0]!==t){var y={};if(m){var S=l.z;y.z=S!==t?S:0}w&&(y.r=u(g[f])&&g[f]>0?+g[f]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:y})}}var k=A.extractOpts(i),M=k.reversescale?A.flipScale(k.colorscale):k.colorscale,T=M[0][1],c=E.opacity(T)<1?T:E.addOpacity(T,0),h=["interpolate",["linear"],["heatmap-density"],0,c];for(f=1;f<M.length;f++)h.push(M[f][0],M[f][1]);var b=["interpolate",["linear"],["get","z"],k.min,0,k.max,1];return d.extendFlat(a.heatmap.paint,{"heatmap-weight":m?b:1/(k.max-k.min),"heatmap-color":h,"heatmap-radius":w?{type:"identity",property:"r"}:i.radius,"heatmap-opacity":i.opacity}),a.geojson={type:"FeatureCollection",features:s},a.heatmap.layout.visibility="visible",a}}),Bz=Vt((Z,V)=>{var u=Fz(),d=qd().traceLayerPrefix;function E(t,e){this.type="densitymap",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",d+e+"-heatmap"]],this.below=null}var A=E.prototype;A.update=function(t){var e=this.subplot,r=this.layerList,i=u(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],f=a[1],v=i[s];e.setOptions(f,"setLayoutProperty",v.layout),v.layout.visibility==="visible"&&e.setOptions(f,"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],f=t[s];r.addLayer({type:s,id:a[1],source:n,layout:f.layout,paint:f.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=u(e),a=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(n,{type:"geojson",data:o.geojson}),i._addLayers(o,a),i}}),Rz=Vt((Z,V)=>{var u=yo(),d=Kx().hoverPoints,E=Kx().getExtraText;V.exports=function(A,t,e){var r=d(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=u.tickText(s,s.c2l(a.z),"hover").text}return i.extraText=E(o,a,n[0].t.labels),[i]}}}),Nz=Vt((Z,V)=>{V.exports=function(u,d){return u.lon=d.lon,u.lat=d.lat,u.z=d.z,u}}),jz=Vt((Z,V)=>{V.exports={attributes:O5(),supplyDefaults:Oz(),colorbar:Ed(),formatLabels:L5(),calc:Dz(),plot:Bz(),hoverPoints:Rz(),eventData:Nz(),getBelow:function(u,d){for(var E=d.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:Yx(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}),Uz=Vt((Z,V)=>{V.exports=jz()}),D5=Vt((Z,V)=>{var u=yu(),d=Tl(),E=nf(),A=hm(),t=Vu().attributes,{hovertemplateAttrs:e,templatefallbackAttrs:r}=kl(),i=Wl(),n=cl().templatedArray,o=fc().descriptionOnlyNumbers,a=So().extendFlat,s=Cu().overrideAll;V.exports=s({hoverinfo:a({},d.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:o("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:u({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"]}),hovertemplatefallback:r(),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"]}),hovertemplatefallback:r(),colorscales:n("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:a(i().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Vz=Vt((Z,V)=>{var u=Xr(),d=D5(),E=Pi(),A=kf(),t=Vu().defaults,e=Og(),r=cl(),i=Wf();V.exports=function(o,a,s,f){function v(P,L){return u.coerce(o,a,d,P,L)}var g=u.extendDeep(f.hoverlabel,o.hoverlabel),m=o.node,w=r.newContainer(a,"node");function l(P,L){return u.coerce(m,w,d.node,P,L)}l("label"),l("groups"),l("x"),l("y"),l("pad"),l("thickness"),l("line.color"),l("line.width"),l("hoverinfo",o.hoverinfo),e(m,w,l,g),l("hovertemplate"),l("align");var x=f.colorway,y=function(P){return x[P%x.length]};l("color",w.label.map(function(P,L){return E.addOpacity(y(L),.8)})),l("customdata");var S=o.link||{},k=r.newContainer(a,"link");function M(P,L){return u.coerce(S,k,d.link,P,L)}M("label"),M("arrowlen"),M("source"),M("target"),M("value"),M("line.color"),M("line.width"),M("hoverinfo",o.hoverinfo),e(S,k,M,g),M("hovertemplate");var T=A(f.paper_bgcolor).getLuminance()<.333,c=T?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",h=M("color",c);function b(P){var L=A(P);if(!L.isValid())return P;var D=L.getAlpha();return D<=.8?L.setAlpha(D+.2):L=T?L.brighten():L.darken(),L.toRgbString()}M("hovercolor",Array.isArray(h)?h.map(b):b(h)),M("customdata"),i(S,k,{name:"colorscales",handleItemDefaults:n}),t(a,f,v),v("orientation"),v("valueformat"),v("valuesuffix");var _;w.x.length&&w.y.length&&(_="freeform"),v("arrangement",_),u.coerceFont(v,"textfont",f.font,{autoShadowDflt:!0}),a._length=null};function n(o,a){function s(f,v){return u.coerce(o,a,d.link.colorscales,f,v)}s("label"),s("cmin"),s("cmax"),s("colorscale")}}),F5=Vt((Z,V)=>{V.exports=u;function u(d){for(var E=d.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=[],f=[];function v(l){var x=[l],y=[l];for(A[l]=t[l]=a,e[l]=!0,a+=1;y.length>0;){l=y[y.length-1];var S=d[l];if(r[l]<S.length){for(var k=r[l];k<S.length;++k){var M=S[k];if(A[M]<0){A[M]=t[M]=a,e[M]=!0,a+=1,x.push(M),y.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]=k}else{if(t[l]===A[l]){for(var T=[],c=[],h=0,k=x.length-1;k>=0;--k){var b=x[k];if(e[b]=!1,T.push(b),c.push(n[b]),h+=n[b].length,i[b]=s.length,b===l){x.length=k;break}}s.push(T);for(var _=new Array(h),k=0;k<c.length;k++)for(var P=0;P<c[k].length;P++)_[--h]=c[k][P];f.push(_)}y.pop()}}}for(var o=0;o<E;++o)A[o]<0&&v(o);for(var g,o=0;o<f.length;o++){var m=f[o];if(m.length!==0){m.sort(function(x,y){return x-y}),g=[m[0]];for(var w=1;w<m.length;w++)m[w]!==m[w-1]&&g.push(m[w]);f[o]=g}}return{components:s,adjacencyList:f}}}),Hz=Vt((Z,V)=>{var u=F5(),d=Xr(),E=bp().wrap,A=d.isArrayOrTypedArray,t=d.isIndex,e=xu();function r(n){var o=n.node,a=n.link,s=[],f=A(a.color),v=A(a.hovercolor),g=A(a.customdata),m={},w={},l=a.colorscales.length,x;for(x=0;x<l;x++){var y=a.colorscales[x],S=e.extractScale(y,{cLetter:"c"}),k=e.makeColorScaleFunc(S);w[y.label]=k}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 T=M+1;n.node._count=T;var c,h=n.node.groups,b={};for(x=0;x<h.length;x++){var _=h[x];for(c=0;c<_.length;c++){var P=_[c],L=T+x;b.hasOwnProperty(P)?d.warn("Node "+P+" is already part of a group."):b[P]=L}}var D={source:[],target:[]};for(x=0;x<a.value.length;x++){var B=a.value[x],R=a.source[x],I=a.target[x];if(B>0&&t(R,T)&&t(I,T)&&!(b.hasOwnProperty(R)&&b.hasOwnProperty(I)&&b[R]===b[I])){b.hasOwnProperty(I)&&(I=b[I]),b.hasOwnProperty(R)&&(R=b[R]),R=+R,I=+I,m[R]=m[I]=!0;var F="";a.label&&a.label[x]&&(F=a.label[x]);var N=null;F&&w.hasOwnProperty(F)&&(N=w[F]),s.push({pointNumber:x,label:F,color:f?a.color[x]:a.color,hovercolor:v?a.hovercolor[x]:a.hovercolor,customdata:g?a.customdata[x]:a.customdata,concentrationscale:N,source:R,target:I,value:+B}),D.source.push(R),D.target.push(I)}}var j=T+h.length,G=A(o.color),rt=A(o.customdata),ct=[];for(x=0;x<j;x++)if(m[x]){var st=o.label[x];ct.push({group:x>T-1,childrenNodes:[],pointNumber:x,label:st,color:G?o.color[x]:o.color,customdata:rt?o.customdata[x]:o.customdata})}var et=!1;return i(j,D.source,D.target)&&(et=!0),{circular:et,links:s,nodes:ct,groups:h,groupLookup:b}}function i(n,o,a){for(var s=d.init2dArray(n,0),f=0;f<Math.min(o.length,a.length);f++)if(d.isIndex(o[f],n)&&d.isIndex(a[f],n)){if(o[f]===a[f])return!0;s[o[f]].push(a[f])}var v=u(s);return v.components.some(function(g){return g.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})}}),qz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.d3=u.d3||{}))})(Z,function(u){function d(T){var c=+this._x.call(null,T),h=+this._y.call(null,T);return E(this.cover(c,h),c,h,T)}function E(T,c,h,b){if(isNaN(c)||isNaN(h))return T;var _,P=T._root,L={data:b},D=T._x0,B=T._y0,R=T._x1,I=T._y1,F,N,j,G,rt,ct,st,et;if(!P)return T._root=L,T;for(;P.length;)if((rt=c>=(F=(D+R)/2))?D=F:R=F,(ct=h>=(N=(B+I)/2))?B=N:I=N,_=P,!(P=P[st=ct<<1|rt]))return _[st]=L,T;if(j=+T._x.call(null,P.data),G=+T._y.call(null,P.data),c===j&&h===G)return L.next=P,_?_[st]=L:T._root=L,T;do _=_?_[st]=new Array(4):T._root=new Array(4),(rt=c>=(F=(D+R)/2))?D=F:R=F,(ct=h>=(N=(B+I)/2))?B=N:I=N;while((st=ct<<1|rt)===(et=(G>=N)<<1|j>=F));return _[et]=P,_[st]=L,T}function A(T){var c,h,b=T.length,_,P,L=new Array(b),D=new Array(b),B=1/0,R=1/0,I=-1/0,F=-1/0;for(h=0;h<b;++h)isNaN(_=+this._x.call(null,c=T[h]))||isNaN(P=+this._y.call(null,c))||(L[h]=_,D[h]=P,_<B&&(B=_),_>I&&(I=_),P<R&&(R=P),P>F&&(F=P));if(B>I||R>F)return this;for(this.cover(B,R).cover(I,F),h=0;h<b;++h)E(this,L[h],D[h],T[h]);return this}function t(T,c){if(isNaN(T=+T)||isNaN(c=+c))return this;var h=this._x0,b=this._y0,_=this._x1,P=this._y1;if(isNaN(h))_=(h=Math.floor(T))+1,P=(b=Math.floor(c))+1;else{for(var L=_-h,D=this._root,B,R;h>T||T>=_||b>c||c>=P;)switch(R=(c<b)<<1|T<h,B=new Array(4),B[R]=D,D=B,L*=2,R){case 0:_=h+L,P=b+L;break;case 1:h=_-L,P=b+L;break;case 2:_=h+L,b=P-L;break;case 3:h=_-L,b=P-L;break}this._root&&this._root.length&&(this._root=D)}return this._x0=h,this._y0=b,this._x1=_,this._y1=P,this}function e(){var T=[];return this.visit(function(c){if(!c.length)do T.push(c.data);while(c=c.next)}),T}function r(T){return arguments.length?this.cover(+T[0][0],+T[0][1]).cover(+T[1][0],+T[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function i(T,c,h,b,_){this.node=T,this.x0=c,this.y0=h,this.x1=b,this.y1=_}function n(T,c,h){var b,_=this._x0,P=this._y0,L,D,B,R,I=this._x1,F=this._y1,N=[],j=this._root,G,rt;for(j&&N.push(new i(j,_,P,I,F)),h==null?h=1/0:(_=T-h,P=c-h,I=T+h,F=c+h,h*=h);G=N.pop();)if(!(!(j=G.node)||(L=G.x0)>I||(D=G.y0)>F||(B=G.x1)<_||(R=G.y1)<P))if(j.length){var ct=(L+B)/2,st=(D+R)/2;N.push(new i(j[3],ct,st,B,R),new i(j[2],L,st,ct,R),new i(j[1],ct,D,B,st),new i(j[0],L,D,ct,st)),(rt=(c>=st)<<1|T>=ct)&&(G=N[N.length-1],N[N.length-1]=N[N.length-1-rt],N[N.length-1-rt]=G)}else{var et=T-+this._x.call(null,j.data),K=c-+this._y.call(null,j.data),ot=et*et+K*K;if(ot<h){var X=Math.sqrt(h=ot);_=T-X,P=c-X,I=T+X,F=c+X,b=j.data}}return b}function o(T){if(isNaN(I=+this._x.call(null,T))||isNaN(F=+this._y.call(null,T)))return this;var c,h=this._root,b,_,P,L=this._x0,D=this._y0,B=this._x1,R=this._y1,I,F,N,j,G,rt,ct,st;if(!h)return this;if(h.length)for(;;){if((G=I>=(N=(L+B)/2))?L=N:B=N,(rt=F>=(j=(D+R)/2))?D=j:R=j,c=h,!(h=h[ct=rt<<1|G]))return this;if(!h.length)break;(c[ct+1&3]||c[ct+2&3]||c[ct+3&3])&&(b=c,st=ct)}for(;h.data!==T;)if(_=h,!(h=h.next))return this;return(P=h.next)&&delete h.next,_?(P?_.next=P:delete _.next,this):c?(P?c[ct]=P:delete c[ct],(h=c[0]||c[1]||c[2]||c[3])&&h===(c[3]||c[2]||c[1]||c[0])&&!h.length&&(b?b[st]=h:this._root=h),this):(this._root=P,this)}function a(T){for(var c=0,h=T.length;c<h;++c)this.remove(T[c]);return this}function s(){return this._root}function f(){var T=0;return this.visit(function(c){if(!c.length)do++T;while(c=c.next)}),T}function v(T){var c=[],h,b=this._root,_,P,L,D,B;for(b&&c.push(new i(b,this._x0,this._y0,this._x1,this._y1));h=c.pop();)if(!T(b=h.node,P=h.x0,L=h.y0,D=h.x1,B=h.y1)&&b.length){var R=(P+D)/2,I=(L+B)/2;(_=b[3])&&c.push(new i(_,R,I,D,B)),(_=b[2])&&c.push(new i(_,P,I,R,B)),(_=b[1])&&c.push(new i(_,R,L,D,I)),(_=b[0])&&c.push(new i(_,P,L,R,I))}return this}function g(T){var c=[],h=[],b;for(this._root&&c.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));b=c.pop();){var _=b.node;if(_.length){var P,L=b.x0,D=b.y0,B=b.x1,R=b.y1,I=(L+B)/2,F=(D+R)/2;(P=_[0])&&c.push(new i(P,L,D,I,F)),(P=_[1])&&c.push(new i(P,I,D,B,F)),(P=_[2])&&c.push(new i(P,L,F,I,R)),(P=_[3])&&c.push(new i(P,I,F,B,R))}h.push(b)}for(;b=h.pop();)T(b.node,b.x0,b.y0,b.x1,b.y1);return this}function m(T){return T[0]}function w(T){return arguments.length?(this._x=T,this):this._x}function l(T){return T[1]}function x(T){return arguments.length?(this._y=T,this):this._y}function y(T,c,h){var b=new S(c??m,h??l,NaN,NaN,NaN,NaN);return T==null?b:b.addAll(T)}function S(T,c,h,b,_,P){this._x=T,this._y=c,this._x0=h,this._y0=b,this._x1=_,this._y1=P,this._root=void 0}function k(T){for(var c={data:T.data},h=c;T=T.next;)h=h.next={data:T.data};return c}var M=y.prototype=S.prototype;M.copy=function(){var T=new S(this._x,this._y,this._x0,this._y0,this._x1,this._y1),c=this._root,h,b;if(!c)return T;if(!c.length)return T._root=k(c),T;for(h=[{source:c,target:T._root=new Array(4)}];c=h.pop();)for(var _=0;_<4;++_)(b=c.source[_])&&(b.length?h.push({source:b,target:c.target[_]=new Array(4)}):c.target[_]=k(b));return T},M.add=d,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=f,M.visit=v,M.visitAfter=g,M.x=w,M.y=x,u.quadtree=y,Object.defineProperty(u,"__esModule",{value:!0})})}),Xx=Vt((Z,V)=>{(function(u,d){d(typeof Z=="object"&&typeof V<"u"?Z:u.d3=u.d3||{})})(Z,function(u){var d="$";function E(){}E.prototype=A.prototype={constructor:E,has:function(m){return d+m in this},get:function(m){return this[d+m]},set:function(m,w){return this[d+m]=w,this},remove:function(m){var w=d+m;return w in this&&delete this[w]},clear:function(){for(var m in this)m[0]===d&&delete this[m]},keys:function(){var m=[];for(var w in this)w[0]===d&&m.push(w.slice(1));return m},values:function(){var m=[];for(var w in this)w[0]===d&&m.push(this[w]);return m},entries:function(){var m=[];for(var w in this)w[0]===d&&m.push({key:w.slice(1),value:this[w]});return m},size:function(){var m=0;for(var w in this)w[0]===d&&++m;return m},empty:function(){for(var m in this)if(m[0]===d)return!1;return!0},each:function(m){for(var w in this)w[0]===d&&m(this[w],w.slice(1),this)}};function A(m,w){var l=new E;if(m instanceof E)m.each(function(M,T){l.set(T,M)});else if(Array.isArray(m)){var x=-1,y=m.length,S;if(w==null)for(;++x<y;)l.set(x,m[x]);else for(;++x<y;)l.set(w(S=m[x],x,m),S)}else if(m)for(var k in m)l.set(k,m[k]);return l}function t(){var m=[],w=[],l,x,y;function S(M,T,c,h){if(T>=m.length)return l!=null&&M.sort(l),x!=null?x(M):M;for(var b=-1,_=M.length,P=m[T++],L,D,B=A(),R,I=c();++b<_;)(R=B.get(L=P(D=M[b])+""))?R.push(D):B.set(L,[D]);return B.each(function(F,N){h(I,N,S(F,T,c,h))}),I}function k(M,T){if(++T>m.length)return M;var c,h=w[T-1];return x!=null&&T>=m.length?c=M.entries():(c=[],M.each(function(b,_){c.push({key:_,values:k(b,T)})})),h!=null?c.sort(function(b,_){return h(b.key,_.key)}):c}return y={object:function(M){return S(M,0,e,r)},map:function(M){return S(M,0,i,n)},entries:function(M){return k(S(M,0,i,n),0)},key:function(M){return m.push(M),y},sortKeys:function(M){return w[m.length-1]=M,y},sortValues:function(M){return l=M,y},rollup:function(M){return x=M,y}}}function e(){return{}}function r(m,w,l){m[w]=l}function i(){return A()}function n(m,w,l){m.set(w,l)}function o(){}var a=A.prototype;o.prototype=s.prototype={constructor:o,has:a.has,add:function(m){return m+="",this[d+m]=m,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(m,w){var l=new o;if(m instanceof o)m.each(function(S){l.add(S)});else if(m){var x=-1,y=m.length;if(w==null)for(;++x<y;)l.add(m[x]);else for(;++x<y;)l.add(w(m[x],x,m))}return l}function f(m){var w=[];for(var l in m)w.push(l);return w}function v(m){var w=[];for(var l in m)w.push(m[l]);return w}function g(m){var w=[];for(var l in m)w.push({key:l,value:m[l]});return w}u.nest=t,u.set=s,u.map=A,u.keys=f,u.values=v,u.entries=g,Object.defineProperty(u,"__esModule",{value:!0})})}),Wz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.d3=u.d3||{}))})(Z,function(u){var d={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,f=-1,v=a.length;if(arguments.length<2){for(;++f<v;)if((s=(i=a[f]).type)&&(s=e(o[s],i.name)))return s;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++f<v;)if(s=(i=a[f]).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,f;a<s;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(f=this._[i],a=0,s=f.length;a<s;++a)f[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,f=a.length;s<f;++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]=d,i=i.slice(0,a).concat(i.slice(a+1));break}return o!=null&&i.push({name:n,value:o}),i}u.dispatch=E,Object.defineProperty(u,"__esModule",{value:!0})})}),Gz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.d3=u.d3||{}))})(Z,function(u){var d=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(T){setTimeout(T,17)};function f(){return n||(s(v),n=a.now()+o)}function v(){n=0}function g(){this._call=this._time=this._next=null}g.prototype=m.prototype={constructor:g,restart:function(T,c,h){if(typeof T!="function")throw new TypeError("callback is not a function");h=(h==null?f():+h)+(c==null?0:+c),!this._next&&r!==this&&(r?r._next=this:e=this,r=this),this._call=T,this._time=h,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};function m(T,c,h){var b=new g;return b.restart(T,c,h),b}function w(){f(),++d;for(var T=e,c;T;)(c=n-T._time)>=0&&T._call.call(null,c),T=T._next;--d}function l(){n=(i=a.now())+o,d=E=0;try{w()}finally{d=0,y(),n=0}}function x(){var T=a.now(),c=T-i;c>t&&(o-=c,i=T)}function y(){for(var T,c=e,h,b=1/0;c;)c._call?(b>c._time&&(b=c._time),T=c,c=c._next):(h=c._next,c._next=null,c=T?T._next=h:e=h);r=T,S(b)}function S(T){if(!d){E&&(E=clearTimeout(E));var c=T-n;c>24?(T<1/0&&(E=setTimeout(l,T-a.now()-o)),A&&(A=clearInterval(A))):(A||(i=a.now(),A=setInterval(x,t)),d=1,s(l))}}function k(T,c,h){var b=new g;return c=c==null?0:+c,b.restart(function(_){b.stop(),T(_+c)},c,h),b}function M(T,c,h){var b=new g,_=c;return c==null?(b.restart(T,c,h),b):(c=+c,h=h==null?f():+h,b.restart(function P(L){L+=_,b.restart(P,_+=c,h),T(L)},c,h),b)}u.interval=M,u.now=f,u.timeout=k,u.timer=m,u.timerFlush=w,Object.defineProperty(u,"__esModule",{value:!0})})}),Zz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,qz(),Xx(),Wz(),Gz()):d(u.d3=u.d3||{},u.d3,u.d3,u.d3,u.d3)})(Z,function(u,d,E,A,t){function e(T,c){var h;T==null&&(T=0),c==null&&(c=0);function b(){var _,P=h.length,L,D=0,B=0;for(_=0;_<P;++_)L=h[_],D+=L.x,B+=L.y;for(D=D/P-T,B=B/P-c,_=0;_<P;++_)L=h[_],L.x-=D,L.y-=B}return b.initialize=function(_){h=_},b.x=function(_){return arguments.length?(T=+_,b):T},b.y=function(_){return arguments.length?(c=+_,b):c},b}function r(T){return function(){return T}}function i(){return(Math.random()-.5)*1e-6}function n(T){return T.x+T.vx}function o(T){return T.y+T.vy}function a(T){var c,h,b=1,_=1;typeof T!="function"&&(T=r(T==null?1:+T));function P(){for(var B,R=c.length,I,F,N,j,G,rt,ct=0;ct<_;++ct)for(I=d.quadtree(c,n,o).visitAfter(L),B=0;B<R;++B)F=c[B],G=h[F.index],rt=G*G,N=F.x+F.vx,j=F.y+F.vy,I.visit(st);function st(et,K,ot,X,Q){var ut=et.data,J=et.r,q=G+J;if(ut){if(ut.index>F.index){var it=N-ut.x-ut.vx,nt=j-ut.y-ut.vy,dt=it*it+nt*nt;dt<q*q&&(it===0&&(it=i(),dt+=it*it),nt===0&&(nt=i(),dt+=nt*nt),dt=(q-(dt=Math.sqrt(dt)))/dt*b,F.vx+=(it*=dt)*(q=(J*=J)/(rt+J)),F.vy+=(nt*=dt)*q,ut.vx-=it*(q=1-q),ut.vy-=nt*q)}return}return K>N+q||X<N-q||ot>j+q||Q<j-q}}function L(B){if(B.data)return B.r=h[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 D(){if(c){var B,R=c.length,I;for(h=new Array(R),B=0;B<R;++B)I=c[B],h[I.index]=+T(I,B,c)}}return P.initialize=function(B){c=B,D()},P.iterations=function(B){return arguments.length?(_=+B,P):_},P.strength=function(B){return arguments.length?(b=+B,P):b},P.radius=function(B){return arguments.length?(T=typeof B=="function"?B:r(+B),D(),P):T},P}function s(T){return T.index}function f(T,c){var h=T.get(c);if(!h)throw new Error("missing: "+c);return h}function v(T){var c=s,h=I,b,_=r(30),P,L,D,B,R=1;T==null&&(T=[]);function I(rt){return 1/Math.min(D[rt.source.index],D[rt.target.index])}function F(rt){for(var ct=0,st=T.length;ct<R;++ct)for(var et=0,K,ot,X,Q,ut,J,q;et<st;++et)K=T[et],ot=K.source,X=K.target,Q=X.x+X.vx-ot.x-ot.vx||i(),ut=X.y+X.vy-ot.y-ot.vy||i(),J=Math.sqrt(Q*Q+ut*ut),J=(J-P[et])/J*rt*b[et],Q*=J,ut*=J,X.vx-=Q*(q=B[et]),X.vy-=ut*q,ot.vx+=Q*(q=1-q),ot.vy+=ut*q}function N(){if(L){var rt,ct=L.length,st=T.length,et=E.map(L,c),K;for(rt=0,D=new Array(ct);rt<st;++rt)K=T[rt],K.index=rt,typeof K.source!="object"&&(K.source=f(et,K.source)),typeof K.target!="object"&&(K.target=f(et,K.target)),D[K.source.index]=(D[K.source.index]||0)+1,D[K.target.index]=(D[K.target.index]||0)+1;for(rt=0,B=new Array(st);rt<st;++rt)K=T[rt],B[rt]=D[K.source.index]/(D[K.source.index]+D[K.target.index]);b=new Array(st),j(),P=new Array(st),G()}}function j(){if(L)for(var rt=0,ct=T.length;rt<ct;++rt)b[rt]=+h(T[rt],rt,T)}function G(){if(L)for(var rt=0,ct=T.length;rt<ct;++rt)P[rt]=+_(T[rt],rt,T)}return F.initialize=function(rt){L=rt,N()},F.links=function(rt){return arguments.length?(T=rt,N(),F):T},F.id=function(rt){return arguments.length?(c=rt,F):c},F.iterations=function(rt){return arguments.length?(R=+rt,F):R},F.strength=function(rt){return arguments.length?(h=typeof rt=="function"?rt:r(+rt),j(),F):h},F.distance=function(rt){return arguments.length?(_=typeof rt=="function"?rt:r(+rt),G(),F):_},F}function g(T){return T.x}function m(T){return T.y}var w=10,l=Math.PI*(3-Math.sqrt(5));function x(T){var c,h=1,b=.001,_=1-Math.pow(b,1/300),P=0,L=.6,D=E.map(),B=t.timer(I),R=A.dispatch("tick","end");T==null&&(T=[]);function I(){F(),R.call("tick",c),h<b&&(B.stop(),R.call("end",c))}function F(G){var rt,ct=T.length,st;G===void 0&&(G=1);for(var et=0;et<G;++et)for(h+=(P-h)*_,D.each(function(K){K(h)}),rt=0;rt<ct;++rt)st=T[rt],st.fx==null?st.x+=st.vx*=L:(st.x=st.fx,st.vx=0),st.fy==null?st.y+=st.vy*=L:(st.y=st.fy,st.vy=0);return c}function N(){for(var G=0,rt=T.length,ct;G<rt;++G){if(ct=T[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 st=w*Math.sqrt(G),et=G*l;ct.x=st*Math.cos(et),ct.y=st*Math.sin(et)}(isNaN(ct.vx)||isNaN(ct.vy))&&(ct.vx=ct.vy=0)}}function j(G){return G.initialize&&G.initialize(T),G}return N(),c={tick:F,restart:function(){return B.restart(I),c},stop:function(){return B.stop(),c},nodes:function(G){return arguments.length?(T=G,N(),D.each(j),c):T},alpha:function(G){return arguments.length?(h=+G,c):h},alphaMin:function(G){return arguments.length?(b=+G,c):b},alphaDecay:function(G){return arguments.length?(_=+G,c):+_},alphaTarget:function(G){return arguments.length?(P=+G,c):P},velocityDecay:function(G){return arguments.length?(L=1-G,c):1-L},force:function(G,rt){return arguments.length>1?(rt==null?D.remove(G):D.set(G,j(rt)),c):D.get(G)},find:function(G,rt,ct){var st=0,et=T.length,K,ot,X,Q,ut;for(ct==null?ct=1/0:ct*=ct,st=0;st<et;++st)Q=T[st],K=G-Q.x,ot=rt-Q.y,X=K*K+ot*ot,X<ct&&(ut=Q,ct=X);return ut},on:function(G,rt){return arguments.length>1?(R.on(G,rt),c):R.on(G)}}}function y(){var T,c,h,b=r(-30),_,P=1,L=1/0,D=.81;function B(N){var j,G=T.length,rt=d.quadtree(T,g,m).visitAfter(I);for(h=N,j=0;j<G;++j)c=T[j],rt.visit(F)}function R(){if(T){var N,j=T.length,G;for(_=new Array(j),N=0;N<j;++N)G=T[N],_[G.index]=+b(G,N,T)}}function I(N){var j=0,G,rt,ct=0,st,et,K;if(N.length){for(st=et=K=0;K<4;++K)(G=N[K])&&(rt=Math.abs(G.value))&&(j+=G.value,ct+=rt,st+=rt*G.x,et+=rt*G.y);N.x=st/ct,N.y=et/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-c.x,st=N.y-c.y,et=rt-j,K=ct*ct+st*st;if(et*et/D<K)return K<L&&(ct===0&&(ct=i(),K+=ct*ct),st===0&&(st=i(),K+=st*st),K<P&&(K=Math.sqrt(P*K)),c.vx+=ct*N.value*h/K,c.vy+=st*N.value*h/K),!0;if(!(N.length||K>=L)){(N.data!==c||N.next)&&(ct===0&&(ct=i(),K+=ct*ct),st===0&&(st=i(),K+=st*st),K<P&&(K=Math.sqrt(P*K)));do N.data!==c&&(et=_[N.data.index]*h/K,c.vx+=ct*et,c.vy+=st*et);while(N=N.next)}}return B.initialize=function(N){T=N,R()},B.strength=function(N){return arguments.length?(b=typeof N=="function"?N:r(+N),R(),B):b},B.distanceMin=function(N){return arguments.length?(P=N*N,B):Math.sqrt(P)},B.distanceMax=function(N){return arguments.length?(L=N*N,B):Math.sqrt(L)},B.theta=function(N){return arguments.length?(D=N*N,B):Math.sqrt(D)},B}function S(T,c,h){var b,_=r(.1),P,L;typeof T!="function"&&(T=r(+T)),c==null&&(c=0),h==null&&(h=0);function D(R){for(var I=0,F=b.length;I<F;++I){var N=b[I],j=N.x-c||1e-6,G=N.y-h||1e-6,rt=Math.sqrt(j*j+G*G),ct=(L[I]-rt)*P[I]*R/rt;N.vx+=j*ct,N.vy+=G*ct}}function B(){if(b){var R,I=b.length;for(P=new Array(I),L=new Array(I),R=0;R<I;++R)L[R]=+T(b[R],R,b),P[R]=isNaN(L[R])?0:+_(b[R],R,b)}}return D.initialize=function(R){b=R,B()},D.strength=function(R){return arguments.length?(_=typeof R=="function"?R:r(+R),B(),D):_},D.radius=function(R){return arguments.length?(T=typeof R=="function"?R:r(+R),B(),D):T},D.x=function(R){return arguments.length?(c=+R,D):c},D.y=function(R){return arguments.length?(h=+R,D):h},D}function k(T){var c=r(.1),h,b,_;typeof T!="function"&&(T=r(T==null?0:+T));function P(D){for(var B=0,R=h.length,I;B<R;++B)I=h[B],I.vx+=(_[B]-I.x)*b[B]*D}function L(){if(h){var D,B=h.length;for(b=new Array(B),_=new Array(B),D=0;D<B;++D)b[D]=isNaN(_[D]=+T(h[D],D,h))?0:+c(h[D],D,h)}}return P.initialize=function(D){h=D,L()},P.strength=function(D){return arguments.length?(c=typeof D=="function"?D:r(+D),L(),P):c},P.x=function(D){return arguments.length?(T=typeof D=="function"?D:r(+D),L(),P):T},P}function M(T){var c=r(.1),h,b,_;typeof T!="function"&&(T=r(T==null?0:+T));function P(D){for(var B=0,R=h.length,I;B<R;++B)I=h[B],I.vy+=(_[B]-I.y)*b[B]*D}function L(){if(h){var D,B=h.length;for(b=new Array(B),_=new Array(B),D=0;D<B;++D)b[D]=isNaN(_[D]=+T(h[D],D,h))?0:+c(h[D],D,h)}}return P.initialize=function(D){h=D,L()},P.strength=function(D){return arguments.length?(c=typeof D=="function"?D:r(+D),L(),P):c},P.y=function(D){return arguments.length?(T=typeof D=="function"?D:r(+D),L(),P):T},P}u.forceCenter=e,u.forceCollide=a,u.forceLink=v,u.forceManyBody=y,u.forceRadial=S,u.forceSimulation=x,u.forceX=k,u.forceY=M,Object.defineProperty(u,"__esModule",{value:!0})})}),Kz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z):(u=u||self,d(u.d3=u.d3||{}))})(Z,function(u){var d=Math.PI,E=2*d,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,f){this._+="C"+ +i+","+ +n+","+ +o+","+ +a+","+(this._x1=+s)+","+(this._y1=+f)},arcTo:function(i,n,o,a,s){i=+i,n=+n,o=+o,a=+a,s=+s;var f=this._x1,v=this._y1,g=o-i,m=a-n,w=f-i,l=v-n,x=w*w+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*g-m*w)>A)||!s)this._+="L"+(this._x1=i)+","+(this._y1=n);else{var y=o-f,S=a-v,k=g*g+m*m,M=y*y+S*S,T=Math.sqrt(k),c=Math.sqrt(x),h=s*Math.tan((d-Math.acos((k+x-M)/(2*T*c)))/2),b=h/c,_=h/T;Math.abs(b-1)>A&&(this._+="L"+(i+b*w)+","+(n+b*l)),this._+="A"+s+","+s+",0,0,"+ +(l*y>w*S)+","+(this._x1=i+_*g)+","+(this._y1=n+_*m)}},arc:function(i,n,o,a,s,f){i=+i,n=+n,o=+o,f=!!f;var v=o*Math.cos(a),g=o*Math.sin(a),m=i+v,w=n+g,l=1^f,x=f?a-s:s-a;if(o<0)throw new Error("negative radius: "+o);this._x1===null?this._+="M"+m+","+w:(Math.abs(this._x1-m)>A||Math.abs(this._y1-w)>A)&&(this._+="L"+m+","+w),o&&(x<0&&(x=x%E+E),x>t?this._+="A"+o+","+o+",0,1,"+l+","+(i-v)+","+(n-g)+"A"+o+","+o+",0,1,"+l+","+(this._x1=m)+","+(this._y1=w):x>A&&(this._+="A"+o+","+o+",0,"+ +(x>=d)+","+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._}},u.path=r,Object.defineProperty(u,"__esModule",{value:!0})})}),B5=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,Kz()):(u=u||self,d(u.d3=u.d3||{},u.d3))})(Z,function(u,d){function E(pe){return function(){return pe}}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,f=s/2,v=2*s;function g(pe){return pe>1?0:pe<-1?s:Math.acos(pe)}function m(pe){return pe>=1?f:pe<=-1?-f:Math.asin(pe)}function w(pe){return pe.innerRadius}function l(pe){return pe.outerRadius}function x(pe){return pe.startAngle}function y(pe){return pe.endAngle}function S(pe){return pe&&pe.padAngle}function k(pe,Ke,xr,Gr,ln,wn,rn,Qr){var vn=xr-pe,Oa=Gr-Ke,Qn=rn-ln,Qa=Qr-wn,Ja=Qa*vn-Qn*Oa;if(!(Ja*Ja<a))return Ja=(Qn*(Ke-wn)-Qa*(pe-ln))/Ja,[pe+Ja*vn,Ke+Ja*Oa]}function M(pe,Ke,xr,Gr,ln,wn,rn){var Qr=pe-xr,vn=Ke-Gr,Oa=(rn?wn:-wn)/o(Qr*Qr+vn*vn),Qn=Oa*vn,Qa=-Oa*Qr,Ja=pe+Qn,wi=Ke+Qa,ci=xr+Qn,Ti=Gr+Qa,Ra=(Ja+ci)/2,Qi=(wi+Ti)/2,Hi=ci-Ja,Ho=Ti-wi,Ci=Hi*Hi+Ho*Ho,zo=ln-wn,qi=Ja*Ti-ci*wi,qo=(Ho<0?-1:1)*o(r(0,zo*zo*Ci-qi*qi)),Po=(qi*Ho-Hi*qo)/Ci,hs=(-qi*Hi-Ho*qo)/Ci,Gi=(qi*Ho+Hi*qo)/Ci,uo=(-qi*Hi+Ho*qo)/Ci,yi=Po-Ra,ao=hs-Qi,ts=Gi-Ra,vs=uo-Qi;return yi*yi+ao*ao>ts*ts+vs*vs&&(Po=Gi,hs=uo),{cx:Po,cy:hs,x01:-Qn,y01:-Qa,x11:Po*(ln/zo-1),y11:hs*(ln/zo-1)}}function T(){var pe=w,Ke=l,xr=E(0),Gr=null,ln=x,wn=y,rn=S,Qr=null;function vn(){var Oa,Qn,Qa=+pe.apply(this,arguments),Ja=+Ke.apply(this,arguments),wi=ln.apply(this,arguments)-f,ci=wn.apply(this,arguments)-f,Ti=A(ci-wi),Ra=ci>wi;if(Qr||(Qr=Oa=d.path()),Ja<Qa&&(Qn=Ja,Ja=Qa,Qa=Qn),!(Ja>a))Qr.moveTo(0,0);else if(Ti>v-a)Qr.moveTo(Ja*e(wi),Ja*n(wi)),Qr.arc(0,0,Ja,wi,ci,!Ra),Qa>a&&(Qr.moveTo(Qa*e(ci),Qa*n(ci)),Qr.arc(0,0,Qa,ci,wi,Ra));else{var Qi=wi,Hi=ci,Ho=wi,Ci=ci,zo=Ti,qi=Ti,qo=rn.apply(this,arguments)/2,Po=qo>a&&(Gr?+Gr.apply(this,arguments):o(Qa*Qa+Ja*Ja)),hs=i(A(Ja-Qa)/2,+xr.apply(this,arguments)),Gi=hs,uo=hs,yi,ao;if(Po>a){var ts=m(Po/Qa*n(qo)),vs=m(Po/Ja*n(qo));(zo-=ts*2)>a?(ts*=Ra?1:-1,Ho+=ts,Ci-=ts):(zo=0,Ho=Ci=(wi+ci)/2),(qi-=vs*2)>a?(vs*=Ra?1:-1,Qi+=vs,Hi-=vs):(qi=0,Qi=Hi=(wi+ci)/2)}var As=Ja*e(Qi),_o=Ja*n(Qi),Da=Qa*e(Ci),li=Qa*n(Ci);if(hs>a){var wo=Ja*e(Hi),Ms=Ja*n(Hi),Di=Qa*e(Ho),_s=Qa*n(Ho),No;if(Ti<s&&(No=k(As,_o,Di,_s,wo,Ms,Da,li))){var is=As-No[0],al=_o-No[1],ii=wo-No[0],io=Ms-No[1],co=1/n(g((is*ii+al*io)/(o(is*is+al*al)*o(ii*ii+io*io)))/2),Is=o(No[0]*No[0]+No[1]*No[1]);Gi=i(hs,(Qa-Is)/(co-1)),uo=i(hs,(Ja-Is)/(co+1))}}qi>a?uo>a?(yi=M(Di,_s,As,_o,Ja,uo,Ra),ao=M(wo,Ms,Da,li,Ja,uo,Ra),Qr.moveTo(yi.cx+yi.x01,yi.cy+yi.y01),uo<hs?Qr.arc(yi.cx,yi.cy,uo,t(yi.y01,yi.x01),t(ao.y01,ao.x01),!Ra):(Qr.arc(yi.cx,yi.cy,uo,t(yi.y01,yi.x01),t(yi.y11,yi.x11),!Ra),Qr.arc(0,0,Ja,t(yi.cy+yi.y11,yi.cx+yi.x11),t(ao.cy+ao.y11,ao.cx+ao.x11),!Ra),Qr.arc(ao.cx,ao.cy,uo,t(ao.y11,ao.x11),t(ao.y01,ao.x01),!Ra))):(Qr.moveTo(As,_o),Qr.arc(0,0,Ja,Qi,Hi,!Ra)):Qr.moveTo(As,_o),!(Qa>a)||!(zo>a)?Qr.lineTo(Da,li):Gi>a?(yi=M(Da,li,wo,Ms,Qa,-Gi,Ra),ao=M(As,_o,Di,_s,Qa,-Gi,Ra),Qr.lineTo(yi.cx+yi.x01,yi.cy+yi.y01),Gi<hs?Qr.arc(yi.cx,yi.cy,Gi,t(yi.y01,yi.x01),t(ao.y01,ao.x01),!Ra):(Qr.arc(yi.cx,yi.cy,Gi,t(yi.y01,yi.x01),t(yi.y11,yi.x11),!Ra),Qr.arc(0,0,Qa,t(yi.cy+yi.y11,yi.cx+yi.x11),t(ao.cy+ao.y11,ao.cx+ao.x11),Ra),Qr.arc(ao.cx,ao.cy,Gi,t(ao.y11,ao.x11),t(ao.y01,ao.x01),!Ra))):Qr.arc(0,0,Qa,Ci,Ho,Ra)}if(Qr.closePath(),Oa)return Qr=null,Oa+""||null}return vn.centroid=function(){var Oa=(+pe.apply(this,arguments)+ +Ke.apply(this,arguments))/2,Qn=(+ln.apply(this,arguments)+ +wn.apply(this,arguments))/2-s/2;return[e(Qn)*Oa,n(Qn)*Oa]},vn.innerRadius=function(Oa){return arguments.length?(pe=typeof Oa=="function"?Oa:E(+Oa),vn):pe},vn.outerRadius=function(Oa){return arguments.length?(Ke=typeof Oa=="function"?Oa:E(+Oa),vn):Ke},vn.cornerRadius=function(Oa){return arguments.length?(xr=typeof Oa=="function"?Oa:E(+Oa),vn):xr},vn.padRadius=function(Oa){return arguments.length?(Gr=Oa==null?null:typeof Oa=="function"?Oa:E(+Oa),vn):Gr},vn.startAngle=function(Oa){return arguments.length?(ln=typeof Oa=="function"?Oa:E(+Oa),vn):ln},vn.endAngle=function(Oa){return arguments.length?(wn=typeof Oa=="function"?Oa:E(+Oa),vn):wn},vn.padAngle=function(Oa){return arguments.length?(rn=typeof Oa=="function"?Oa:E(+Oa),vn):rn},vn.context=function(Oa){return arguments.length?(Qr=Oa??null,vn):Qr},vn}function c(pe){this._context=pe}c.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(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;default:this._context.lineTo(pe,Ke);break}}};function h(pe){return new c(pe)}function b(pe){return pe[0]}function _(pe){return pe[1]}function P(){var pe=b,Ke=_,xr=E(!0),Gr=null,ln=h,wn=null;function rn(Qr){var vn,Oa=Qr.length,Qn,Qa=!1,Ja;for(Gr==null&&(wn=ln(Ja=d.path())),vn=0;vn<=Oa;++vn)!(vn<Oa&&xr(Qn=Qr[vn],vn,Qr))===Qa&&((Qa=!Qa)?wn.lineStart():wn.lineEnd()),Qa&&wn.point(+pe(Qn,vn,Qr),+Ke(Qn,vn,Qr));if(Ja)return wn=null,Ja+""||null}return rn.x=function(Qr){return arguments.length?(pe=typeof Qr=="function"?Qr:E(+Qr),rn):pe},rn.y=function(Qr){return arguments.length?(Ke=typeof Qr=="function"?Qr:E(+Qr),rn):Ke},rn.defined=function(Qr){return arguments.length?(xr=typeof Qr=="function"?Qr:E(!!Qr),rn):xr},rn.curve=function(Qr){return arguments.length?(ln=Qr,Gr!=null&&(wn=ln(Gr)),rn):ln},rn.context=function(Qr){return arguments.length?(Qr==null?Gr=wn=null:wn=ln(Gr=Qr),rn):Gr},rn}function L(){var pe=b,Ke=null,xr=E(0),Gr=_,ln=E(!0),wn=null,rn=h,Qr=null;function vn(Qn){var Qa,Ja,wi,ci=Qn.length,Ti,Ra=!1,Qi,Hi=new Array(ci),Ho=new Array(ci);for(wn==null&&(Qr=rn(Qi=d.path())),Qa=0;Qa<=ci;++Qa){if(!(Qa<ci&&ln(Ti=Qn[Qa],Qa,Qn))===Ra)if(Ra=!Ra)Ja=Qa,Qr.areaStart(),Qr.lineStart();else{for(Qr.lineEnd(),Qr.lineStart(),wi=Qa-1;wi>=Ja;--wi)Qr.point(Hi[wi],Ho[wi]);Qr.lineEnd(),Qr.areaEnd()}Ra&&(Hi[Qa]=+pe(Ti,Qa,Qn),Ho[Qa]=+xr(Ti,Qa,Qn),Qr.point(Ke?+Ke(Ti,Qa,Qn):Hi[Qa],Gr?+Gr(Ti,Qa,Qn):Ho[Qa]))}if(Qi)return Qr=null,Qi+""||null}function Oa(){return P().defined(ln).curve(rn).context(wn)}return vn.x=function(Qn){return arguments.length?(pe=typeof Qn=="function"?Qn:E(+Qn),Ke=null,vn):pe},vn.x0=function(Qn){return arguments.length?(pe=typeof Qn=="function"?Qn:E(+Qn),vn):pe},vn.x1=function(Qn){return arguments.length?(Ke=Qn==null?null:typeof Qn=="function"?Qn:E(+Qn),vn):Ke},vn.y=function(Qn){return arguments.length?(xr=typeof Qn=="function"?Qn:E(+Qn),Gr=null,vn):xr},vn.y0=function(Qn){return arguments.length?(xr=typeof Qn=="function"?Qn:E(+Qn),vn):xr},vn.y1=function(Qn){return arguments.length?(Gr=Qn==null?null:typeof Qn=="function"?Qn:E(+Qn),vn):Gr},vn.lineX0=vn.lineY0=function(){return Oa().x(pe).y(xr)},vn.lineY1=function(){return Oa().x(pe).y(Gr)},vn.lineX1=function(){return Oa().x(Ke).y(xr)},vn.defined=function(Qn){return arguments.length?(ln=typeof Qn=="function"?Qn:E(!!Qn),vn):ln},vn.curve=function(Qn){return arguments.length?(rn=Qn,wn!=null&&(Qr=rn(wn)),vn):rn},vn.context=function(Qn){return arguments.length?(Qn==null?wn=Qr=null:Qr=rn(wn=Qn),vn):wn},vn}function D(pe,Ke){return Ke<pe?-1:Ke>pe?1:Ke>=pe?0:NaN}function B(pe){return pe}function R(){var pe=B,Ke=D,xr=null,Gr=E(0),ln=E(v),wn=E(0);function rn(Qr){var vn,Oa=Qr.length,Qn,Qa,Ja=0,wi=new Array(Oa),ci=new Array(Oa),Ti=+Gr.apply(this,arguments),Ra=Math.min(v,Math.max(-v,ln.apply(this,arguments)-Ti)),Qi,Hi=Math.min(Math.abs(Ra)/Oa,wn.apply(this,arguments)),Ho=Hi*(Ra<0?-1:1),Ci;for(vn=0;vn<Oa;++vn)(Ci=ci[wi[vn]=vn]=+pe(Qr[vn],vn,Qr))>0&&(Ja+=Ci);for(Ke!=null?wi.sort(function(zo,qi){return Ke(ci[zo],ci[qi])}):xr!=null&&wi.sort(function(zo,qi){return xr(Qr[zo],Qr[qi])}),vn=0,Qa=Ja?(Ra-Oa*Ho)/Ja:0;vn<Oa;++vn,Ti=Qi)Qn=wi[vn],Ci=ci[Qn],Qi=Ti+(Ci>0?Ci*Qa:0)+Ho,ci[Qn]={data:Qr[Qn],index:vn,value:Ci,startAngle:Ti,endAngle:Qi,padAngle:Hi};return ci}return rn.value=function(Qr){return arguments.length?(pe=typeof Qr=="function"?Qr:E(+Qr),rn):pe},rn.sortValues=function(Qr){return arguments.length?(Ke=Qr,xr=null,rn):Ke},rn.sort=function(Qr){return arguments.length?(xr=Qr,Ke=null,rn):xr},rn.startAngle=function(Qr){return arguments.length?(Gr=typeof Qr=="function"?Qr:E(+Qr),rn):Gr},rn.endAngle=function(Qr){return arguments.length?(ln=typeof Qr=="function"?Qr:E(+Qr),rn):ln},rn.padAngle=function(Qr){return arguments.length?(wn=typeof Qr=="function"?Qr:E(+Qr),rn):wn},rn}var I=N(h);function F(pe){this._curve=pe}F.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(pe,Ke){this._curve.point(Ke*Math.sin(pe),Ke*-Math.cos(pe))}};function N(pe){function Ke(xr){return new F(pe(xr))}return Ke._curve=pe,Ke}function j(pe){var Ke=pe.curve;return pe.angle=pe.x,delete pe.x,pe.radius=pe.y,delete pe.y,pe.curve=function(xr){return arguments.length?Ke(N(xr)):Ke()._curve},pe}function G(){return j(P().curve(I))}function rt(){var pe=L().curve(I),Ke=pe.curve,xr=pe.lineX0,Gr=pe.lineX1,ln=pe.lineY0,wn=pe.lineY1;return pe.angle=pe.x,delete pe.x,pe.startAngle=pe.x0,delete pe.x0,pe.endAngle=pe.x1,delete pe.x1,pe.radius=pe.y,delete pe.y,pe.innerRadius=pe.y0,delete pe.y0,pe.outerRadius=pe.y1,delete pe.y1,pe.lineStartAngle=function(){return j(xr())},delete pe.lineX0,pe.lineEndAngle=function(){return j(Gr())},delete pe.lineX1,pe.lineInnerRadius=function(){return j(ln())},delete pe.lineY0,pe.lineOuterRadius=function(){return j(wn())},delete pe.lineY1,pe.curve=function(rn){return arguments.length?Ke(N(rn)):Ke()._curve},pe}function ct(pe,Ke){return[(Ke=+Ke)*Math.cos(pe-=Math.PI/2),Ke*Math.sin(pe)]}var st=Array.prototype.slice;function et(pe){return pe.source}function K(pe){return pe.target}function ot(pe){var Ke=et,xr=K,Gr=b,ln=_,wn=null;function rn(){var Qr,vn=st.call(arguments),Oa=Ke.apply(this,vn),Qn=xr.apply(this,vn);if(wn||(wn=Qr=d.path()),pe(wn,+Gr.apply(this,(vn[0]=Oa,vn)),+ln.apply(this,vn),+Gr.apply(this,(vn[0]=Qn,vn)),+ln.apply(this,vn)),Qr)return wn=null,Qr+""||null}return rn.source=function(Qr){return arguments.length?(Ke=Qr,rn):Ke},rn.target=function(Qr){return arguments.length?(xr=Qr,rn):xr},rn.x=function(Qr){return arguments.length?(Gr=typeof Qr=="function"?Qr:E(+Qr),rn):Gr},rn.y=function(Qr){return arguments.length?(ln=typeof Qr=="function"?Qr:E(+Qr),rn):ln},rn.context=function(Qr){return arguments.length?(wn=Qr??null,rn):wn},rn}function X(pe,Ke,xr,Gr,ln){pe.moveTo(Ke,xr),pe.bezierCurveTo(Ke=(Ke+Gr)/2,xr,Ke,ln,Gr,ln)}function Q(pe,Ke,xr,Gr,ln){pe.moveTo(Ke,xr),pe.bezierCurveTo(Ke,xr=(xr+ln)/2,Gr,xr,Gr,ln)}function ut(pe,Ke,xr,Gr,ln){var wn=ct(Ke,xr),rn=ct(Ke,xr=(xr+ln)/2),Qr=ct(Gr,xr),vn=ct(Gr,ln);pe.moveTo(wn[0],wn[1]),pe.bezierCurveTo(rn[0],rn[1],Qr[0],Qr[1],vn[0],vn[1])}function J(){return ot(X)}function q(){return ot(Q)}function it(){var pe=ot(ut);return pe.angle=pe.x,delete pe.x,pe.radius=pe.y,delete pe.y,pe}var nt={draw:function(pe,Ke){var xr=Math.sqrt(Ke/s);pe.moveTo(xr,0),pe.arc(0,0,xr,0,v)}},dt={draw:function(pe,Ke){var xr=Math.sqrt(Ke/5)/2;pe.moveTo(-3*xr,-xr),pe.lineTo(-xr,-xr),pe.lineTo(-xr,-3*xr),pe.lineTo(xr,-3*xr),pe.lineTo(xr,-xr),pe.lineTo(3*xr,-xr),pe.lineTo(3*xr,xr),pe.lineTo(xr,xr),pe.lineTo(xr,3*xr),pe.lineTo(-xr,3*xr),pe.lineTo(-xr,xr),pe.lineTo(-3*xr,xr),pe.closePath()}},Tt=Math.sqrt(1/3),wt=Tt*2,It={draw:function(pe,Ke){var xr=Math.sqrt(Ke/wt),Gr=xr*Tt;pe.moveTo(0,-xr),pe.lineTo(Gr,0),pe.lineTo(0,xr),pe.lineTo(-Gr,0),pe.closePath()}},Ct=.8908130915292852,Nt=Math.sin(s/10)/Math.sin(7*s/10),ee=Math.sin(v/10)*Nt,Jt=-Math.cos(v/10)*Nt,te={draw:function(pe,Ke){var xr=Math.sqrt(Ke*Ct),Gr=ee*xr,ln=Jt*xr;pe.moveTo(0,-xr),pe.lineTo(Gr,ln);for(var wn=1;wn<5;++wn){var rn=v*wn/5,Qr=Math.cos(rn),vn=Math.sin(rn);pe.lineTo(vn*xr,-Qr*xr),pe.lineTo(Qr*Gr-vn*ln,vn*Gr+Qr*ln)}pe.closePath()}},Kt={draw:function(pe,Ke){var xr=Math.sqrt(Ke),Gr=-xr/2;pe.rect(Gr,Gr,xr,xr)}},mt=Math.sqrt(3),bt={draw:function(pe,Ke){var xr=-Math.sqrt(Ke/(mt*3));pe.moveTo(0,xr*2),pe.lineTo(-mt*xr,-xr),pe.lineTo(mt*xr,-xr),pe.closePath()}},vt=-.5,Ut=Math.sqrt(3)/2,re=1/Math.sqrt(12),Zt=(re/2+1)*3,ue={draw:function(pe,Ke){var xr=Math.sqrt(Ke/Zt),Gr=xr/2,ln=xr*re,wn=Gr,rn=xr*re+xr,Qr=-wn,vn=rn;pe.moveTo(Gr,ln),pe.lineTo(wn,rn),pe.lineTo(Qr,vn),pe.lineTo(vt*Gr-Ut*ln,Ut*Gr+vt*ln),pe.lineTo(vt*wn-Ut*rn,Ut*wn+vt*rn),pe.lineTo(vt*Qr-Ut*vn,Ut*Qr+vt*vn),pe.lineTo(vt*Gr+Ut*ln,vt*ln-Ut*Gr),pe.lineTo(vt*wn+Ut*rn,vt*rn-Ut*wn),pe.lineTo(vt*Qr+Ut*vn,vt*vn-Ut*Qr),pe.closePath()}},Me=[nt,dt,It,Kt,te,bt,ue];function Ce(){var pe=E(nt),Ke=E(64),xr=null;function Gr(){var ln;if(xr||(xr=ln=d.path()),pe.apply(this,arguments).draw(xr,+Ke.apply(this,arguments)),ln)return xr=null,ln+""||null}return Gr.type=function(ln){return arguments.length?(pe=typeof ln=="function"?ln:E(ln),Gr):pe},Gr.size=function(ln){return arguments.length?(Ke=typeof ln=="function"?ln:E(+ln),Gr):Ke},Gr.context=function(ln){return arguments.length?(xr=ln??null,Gr):xr},Gr}function We(){}function qe(pe,Ke,xr){pe._context.bezierCurveTo((2*pe._x0+pe._x1)/3,(2*pe._y0+pe._y1)/3,(pe._x0+2*pe._x1)/3,(pe._y0+2*pe._y1)/3,(pe._x0+4*pe._x1+Ke)/6,(pe._y0+4*pe._y1+xr)/6)}function vr(pe){this._context=pe}vr.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:qe(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(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);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:qe(this,pe,Ke);break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke}};function _r(pe){return new vr(pe)}function er(pe){this._context=pe}er.prototype={areaStart:We,areaEnd:We,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(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._x2=pe,this._y2=Ke;break;case 1:this._point=2,this._x3=pe,this._y3=Ke;break;case 2:this._point=3,this._x4=pe,this._y4=Ke,this._context.moveTo((this._x0+4*this._x1+pe)/6,(this._y0+4*this._y1+Ke)/6);break;default:qe(this,pe,Ke);break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke}};function Mr(pe){return new er(pe)}function Ir(pe){this._context=pe}Ir.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(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var xr=(this._x0+4*this._x1+pe)/6,Gr=(this._y0+4*this._y1+Ke)/6;this._line?this._context.lineTo(xr,Gr):this._context.moveTo(xr,Gr);break;case 3:this._point=4;default:qe(this,pe,Ke);break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke}};function de(pe){return new Ir(pe)}function Dt(pe,Ke){this._basis=new vr(pe),this._beta=Ke}Dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var pe=this._x,Ke=this._y,xr=pe.length-1;if(xr>0)for(var Gr=pe[0],ln=Ke[0],wn=pe[xr]-Gr,rn=Ke[xr]-ln,Qr=-1,vn;++Qr<=xr;)vn=Qr/xr,this._basis.point(this._beta*pe[Qr]+(1-this._beta)*(Gr+vn*wn),this._beta*Ke[Qr]+(1-this._beta)*(ln+vn*rn));this._x=this._y=null,this._basis.lineEnd()},point:function(pe,Ke){this._x.push(+pe),this._y.push(+Ke)}};var qt=function pe(Ke){function xr(Gr){return Ke===1?new vr(Gr):new Dt(Gr,Ke)}return xr.beta=function(Gr){return pe(+Gr)},xr}(.85);function _t(pe,Ke,xr){pe._context.bezierCurveTo(pe._x1+pe._k*(pe._x2-pe._x0),pe._y1+pe._k*(pe._y2-pe._y0),pe._x2+pe._k*(pe._x1-Ke),pe._y2+pe._k*(pe._y1-xr),pe._x2,pe._y2)}function lt(pe,Ke){this._context=pe,this._k=(1-Ke)/6}lt.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:_t(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2,this._x1=pe,this._y1=Ke;break;case 2:this._point=3;default:_t(this,pe,Ke);break}this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var yt=function pe(Ke){function xr(Gr){return new lt(Gr,Ke)}return xr.tension=function(Gr){return pe(+Gr)},xr}(0);function St(pe,Ke){this._context=pe,this._k=(1-Ke)/6}St.prototype={areaStart:We,areaEnd:We,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(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._x3=pe,this._y3=Ke;break;case 1:this._point=2,this._context.moveTo(this._x4=pe,this._y4=Ke);break;case 2:this._point=3,this._x5=pe,this._y5=Ke;break;default:_t(this,pe,Ke);break}this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var Ht=function pe(Ke){function xr(Gr){return new St(Gr,Ke)}return xr.tension=function(Gr){return pe(+Gr)},xr}(0);function Yt(pe,Ke){this._context=pe,this._k=(1-Ke)/6}Yt.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(pe,Ke){switch(pe=+pe,Ke=+Ke,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:_t(this,pe,Ke);break}this._x0=this._x1,this._x1=this._x2,this._x2=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var se=function pe(Ke){function xr(Gr){return new Yt(Gr,Ke)}return xr.tension=function(Gr){return pe(+Gr)},xr}(0);function ke(pe,Ke,xr){var Gr=pe._x1,ln=pe._y1,wn=pe._x2,rn=pe._y2;if(pe._l01_a>a){var Qr=2*pe._l01_2a+3*pe._l01_a*pe._l12_a+pe._l12_2a,vn=3*pe._l01_a*(pe._l01_a+pe._l12_a);Gr=(Gr*Qr-pe._x0*pe._l12_2a+pe._x2*pe._l01_2a)/vn,ln=(ln*Qr-pe._y0*pe._l12_2a+pe._y2*pe._l01_2a)/vn}if(pe._l23_a>a){var Oa=2*pe._l23_2a+3*pe._l23_a*pe._l12_a+pe._l12_2a,Qn=3*pe._l23_a*(pe._l23_a+pe._l12_a);wn=(wn*Oa+pe._x1*pe._l23_2a-Ke*pe._l12_2a)/Qn,rn=(rn*Oa+pe._y1*pe._l23_2a-xr*pe._l12_2a)/Qn}pe._context.bezierCurveTo(Gr,ln,wn,rn,pe._x2,pe._y2)}function Ee(pe,Ke){this._context=pe,this._alpha=Ke}Ee.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(pe,Ke){if(pe=+pe,Ke=+Ke,this._point){var xr=this._x2-pe,Gr=this._y2-Ke;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(xr*xr+Gr*Gr,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;break;case 2:this._point=3;default:ke(this,pe,Ke);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=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var Ue=function pe(Ke){function xr(Gr){return Ke?new Ee(Gr,Ke):new lt(Gr,0)}return xr.alpha=function(Gr){return pe(+Gr)},xr}(.5);function ir(pe,Ke){this._context=pe,this._alpha=Ke}ir.prototype={areaStart:We,areaEnd:We,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(pe,Ke){if(pe=+pe,Ke=+Ke,this._point){var xr=this._x2-pe,Gr=this._y2-Ke;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(xr*xr+Gr*Gr,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=pe,this._y3=Ke;break;case 1:this._point=2,this._context.moveTo(this._x4=pe,this._y4=Ke);break;case 2:this._point=3,this._x5=pe,this._y5=Ke;break;default:ke(this,pe,Ke);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=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var ar=function pe(Ke){function xr(Gr){return Ke?new ir(Gr,Ke):new St(Gr,0)}return xr.alpha=function(Gr){return pe(+Gr)},xr}(.5);function Ye(pe,Ke){this._context=pe,this._alpha=Ke}Ye.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(pe,Ke){if(pe=+pe,Ke=+Ke,this._point){var xr=this._x2-pe,Gr=this._y2-Ke;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(xr*xr+Gr*Gr,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:ke(this,pe,Ke);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=pe,this._y0=this._y1,this._y1=this._y2,this._y2=Ke}};var Er=function pe(Ke){function xr(Gr){return Ke?new Ye(Gr,Ke):new Yt(Gr,0)}return xr.alpha=function(Gr){return pe(+Gr)},xr}(.5);function pn(pe){this._context=pe}pn.prototype={areaStart:We,areaEnd:We,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(pe,Ke){pe=+pe,Ke=+Ke,this._point?this._context.lineTo(pe,Ke):(this._point=1,this._context.moveTo(pe,Ke))}};function dn(pe){return new pn(pe)}function bn(pe){return pe<0?-1:1}function Zn(pe,Ke,xr){var Gr=pe._x1-pe._x0,ln=Ke-pe._x1,wn=(pe._y1-pe._y0)/(Gr||ln<0&&-0),rn=(xr-pe._y1)/(ln||Gr<0&&-0),Qr=(wn*ln+rn*Gr)/(Gr+ln);return(bn(wn)+bn(rn))*Math.min(Math.abs(wn),Math.abs(rn),.5*Math.abs(Qr))||0}function En(pe,Ke){var xr=pe._x1-pe._x0;return xr?(3*(pe._y1-pe._y0)/xr-Ke)/2:Ke}function gn(pe,Ke,xr){var Gr=pe._x0,ln=pe._y0,wn=pe._x1,rn=pe._y1,Qr=(wn-Gr)/3;pe._context.bezierCurveTo(Gr+Qr,ln+Qr*Ke,wn-Qr,rn-Qr*xr,wn,rn)}function da(pe){this._context=pe}da.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:gn(this,this._t0,En(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(pe,Ke){var xr=NaN;if(pe=+pe,Ke=+Ke,!(pe===this._x1&&Ke===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;break;case 2:this._point=3,gn(this,En(this,xr=Zn(this,pe,Ke)),xr);break;default:gn(this,this._t0,xr=Zn(this,pe,Ke));break}this._x0=this._x1,this._x1=pe,this._y0=this._y1,this._y1=Ke,this._t0=xr}}};function ra(pe){this._context=new Se(pe)}(ra.prototype=Object.create(da.prototype)).point=function(pe,Ke){da.prototype.point.call(this,Ke,pe)};function Se(pe){this._context=pe}Se.prototype={moveTo:function(pe,Ke){this._context.moveTo(Ke,pe)},closePath:function(){this._context.closePath()},lineTo:function(pe,Ke){this._context.lineTo(Ke,pe)},bezierCurveTo:function(pe,Ke,xr,Gr,ln,wn){this._context.bezierCurveTo(Ke,pe,Gr,xr,wn,ln)}};function Re(pe){return new da(pe)}function Ze(pe){return new ra(pe)}function tr(pe){this._context=pe}tr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var pe=this._x,Ke=this._y,xr=pe.length;if(xr)if(this._line?this._context.lineTo(pe[0],Ke[0]):this._context.moveTo(pe[0],Ke[0]),xr===2)this._context.lineTo(pe[1],Ke[1]);else for(var Gr=zr(pe),ln=zr(Ke),wn=0,rn=1;rn<xr;++wn,++rn)this._context.bezierCurveTo(Gr[0][wn],ln[0][wn],Gr[1][wn],ln[1][wn],pe[rn],Ke[rn]);(this._line||this._line!==0&&xr===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(pe,Ke){this._x.push(+pe),this._y.push(+Ke)}};function zr(pe){var Ke,xr=pe.length-1,Gr,ln=new Array(xr),wn=new Array(xr),rn=new Array(xr);for(ln[0]=0,wn[0]=2,rn[0]=pe[0]+2*pe[1],Ke=1;Ke<xr-1;++Ke)ln[Ke]=1,wn[Ke]=4,rn[Ke]=4*pe[Ke]+2*pe[Ke+1];for(ln[xr-1]=2,wn[xr-1]=7,rn[xr-1]=8*pe[xr-1]+pe[xr],Ke=1;Ke<xr;++Ke)Gr=ln[Ke]/wn[Ke-1],wn[Ke]-=Gr,rn[Ke]-=Gr*rn[Ke-1];for(ln[xr-1]=rn[xr-1]/wn[xr-1],Ke=xr-2;Ke>=0;--Ke)ln[Ke]=(rn[Ke]-ln[Ke+1])/wn[Ke];for(wn[xr-1]=(pe[xr]+ln[xr-1])/2,Ke=0;Ke<xr-1;++Ke)wn[Ke]=2*pe[Ke+1]-ln[Ke+1];return[ln,wn]}function tn(pe){return new tr(pe)}function Yr(pe,Ke){this._context=pe,this._t=Ke}Yr.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(pe,Ke){switch(pe=+pe,Ke=+Ke,this._point){case 0:this._point=1,this._line?this._context.lineTo(pe,Ke):this._context.moveTo(pe,Ke);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Ke),this._context.lineTo(pe,Ke);else{var xr=this._x*(1-this._t)+pe*this._t;this._context.lineTo(xr,this._y),this._context.lineTo(xr,Ke)}break}}this._x=pe,this._y=Ke}};function $r(pe){return new Yr(pe,.5)}function In(pe){return new Yr(pe,0)}function Nn(pe){return new Yr(pe,1)}function Kn(pe,Ke){if((rn=pe.length)>1)for(var xr=1,Gr,ln,wn=pe[Ke[0]],rn,Qr=wn.length;xr<rn;++xr)for(ln=wn,wn=pe[Ke[xr]],Gr=0;Gr<Qr;++Gr)wn[Gr][1]+=wn[Gr][0]=isNaN(ln[Gr][1])?ln[Gr][0]:ln[Gr][1]}function $n(pe){for(var Ke=pe.length,xr=new Array(Ke);--Ke>=0;)xr[Ke]=Ke;return xr}function ia(pe,Ke){return pe[Ke]}function Cn(){var pe=E([]),Ke=$n,xr=Kn,Gr=ia;function ln(wn){var rn=pe.apply(this,arguments),Qr,vn=wn.length,Oa=rn.length,Qn=new Array(Oa),Qa;for(Qr=0;Qr<Oa;++Qr){for(var Ja=rn[Qr],wi=Qn[Qr]=new Array(vn),ci=0,Ti;ci<vn;++ci)wi[ci]=Ti=[0,+Gr(wn[ci],Ja,ci,wn)],Ti.data=wn[ci];wi.key=Ja}for(Qr=0,Qa=Ke(Qn);Qr<Oa;++Qr)Qn[Qa[Qr]].index=Qr;return xr(Qn,Qa),Qn}return ln.keys=function(wn){return arguments.length?(pe=typeof wn=="function"?wn:E(st.call(wn)),ln):pe},ln.value=function(wn){return arguments.length?(Gr=typeof wn=="function"?wn:E(+wn),ln):Gr},ln.order=function(wn){return arguments.length?(Ke=wn==null?$n:typeof wn=="function"?wn:E(st.call(wn)),ln):Ke},ln.offset=function(wn){return arguments.length?(xr=wn??Kn,ln):xr},ln}function Fa(pe,Ke){if((Gr=pe.length)>0){for(var xr,Gr,ln=0,wn=pe[0].length,rn;ln<wn;++ln){for(rn=xr=0;xr<Gr;++xr)rn+=pe[xr][ln][1]||0;if(rn)for(xr=0;xr<Gr;++xr)pe[xr][ln][1]/=rn}Kn(pe,Ke)}}function Ga(pe,Ke){if((vn=pe.length)>0)for(var xr,Gr=0,ln,wn,rn,Qr,vn,Oa=pe[Ke[0]].length;Gr<Oa;++Gr)for(rn=Qr=0,xr=0;xr<vn;++xr)(wn=(ln=pe[Ke[xr]][Gr])[1]-ln[0])>0?(ln[0]=rn,ln[1]=rn+=wn):wn<0?(ln[1]=Qr,ln[0]=Qr+=wn):(ln[0]=0,ln[1]=wn)}function ve(pe,Ke){if((ln=pe.length)>0){for(var xr=0,Gr=pe[Ke[0]],ln,wn=Gr.length;xr<wn;++xr){for(var rn=0,Qr=0;rn<ln;++rn)Qr+=pe[rn][xr][1]||0;Gr[xr][1]+=Gr[xr][0]=-Qr/2}Kn(pe,Ke)}}function ge(pe,Ke){if(!(!((rn=pe.length)>0)||!((wn=(ln=pe[Ke[0]]).length)>0))){for(var xr=0,Gr=1,ln,wn,rn;Gr<wn;++Gr){for(var Qr=0,vn=0,Oa=0;Qr<rn;++Qr){for(var Qn=pe[Ke[Qr]],Qa=Qn[Gr][1]||0,Ja=Qn[Gr-1][1]||0,wi=(Qa-Ja)/2,ci=0;ci<Qr;++ci){var Ti=pe[Ke[ci]],Ra=Ti[Gr][1]||0,Qi=Ti[Gr-1][1]||0;wi+=Ra-Qi}vn+=Qa,Oa+=wi*Qa}ln[Gr-1][1]+=ln[Gr-1][0]=xr,vn&&(xr-=Oa/vn)}ln[Gr-1][1]+=ln[Gr-1][0]=xr,Kn(pe,Ke)}}function dr(pe){var Ke=pe.map(br);return $n(pe).sort(function(xr,Gr){return Ke[xr]-Ke[Gr]})}function br(pe){for(var Ke=-1,xr=0,Gr=pe.length,ln,wn=-1/0;++Ke<Gr;)(ln=+pe[Ke][1])>wn&&(wn=ln,xr=Ke);return xr}function Tr(pe){var Ke=pe.map(mr);return $n(pe).sort(function(xr,Gr){return Ke[xr]-Ke[Gr]})}function mr(pe){for(var Ke=0,xr=-1,Gr=pe.length,ln;++xr<Gr;)(ln=+pe[xr][1])&&(Ke+=ln);return Ke}function kr(pe){return Tr(pe).reverse()}function Ur(pe){var Ke=pe.length,xr,Gr,ln=pe.map(mr),wn=dr(pe),rn=0,Qr=0,vn=[],Oa=[];for(xr=0;xr<Ke;++xr)Gr=wn[xr],rn<Qr?(rn+=ln[Gr],vn.push(Gr)):(Qr+=ln[Gr],Oa.push(Gr));return Oa.reverse().concat(vn)}function Or(pe){return $n(pe).reverse()}u.arc=T,u.area=L,u.areaRadial=rt,u.curveBasis=_r,u.curveBasisClosed=Mr,u.curveBasisOpen=de,u.curveBundle=qt,u.curveCardinal=yt,u.curveCardinalClosed=Ht,u.curveCardinalOpen=se,u.curveCatmullRom=Ue,u.curveCatmullRomClosed=ar,u.curveCatmullRomOpen=Er,u.curveLinear=h,u.curveLinearClosed=dn,u.curveMonotoneX=Re,u.curveMonotoneY=Ze,u.curveNatural=tn,u.curveStep=$r,u.curveStepAfter=Nn,u.curveStepBefore=In,u.line=P,u.lineRadial=G,u.linkHorizontal=J,u.linkRadial=it,u.linkVertical=q,u.pie=R,u.pointRadial=ct,u.radialArea=rt,u.radialLine=G,u.stack=Cn,u.stackOffsetDiverging=Ga,u.stackOffsetExpand=Fa,u.stackOffsetNone=Kn,u.stackOffsetSilhouette=ve,u.stackOffsetWiggle=ge,u.stackOrderAppearance=dr,u.stackOrderAscending=Tr,u.stackOrderDescending=kr,u.stackOrderInsideOut=Ur,u.stackOrderNone=$n,u.stackOrderReverse=Or,u.symbol=Ce,u.symbolCircle=nt,u.symbolCross=dt,u.symbolDiamond=It,u.symbolSquare=Kt,u.symbolStar=te,u.symbolTriangle=bt,u.symbolWye=ue,u.symbols=Me,Object.defineProperty(u,"__esModule",{value:!0})})}),Yz=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,Av(),Xx(),B5()):d(u.d3=u.d3||{},u.d3,u.d3,u.d3)})(Z,function(u,d,E,A){function t(h){return h.target.depth}function e(h){return h.depth}function r(h,b){return b-1-h.height}function i(h,b){return h.sourceLinks.length?h.depth:b-1}function n(h){return h.targetLinks.length?h.depth:h.sourceLinks.length?d.min(h.sourceLinks,t)-1:0}function o(h){return function(){return h}}function a(h,b){return f(h.source,b.source)||h.index-b.index}function s(h,b){return f(h.target,b.target)||h.index-b.index}function f(h,b){return h.y0-b.y0}function v(h){return h.value}function g(h){return(h.y0+h.y1)/2}function m(h){return g(h.source)*h.value}function w(h){return g(h.target)*h.value}function l(h){return h.index}function x(h){return h.nodes}function y(h){return h.links}function S(h,b){var _=h.get(b);if(!_)throw new Error("missing: "+b);return _}var k=function(){var h=0,b=0,_=1,P=1,L=24,D=8,B=l,R=i,I=x,F=y,N=32,j=2/3;function G(){var ot={nodes:I.apply(null,arguments),links:F.apply(null,arguments)};return rt(ot),ct(ot),st(ot),et(ot),K(ot),ot}G.update=function(ot){return K(ot),ot},G.nodeId=function(ot){return arguments.length?(B=typeof ot=="function"?ot:o(ot),G):B},G.nodeAlign=function(ot){return arguments.length?(R=typeof ot=="function"?ot:o(ot),G):R},G.nodeWidth=function(ot){return arguments.length?(L=+ot,G):L},G.nodePadding=function(ot){return arguments.length?(D=+ot,G):D},G.nodes=function(ot){return arguments.length?(I=typeof ot=="function"?ot:o(ot),G):I},G.links=function(ot){return arguments.length?(F=typeof ot=="function"?ot:o(ot),G):F},G.size=function(ot){return arguments.length?(h=b=0,_=+ot[0],P=+ot[1],G):[_-h,P-b]},G.extent=function(ot){return arguments.length?(h=+ot[0][0],_=+ot[1][0],b=+ot[0][1],P=+ot[1][1],G):[[h,b],[_,P]]},G.iterations=function(ot){return arguments.length?(N=+ot,G):N};function rt(ot){ot.nodes.forEach(function(Q,ut){Q.index=ut,Q.sourceLinks=[],Q.targetLinks=[]});var X=E.map(ot.nodes,B);ot.links.forEach(function(Q,ut){Q.index=ut;var J=Q.source,q=Q.target;typeof J!="object"&&(J=Q.source=S(X,J)),typeof q!="object"&&(q=Q.target=S(X,q)),J.sourceLinks.push(Q),q.targetLinks.push(Q)})}function ct(ot){ot.nodes.forEach(function(X){X.value=Math.max(d.sum(X.sourceLinks,v),d.sum(X.targetLinks,v))})}function st(ot){var X,Q,ut;for(X=ot.nodes,Q=[],ut=0;X.length;++ut,X=Q,Q=[])X.forEach(function(q){q.depth=ut,q.sourceLinks.forEach(function(it){Q.indexOf(it.target)<0&&Q.push(it.target)})});for(X=ot.nodes,Q=[],ut=0;X.length;++ut,X=Q,Q=[])X.forEach(function(q){q.height=ut,q.targetLinks.forEach(function(it){Q.indexOf(it.source)<0&&Q.push(it.source)})});var J=(_-h-L)/(ut-1);ot.nodes.forEach(function(q){q.x1=(q.x0=h+Math.max(0,Math.min(ut-1,Math.floor(R.call(null,q,ut))))*J)+L})}function et(ot){var X=E.nest().key(function(dt){return dt.x0}).sortKeys(d.ascending).entries(ot.nodes).map(function(dt){return dt.values});J(),nt();for(var Q=1,ut=N;ut>0;--ut)it(Q*=.99),nt(),q(Q),nt();function J(){var dt=d.max(X,function(It){return It.length}),Tt=j*(P-b)/(dt-1);D>Tt&&(D=Tt);var wt=d.min(X,function(It){return(P-b-(It.length-1)*D)/d.sum(It,v)});X.forEach(function(It){It.forEach(function(Ct,Nt){Ct.y1=(Ct.y0=Nt)+Ct.value*wt})}),ot.links.forEach(function(It){It.width=It.value*wt})}function q(dt){X.forEach(function(Tt){Tt.forEach(function(wt){if(wt.targetLinks.length){var It=(d.sum(wt.targetLinks,m)/d.sum(wt.targetLinks,v)-g(wt))*dt;wt.y0+=It,wt.y1+=It}})})}function it(dt){X.slice().reverse().forEach(function(Tt){Tt.forEach(function(wt){if(wt.sourceLinks.length){var It=(d.sum(wt.sourceLinks,w)/d.sum(wt.sourceLinks,v)-g(wt))*dt;wt.y0+=It,wt.y1+=It}})})}function nt(){X.forEach(function(dt){var Tt,wt,It=b,Ct=dt.length,Nt;for(dt.sort(f),Nt=0;Nt<Ct;++Nt)Tt=dt[Nt],wt=It-Tt.y0,wt>0&&(Tt.y0+=wt,Tt.y1+=wt),It=Tt.y1+D;if(wt=It-D-P,wt>0)for(It=Tt.y0-=wt,Tt.y1-=wt,Nt=Ct-2;Nt>=0;--Nt)Tt=dt[Nt],wt=Tt.y1+D-It,wt>0&&(Tt.y0-=wt,Tt.y1-=wt),It=Tt.y0})}}function K(ot){ot.nodes.forEach(function(X){X.sourceLinks.sort(s),X.targetLinks.sort(a)}),ot.nodes.forEach(function(X){var Q=X.y0,ut=Q;X.sourceLinks.forEach(function(J){J.y0=Q+J.width/2,Q+=J.width}),X.targetLinks.forEach(function(J){J.y1=ut+J.width/2,ut+=J.width})})}return G};function M(h){return[h.source.x1,h.y0]}function T(h){return[h.target.x0,h.y1]}var c=function(){return A.linkHorizontal().source(M).target(T)};u.sankey=k,u.sankeyCenter=n,u.sankeyLeft=e,u.sankeyRight=r,u.sankeyJustify=i,u.sankeyLinkHorizontal=c,Object.defineProperty(u,"__esModule",{value:!0})})}),Xz=Vt((Z,V)=>{var u=F5();V.exports=function(d,E){var A=[],t=[],e=[],r={},i=[],n;function o(y){e[y]=!1,r.hasOwnProperty(y)&&Object.keys(r[y]).forEach(function(S){delete r[y][S],e[S]&&o(S)})}function a(y){var S=!1;t.push(y),e[y]=!0;var k,M;for(k=0;k<i[y].length;k++)M=i[y][k],M===n?(s(n,t),S=!0):e[M]||(S=a(M));if(S)o(y);else for(k=0;k<i[y].length;k++){M=i[y][k];var T=r[M];T||(T={},r[M]=T),T[M]=!0}return t.pop(),S}function s(y,S){var k=[].concat(S).concat(y);E?E(a):A.push(k)}function f(y){for(var S=0;S<d.length;S++)S<y&&(d[S]=[]),d[S]=d[S].filter(function(k){return k>=y})}function v(y){f(y);for(var S=d,k=u(S),M=k.components.filter(function(L){return L.length>1}),T=1/0,c,h=0;h<M.length;h++)for(var b=0;b<M[h].length;b++)M[h][b]<T&&(T=M[h][b],c=h);var _=M[c];if(!_)return!1;var P=d.map(function(L,D){return _.indexOf(D)===-1?[]:L.filter(function(B){return _.indexOf(B)!==-1})});return{leastVertex:T,adjList:P}}n=0;for(var g=d.length;n<g;){var m=v(n);if(n=m.leastVertex,i=m.adjList,i){for(var w=0;w<i.length;w++)for(var l=0;l<i[w].length;l++){var x=i[w][l];e[+x]=!1,r[x]={}}a(n),n=n+1}else n=g}if(!E)return A}}),$z=Vt((Z,V)=>{(function(u,d){typeof Z=="object"&&typeof V<"u"?d(Z,Av(),Xx(),B5(),Xz()):d(u.d3=u.d3||{},u.d3,u.d3,u.d3,null)})(Z,function(u,d,E,A,t){t=t&&t.hasOwnProperty("default")?t.default:t;function e(Ct){return Ct.target.depth}function r(Ct){return Ct.depth}function i(Ct,Nt){return Nt-1-Ct.height}function n(Ct,Nt){return Ct.sourceLinks.length?Ct.depth:Nt-1}function o(Ct){return Ct.targetLinks.length?Ct.depth:Ct.sourceLinks.length?d.min(Ct.sourceLinks,e)-1:0}function a(Ct){return function(){return Ct}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ct){return typeof Ct}:function(Ct){return Ct&&typeof Symbol=="function"&&Ct.constructor===Symbol&&Ct!==Symbol.prototype?"symbol":typeof Ct};function f(Ct,Nt){return g(Ct.source,Nt.source)||Ct.index-Nt.index}function v(Ct,Nt){return g(Ct.target,Nt.target)||Ct.index-Nt.index}function g(Ct,Nt){return Ct.partOfCycle===Nt.partOfCycle?Ct.y0-Nt.y0:Ct.circularLinkType==="top"||Nt.circularLinkType==="bottom"?-1:1}function m(Ct){return Ct.value}function w(Ct){return(Ct.y0+Ct.y1)/2}function l(Ct){return w(Ct.source)}function x(Ct){return w(Ct.target)}function y(Ct){return Ct.index}function S(Ct){return Ct.nodes}function k(Ct){return Ct.links}function M(Ct,Nt){var ee=Ct.get(Nt);if(!ee)throw new Error("missing: "+Nt);return ee}function T(Ct,Nt){return Nt(Ct)}var c=25,h=10,b=.3;function _(){var Ct=0,Nt=0,ee=1,Jt=1,te=24,Kt,mt=y,bt=n,vt=S,Ut=k,re=32,Zt=2,ue,Me=null;function Ce(){var de={nodes:vt.apply(null,arguments),links:Ut.apply(null,arguments)};We(de),P(de,mt,Me),qe(de),er(de),L(de,mt),Mr(de,re,mt),Ir(de);for(var Dt=4,qt=0;qt<Dt;qt++)it(de,Jt,mt),nt(de,Jt,mt),ut(de,Nt,Jt,mt),it(de,Jt,mt),nt(de,Jt,mt);return It(de,Nt,Jt),N(de,Zt,Jt,mt),de}Ce.nodeId=function(de){return arguments.length?(mt=typeof de=="function"?de:a(de),Ce):mt},Ce.nodeAlign=function(de){return arguments.length?(bt=typeof de=="function"?de:a(de),Ce):bt},Ce.nodeWidth=function(de){return arguments.length?(te=+de,Ce):te},Ce.nodePadding=function(de){return arguments.length?(Kt=+de,Ce):Kt},Ce.nodes=function(de){return arguments.length?(vt=typeof de=="function"?de:a(de),Ce):vt},Ce.links=function(de){return arguments.length?(Ut=typeof de=="function"?de:a(de),Ce):Ut},Ce.size=function(de){return arguments.length?(Ct=Nt=0,ee=+de[0],Jt=+de[1],Ce):[ee-Ct,Jt-Nt]},Ce.extent=function(de){return arguments.length?(Ct=+de[0][0],ee=+de[1][0],Nt=+de[0][1],Jt=+de[1][1],Ce):[[Ct,Nt],[ee,Jt]]},Ce.iterations=function(de){return arguments.length?(re=+de,Ce):re},Ce.circularLinkGap=function(de){return arguments.length?(Zt=+de,Ce):Zt},Ce.nodePaddingRatio=function(de){return arguments.length?(ue=+de,Ce):ue},Ce.sortNodes=function(de){return arguments.length?(Me=de,Ce):Me},Ce.update=function(de){return L(de,mt),Ir(de),de.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)}),it(de,Jt,mt,!1),nt(de,Jt,mt),N(de,Zt,Jt,mt),de};function We(de){de.nodes.forEach(function(qt,_t){qt.index=_t,qt.sourceLinks=[],qt.targetLinks=[]});var Dt=E.map(de.nodes,mt);return de.links.forEach(function(qt,_t){qt.index=_t;var lt=qt.source,yt=qt.target;(typeof lt>"u"?"undefined":s(lt))!=="object"&&(lt=qt.source=M(Dt,lt)),(typeof yt>"u"?"undefined":s(yt))!=="object"&&(yt=qt.target=M(Dt,yt)),lt.sourceLinks.push(qt),yt.targetLinks.push(qt)}),de}function qe(de){de.nodes.forEach(function(Dt){Dt.partOfCycle=!1,Dt.value=Math.max(d.sum(Dt.sourceLinks,m),d.sum(Dt.targetLinks,m)),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 vr(de){var Dt=0,qt=0,_t=0,lt=0,yt=d.max(de.nodes,function(St){return St.column});return de.links.forEach(function(St){St.circular&&(St.circularLinkType=="top"?Dt=Dt+St.width:qt=qt+St.width,St.target.column==0&&(lt=lt+St.width),St.source.column==yt&&(_t=_t+St.width))}),Dt=Dt>0?Dt+c+h:Dt,qt=qt>0?qt+c+h:qt,_t=_t>0?_t+c+h:_t,lt=lt>0?lt+c+h:lt,{top:Dt,bottom:qt,left:lt,right:_t}}function _r(de,Dt){var qt=d.max(de.nodes,function(se){return se.column}),_t=ee-Ct,lt=Jt-Nt,yt=_t+Dt.right+Dt.left,St=lt+Dt.top+Dt.bottom,Ht=_t/yt,Yt=lt/St;return Ct=Ct*Ht+Dt.left,ee=Dt.right==0?ee:ee*Ht,Nt=Nt*Yt+Dt.top,Jt=Jt*Yt,de.nodes.forEach(function(se){se.x0=Ct+se.column*((ee-Ct-te)/qt),se.x1=se.x0+te}),Yt}function er(de){var Dt,qt,_t;for(Dt=de.nodes,qt=[],_t=0;Dt.length;++_t,Dt=qt,qt=[])Dt.forEach(function(lt){lt.depth=_t,lt.sourceLinks.forEach(function(yt){qt.indexOf(yt.target)<0&&!yt.circular&&qt.push(yt.target)})});for(Dt=de.nodes,qt=[],_t=0;Dt.length;++_t,Dt=qt,qt=[])Dt.forEach(function(lt){lt.height=_t,lt.targetLinks.forEach(function(yt){qt.indexOf(yt.source)<0&&!yt.circular&&qt.push(yt.source)})});de.nodes.forEach(function(lt){lt.column=Math.floor(bt.call(null,lt,_t))})}function Mr(de,Dt,qt){var _t=E.nest().key(function(se){return se.column}).sortKeys(d.ascending).entries(de.nodes).map(function(se){return se.values});St(qt),Yt();for(var lt=1,yt=Dt;yt>0;--yt)Ht(lt*=.99,qt),Yt();function St(se){if(ue){var ke=1/0;_t.forEach(function(ar){var Ye=Jt*ue/(ar.length+1);ke=Ye<ke?Ye:ke}),Kt=ke}var Ee=d.min(_t,function(ar){return(Jt-Nt-(ar.length-1)*Kt)/d.sum(ar,m)});Ee=Ee*b,de.links.forEach(function(ar){ar.width=ar.value*Ee});var Ue=vr(de),ir=_r(de,Ue);Ee=Ee*ir,de.links.forEach(function(ar){ar.width=ar.value*Ee}),_t.forEach(function(ar){var Ye=ar.length;ar.forEach(function(Er,pn){Er.depth==_t.length-1&&Ye==1||Er.depth==0&&Ye==1?(Er.y0=Jt/2-Er.value*Ee,Er.y1=Er.y0+Er.value*Ee):Er.partOfCycle?R(Er,se)==0?(Er.y0=Jt/2+pn,Er.y1=Er.y0+Er.value*Ee):Er.circularLinkType=="top"?(Er.y0=Nt+pn,Er.y1=Er.y0+Er.value*Ee):(Er.y0=Jt-Er.value*Ee-pn,Er.y1=Er.y0+Er.value*Ee):Ue.top==0||Ue.bottom==0?(Er.y0=(Jt-Nt)/Ye*pn,Er.y1=Er.y0+Er.value*Ee):(Er.y0=(Jt-Nt)/2-Ye/2+pn,Er.y1=Er.y0+Er.value*Ee)})})}function Ht(se,ke){var Ee=_t.length;_t.forEach(function(Ue){var ir=Ue.length,ar=Ue[0].depth;Ue.forEach(function(Ye){var Er;if((Ye.sourceLinks.length||Ye.targetLinks.length)&&!(Ye.partOfCycle&&R(Ye,ke)>0))if(ar==0&&ir==1)Er=Ye.y1-Ye.y0,Ye.y0=Jt/2-Er/2,Ye.y1=Jt/2+Er/2;else if(ar==Ee-1&&ir==1)Er=Ye.y1-Ye.y0,Ye.y0=Jt/2-Er/2,Ye.y1=Jt/2+Er/2;else{var pn=0,dn=d.mean(Ye.sourceLinks,x),bn=d.mean(Ye.targetLinks,l);dn&&bn?pn=(dn+bn)/2:pn=dn||bn;var Zn=(pn-w(Ye))*se;Ye.y0+=Zn,Ye.y1+=Zn}})})}function Yt(){_t.forEach(function(se){var ke,Ee,Ue=Nt,ir=se.length,ar;for(se.sort(g),ar=0;ar<ir;++ar)ke=se[ar],Ee=Ue-ke.y0,Ee>0&&(ke.y0+=Ee,ke.y1+=Ee),Ue=ke.y1+Kt;if(Ee=Ue-Kt-Jt,Ee>0)for(Ue=ke.y0-=Ee,ke.y1-=Ee,ar=ir-2;ar>=0;--ar)ke=se[ar],Ee=ke.y1+Kt-Ue,Ee>0&&(ke.y0-=Ee,ke.y1-=Ee),Ue=ke.y0})}}function Ir(de){de.nodes.forEach(function(Dt){Dt.sourceLinks.sort(v),Dt.targetLinks.sort(f)}),de.nodes.forEach(function(Dt){var qt=Dt.y0,_t=qt,lt=Dt.y1,yt=lt;Dt.sourceLinks.forEach(function(St){St.circular?(St.y0=lt-St.width/2,lt=lt-St.width):(St.y0=qt+St.width/2,qt+=St.width)}),Dt.targetLinks.forEach(function(St){St.circular?(St.y1=yt-St.width/2,yt=yt-St.width):(St.y1=_t+St.width/2,_t+=St.width)})})}return Ce}function P(Ct,Nt,ee){var Jt=0;if(ee===null){for(var te=[],Kt=0;Kt<Ct.links.length;Kt++){var mt=Ct.links[Kt],bt=mt.source.index,vt=mt.target.index;te[bt]||(te[bt]=[]),te[vt]||(te[vt]=[]),te[bt].indexOf(vt)===-1&&te[bt].push(vt)}var Ut=t(te);Ut.sort(function(Me,Ce){return Me.length-Ce.length});var re={};for(Kt=0;Kt<Ut.length;Kt++){var Zt=Ut[Kt],ue=Zt.slice(-2);re[ue[0]]||(re[ue[0]]={}),re[ue[0]][ue[1]]=!0}Ct.links.forEach(function(Me){var Ce=Me.target.index,We=Me.source.index;Ce===We||re[We]&&re[We][Ce]?(Me.circular=!0,Me.circularLinkID=Jt,Jt=Jt+1):Me.circular=!1})}else Ct.links.forEach(function(Me){Me.source[ee]<Me.target[ee]?Me.circular=!1:(Me.circular=!0,Me.circularLinkID=Jt,Jt=Jt+1)})}function L(Ct,Nt){var ee=0,Jt=0;Ct.links.forEach(function(te){te.circular&&(te.source.circularLinkType||te.target.circularLinkType?te.circularLinkType=te.source.circularLinkType?te.source.circularLinkType:te.target.circularLinkType:te.circularLinkType=ee<Jt?"top":"bottom",te.circularLinkType=="top"?ee=ee+1:Jt=Jt+1,Ct.nodes.forEach(function(Kt){(T(Kt,Nt)==T(te.source,Nt)||T(Kt,Nt)==T(te.target,Nt))&&(Kt.circularLinkType=te.circularLinkType)}))}),Ct.links.forEach(function(te){te.circular&&(te.source.circularLinkType==te.target.circularLinkType&&(te.circularLinkType=te.source.circularLinkType),wt(te,Nt)&&(te.circularLinkType=te.source.circularLinkType))})}function D(Ct){var Nt=Math.abs(Ct.y1-Ct.y0),ee=Math.abs(Ct.target.x0-Ct.source.x1);return Math.atan(ee/Nt)}function B(Ct,Nt){return Ct.source.column<Nt.target.column?!1:!(Ct.target.column>Nt.source.column)}function R(Ct,Nt){var ee=0;Ct.sourceLinks.forEach(function(te){ee=te.circular&&!wt(te,Nt)?ee+1:ee});var Jt=0;return Ct.targetLinks.forEach(function(te){Jt=te.circular&&!wt(te,Nt)?Jt+1:Jt}),ee+Jt}function I(Ct){var Nt=Ct.source.sourceLinks,ee=0;Nt.forEach(function(Kt){ee=Kt.circular?ee+1:ee});var Jt=Ct.target.targetLinks,te=0;return Jt.forEach(function(Kt){te=Kt.circular?te+1:te}),!(ee>1||te>1)}function F(Ct,Nt,ee){return Ct.sort(G),Ct.forEach(function(Jt,te){var Kt=0;if(wt(Jt,ee)&&I(Jt))Jt.circularPathData.verticalBuffer=Kt+Jt.width/2;else{var mt=0;for(mt;mt<te;mt++)if(B(Ct[te],Ct[mt])){var bt=Ct[mt].circularPathData.verticalBuffer+Ct[mt].width/2+Nt;Kt=bt>Kt?bt:Kt}Jt.circularPathData.verticalBuffer=Kt+Jt.width/2}}),Ct}function N(Ct,Nt,ee,Jt){var te=5,Kt=d.min(Ct.links,function(vt){return vt.source.y0});Ct.links.forEach(function(vt){vt.circular&&(vt.circularPathData={})});var mt=Ct.links.filter(function(vt){return vt.circularLinkType=="top"});F(mt,Nt,Jt);var bt=Ct.links.filter(function(vt){return vt.circularLinkType=="bottom"});F(bt,Nt,Jt),Ct.links.forEach(function(vt){if(vt.circular){if(vt.circularPathData.arcRadius=vt.width+h,vt.circularPathData.leftNodeBuffer=te,vt.circularPathData.rightNodeBuffer=te,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,wt(vt,Jt)&&I(vt))vt.circularPathData.leftSmallArcRadius=h+vt.width/2,vt.circularPathData.leftLargeArcRadius=h+vt.width/2,vt.circularPathData.rightSmallArcRadius=h+vt.width/2,vt.circularPathData.rightLargeArcRadius=h+vt.width/2,vt.circularLinkType=="bottom"?(vt.circularPathData.verticalFullExtent=vt.source.y1+c+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-c-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,re=vt.circularLinkType,Zt=Ct.links.filter(function(Ce){return Ce.source.column==Ut&&Ce.circularLinkType==re});vt.circularLinkType=="bottom"?Zt.sort(ct):Zt.sort(rt);var ue=0;Zt.forEach(function(Ce,We){Ce.circularLinkID==vt.circularLinkID&&(vt.circularPathData.leftSmallArcRadius=h+vt.width/2+ue,vt.circularPathData.leftLargeArcRadius=h+vt.width/2+We*Nt+ue),ue=ue+Ce.width}),Ut=vt.target.column,Zt=Ct.links.filter(function(Ce){return Ce.target.column==Ut&&Ce.circularLinkType==re}),vt.circularLinkType=="bottom"?Zt.sort(et):Zt.sort(st),ue=0,Zt.forEach(function(Ce,We){Ce.circularLinkID==vt.circularLinkID&&(vt.circularPathData.rightSmallArcRadius=h+vt.width/2+ue,vt.circularPathData.rightLargeArcRadius=h+vt.width/2+We*Nt+ue),ue=ue+Ce.width}),vt.circularLinkType=="bottom"?(vt.circularPathData.verticalFullExtent=Math.max(ee,vt.source.y1,vt.target.y1)+c+vt.circularPathData.verticalBuffer,vt.circularPathData.verticalLeftInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.leftLargeArcRadius,vt.circularPathData.verticalRightInnerExtent=vt.circularPathData.verticalFullExtent-vt.circularPathData.rightLargeArcRadius):(vt.circularPathData.verticalFullExtent=Kt-c-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 Me=A.linkHorizontal().source(function(Ce){var We=Ce.source.x0+(Ce.source.x1-Ce.source.x0),qe=Ce.y0;return[We,qe]}).target(function(Ce){var We=Ce.target.x0,qe=Ce.y1;return[We,qe]});vt.path=Me(vt)}})}function j(Ct){var Nt="";return Ct.circularLinkType=="top"?Nt="M"+Ct.circularPathData.sourceX+" "+Ct.circularPathData.sourceY+" L"+Ct.circularPathData.leftInnerExtent+" "+Ct.circularPathData.sourceY+" A"+Ct.circularPathData.leftLargeArcRadius+" "+Ct.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ct.circularPathData.leftFullExtent+" "+(Ct.circularPathData.sourceY-Ct.circularPathData.leftSmallArcRadius)+" L"+Ct.circularPathData.leftFullExtent+" "+Ct.circularPathData.verticalLeftInnerExtent+" A"+Ct.circularPathData.leftLargeArcRadius+" "+Ct.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ct.circularPathData.leftInnerExtent+" "+Ct.circularPathData.verticalFullExtent+" L"+Ct.circularPathData.rightInnerExtent+" "+Ct.circularPathData.verticalFullExtent+" A"+Ct.circularPathData.rightLargeArcRadius+" "+Ct.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ct.circularPathData.rightFullExtent+" "+Ct.circularPathData.verticalRightInnerExtent+" L"+Ct.circularPathData.rightFullExtent+" "+(Ct.circularPathData.targetY-Ct.circularPathData.rightSmallArcRadius)+" A"+Ct.circularPathData.rightLargeArcRadius+" "+Ct.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ct.circularPathData.rightInnerExtent+" "+Ct.circularPathData.targetY+" L"+Ct.circularPathData.targetX+" "+Ct.circularPathData.targetY:Nt="M"+Ct.circularPathData.sourceX+" "+Ct.circularPathData.sourceY+" L"+Ct.circularPathData.leftInnerExtent+" "+Ct.circularPathData.sourceY+" A"+Ct.circularPathData.leftLargeArcRadius+" "+Ct.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ct.circularPathData.leftFullExtent+" "+(Ct.circularPathData.sourceY+Ct.circularPathData.leftSmallArcRadius)+" L"+Ct.circularPathData.leftFullExtent+" "+Ct.circularPathData.verticalLeftInnerExtent+" A"+Ct.circularPathData.leftLargeArcRadius+" "+Ct.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ct.circularPathData.leftInnerExtent+" "+Ct.circularPathData.verticalFullExtent+" L"+Ct.circularPathData.rightInnerExtent+" "+Ct.circularPathData.verticalFullExtent+" A"+Ct.circularPathData.rightLargeArcRadius+" "+Ct.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ct.circularPathData.rightFullExtent+" "+Ct.circularPathData.verticalRightInnerExtent+" L"+Ct.circularPathData.rightFullExtent+" "+(Ct.circularPathData.targetY+Ct.circularPathData.rightSmallArcRadius)+" A"+Ct.circularPathData.rightLargeArcRadius+" "+Ct.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ct.circularPathData.rightInnerExtent+" "+Ct.circularPathData.targetY+" L"+Ct.circularPathData.targetX+" "+Ct.circularPathData.targetY,Nt}function G(Ct,Nt){return K(Ct)==K(Nt)?Ct.circularLinkType=="bottom"?ct(Ct,Nt):rt(Ct,Nt):K(Nt)-K(Ct)}function rt(Ct,Nt){return Ct.y0-Nt.y0}function ct(Ct,Nt){return Nt.y0-Ct.y0}function st(Ct,Nt){return Ct.y1-Nt.y1}function et(Ct,Nt){return Nt.y1-Ct.y1}function K(Ct){return Ct.target.column-Ct.source.column}function ot(Ct){return Ct.target.x0-Ct.source.x1}function X(Ct,Nt){var ee=D(Ct),Jt=ot(Nt)/Math.tan(ee),te=Tt(Ct)=="up"?Ct.y1+Jt:Ct.y1-Jt;return te}function Q(Ct,Nt){var ee=D(Ct),Jt=ot(Nt)/Math.tan(ee),te=Tt(Ct)=="up"?Ct.y1-Jt:Ct.y1+Jt;return te}function ut(Ct,Nt,ee,Jt){Ct.links.forEach(function(te){if(!te.circular&&te.target.column-te.source.column>1){var Kt=te.source.column+1,mt=te.target.column-1,bt=1,vt=mt-Kt+1;for(bt=1;Kt<=mt;Kt++,bt++)Ct.nodes.forEach(function(Ut){if(Ut.column==Kt){var re=bt/(vt+1),Zt=Math.pow(1-re,3),ue=3*re*Math.pow(1-re,2),Me=3*Math.pow(re,2)*(1-re),Ce=Math.pow(re,3),We=Zt*te.y0+ue*te.y0+Me*te.y1+Ce*te.y1,qe=We-te.width/2,vr=We+te.width/2,_r;qe>Ut.y0&&qe<Ut.y1?(_r=Ut.y1-qe+10,_r=Ut.circularLinkType=="bottom"?_r:-_r,Ut=q(Ut,_r,Nt,ee),Ct.nodes.forEach(function(er){T(er,Jt)==T(Ut,Jt)||er.column!=Ut.column||J(Ut,er)&&q(er,_r,Nt,ee)})):vr>Ut.y0&&vr<Ut.y1?(_r=vr-Ut.y0+10,Ut=q(Ut,_r,Nt,ee),Ct.nodes.forEach(function(er){T(er,Jt)==T(Ut,Jt)||er.column!=Ut.column||er.y0<Ut.y1&&er.y1>Ut.y1&&q(er,_r,Nt,ee)})):qe<Ut.y0&&vr>Ut.y1&&(_r=vr-Ut.y0+10,Ut=q(Ut,_r,Nt,ee),Ct.nodes.forEach(function(er){T(er,Jt)==T(Ut,Jt)||er.column!=Ut.column||er.y0<Ut.y1&&er.y1>Ut.y1&&q(er,_r,Nt,ee)}))}})}})}function J(Ct,Nt){return Ct.y0>Nt.y0&&Ct.y0<Nt.y1||Ct.y1>Nt.y0&&Ct.y1<Nt.y1?!0:Ct.y0<Nt.y0&&Ct.y1>Nt.y1}function q(Ct,Nt,ee,Jt){return Ct.y0+Nt>=ee&&Ct.y1+Nt<=Jt&&(Ct.y0=Ct.y0+Nt,Ct.y1=Ct.y1+Nt,Ct.targetLinks.forEach(function(te){te.y1=te.y1+Nt}),Ct.sourceLinks.forEach(function(te){te.y0=te.y0+Nt})),Ct}function it(Ct,Nt,ee,Jt){Ct.nodes.forEach(function(te){Jt&&te.y+(te.y1-te.y0)>Nt&&(te.y=te.y-(te.y+(te.y1-te.y0)-Nt));var Kt=Ct.links.filter(function(vt){return T(vt.source,ee)==T(te,ee)}),mt=Kt.length;mt>1&&Kt.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 re=Q(Ut,vt);return vt.y1-re}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=te.y0;Kt.forEach(function(vt){vt.y0=bt+vt.width/2,bt=bt+vt.width}),Kt.forEach(function(vt,Ut){if(vt.circularLinkType=="bottom"){var re=Ut+1,Zt=0;for(re;re<mt;re++)Zt=Zt+Kt[re].width;vt.y0=te.y1-Zt-vt.width/2}})})}function nt(Ct,Nt,ee){Ct.nodes.forEach(function(Jt){var te=Ct.links.filter(function(bt){return T(bt.target,ee)==T(Jt,ee)}),Kt=te.length;Kt>1&&te.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=X(vt,bt);return bt.y0-Ut}if(bt.source.column<vt.source.column){var re=X(bt,vt);return re-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 mt=Jt.y0;te.forEach(function(bt){bt.y1=mt+bt.width/2,mt=mt+bt.width}),te.forEach(function(bt,vt){if(bt.circularLinkType=="bottom"){var Ut=vt+1,re=0;for(Ut;Ut<Kt;Ut++)re=re+te[Ut].width;bt.y1=Jt.y1-re-bt.width/2}})})}function dt(Ct,Nt){return Tt(Ct)==Tt(Nt)}function Tt(Ct){return Ct.y0-Ct.y1>0?"up":"down"}function wt(Ct,Nt){return T(Ct.source,Nt)==T(Ct.target,Nt)}function It(Ct,Nt,ee){var Jt=Ct.nodes,te=Ct.links,Kt=!1,mt=!1;if(te.forEach(function(ue){ue.circularLinkType=="top"?Kt=!0:ue.circularLinkType=="bottom"&&(mt=!0)}),Kt==!1||mt==!1){var bt=d.min(Jt,function(ue){return ue.y0}),vt=d.max(Jt,function(ue){return ue.y1}),Ut=vt-bt,re=ee-Nt,Zt=re/Ut;Jt.forEach(function(ue){var Me=(ue.y1-ue.y0)*Zt;ue.y0=(ue.y0-bt)*Zt,ue.y1=ue.y0+Me}),te.forEach(function(ue){ue.y0=(ue.y0-bt)*Zt,ue.y1=(ue.y1-bt)*Zt,ue.width=ue.width*Zt})}}u.sankeyCircular=_,u.sankeyCenter=o,u.sankeyLeft=r,u.sankeyRight=i,u.sankeyJustify=n,Object.defineProperty(u,"__esModule",{value:!0})})}),R5=Vt((Z,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"}}}),Jz=Vt((Z,V)=>{var u=Zz(),d=(k0(),vd(Fd)).interpolateNumber,E=Ni(),A=Yz(),t=$z(),e=R5(),r=kf(),i=Pi(),n=Eo(),o=Xr(),a=o.strTranslate,s=o.strRotate,f=bp(),v=f.keyFun,g=f.repeat,m=f.unwrap,w=Dl(),l=ji(),x=mf(),y=x.CAP_SHIFT,S=x.LINE_SPACING,k=3;function M(X,Q,ut){var J=m(Q),q=J.trace,it=q.domain,nt=q.orientation==="h",dt=q.node.pad,Tt=q.node.thickness,wt={justify:A.sankeyJustify,left:A.sankeyLeft,right:A.sankeyRight,center:A.sankeyCenter}[q.node.align],It=X.width*(it.x[1]-it.x[0]),Ct=X.height*(it.y[1]-it.y[0]),Nt=J._nodes,ee=J._links,Jt=J.circular,te;Jt?te=t.sankeyCircular().circularLinkGap(0):te=A.sankey(),te.iterations(e.sankeyIterations).size(nt?[It,Ct]:[Ct,It]).nodeWidth(Tt).nodePadding(dt).nodeId(function(er){return er.pointNumber}).nodeAlign(wt).nodes(Nt).links(ee);var Kt=te();te.nodePadding()<dt&&o.warn("node.pad was reduced to ",te.nodePadding()," to fit within the figure.");var mt,bt,vt;for(var Ut in J._groupLookup){var re=parseInt(J._groupLookup[Ut]),Zt;for(mt=0;mt<Kt.nodes.length;mt++)if(Kt.nodes[mt].pointNumber===re){Zt=Kt.nodes[mt];break}if(Zt){var ue={pointNumber:parseInt(Ut),x0:Zt.x0,x1:Zt.x1,y0:Zt.y0,y1:Zt.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};Kt.nodes.unshift(ue),Zt.childrenNodes.unshift(ue)}}function Me(){for(mt=0;mt<Kt.nodes.length;mt++){var er=Kt.nodes[mt],Mr={},Ir,de;for(bt=0;bt<er.targetLinks.length;bt++)de=er.targetLinks[bt],Ir=de.source.pointNumber+":"+de.target.pointNumber,Mr.hasOwnProperty(Ir)||(Mr[Ir]=[]),Mr[Ir].push(de);var Dt=Object.keys(Mr);for(bt=0;bt<Dt.length;bt++){Ir=Dt[bt];var qt=Mr[Ir],_t=0,lt={};for(vt=0;vt<qt.length;vt++)de=qt[vt],lt[de.label]||(lt[de.label]=0),lt[de.label]+=de.value,_t+=de.value;for(vt=0;vt<qt.length;vt++)de=qt[vt],de.flow={value:_t,labelConcentration:lt[de.label]/_t,concentration:de.value/_t,links:qt},de.concentrationscale&&(de.color=r(de.concentrationscale(de.flow.labelConcentration)))}var yt=0;for(bt=0;bt<er.sourceLinks.length;bt++)yt+=er.sourceLinks[bt].value;for(bt=0;bt<er.sourceLinks.length;bt++)de=er.sourceLinks[bt],de.concentrationOut=de.value/yt;var St=0;for(bt=0;bt<er.targetLinks.length;bt++)St+=er.targetLinks[bt].value;for(bt=0;bt<er.targetLinks.length;bt++)de=er.targetLinks[bt],de.concenrationIn=de.value/St}}Me();function Ce(er){er.forEach(function(Mr){var Ir,de,Dt=0,qt=Mr.length,_t;for(Mr.sort(function(lt,yt){return lt.y0-yt.y0}),_t=0;_t<qt;++_t)Ir=Mr[_t],Ir.y0>=Dt||(de=Dt-Ir.y0,de>1e-6&&(Ir.y0+=de,Ir.y1+=de)),Dt=Ir.y1+dt})}function We(er){var Mr=er.map(function(yt,St){return{x0:yt.x0,index:St}}).sort(function(yt,St){return yt.x0-St.x0}),Ir=[],de=-1,Dt,qt=-1/0,_t;for(mt=0;mt<Mr.length;mt++){var lt=er[Mr[mt].index];lt.x0>qt+Tt&&(de+=1,Dt=lt.x0),qt=lt.x0,Ir[de]||(Ir[de]=[]),Ir[de].push(lt),_t=Dt-lt.x0,lt.x0+=_t,lt.x1+=_t}return Ir}if(q.node.x.length&&q.node.y.length){for(mt=0;mt<Math.min(q.node.x.length,q.node.y.length,Kt.nodes.length);mt++)if(q.node.x[mt]&&q.node.y[mt]){var qe=[q.node.x[mt]*It,q.node.y[mt]*Ct];Kt.nodes[mt].x0=qe[0]-Tt/2,Kt.nodes[mt].x1=qe[0]+Tt/2;var vr=Kt.nodes[mt].y1-Kt.nodes[mt].y0;Kt.nodes[mt].y0=qe[1]-vr/2,Kt.nodes[mt].y1=qe[1]+vr/2}if(q.arrangement==="snap"){Nt=Kt.nodes;var _r=We(Nt);Ce(_r)}te.update(Kt)}return{circular:Jt,key:ut,trace:q,guid:o.randstr(),horizontal:nt,width:It,height:Ct,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:it.x[0]*X.width+X.margin.l,translateY:X.height-it.y[1]*X.height+X.margin.t,dragParallel:nt?Ct:It,dragPerpendicular:nt?It:Ct,arrangement:q.arrangement,sankey:te,graph:Kt,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function T(X,Q,ut){var J=r(Q.color),q=r(Q.hovercolor),it=Q.source.label+"|"+Q.target.label,nt=it+"__"+ut;return Q.trace=X.trace,Q.curveNumber=X.trace.index,{circular:X.circular,key:nt,traceId:X.key,pointNumber:Q.pointNumber,link:Q,tinyColorHue:i.tinyRGB(J),tinyColorAlpha:J.getAlpha(),tinyColorHoverHue:i.tinyRGB(q),tinyColorHoverAlpha:q.getAlpha(),linkPath:h,linkLineColor:X.linkLineColor,linkLineWidth:X.linkLineWidth,linkArrowLength:X.linkArrowLength,valueFormat:X.valueFormat,valueSuffix:X.valueSuffix,sankey:X.sankey,parent:X,interactionState:X.interactionState,flow:Q.flow}}function c(X,Q){var ut="",J=X.width/2,q=X.circularPathData,it=q.sourceX+q.verticalBuffer<q.targetX,nt=q.rightFullExtent-q.rightLargeArcRadius-Q<=q.leftFullExtent-J;return Math.abs(q.rightFullExtent-q.leftFullExtent-J)<J,X.circularLinkType==="top"?(ut="M "+(q.targetX-Q)+" "+(q.targetY+J)+" L "+(q.rightInnerExtent-Q)+" "+(q.targetY+J)+"A "+(q.rightLargeArcRadius+J)+" "+(q.rightSmallArcRadius+J)+" 0 0 1 "+(q.rightFullExtent-J-Q)+" "+(q.targetY-q.rightSmallArcRadius)+"L "+(q.rightFullExtent-J-Q)+" "+q.verticalRightInnerExtent,it&&nt?ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 1 "+(q.rightFullExtent+J-Q-(q.rightLargeArcRadius-J))+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius+J))+" L "+(q.rightFullExtent+J-(q.rightLargeArcRadius-J)-Q)+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius+J))+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftLargeArcRadius+J)+" 0 0 1 "+(q.leftFullExtent+J)+" "+q.verticalRightInnerExtent:it?ut+=" A "+(q.rightLargeArcRadius-J)+" "+(q.rightLargeArcRadius-J)+" 0 0 0 "+(q.rightFullExtent-J-Q-(q.rightLargeArcRadius-J))+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius-J))+" L "+(q.leftFullExtent+J+(q.rightLargeArcRadius-J))+" "+(q.verticalRightInnerExtent-(q.rightLargeArcRadius-J))+" A "+(q.leftLargeArcRadius-J)+" "+(q.leftLargeArcRadius-J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent:ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 1 "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent-J)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent-J)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftLargeArcRadius+J)+" 0 0 1 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent,ut+=" L "+(q.leftFullExtent+J)+" "+(q.sourceY-q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 1 "+q.leftInnerExtent+" "+(q.sourceY+J)+" L "+q.sourceX+" "+(q.sourceY+J)+" L "+q.sourceX+" "+(q.sourceY-J)+" L "+q.leftInnerExtent+" "+(q.sourceY-J)+" A "+(q.leftLargeArcRadius-J)+" "+(q.leftSmallArcRadius-J)+" 0 0 0 "+(q.leftFullExtent-J)+" "+(q.sourceY-q.leftSmallArcRadius)+" L "+(q.leftFullExtent-J)+" "+q.verticalLeftInnerExtent,it&&nt?ut+=" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 0 "+(q.leftFullExtent-J)+" "+(q.verticalFullExtent+J)+"L"+(q.rightFullExtent+J-Q)+" "+(q.verticalFullExtent+J)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 0 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent:it?ut+=" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 1 "+(q.leftFullExtent+J)+" "+(q.verticalFullExtent-J)+" L "+(q.rightFullExtent-J-Q)+" "+(q.verticalFullExtent-J)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 1 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent:ut+=" A "+(q.leftLargeArcRadius-J)+" "+(q.leftLargeArcRadius-J)+" 0 0 0 "+q.leftInnerExtent+" "+(q.verticalFullExtent+J)+" L "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent+J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightLargeArcRadius-J)+" 0 0 0 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent,ut+=" L "+(q.rightFullExtent+J-Q)+" "+(q.targetY-q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 0 "+(q.rightInnerExtent-Q)+" "+(q.targetY-J)+" L "+(q.targetX-Q)+" "+(q.targetY-J)+(Q>0?" L "+q.targetX+" "+q.targetY:"")+"Z"):(ut="M "+(q.targetX-Q)+" "+(q.targetY-J)+" L "+(q.rightInnerExtent-Q)+" "+(q.targetY-J)+" A "+(q.rightLargeArcRadius+J)+" "+(q.rightSmallArcRadius+J)+" 0 0 0 "+(q.rightFullExtent-J-Q)+" "+(q.targetY+q.rightSmallArcRadius)+" L "+(q.rightFullExtent-J-Q)+" "+q.verticalRightInnerExtent,it&&nt?ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.rightInnerExtent-J-Q)+" "+(q.verticalFullExtent+J)+" L "+(q.rightFullExtent+J-Q-(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent+J)+" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent:it?ut+=" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.rightFullExtent-Q-J-(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" L "+(q.leftFullExtent+J+(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent:ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent+J)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent+J)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftLargeArcRadius+J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+q.verticalLeftInnerExtent,ut+=" L "+(q.leftFullExtent+J)+" "+(q.sourceY+q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+J)+" "+(q.leftSmallArcRadius+J)+" 0 0 0 "+q.leftInnerExtent+" "+(q.sourceY-J)+" L "+q.sourceX+" "+(q.sourceY-J)+" L "+q.sourceX+" "+(q.sourceY+J)+" L "+q.leftInnerExtent+" "+(q.sourceY+J)+" A "+(q.leftLargeArcRadius-J)+" "+(q.leftSmallArcRadius-J)+" 0 0 1 "+(q.leftFullExtent-J)+" "+(q.sourceY+q.leftSmallArcRadius)+" L "+(q.leftFullExtent-J)+" "+q.verticalLeftInnerExtent,it&&nt?ut+=" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.leftFullExtent-J-(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" L "+(q.rightFullExtent+J-Q+(q.rightLargeArcRadius-J))+" "+(q.verticalFullExtent-J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent:it?ut+=" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.leftFullExtent+J)+" "+(q.verticalFullExtent+J)+" L "+(q.rightFullExtent-Q-J)+" "+(q.verticalFullExtent+J)+" A "+(q.rightLargeArcRadius+J)+" "+(q.rightLargeArcRadius+J)+" 0 0 0 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent:ut+=" A "+(q.leftLargeArcRadius-J)+" "+(q.leftLargeArcRadius-J)+" 0 0 1 "+q.leftInnerExtent+" "+(q.verticalFullExtent-J)+" L "+(q.rightInnerExtent-Q)+" "+(q.verticalFullExtent-J)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightLargeArcRadius-J)+" 0 0 1 "+(q.rightFullExtent+J-Q)+" "+q.verticalRightInnerExtent,ut+=" L "+(q.rightFullExtent+J-Q)+" "+(q.targetY+q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-J)+" "+(q.rightSmallArcRadius-J)+" 0 0 1 "+(q.rightInnerExtent-Q)+" "+(q.targetY+J)+" L "+(q.targetX-Q)+" "+(q.targetY+J)+(Q>0?" L "+q.targetX+" "+q.targetY:"")+"Z"),ut}function h(){var X=.5;function Q(ut){var J=ut.linkArrowLength;if(ut.link.circular)return c(ut.link,J);var q=Math.abs((ut.link.target.x0-ut.link.source.x1)/2);J>q&&(J=q);var it=ut.link.source.x1,nt=ut.link.target.x0-J,dt=d(it,nt),Tt=dt(X),wt=dt(1-X),It=ut.link.y0-ut.link.width/2,Ct=ut.link.y0+ut.link.width/2,Nt=ut.link.y1-ut.link.width/2,ee=ut.link.y1+ut.link.width/2,Jt="M"+it+","+It,te="C"+Tt+","+It+" "+wt+","+Nt+" "+nt+","+Nt,Kt="C"+wt+","+ee+" "+Tt+","+Ct+" "+it+","+Ct,mt=J>0?"L"+(nt+J)+","+(Nt+ut.link.width/2):"";return mt+="L"+nt+","+ee,Jt+te+mt+Kt+"Z"}return Q}function b(X,Q){var ut=r(Q.color),J=e.nodePadAcross,q=X.nodePad/2;Q.dx=Q.x1-Q.x0,Q.dy=Q.y1-Q.y0;var it=Q.dx,nt=Math.max(.5,Q.dy),dt="node_"+Q.pointNumber;return Q.group&&(dt=o.randstr()),Q.trace=X.trace,Q.curveNumber=X.trace.index,{index:Q.pointNumber,key:dt,partOfGroup:Q.partOfGroup||!1,group:Q.group,traceId:X.key,trace:X.trace,node:Q,nodePad:X.nodePad,nodeLineColor:X.nodeLineColor,nodeLineWidth:X.nodeLineWidth,textFont:X.textFont,size:X.horizontal?X.height:X.width,visibleWidth:Math.ceil(it),visibleHeight:nt,zoneX:-J,zoneY:-q,zoneWidth:it+2*J,zoneHeight:nt+2*q,labelY:X.horizontal?Q.dy/2+1:Q.dx/2+1,left:Q.originalLayer===1,sizeAcross:X.width,forceLayouts:X.forceLayouts,horizontal:X.horizontal,darkBackground:ut.getBrightness()<=128,tinyColorHue:i.tinyRGB(ut),tinyColorAlpha:ut.getAlpha(),valueFormat:X.valueFormat,valueSuffix:X.valueSuffix,sankey:X.sankey,graph:X.graph,arrangement:X.arrangement,uniqueNodeLabelPathId:[X.guid,X.key,dt].join("_"),interactionState:X.interactionState,figure:X}}function _(X){X.attr("transform",function(Q){return a(Q.node.x0.toFixed(3),Q.node.y0.toFixed(3))})}function P(X){X.call(_)}function L(X,Q){X.call(P),Q.attr("d",h())}function D(X){X.attr("width",function(Q){return Q.node.x1-Q.node.x0}).attr("height",function(Q){return Q.visibleHeight})}function B(X){return X.link.width>1||X.linkLineWidth>0}function R(X){var Q=a(X.translateX,X.translateY);return Q+(X.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function I(X,Q,ut){X.on(".basic",null).on("mouseover.basic",function(J){!J.interactionState.dragInProgress&&!J.partOfGroup&&(ut.hover(this,J,Q),J.interactionState.hovered=[this,J])}).on("mousemove.basic",function(J){!J.interactionState.dragInProgress&&!J.partOfGroup&&(ut.follow(this,J),J.interactionState.hovered=[this,J])}).on("mouseout.basic",function(J){!J.interactionState.dragInProgress&&!J.partOfGroup&&(ut.unhover(this,J,Q),J.interactionState.hovered=!1)}).on("click.basic",function(J){J.interactionState.hovered&&(ut.unhover(this,J,Q),J.interactionState.hovered=!1),!J.interactionState.dragInProgress&&!J.partOfGroup&&ut.select(this,J,Q)})}function F(X,Q,ut,J){var q=E.behavior.drag().origin(function(it){return{x:it.node.x0+it.visibleWidth/2,y:it.node.y0+it.visibleHeight/2}}).on("dragstart",function(it){if(it.arrangement!=="fixed"&&(o.ensureSingle(J._fullLayout._infolayer,"g","dragcover",function(dt){J._fullLayout._dragCover=dt}),o.raiseToTop(this),it.interactionState.dragInProgress=it.node,st(it.node),it.interactionState.hovered&&(ut.nodeEvents.unhover.apply(0,it.interactionState.hovered),it.interactionState.hovered=!1),it.arrangement==="snap")){var nt=it.traceId+"|"+it.key;it.forceLayouts[nt]?it.forceLayouts[nt].alpha(1):N(X,nt,it),j(X,Q,it,nt,J)}}).on("drag",function(it){if(it.arrangement!=="fixed"){var nt=E.event.x,dt=E.event.y;it.arrangement==="snap"?(it.node.x0=nt-it.visibleWidth/2,it.node.x1=nt+it.visibleWidth/2,it.node.y0=dt-it.visibleHeight/2,it.node.y1=dt+it.visibleHeight/2):(it.arrangement==="freeform"&&(it.node.x0=nt-it.visibleWidth/2,it.node.x1=nt+it.visibleWidth/2),dt=Math.max(0,Math.min(it.size-it.visibleHeight/2,dt)),it.node.y0=dt-it.visibleHeight/2,it.node.y1=dt+it.visibleHeight/2),st(it.node),it.arrangement!=="snap"&&(it.sankey.update(it.graph),L(X.filter(et(it)),Q))}}).on("dragend",function(it){if(it.arrangement!=="fixed"){it.interactionState.dragInProgress=!1;for(var nt=0;nt<it.node.childrenNodes.length;nt++)it.node.childrenNodes[nt].x=it.node.x,it.node.childrenNodes[nt].y=it.node.y;it.arrangement!=="snap"&&rt(it,J)}});X.on(".drag",null).call(q)}function N(X,Q,ut,J){K(ut.graph.nodes);var q=ut.graph.nodes.filter(function(it){return it.originalX===ut.node.originalX}).filter(function(it){return!it.partOfGroup});ut.forceLayouts[Q]=u.forceSimulation(q).alphaDecay(0).force("collide",u.forceCollide().radius(function(it){return it.dy/2+ut.nodePad/2}).strength(1).iterations(e.forceIterations)).force("constrain",G(X,Q,q,ut)).stop()}function j(X,Q,ut,J,q){window.requestAnimationFrame(function it(){var nt;for(nt=0;nt<e.forceTicksPerFrame;nt++)ut.forceLayouts[J].tick();var dt=ut.graph.nodes;if(ot(dt),ut.sankey.update(ut.graph),L(X.filter(et(ut)),Q),ut.forceLayouts[J].alpha()>0)window.requestAnimationFrame(it);else{var Tt=ut.node.originalX;ut.node.x0=Tt-ut.visibleWidth/2,ut.node.x1=Tt+ut.visibleWidth/2,rt(ut,q)}})}function G(X,Q,ut,J){return function(){for(var q=0,it=0;it<ut.length;it++){var nt=ut[it];nt===J.interactionState.dragInProgress?(nt.x=nt.lastDraggedX,nt.y=nt.lastDraggedY):(nt.vx=(nt.originalX-nt.x)/e.forceTicksPerFrame,nt.y=Math.min(J.size-nt.dy/2,Math.max(nt.dy/2,nt.y))),q=Math.max(q,Math.abs(nt.vx),Math.abs(nt.vy))}!J.interactionState.dragInProgress&&q<.1&&J.forceLayouts[Q].alpha()>0&&J.forceLayouts[Q].alpha(0)}}function rt(X,Q){for(var ut=[],J=[],q=0;q<X.graph.nodes.length;q++){var it=(X.graph.nodes[q].x0+X.graph.nodes[q].x1)/2,nt=(X.graph.nodes[q].y0+X.graph.nodes[q].y1)/2;ut.push(it/X.figure.width),J.push(nt/X.figure.height)}l.call("_guiRestyle",Q,{"node.x":[ut],"node.y":[J]},X.trace.index).then(function(){Q._fullLayout._dragCover&&Q._fullLayout._dragCover.remove()})}function ct(X){var Q=[],ut;for(ut=0;ut<X.length;ut++)X[ut].originalX=(X[ut].x0+X[ut].x1)/2,X[ut].originalY=(X[ut].y0+X[ut].y1)/2,Q.indexOf(X[ut].originalX)===-1&&Q.push(X[ut].originalX);for(Q.sort(function(J,q){return J-q}),ut=0;ut<X.length;ut++)X[ut].originalLayerIndex=Q.indexOf(X[ut].originalX),X[ut].originalLayer=X[ut].originalLayerIndex/(Q.length-1)}function st(X){X.lastDraggedX=X.x0+X.dx/2,X.lastDraggedY=X.y0+X.dy/2}function et(X){return function(Q){return Q.node.originalX===X.node.originalX}}function K(X){for(var Q=0;Q<X.length;Q++)X[Q].y=(X[Q].y0+X[Q].y1)/2,X[Q].x=(X[Q].x0+X[Q].x1)/2}function ot(X){for(var Q=0;Q<X.length;Q++)X[Q].y0=X[Q].y-X[Q].dy/2,X[Q].y1=X[Q].y0+X[Q].dy,X[Q].x0=X[Q].x-X[Q].dx/2,X[Q].x1=X[Q].x0+X[Q].dx}V.exports=function(X,Q,ut,J,q){var it=X._context.staticPlot,nt=!1;o.ensureSingle(X._fullLayout._infolayer,"g","first-render",function(){nt=!0});var dt=X._fullLayout._dragCover,Tt=ut.filter(function(Kt){return m(Kt).trace.visible}).map(M.bind(null,J)),wt=Q.selectAll("."+e.cn.sankey).data(Tt,v);wt.exit().remove(),wt.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",it?"none":"auto").attr("transform",R),wt.each(function(Kt,mt){X._fullData[mt]._sankey=Kt;var bt="bgsankey-"+Kt.trace.uid+"-"+mt;o.ensureSingle(X._fullLayout._draggers,"rect",bt),X._fullData[mt]._bgRect=E.select("."+bt),X._fullData[mt]._bgRect.style("pointer-events",it?"none":"all").attr("width",Kt.width).attr("height",Kt.height).attr("x",Kt.translateX).attr("y",Kt.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),wt.transition().ease(e.ease).duration(e.duration).attr("transform",R);var It=wt.selectAll("."+e.cn.sankeyLinks).data(g,v);It.enter().append("g").classed(e.cn.sankeyLinks,!0).style("fill","none");var Ct=It.selectAll("."+e.cn.sankeyLink).data(function(Kt){var mt=Kt.graph.links;return mt.filter(function(bt){return bt.value}).map(T.bind(null,Kt))},v);Ct.enter().append("path").classed(e.cn.sankeyLink,!0).call(I,wt,q.linkEvents),Ct.style("stroke",function(Kt){return B(Kt)?i.tinyRGB(r(Kt.linkLineColor)):Kt.tinyColorHue}).style("stroke-opacity",function(Kt){return B(Kt)?i.opacity(Kt.linkLineColor):Kt.tinyColorAlpha}).style("fill",function(Kt){return Kt.tinyColorHue}).style("fill-opacity",function(Kt){return Kt.tinyColorAlpha}).style("stroke-width",function(Kt){return B(Kt)?Kt.linkLineWidth:1}).attr("d",h()),Ct.style("opacity",function(){return X._context.staticPlot||nt||dt?1:0}).transition().ease(e.ease).duration(e.duration).style("opacity",1),Ct.exit().transition().ease(e.ease).duration(e.duration).style("opacity",0).remove();var Nt=wt.selectAll("."+e.cn.sankeyNodeSet).data(g,v);Nt.enter().append("g").classed(e.cn.sankeyNodeSet,!0),Nt.style("cursor",function(Kt){switch(Kt.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var ee=Nt.selectAll("."+e.cn.sankeyNode).data(function(Kt){var mt=Kt.graph.nodes;return ct(mt),mt.map(b.bind(null,Kt))},v);ee.enter().append("g").classed(e.cn.sankeyNode,!0).call(_).style("opacity",function(Kt){return(X._context.staticPlot||nt)&&!Kt.partOfGroup?1:0}),ee.call(I,wt,q.nodeEvents).call(F,Ct,q,X),ee.transition().ease(e.ease).duration(e.duration).call(_).style("opacity",function(Kt){return Kt.partOfGroup?0:1}),ee.exit().transition().ease(e.ease).duration(e.duration).style("opacity",0).remove();var Jt=ee.selectAll("."+e.cn.nodeRect).data(g);Jt.enter().append("rect").classed(e.cn.nodeRect,!0).call(D),Jt.style("stroke-width",function(Kt){return Kt.nodeLineWidth}).style("stroke",function(Kt){return i.tinyRGB(r(Kt.nodeLineColor))}).style("stroke-opacity",function(Kt){return i.opacity(Kt.nodeLineColor)}).style("fill",function(Kt){return Kt.tinyColorHue}).style("fill-opacity",function(Kt){return Kt.tinyColorAlpha}),Jt.transition().ease(e.ease).duration(e.duration).call(D);var te=ee.selectAll("."+e.cn.nodeLabel).data(g);te.enter().append("text").classed(e.cn.nodeLabel,!0).style("cursor","default"),te.attr("data-notex",1).text(function(Kt){return Kt.node.label}).each(function(Kt){var mt=E.select(this);n.font(mt,Kt.textFont),w.convertToTspans(mt,X)}).attr("text-anchor",function(Kt){return Kt.horizontal&&Kt.left?"end":"start"}).attr("transform",function(Kt){var mt=E.select(this),bt=w.lineCount(mt),vt=Kt.textFont.size*((bt-1)*S-y),Ut=Kt.nodeLineWidth/2+k,re=((Kt.horizontal?Kt.visibleHeight:Kt.visibleWidth)-vt)/2;Kt.horizontal&&(Kt.left?Ut=-Ut:Ut+=Kt.visibleWidth);var Zt=Kt.horizontal?"":"scale(-1,1)"+s(90);return a(Kt.horizontal?Ut:re,Kt.horizontal?re:Ut)+Zt}),te.transition().ease(e.ease).duration(e.duration)}}),N5=Vt((Z,V)=>{var u=Ni(),d=Xr(),E=d.numberFormat,A=Jz(),t=hc(),e=Pi(),r=R5().cn,i=d._;function n(y){return y!==""}function o(y,S){return y.filter(function(k){return k.key===S.traceId})}function a(y,S){u.select(y).select("path").style("fill-opacity",S),u.select(y).select("rect").style("fill-opacity",S)}function s(y){u.select(y).select("text.name").style("fill","black")}function f(y){return function(S){return y.node.sourceLinks.indexOf(S.link)!==-1||y.node.targetLinks.indexOf(S.link)!==-1}}function v(y){return function(S){return S.node.sourceLinks.indexOf(y.link)!==-1||S.node.targetLinks.indexOf(y.link)!==-1}}function g(y,S,k){S&&k&&o(k,S).selectAll("."+r.sankeyLink).filter(f(S)).call(w.bind(0,S,k,!1))}function m(y,S,k){S&&k&&o(k,S).selectAll("."+r.sankeyLink).filter(f(S)).call(l.bind(0,S,k,!1))}function w(y,S,k,M){M.style("fill",function(T){if(!T.link.concentrationscale)return T.tinyColorHoverHue}).style("fill-opacity",function(T){if(!T.link.concentrationscale)return T.tinyColorHoverAlpha}),M.each(function(T){var c=T.link.label;c!==""&&o(S,y).selectAll("."+r.sankeyLink).filter(function(h){return h.link.label===c}).style("fill",function(h){if(!h.link.concentrationscale)return h.tinyColorHoverHue}).style("fill-opacity",function(h){if(!h.link.concentrationscale)return h.tinyColorHoverAlpha})}),k&&o(S,y).selectAll("."+r.sankeyNode).filter(v(y)).call(g)}function l(y,S,k,M){M.style("fill",function(T){return T.tinyColorHue}).style("fill-opacity",function(T){return T.tinyColorAlpha}),M.each(function(T){var c=T.link.label;c!==""&&o(S,y).selectAll("."+r.sankeyLink).filter(function(h){return h.link.label===c}).style("fill",function(h){return h.tinyColorHue}).style("fill-opacity",function(h){return h.tinyColorAlpha})}),k&&o(S,y).selectAll(r.sankeyNode).filter(v(y)).call(m)}function x(y,S){var k=y.hoverlabel||{},M=d.nestedProperty(k,S).get();return Array.isArray(M)?!1:M}V.exports=function(y,S){for(var k=y._fullLayout,M=k._paper,T=k._size,c=0;c<y._fullData.length;c++)if(y._fullData[c].visible&&y._fullData[c].type===r.sankey&&!y._fullData[c]._viewInitial){var h=y._fullData[c].node;y._fullData[c]._viewInitial={node:{groups:h.groups.slice(),x:h.x.slice(),y:h.y.slice()}}}var b=function(ct,st){var et=st.link;et.originalEvent=u.event,y._hoverdata=[et],t.click(y,{target:!0})},_=function(ct,st,et){y._fullLayout.hovermode!==!1&&(u.select(ct).call(w.bind(0,st,et,!0)),st.link.trace.link.hoverinfo!=="skip"&&(st.link.fullData=st.link.trace,y.emit("plotly_hover",{event:u.event,points:[st.link]})))},P=i(y,"source:")+" ",L=i(y,"target:")+" ",D=i(y,"concentration:")+" ",B=i(y,"incoming flow count:")+" ",R=i(y,"outgoing flow count:")+" ",I=function(ct,st){if(y._fullLayout.hovermode===!1)return;var et=st.link.trace.link;if(et.hoverinfo==="none"||et.hoverinfo==="skip")return;var K=[];function ot(nt){var dt,Tt;nt.circular?(dt=(nt.circularPathData.leftInnerExtent+nt.circularPathData.rightInnerExtent)/2,Tt=nt.circularPathData.verticalFullExtent):(dt=(nt.source.x1+nt.target.x0)/2,Tt=(nt.y0+nt.y1)/2);var wt=[dt,Tt];return nt.trace.orientation==="v"&&wt.reverse(),wt[0]+=st.parent.translateX,wt[1]+=st.parent.translateY,wt}for(var X=0,Q=0;Q<st.flow.links.length;Q++){var ut=st.flow.links[Q];if(!(y._fullLayout.hovermode==="closest"&&st.link.pointNumber!==ut.pointNumber)){st.link.pointNumber===ut.pointNumber&&(X=Q),ut.fullData=ut.trace,et=st.link.trace.link;var J=ot(ut),q={valueLabel:E(st.valueFormat)(ut.value)+st.valueSuffix};K.push({x:J[0],y:J[1],name:q.valueLabel,text:[ut.label||"",P+ut.source.label,L+ut.target.label,ut.concentrationscale?D+E("%0.2f")(ut.flow.labelConcentration):""].filter(n).join("<br>"),color:x(et,"bgcolor")||e.addOpacity(ut.color,1),borderColor:x(et,"bordercolor"),fontFamily:x(et,"font.family"),fontSize:x(et,"font.size"),fontColor:x(et,"font.color"),fontWeight:x(et,"font.weight"),fontStyle:x(et,"font.style"),fontVariant:x(et,"font.variant"),fontTextcase:x(et,"font.textcase"),fontLineposition:x(et,"font.lineposition"),fontShadow:x(et,"font.shadow"),nameLength:x(et,"namelength"),textAlign:x(et,"align"),idealAlign:u.event.x<J[0]?"right":"left",hovertemplate:et.hovertemplate,hovertemplateLabels:q,eventData:[ut]})}}var it=t.loneHover(K,{container:k._hoverlayer.node(),outerContainer:k._paper.node(),gd:y,anchorIndex:X});it.each(function(){var nt=this;st.link.concentrationscale||a(nt,.65),s(nt)})},F=function(ct,st,et){y._fullLayout.hovermode!==!1&&(u.select(ct).call(l.bind(0,st,et,!0)),st.link.trace.link.hoverinfo!=="skip"&&(st.link.fullData=st.link.trace,y.emit("plotly_unhover",{event:u.event,points:[st.link]})),t.loneUnhover(k._hoverlayer.node()))},N=function(ct,st,et){var K=st.node;K.originalEvent=u.event,y._hoverdata=[K],u.select(ct).call(m,st,et),t.click(y,{target:!0})},j=function(ct,st,et){y._fullLayout.hovermode!==!1&&(u.select(ct).call(g,st,et),st.node.trace.node.hoverinfo!=="skip"&&(st.node.fullData=st.node.trace,y.emit("plotly_hover",{event:u.event,points:[st.node]})))},G=function(ct,st){if(y._fullLayout.hovermode!==!1){var et=st.node.trace.node;if(!(et.hoverinfo==="none"||et.hoverinfo==="skip")){var K=u.select(ct).select("."+r.nodeRect),ot=y._fullLayout._paperdiv.node().getBoundingClientRect(),X=K.node().getBoundingClientRect(),Q=X.left-2-ot.left,ut=X.right+2-ot.left,J=X.top+X.height/4-ot.top,q={valueLabel:E(st.valueFormat)(st.node.value)+st.valueSuffix};st.node.fullData=st.node.trace,y._fullLayout._calcInverseTransform(y);var it=y._fullLayout._invScaleX,nt=y._fullLayout._invScaleY,dt=t.loneHover({x0:it*Q,x1:it*ut,y:nt*J,name:E(st.valueFormat)(st.node.value)+st.valueSuffix,text:[st.node.label,B+st.node.targetLinks.length,R+st.node.sourceLinks.length].filter(n).join("<br>"),color:x(et,"bgcolor")||st.tinyColorHue,borderColor:x(et,"bordercolor"),fontFamily:x(et,"font.family"),fontSize:x(et,"font.size"),fontColor:x(et,"font.color"),fontWeight:x(et,"font.weight"),fontStyle:x(et,"font.style"),fontVariant:x(et,"font.variant"),fontTextcase:x(et,"font.textcase"),fontLineposition:x(et,"font.lineposition"),fontShadow:x(et,"font.shadow"),nameLength:x(et,"namelength"),textAlign:x(et,"align"),idealAlign:"left",hovertemplate:et.hovertemplate,hovertemplateLabels:q,eventData:[st.node]},{container:k._hoverlayer.node(),outerContainer:k._paper.node(),gd:y});a(dt,.85),s(dt)}}},rt=function(ct,st,et){y._fullLayout.hovermode!==!1&&(u.select(ct).call(m,st,et),st.node.trace.node.hoverinfo!=="skip"&&(st.node.fullData=st.node.trace,y.emit("plotly_unhover",{event:u.event,points:[st.node]})),t.loneUnhover(k._hoverlayer.node()))};A(y,M,S,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{linkEvents:{hover:_,follow:I,unhover:F,select:b},nodeEvents:{hover:j,follow:G,unhover:rt,select:N}})}}),Qz=Vt(Z=>{var V=Cu().overrideAll,u=If().getModuleCalcData,d=N5(),E=yd(),A=$h(),t=ih(),e=Sc().prepSelect,r=Xr(),i=ji(),n="sankey";Z.name=n,Z.baseLayoutAttrOverrides=V({hoverlabel:E.hoverlabel},"plot","nested"),Z.plot=function(a){var s=u(a.calcdata,n)[0];d(a,s),Z.updateFx(a)},Z.clean=function(a,s,f,v){var g=v._has&&v._has(n),m=s._has&&s._has(n);g&&!m&&(v._paperdiv.selectAll(".sankey").remove(),v._paperdiv.selectAll(".bgsankey").remove())},Z.updateFx=function(a){for(var s=0;s<a._fullData.length;s++)o(a,s)};function o(a,s){var f=a._fullData[s],v=a._fullLayout,g=v.dragmode,m=v.dragmode==="pan"?"move":"crosshair",w=f._bgRect;if(w&&!(g==="pan"||g==="zoom")){A(w,m);var l={_id:"x",c2p:r.identity,_offset:f._sankey.translateX,_length:f._sankey.width},x={_id:"y",c2p:r.identity,_offset:f._sankey.translateY,_length:f._sankey.height},y={gd:a,element:w.node(),plotinfo:{id:s,xaxis:l,yaxis:x,fillRangeItems:r.noop},subplot:s,xaxes:[l],yaxes:[x],doneFnCompleted:function(S){var k=a._fullData[s],M,T=k.node.groups.slice(),c=[];function h(L){for(var D=k._sankey.graph.nodes,B=0;B<D.length;B++)if(D[B].pointNumber===L)return D[B]}for(var b=0;b<S.length;b++){var _=h(S[b].pointNumber);if(_)if(_.group){for(var P=0;P<_.childrenNodes.length;P++)c.push(_.childrenNodes[P].pointNumber);T[_.pointNumber-k.node._count]=!1}else c.push(_.pointNumber)}M=T.filter(Boolean).concat([c]),i.call("_guiRestyle",a,{"node.groups":[M]},s)}};y.prepFn=function(S,k,M){e(S,k,M,y,g)},t.init(y)}}}),tL=Vt((Z,V)=>{V.exports=function(u,d){for(var E=u.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(),d&&d.contains(n,!1,r,u)&&A.push({pointNumber:i.pointNumber})}}return A}}),eL=Vt((Z,V)=>{V.exports={attributes:D5(),supplyDefaults:Vz(),calc:Hz(),plot:N5(),moduleType:"trace",name:"sankey",basePlotModule:Qz(),selectPoints:tL(),categories:["noOpacity"],meta:{}}}),rL=Vt((Z,V)=>{V.exports=eL()}),nL=Vt(Z=>{var V=Uu();Z.name="indicator",Z.plot=function(u,d,E,A){V.plotBasePlot(Z.name,u,d,E,A)},Z.clean=function(u,d,E,A){V.cleanBasePlot(Z.name,u,d,E,A)}}),j5=Vt((Z,V)=>{var u=So().extendFlat,d=So().extendDeep,E=Cu().overrideAll,A=yu(),t=nf(),e=Vu().attributes,r=Pf(),i=cl().templatedArray,n=Lm(),o=fc().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"},f={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},v=i("step",d({},s,{range:f}));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:u({},a,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:o("value")},font:u({},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:u({},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:d({},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:f,visible:u({},r.visible,{dflt:!0}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:u({},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:u({},s.line.color,{}),width:u({},s.line.width,{dflt:1}),editType:"plot"},thickness:u({},s.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),U5=Vt((Z,V)=>{V.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),aL=Vt((Z,V)=>{var u=Xr(),d=j5(),E=Vu().defaults,A=cl(),t=Wf(),e=U5(),r=i0(),i=vm(),n=Td(),o=kd();function a(f,v,g,m){function w(F,N){return u.coerce(f,v,d,F,N)}E(v,m,w),w("mode"),v._hasNumber=v.mode.indexOf("number")!==-1,v._hasDelta=v.mode.indexOf("delta")!==-1,v._hasGauge=v.mode.indexOf("gauge")!==-1;var l=w("value");v._range=[0,typeof l=="number"?1.5*l:1];var x=new Array(2),y;if(v._hasNumber){w("number.valueformat");var S=u.extendFlat({},m.font);S.size=void 0,u.coerceFont(w,"number.font",S),v.number.font.size===void 0&&(v.number.font.size=e.defaultNumberFontSize,x[0]=!0),w("number.prefix"),w("number.suffix"),y=v.number.font.size}var k;if(v._hasDelta){var M=u.extendFlat({},m.font);M.size=void 0,u.coerceFont(w,"delta.font",M),v.delta.font.size===void 0&&(v.delta.font.size=(v._hasNumber?.5:1)*(y||e.defaultNumberFontSize),x[1]=!0),w("delta.reference",v.value),w("delta.relative"),w("delta.valueformat",v.delta.relative?"2%":""),w("delta.increasing.symbol"),w("delta.increasing.color"),w("delta.decreasing.symbol"),w("delta.decreasing.color"),w("delta.position"),w("delta.prefix"),w("delta.suffix"),k=v.delta.font.size}v._scaleNumbers=(!v._hasNumber||x[0])&&(!v._hasDelta||x[1])||!1;var T=u.extendFlat({},m.font);T.size=.25*(y||k||e.defaultNumberFontSize),u.coerceFont(w,"title.font",T),w("title.text");var c,h,b,_;function P(F,N){return u.coerce(c,h,d.gauge,F,N)}function L(F,N){return u.coerce(b,_,d.gauge.axis,F,N)}if(v._hasGauge){c=f.gauge,c||(c={}),h=A.newContainer(v,"gauge"),P("shape");var D=v._isBullet=v.gauge.shape==="bullet";D||w("title.align","center");var B=v._isAngular=v.gauge.shape==="angular";B||w("align","center"),P("bgcolor",m.paper_bgcolor),P("borderwidth"),P("bordercolor"),P("bar.color"),P("bar.line.color"),P("bar.line.width");var R=e.valueThickness*(v.gauge.shape==="bullet"?.5:1);P("bar.thickness",R),t(c,h,{name:"steps",handleItemDefaults:s}),P("threshold.value"),P("threshold.thickness"),P("threshold.line.width"),P("threshold.line.color"),b={},c&&(b=c.axis||{}),_=A.newContainer(h,"axis"),L("visible"),v._range=L("range",v._range);var I={font:m.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};r(b,_,L,"linear"),o(b,_,L,"linear",I),n(b,_,L,"linear",I),i(b,_,L,I)}else w("title.align","center"),w("align","center"),v._isAngular=v._isBullet=!1;v._length=null}function s(f,v){function g(m,w){return u.coerce(f,v,d.gauge.steps,m,w)}g("color"),g("line.color"),g("line.width"),g("range"),g("thickness")}V.exports={supplyDefaults:a}}),iL=Vt((Z,V)=>{function u(d,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:u}}),oL=Vt((Z,V)=>{var u=Ni(),d=(k0(),vd(Fd)).interpolate,E=(k0(),vd(Fd)).interpolateNumber,A=Xr(),t=A.strScale,e=A.strTranslate,r=A.rad2deg,i=mf().MID_SHIFT,n=Eo(),o=U5(),a=Dl(),s=yo(),f=Vg(),v=Qy(),g=Pf(),m=Pi(),w={left:"start",center:"middle",right:"end"},l={left:0,center:.5,right:1},x=/[yzafpnµmkMGTPEZY]/;function y(D){return D&&D.duration>0}V.exports=function(D,B,R,I){var F=D._fullLayout,N;y(R)&&I&&(N=I()),A.makeTraceGroups(F._indicatorlayer,B,"trace").each(function(j){var G=j[0],rt=G.trace,ct=u.select(this),st=rt._hasGauge,et=rt._isAngular,K=rt._isBullet,ot=rt.domain,X={w:F._size.w*(ot.x[1]-ot.x[0]),h:F._size.h*(ot.y[1]-ot.y[0]),l:F._size.l+F._size.w*ot.x[0],r:F._size.r+F._size.w*(1-ot.x[1]),t:F._size.t+F._size.h*(1-ot.y[1]),b:F._size.b+F._size.h*ot.y[0]},Q=X.l+X.w/2,ut=X.t+X.h/2,J=Math.min(X.w/2,X.h),q=o.innerRadius*J,it,nt,dt,Tt=rt.align||"center";if(nt=ut,!st)it=X.l+l[Tt]*X.w,dt=function(bt){return b(bt,X.w,X.h)};else if(et&&(it=Q,nt=ut+J/2,dt=function(bt){return _(bt,.9*q)}),K){var wt=o.bulletPadding,It=1-o.bulletNumberDomainSize+wt;it=X.l+(It+(1-It)*l[Tt])*X.w,dt=function(bt){return b(bt,(o.bulletNumberDomainSize-wt)*X.w,X.h)}}M(D,ct,j,{numbersX:it,numbersY:nt,numbersScaler:dt,transitionOpts:R,onComplete:N});var Ct,Nt;st&&(Ct={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 ee=ct.selectAll("g.angular").data(et?j:[]);ee.exit().remove();var Jt=ct.selectAll("g.angularaxis").data(et?j:[]);Jt.exit().remove(),et&&k(D,ct,j,{radius:J,innerRadius:q,gauge:ee,layer:Jt,size:X,gaugeBg:Ct,gaugeOutline:Nt,transitionOpts:R,onComplete:N});var te=ct.selectAll("g.bullet").data(K?j:[]);te.exit().remove();var Kt=ct.selectAll("g.bulletaxis").data(K?j:[]);Kt.exit().remove(),K&&S(D,ct,j,{gauge:te,layer:Kt,size:X,gaugeBg:Ct,gaugeOutline:Nt,transitionOpts:R,onComplete:N});var mt=ct.selectAll("text.title").data(j);mt.exit().remove(),mt.enter().append("text").classed("title",!0),mt.attr("text-anchor",function(){return K?w.right:w[rt.title.align]}).text(rt.title.text).call(n.font,rt.title.font).call(a.convertToTspans,D),mt.attr("transform",function(){var bt=X.l+X.w*l[rt.title.align],vt,Ut=o.titlePadding,re=n.bBox(mt.node());if(st){if(et)if(rt.gauge.axis.visible){var Zt=n.bBox(Jt.node());vt=Zt.top-Ut-re.bottom}else vt=X.t+X.h/2-J/2-re.bottom-Ut;K&&(vt=nt-(re.top+re.bottom)/2,bt=X.l-o.bulletPadding*X.w)}else vt=rt._numbersTop-Ut-re.bottom;return e(bt,vt)})})};function S(D,B,R,I){var F=R[0].trace,N=I.gauge,j=I.layer,G=I.gaugeBg,rt=I.gaugeOutline,ct=I.size,st=F.domain,et=I.transitionOpts,K=I.onComplete,ot,X,Q,ut,J;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,it=F.gauge.bar.thickness*q,nt=st.x[0],dt=st.x[0]+(st.x[1]-st.x[0])*(F._hasNumber||F._hasDelta?1-o.bulletNumberDomainSize:1);ot=h(D,F.gauge.axis),ot._id="xbulletaxis",ot.domain=[nt,dt],ot.setScale(),X=s.calcTicks(ot),Q=s.makeTransTickFn(ot),ut=s.getTickSigns(ot)[2],J=ct.t+ct.h,ot.visible&&(s.drawTicks(D,ot,{vals:ot.ticks==="inside"?s.clipEnds(ot,X):X,layer:j,path:s.makeTickPath(ot,J,ut),transFn:Q}),s.drawLabels(D,ot,{vals:X,layer:j,transFn:Q,labelFns:s.makeLabelFns(ot,J)}));function Tt(te){te.attr("width",function(Kt){return Math.max(0,ot.c2p(Kt.range[1])-ot.c2p(Kt.range[0]))}).attr("x",function(Kt){return ot.c2p(Kt.range[0])}).attr("y",function(Kt){return .5*(1-Kt.thickness)*q}).attr("height",function(Kt){return Kt.thickness*q})}var wt=[G].concat(F.gauge.steps),It=N.selectAll("g.bg-bullet").data(wt);It.enter().append("g").classed("bg-bullet",!0).append("rect"),It.select("rect").call(Tt).call(T),It.exit().remove();var Ct=N.selectAll("g.value-bullet").data([F.gauge.bar]);Ct.enter().append("g").classed("value-bullet",!0).append("rect"),Ct.select("rect").attr("height",it).attr("y",(q-it)/2).call(T),y(et)?Ct.select("rect").transition().duration(et.duration).ease(et.easing).each("end",function(){K&&K()}).each("interrupt",function(){K&&K()}).attr("width",Math.max(0,ot.c2p(Math.min(F.gauge.axis.range[1],R[0].y)))):Ct.select("rect").attr("width",typeof R[0].y=="number"?Math.max(0,ot.c2p(Math.min(F.gauge.axis.range[1],R[0].y))):0),Ct.exit().remove();var Nt=R.filter(function(){return F.gauge.threshold.value||F.gauge.threshold.value===0}),ee=N.selectAll("g.threshold-bullet").data(Nt);ee.enter().append("g").classed("threshold-bullet",!0).append("line"),ee.select("line").attr("x1",ot.c2p(F.gauge.threshold.value)).attr("x2",ot.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(m.stroke,F.gauge.threshold.line.color).style("stroke-width",F.gauge.threshold.line.width),ee.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(Tt).call(T),Jt.exit().remove()}function k(D,B,R,I){var F=R[0].trace,N=I.size,j=I.radius,G=I.innerRadius,rt=I.gaugeBg,ct=I.gaugeOutline,st=[N.l+N.w/2,N.t+N.h/2+j/2],et=I.gauge,K=I.layer,ot=I.transitionOpts,X=I.onComplete,Q=Math.PI/2;function ut(Me){var Ce=F.gauge.axis.range[0],We=F.gauge.axis.range[1],qe=(Me-Ce)/(We-Ce)*Math.PI-Q;return qe<-Q?-Q:qe>Q?Q:qe}function J(Me){return u.svg.arc().innerRadius((G+j)/2-Me/2*(j-G)).outerRadius((G+j)/2+Me/2*(j-G)).startAngle(-Q)}function q(Me){Me.attr("d",function(Ce){return J(Ce.thickness).startAngle(ut(Ce.range[0])).endAngle(ut(Ce.range[1]))()})}var it,nt,dt,Tt;et.enter().append("g").classed("angular",!0),et.attr("transform",e(st[0],st[1])),K.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),K.selectAll("g.xangularaxistick,path,text").remove(),it=h(D,F.gauge.axis),it.type="linear",it.range=F.gauge.axis.range,it._id="xangularaxis",it.ticklabeloverflow="allow",it.setScale();var wt=function(Me){return(it.range[0]-Me.x)/(it.range[1]-it.range[0])*Math.PI+Math.PI},It={},Ct=s.makeLabelFns(it,0),Nt=Ct.labelStandoff;It.xFn=function(Me){var Ce=wt(Me);return Math.cos(Ce)*Nt},It.yFn=function(Me){var Ce=wt(Me),We=Math.sin(Ce)>0?.2:1;return-Math.sin(Ce)*(Nt+Me.fontSize*We)+Math.abs(Math.cos(Ce))*(Me.fontSize*i)},It.anchorFn=function(Me){var Ce=wt(Me),We=Math.cos(Ce);return Math.abs(We)<.1?"middle":We>0?"start":"end"},It.heightFn=function(Me,Ce,We){var qe=wt(Me);return-.5*(1+Math.sin(qe))*We};var ee=function(Me){return e(st[0]+j*Math.cos(Me),st[1]-j*Math.sin(Me))};dt=function(Me){return ee(wt(Me))};var Jt=function(Me){var Ce=wt(Me);return ee(Ce)+"rotate("+-r(Ce)+")"};if(nt=s.calcTicks(it),Tt=s.getTickSigns(it)[2],it.visible){Tt=it.ticks==="inside"?-1:1;var te=(it.linewidth||1)/2;s.drawTicks(D,it,{vals:nt,layer:K,path:"M"+Tt*te+",0h"+Tt*it.ticklen,transFn:Jt}),s.drawLabels(D,it,{vals:nt,layer:K,transFn:dt,labelFns:It})}var Kt=[rt].concat(F.gauge.steps),mt=et.selectAll("g.bg-arc").data(Kt);mt.enter().append("g").classed("bg-arc",!0).append("path"),mt.select("path").call(q).call(T),mt.exit().remove();var bt=J(F.gauge.bar.thickness),vt=et.selectAll("g.value-arc").data([F.gauge.bar]);vt.enter().append("g").classed("value-arc",!0).append("path");var Ut=vt.select("path");y(ot)?(Ut.transition().duration(ot.duration).ease(ot.easing).each("end",function(){X&&X()}).each("interrupt",function(){X&&X()}).attrTween("d",c(bt,ut(R[0].lastY),ut(R[0].y))),F._lastValue=R[0].y):Ut.attr("d",typeof R[0].y=="number"?bt.endAngle(ut(R[0].y)):"M0,0Z"),Ut.call(T),vt.exit().remove(),Kt=[];var re=F.gauge.threshold.value;(re||re===0)&&Kt.push({range:[re,re],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=et.selectAll("g.threshold-arc").data(Kt);Zt.enter().append("g").classed("threshold-arc",!0).append("path"),Zt.select("path").call(q).call(T),Zt.exit().remove();var ue=et.selectAll("g.gauge-outline").data([ct]);ue.enter().append("g").classed("gauge-outline",!0).append("path"),ue.select("path").call(q).call(T),ue.exit().remove()}function M(D,B,R,I){var F=R[0].trace,N=I.numbersX,j=I.numbersY,G=F.align||"center",rt=w[G],ct=I.transitionOpts,st=I.onComplete,et=A.ensureSingle(B,"g","numbers"),K,ot,X,Q=[];F._hasNumber&&Q.push("number"),F._hasDelta&&(Q.push("delta"),F.delta.position==="left"&&Q.reverse());var ut=et.selectAll("text").data(Q);ut.enter().append("text"),ut.attr("text-anchor",function(){return rt}).attr("class",function(ee){return ee}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ut.exit().remove();function J(ee,Jt,te,Kt){if(ee.match("s")&&te>=0!=Kt>=0&&!Jt(te).slice(-1).match(x)&&!Jt(Kt).slice(-1).match(x)){var mt=ee.slice().replace("s","f").replace(/\d+/,function(vt){return parseInt(vt)-1}),bt=h(D,{tickformat:mt});return function(vt){return Math.abs(vt)<1?s.tickText(bt,vt).text:Jt(vt)}}else return Jt}function q(){var ee=h(D,{tickformat:F.number.valueformat},F._range);ee.setScale(),s.prepTicks(ee);var Jt=function(vt){return s.tickText(ee,vt).text},te=F.number.suffix,Kt=F.number.prefix,mt=et.select("text.number");function bt(){var vt=typeof R[0].y=="number"?Kt+Jt(R[0].y)+te:"-";mt.text(vt).call(n.font,F.number.font).call(a.convertToTspans,D)}return y(ct)?mt.transition().duration(ct.duration).ease(ct.easing).each("end",function(){bt(),st&&st()}).each("interrupt",function(){bt(),st&&st()}).attrTween("text",function(){var vt=u.select(this),Ut=E(R[0].lastY,R[0].y);F._lastValue=R[0].y;var re=J(F.number.valueformat,Jt,R[0].lastY,R[0].y);return function(Zt){vt.text(Kt+re(Ut(Zt))+te)}}):bt(),K=P(Kt+Jt(R[0].y)+te,F.number.font,rt,D),mt}function it(){var ee=h(D,{tickformat:F.delta.valueformat},F._range);ee.setScale(),s.prepTicks(ee);var Jt=function(Zt){return s.tickText(ee,Zt).text},te=F.delta.suffix,Kt=F.delta.prefix,mt=function(Zt){var ue=F.delta.relative?Zt.relativeDelta:Zt.delta;return ue},bt=function(Zt,ue){return Zt===0||typeof Zt!="number"||isNaN(Zt)?"-":(Zt>0?F.delta.increasing.symbol:F.delta.decreasing.symbol)+Kt+ue(Zt)+te},vt=function(Zt){return Zt.delta>=0?F.delta.increasing.color:F.delta.decreasing.color};F._deltaLastValue===void 0&&(F._deltaLastValue=mt(R[0]));var Ut=et.select("text.delta");Ut.call(n.font,F.delta.font).call(m.fill,vt({delta:F._deltaLastValue}));function re(){Ut.text(bt(mt(R[0]),Jt)).call(m.fill,vt(R[0])).call(a.convertToTspans,D)}return y(ct)?Ut.transition().duration(ct.duration).ease(ct.easing).tween("text",function(){var Zt=u.select(this),ue=mt(R[0]),Me=F._deltaLastValue,Ce=J(F.delta.valueformat,Jt,Me,ue),We=E(Me,ue);return F._deltaLastValue=ue,function(qe){Zt.text(bt(We(qe),Ce)),Zt.call(m.fill,vt({delta:We(qe)}))}}).each("end",function(){re(),st&&st()}).each("interrupt",function(){re(),st&&st()}):re(),ot=P(bt(mt(R[0]),Jt),F.delta.font,rt,D),Ut}var nt=F.mode+F.align,dt;if(F._hasDelta&&(dt=it(),nt+=F.delta.position+F.delta.font.size+F.delta.font.family+F.delta.valueformat,nt+=F.delta.increasing.symbol+F.delta.decreasing.symbol,X=ot),F._hasNumber&&(q(),nt+=F.number.font.size+F.number.font.family+F.number.valueformat+F.number.suffix+F.number.prefix,X=K),F._hasDelta&&F._hasNumber){var Tt=[(K.left+K.right)/2,(K.top+K.bottom)/2],wt=[(ot.left+ot.right)/2,(ot.top+ot.bottom)/2],It,Ct,Nt=.75*F.delta.font.size;F.delta.position==="left"&&(It=L(F,"deltaPos",0,-1*(K.width*l[F.align]+ot.width*(1-l[F.align])+Nt),nt,Math.min),Ct=Tt[1]-wt[1],X={width:K.width+ot.width+Nt,height:Math.max(K.height,ot.height),left:ot.left+It,right:K.right,top:Math.min(K.top,ot.top+Ct),bottom:Math.max(K.bottom,ot.bottom+Ct)}),F.delta.position==="right"&&(It=L(F,"deltaPos",0,K.width*(1-l[F.align])+ot.width*l[F.align]+Nt,nt,Math.max),Ct=Tt[1]-wt[1],X={width:K.width+ot.width+Nt,height:Math.max(K.height,ot.height),left:K.left,right:ot.right+It,top:Math.min(K.top,ot.top+Ct),bottom:Math.max(K.bottom,ot.bottom+Ct)}),F.delta.position==="bottom"&&(It=null,Ct=ot.height,X={width:Math.max(K.width,ot.width),height:K.height+ot.height,left:Math.min(K.left,ot.left),right:Math.max(K.right,ot.right),top:K.bottom-K.height,bottom:K.bottom+ot.height}),F.delta.position==="top"&&(It=null,Ct=K.top,X={width:Math.max(K.width,ot.width),height:K.height+ot.height,left:Math.min(K.left,ot.left),right:Math.max(K.right,ot.right),top:K.bottom-K.height-ot.height,bottom:K.bottom}),dt.attr({dx:It,dy:Ct})}(F._hasNumber||F._hasDelta)&&et.attr("transform",function(){var ee=I.numbersScaler(X);nt+=ee[2];var Jt=L(F,"numbersScale",1,ee[0],nt,Math.min),te;F._scaleNumbers||(Jt=1),F._isAngular?te=j-Jt*X.bottom:te=j-Jt*(X.top+X.bottom)/2,F._numbersTop=Jt*X.top+te;var Kt=X[G];G==="center"&&(Kt=(X.left+X.right)/2);var mt=N-Jt*Kt;return mt=L(F,"numbersTranslate",0,mt,nt,Math.max),e(mt,te)+t(Jt)})}function T(D){D.each(function(B){m.stroke(u.select(this),B.line.color)}).each(function(B){m.fill(u.select(this),B.color)}).style("stroke-width",function(B){return B.line.width})}function c(D,B,R){return function(){var I=d(B,R);return function(F){return D.endAngle(I(F))()}}}function h(D,B,R){var I=D._fullLayout,F=A.extendFlat({type:"linear",ticks:"outside",range:R,showline:!0},B),N={type:"linear",_id:"x"+B._id},j={letter:"x",font:I.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function G(rt,ct){return A.coerce(F,N,g,rt,ct)}return f(F,N,G,j,I),v(F,N,G,j),N}function b(D,B,R){var I=Math.min(B/D.width,R/D.height);return[I,D,B+"x"+R]}function _(D,B){var R=Math.sqrt(D.width/2*(D.width/2)+D.height*D.height),I=B/R;return[I,D,B]}function P(D,B,R,I){var F=document.createElementNS("http://www.w3.org/2000/svg","text"),N=u.select(F);return N.text(D).attr("x",0).attr("y",0).attr("text-anchor",R).attr("data-unformatted",D).call(a.convertToTspans,I).call(n.font,B),n.bBox(N.node())}function L(D,B,R,I,F,N){var j="_cache"+B;D[j]&&D[j].key===F||(D[j]={key:F,value:R});var G=A.aggNums(N,null,[D[j].value,I],2);return D[j].value=G,G}}),sL=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"indicator",basePlotModule:nL(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:j5(),supplyDefaults:aL().supplyDefaults,calc:iL().calc,plot:oL(),meta:{}}}),lL=Vt((Z,V)=>{V.exports=sL()}),V5=Vt((Z,V)=>{var u=l0(),d=So().extendFlat,E=Cu().overrideAll,A=yu(),t=Vu().attributes,e=fc().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:d({},u.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:d({},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:d({},u.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:d({},A({arrayOk:!0}))}},"calc","from-root")}),uL=Vt((Z,V)=>{var u=Xr(),d=V5(),E=Vu().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(f,v){return f-v}),a=n.map(function(f){return o.indexOf(f)}),s=a.length;s<i;s++)a.push(s);e("columnorder",a)}V.exports=function(t,e,r,i){function n(o,a){return u.coerce(t,e,d,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"),u.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"),u.coerceFont(n,"cells.font",i.font),e._length=null}}),cL=Vt((Z,V)=>{var u=bp().wrap;V.exports=function(){return u({})}}),H5=Vt((Z,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"}}}),fL=Vt((Z,V)=>{var u=H5(),d=So().extendFlat,E=Lo(),A=rh().isTypedArray,t=rh().isArrayOrTypedArray;V.exports=function(v,g){var m=i(g.cells.values),w=function(G){return G.slice(g.header.values.length,G.length)},l=i(g.header.values);l.length&&!l[0].length&&(l[0]=[""],l=i(l));var x=l.concat(w(m).map(function(){return n((l[0]||[""]).length)})),y=g.domain,S=Math.floor(v._fullLayout._size.w*(y.x[1]-y.x[0])),k=Math.floor(v._fullLayout._size.h*(y.y[1]-y.y[0])),M=g.header.values.length?x[0].map(function(){return g.header.height}):[u.emptyHeaderHeight],T=m.length?m[0].map(function(){return g.cells.height}):[],c=M.reduce(r,0),h=k-c,b=h+u.uplift,_=s(T,b),P=s(M,c),L=a(P,[]),D=a(_,L),B={},R=g._fullInput.columnorder;t(R)&&(R=Array.from(R)),R=R.concat(w(m.map(function(G,rt){return rt})));var I=x.map(function(G,rt){var ct=t(g.columnwidth)?g.columnwidth[Math.min(rt,g.columnwidth.length-1)]:g.columnwidth;return E(ct)?Number(ct):1}),F=I.reduce(r,0);I=I.map(function(G){return G/F*S});var N=Math.max(e(g.header.line.width),e(g.cells.line.width)),j={key:g.uid+v._context.staticPlot,translateX:y.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-y.y[1]),size:v._fullLayout._size,width:S,maxLineWidth:N,height:k,columnOrder:R,groupHeight:k,rowBlocks:D,headerRowBlocks:L,scrollY:0,cells:d({},g.cells,{values:m}),headerCells:d({},g.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 st=G+"__"+B[G];return{key:st,label:G,specIndex:rt,xIndex:R[rt],xScale:o,x:void 0,calcdata:void 0,columnWidth:I[rt]}})};return j.columns.forEach(function(G){G.calcdata=j,G.x=o(G)}),j};function e(v){if(t(v)){for(var g=0,m=0;m<v.length;m++)g=Math.max(g,e(v[m]));return g}return v}function r(v,g){return v+g}function i(v){var g=v.slice(),m=1/0,w=0,l;for(l=0;l<g.length;l++)A(g[l])?g[l]=Array.from(g[l]):t(g[l])||(g[l]=[g[l]]),m=Math.min(m,g[l].length),w=Math.max(w,g[l].length);if(m!==w)for(l=0;l<g.length;l++){var x=w-g[l].length;x&&(g[l]=g[l].concat(n(x)))}return g}function n(v){for(var g=new Array(v),m=0;m<v;m++)g[m]="";return g}function o(v){return v.calcdata.columns.reduce(function(g,m){return m.xIndex<v.xIndex?g+m.columnWidth:g},0)}function a(v,g){var m=Object.keys(v);return m.map(function(w){return d({},v[w],{auxiliaryBlocks:g})})}function s(v,g){for(var m={},w,l=0,x=0,y=f(),S=0,k=0,M=0;M<v.length;M++)w=v[M],y.rows.push({rowIndex:M,rowHeight:w}),x+=w,(x>=g||M===v.length-1)&&(m[l]=y,y.key=k++,y.firstRowIndex=S,y.lastRowIndex=M,y=f(),l+=x,S=M+1,x=0);return m}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),hL=Vt(Z=>{var V=So().extendFlat;Z.splitToPanels=function(d){var E=[0,0],A=V({},d,{key:"header",type:"header",page:0,prevPages:E,currentRepaint:[null,null],dragHandle:!0,values:d.calcdata.headerCells.values[d.specIndex],rowBlocks:d.calcdata.headerRowBlocks,calcdata:V({},d.calcdata,{cells:d.calcdata.headerCells})}),t=V({},d,{key:"cells1",type:"cells",page:0,prevPages:E,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks}),e=V({},d,{key:"cells2",type:"cells",page:1,prevPages:E,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks});return[t,e,A]},Z.splitToCells=function(d){var E=u(d);return(d.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:d,calcdata:d.calcdata,page:d.page,rowBlocks:d.rowBlocks,value:A}})};function u(d){var E=d.rowBlocks[d.page],A=E?E.rows[0].rowIndex:0,t=E?A+E.rows.length:0;return[A,t]}}),q5=Vt((Z,V)=>{var u=H5(),d=Ni(),E=Xr(),A=E.numberFormat,t=bp(),e=Eo(),r=Dl(),i=Xr().raiseToTop,n=Xr().strTranslate,o=Xr().cancelTransition,a=fL(),s=hL(),f=Pi();V.exports=function(it,nt){var dt=!it._context.staticPlot,Tt=it._fullLayout._paper.selectAll("."+u.cn.table).data(nt.map(function(Zt){var ue=t.unwrap(Zt),Me=ue.trace;return a(it,Me)}),t.keyFun);Tt.exit().remove(),Tt.enter().append("g").classed(u.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"),Tt.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 wt=Tt.selectAll("."+u.cn.tableControlView).data(t.repeat,t.keyFun),It=wt.enter().append("g").classed(u.cn.tableControlView,!0).style("box-sizing","content-box");if(dt){var Ct="onwheel"in document?"wheel":"mousewheel";It.on("mousemove",function(Zt){wt.filter(function(ue){return Zt===ue}).call(l,it)}).on(Ct,function(Zt){if(!Zt.scrollbarState.wheeling){Zt.scrollbarState.wheeling=!0;var ue=Zt.scrollY+d.event.deltaY,Me=rt(it,wt,null,ue)(Zt);Me||(d.event.stopPropagation(),d.event.preventDefault()),Zt.scrollbarState.wheeling=!1}}).call(l,it,!0)}wt.attr("transform",function(Zt){return n(Zt.size.l,Zt.size.t)});var Nt=wt.selectAll("."+u.cn.scrollBackground).data(t.repeat,t.keyFun);Nt.enter().append("rect").classed(u.cn.scrollBackground,!0).attr("fill","none"),Nt.attr("width",function(Zt){return Zt.width}).attr("height",function(Zt){return Zt.height}),wt.each(function(Zt){e.setClipUrl(d.select(this),g(it,Zt),it)});var ee=wt.selectAll("."+u.cn.yColumn).data(function(Zt){return Zt.columns},t.keyFun);ee.enter().append("g").classed(u.cn.yColumn,!0),ee.exit().remove(),ee.attr("transform",function(Zt){return n(Zt.x,0)}),dt&&ee.call(d.behavior.drag().origin(function(Zt){var ue=d.select(this);return R(ue,Zt,-u.uplift),i(this),Zt.calcdata.columnDragInProgress=!0,l(wt.filter(function(Me){return Zt.calcdata.key===Me.key}),it),Zt}).on("drag",function(Zt){var ue=d.select(this),Me=function(qe){return(Zt===qe?d.event.x:qe.x)+qe.columnWidth/2};Zt.x=Math.max(-u.overdrag,Math.min(Zt.calcdata.width+u.overdrag-Zt.columnWidth,d.event.x));var Ce=w(ee).filter(function(qe){return qe.calcdata.key===Zt.calcdata.key}),We=Ce.sort(function(qe,vr){return Me(qe)-Me(vr)});We.forEach(function(qe,vr){qe.xIndex=vr,qe.x=Zt===qe?qe.x:qe.xScale(qe)}),ee.filter(function(qe){return Zt!==qe}).transition().ease(u.transitionEase).duration(u.transitionDuration).attr("transform",function(qe){return n(qe.x,0)}),ue.call(o).attr("transform",n(Zt.x,-u.uplift))}).on("dragend",function(Zt){var ue=d.select(this),Me=Zt.calcdata;Zt.x=Zt.xScale(Zt),Zt.calcdata.columnDragInProgress=!1,R(ue,Zt,0),D(it,Me,Me.columns.map(function(Ce){return Ce.xIndex}))})),ee.each(function(Zt){e.setClipUrl(d.select(this),m(it,Zt),it)});var Jt=ee.selectAll("."+u.cn.columnBlock).data(s.splitToPanels,t.keyFun);Jt.enter().append("g").classed(u.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 te=Jt.filter(F),Kt=Jt.filter(I);dt&&Kt.call(d.behavior.drag().origin(function(Zt){return d.event.stopPropagation(),Zt}).on("drag",rt(it,wt,-1)).on("dragend",function(){})),x(it,wt,te,Jt),x(it,wt,Kt,Jt);var mt=wt.selectAll("."+u.cn.scrollAreaClip).data(t.repeat,t.keyFun);mt.enter().append("clipPath").classed(u.cn.scrollAreaClip,!0).attr("id",function(Zt){return g(it,Zt)});var bt=mt.selectAll("."+u.cn.scrollAreaClipRect).data(t.repeat,t.keyFun);bt.enter().append("rect").classed(u.cn.scrollAreaClipRect,!0).attr("x",-u.overdrag).attr("y",-u.uplift).attr("fill","none"),bt.attr("width",function(Zt){return Zt.width+2*u.overdrag}).attr("height",function(Zt){return Zt.height+u.uplift});var vt=ee.selectAll("."+u.cn.columnBoundary).data(t.repeat,t.keyFun);vt.enter().append("g").classed(u.cn.columnBoundary,!0);var Ut=ee.selectAll("."+u.cn.columnBoundaryClippath).data(t.repeat,t.keyFun);Ut.enter().append("clipPath").classed(u.cn.columnBoundaryClippath,!0),Ut.attr("id",function(Zt){return m(it,Zt)});var re=Ut.selectAll("."+u.cn.columnBoundaryRect).data(t.repeat,t.keyFun);re.enter().append("rect").classed(u.cn.columnBoundaryRect,!0).attr("fill","none"),re.attr("width",function(Zt){return Zt.columnWidth+2*v(Zt)}).attr("height",function(Zt){return Zt.calcdata.height+2*v(Zt)+u.uplift}).attr("x",function(Zt){return-v(Zt)}).attr("y",function(Zt){return-v(Zt)}),G(null,Kt,wt)};function v(it){return Math.ceil(it.calcdata.maxLineWidth/2)}function g(it,nt){return"clip"+it._fullLayout._uid+"_scrollAreaBottomClip_"+nt.key}function m(it,nt){return"clip"+it._fullLayout._uid+"_columnBoundaryClippath_"+nt.calcdata.key+"_"+nt.specIndex}function w(it){return[].concat.apply([],it.map(function(nt){return nt})).map(function(nt){return nt.__data__})}function l(it,nt,dt){function Tt(Jt){var te=Jt.rowBlocks;return X(te,te.length-1)+(te.length?Q(te[te.length-1],1/0):1)}var wt=it.selectAll("."+u.cn.scrollbarKit).data(t.repeat,t.keyFun);wt.enter().append("g").classed(u.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),wt.each(function(Jt){var te=Jt.scrollbarState;te.totalHeight=Tt(Jt),te.scrollableAreaHeight=Jt.groupHeight-N(Jt),te.currentlyVisibleHeight=Math.min(te.totalHeight,te.scrollableAreaHeight),te.ratio=te.currentlyVisibleHeight/te.totalHeight,te.barLength=Math.max(te.ratio*te.currentlyVisibleHeight,u.goldenRatio*u.scrollbarWidth),te.barWiggleRoom=te.currentlyVisibleHeight-te.barLength,te.wiggleRoom=Math.max(0,te.totalHeight-te.scrollableAreaHeight),te.topY=te.barWiggleRoom===0?0:Jt.scrollY/te.wiggleRoom*te.barWiggleRoom,te.bottomY=te.topY+te.barLength,te.dragMultiplier=te.wiggleRoom/te.barWiggleRoom}).attr("transform",function(Jt){var te=Jt.width+u.scrollbarWidth/2+u.scrollbarOffset;return n(te,N(Jt))});var It=wt.selectAll("."+u.cn.scrollbar).data(t.repeat,t.keyFun);It.enter().append("g").classed(u.cn.scrollbar,!0);var Ct=It.selectAll("."+u.cn.scrollbarSlider).data(t.repeat,t.keyFun);Ct.enter().append("g").classed(u.cn.scrollbarSlider,!0),Ct.attr("transform",function(Jt){return n(0,Jt.scrollbarState.topY||0)});var Nt=Ct.selectAll("."+u.cn.scrollbarGlyph).data(t.repeat,t.keyFun);Nt.enter().append("line").classed(u.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",u.scrollbarWidth).attr("stroke-linecap","round").attr("y1",u.scrollbarWidth/2),Nt.attr("y2",function(Jt){return Jt.scrollbarState.barLength-u.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(u.scrollbarHideDelay).duration(u.scrollbarHideDuration).attr("stroke-opacity",0);var ee=It.selectAll("."+u.cn.scrollbarCaptureZone).data(t.repeat,t.keyFun);ee.enter().append("line").classed(u.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",u.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(Jt){var te=d.event.y,Kt=this.getBoundingClientRect(),mt=Jt.scrollbarState,bt=te-Kt.top,vt=d.scale.linear().domain([0,mt.scrollableAreaHeight]).range([0,mt.totalHeight]).clamp(!0);mt.topY<=bt&&bt<=mt.bottomY||rt(nt,it,null,vt(bt-mt.barLength/2))(Jt)}).call(d.behavior.drag().origin(function(Jt){return d.event.stopPropagation(),Jt.scrollbarState.scrollbarScrollInProgress=!0,Jt}).on("drag",rt(nt,it)).on("dragend",function(){})),ee.attr("y2",function(Jt){return Jt.scrollbarState.scrollableAreaHeight}),nt._context.staticPlot&&(Nt.remove(),ee.remove())}function x(it,nt,dt,Tt){var wt=y(dt),It=S(wt);c(It);var Ct=k(It);b(Ct);var Nt=T(It),ee=M(Nt);h(ee),_(ee,nt,Tt,it),ot(It)}function y(it){var nt=it.selectAll("."+u.cn.columnCells).data(t.repeat,t.keyFun);return nt.enter().append("g").classed(u.cn.columnCells,!0),nt.exit().remove(),nt}function S(it){var nt=it.selectAll("."+u.cn.columnCell).data(s.splitToCells,function(dt){return dt.keyWithinBlock});return nt.enter().append("g").classed(u.cn.columnCell,!0),nt.exit().remove(),nt}function k(it){var nt=it.selectAll("."+u.cn.cellRect).data(t.repeat,function(dt){return dt.keyWithinBlock});return nt.enter().append("rect").classed(u.cn.cellRect,!0),nt}function M(it){var nt=it.selectAll("."+u.cn.cellText).data(t.repeat,function(dt){return dt.keyWithinBlock});return nt.enter().append("text").classed(u.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){d.event.stopPropagation()}),nt}function T(it){var nt=it.selectAll("."+u.cn.cellTextHolder).data(t.repeat,function(dt){return dt.keyWithinBlock});return nt.enter().append("g").classed(u.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),nt}function c(it){it.each(function(nt,dt){var Tt=nt.calcdata.cells.font,wt=nt.column.specIndex,It={size:B(Tt.size,wt,dt),color:B(Tt.color,wt,dt),family:B(Tt.family,wt,dt),weight:B(Tt.weight,wt,dt),style:B(Tt.style,wt,dt),variant:B(Tt.variant,wt,dt),textcase:B(Tt.textcase,wt,dt),lineposition:B(Tt.lineposition,wt,dt),shadow:B(Tt.shadow,wt,dt)};nt.rowNumber=nt.key,nt.align=B(nt.calcdata.cells.align,wt,dt),nt.cellBorderWidth=B(nt.calcdata.cells.line.width,wt,dt),nt.font=It})}function h(it){it.each(function(nt){e.font(d.select(this),nt.font)})}function b(it){it.attr("width",function(nt){return nt.column.columnWidth}).attr("stroke-width",function(nt){return nt.cellBorderWidth}).each(function(nt){var dt=d.select(this);f.stroke(dt,B(nt.calcdata.cells.line.color,nt.column.specIndex,nt.rowNumber)),f.fill(dt,B(nt.calcdata.cells.fill.color,nt.column.specIndex,nt.rowNumber))})}function _(it,nt,dt,Tt){it.text(function(wt){var It=wt.column.specIndex,Ct=wt.rowNumber,Nt=wt.value,ee=typeof Nt=="string",Jt=ee&&Nt.match(/<br>/i),te=!ee||Jt;wt.mayHaveMarkup=ee&&Nt.match(/[<&>]/);var Kt=P(Nt);wt.latex=Kt;var mt=Kt?"":B(wt.calcdata.cells.prefix,It,Ct)||"",bt=Kt?"":B(wt.calcdata.cells.suffix,It,Ct)||"",vt=Kt?null:B(wt.calcdata.cells.format,It,Ct)||null,Ut=mt+(vt?A(vt)(wt.value):wt.value)+bt,re;wt.wrappingNeeded=!wt.wrapped&&!te&&!Kt&&(re=L(Ut)),wt.cellHeightMayIncrease=Jt||Kt||wt.mayHaveMarkup||(re===void 0?L(Ut):re),wt.needsConvertToTspans=wt.mayHaveMarkup||wt.wrappingNeeded||wt.latex;var Zt;if(wt.wrappingNeeded){var ue=u.wrapSplitCharacter===" "?Ut.replace(/<a href=/ig,"<a_href="):Ut,Me=ue.split(u.wrapSplitCharacter),Ce=u.wrapSplitCharacter===" "?Me.map(function(We){return We.replace(/<a_href=/ig,"<a href=")}):Me;wt.fragments=Ce.map(function(We){return{text:We,width:null}}),wt.fragments.push({fragment:u.wrapSpacer,width:null}),Zt=Ce.join(u.lineBreaker)+u.lineBreaker+u.wrapSpacer}else delete wt.fragments,Zt=Ut;return Zt}).attr("dy",function(wt){return wt.needsConvertToTspans?0:"0.75em"}).each(function(wt){var It=this,Ct=d.select(It),Nt=wt.wrappingNeeded?st:et;wt.needsConvertToTspans?r.convertToTspans(Ct,Tt,Nt(dt,It,nt,Tt,wt)):d.select(It.parentNode).attr("transform",function(ee){return n(K(ee),u.cellPad)}).attr("text-anchor",function(ee){return{left:"start",center:"middle",right:"end"}[ee.align]})})}function P(it){return typeof it=="string"&&it.match(u.latexCheck)}function L(it){return it.indexOf(u.wrapSplitCharacter)!==-1}function D(it,nt,dt){var Tt=nt.gdColumnsOriginalOrder;nt.gdColumns.sort(function(wt,It){return dt[Tt.indexOf(wt)]-dt[Tt.indexOf(It)]}),nt.columnorder=dt,it.emit("plotly_restyle")}function B(it,nt,dt){if(E.isArrayOrTypedArray(it)){var Tt=it[Math.min(nt,it.length-1)];return E.isArrayOrTypedArray(Tt)?Tt[Math.min(dt,Tt.length-1)]:Tt}else return it}function R(it,nt,dt){it.transition().ease(u.releaseTransitionEase).duration(u.releaseTransitionDuration).attr("transform",n(nt.x,dt))}function I(it){return it.type==="cells"}function F(it){return it.type==="header"}function N(it){var nt=it.rowBlocks.length?it.rowBlocks[0].auxiliaryBlocks:[];return nt.reduce(function(dt,Tt){return dt+Q(Tt,1/0)},0)}function j(it,nt,dt){for(var Tt=[],wt=0,It=0;It<it.length;It++){for(var Ct=it[It],Nt=Ct.rows,ee=0,Jt=0;Jt<Nt.length;Jt++)ee+=Nt[Jt].rowHeight;Ct.allRowsHeight=ee;var te=wt+ee,Kt=nt,mt=Kt+dt;Kt<te&&mt>wt&&Tt.push(It),wt+=ee}return Tt}function G(it,nt,dt){var Tt=w(nt)[0];if(Tt!==void 0){var wt=Tt.rowBlocks,It=Tt.calcdata,Ct=X(wt,wt.length),Nt=Tt.calcdata.groupHeight-N(Tt),ee=It.scrollY=Math.max(0,Math.min(Ct-Nt,It.scrollY)),Jt=j(wt,ee,Nt);Jt.length===1&&(Jt[0]===wt.length-1?Jt.unshift(Jt[0]-1):Jt.push(Jt[0]+1)),Jt[0]%2&&Jt.reverse(),nt.each(function(te,Kt){te.page=Jt[Kt],te.scrollY=ee}),nt.attr("transform",function(te){var Kt=X(te.rowBlocks,te.page)-te.scrollY;return n(0,Kt)}),it&&(ct(it,dt,nt,Jt,Tt.prevPages,Tt,0),ct(it,dt,nt,Jt,Tt.prevPages,Tt,1),l(dt,it))}}function rt(it,nt,dt,Tt){return function(wt){var It=wt.calcdata?wt.calcdata:wt,Ct=nt.filter(function(te){return It.key===te.key}),Nt=dt||It.scrollbarState.dragMultiplier,ee=It.scrollY;It.scrollY=Tt===void 0?It.scrollY+Nt*d.event.dy:Tt;var Jt=Ct.selectAll("."+u.cn.yColumn).selectAll("."+u.cn.columnBlock).filter(I);return G(it,Jt,Ct),It.scrollY===ee}}function ct(it,nt,dt,Tt,wt,It,Ct){var Nt=Tt[Ct]!==wt[Ct];Nt&&(clearTimeout(It.currentRepaint[Ct]),It.currentRepaint[Ct]=setTimeout(function(){var ee=dt.filter(function(Jt,te){return te===Ct&&Tt[te]!==wt[te]});x(it,nt,ee,dt),wt[Ct]=Tt[Ct]}))}function st(it,nt,dt,Tt){return function(){var wt=d.select(nt.parentNode);wt.each(function(It){var Ct=It.fragments;wt.selectAll("tspan.line").each(function(vt,Ut){Ct[Ut].width=this.getComputedTextLength()});var Nt=Ct[Ct.length-1].width,ee=Ct.slice(0,-1),Jt=[],te,Kt,mt=0,bt=It.column.columnWidth-2*u.cellPad;for(It.value="";ee.length;)te=ee.shift(),Kt=te.width+Nt,mt+Kt>bt&&(It.value+=Jt.join(u.wrapSpacer)+u.lineBreaker,Jt=[],mt=0),Jt.push(te.text),mt+=Kt;mt&&(It.value+=Jt.join(u.wrapSpacer)),It.wrapped=!0}),wt.selectAll("tspan.line").remove(),_(wt.select("."+u.cn.cellText),dt,it,Tt),d.select(nt.parentNode.parentNode).call(ot)}}function et(it,nt,dt,Tt,wt){return function(){if(!wt.settledY){var It=d.select(nt.parentNode),Ct=J(wt),Nt=wt.key-Ct.firstRowIndex,ee=Ct.rows[Nt].rowHeight,Jt=wt.cellHeightMayIncrease?nt.parentNode.getBoundingClientRect().height+2*u.cellPad:ee,te=Math.max(Jt,ee),Kt=te-Ct.rows[Nt].rowHeight;Kt&&(Ct.rows[Nt].rowHeight=te,it.selectAll("."+u.cn.columnCell).call(ot),G(null,it.filter(I),0),l(dt,Tt,!0)),It.attr("transform",function(){var mt=this,bt=mt.parentNode,vt=bt.getBoundingClientRect(),Ut=d.select(mt.parentNode).select("."+u.cn.cellRect).node().getBoundingClientRect(),re=mt.transform.baseVal.consolidate(),Zt=Ut.top-vt.top+(re?re.matrix.f:u.cellPad);return n(K(wt,d.select(mt.parentNode).select("."+u.cn.cellTextHolder).node().getBoundingClientRect().width),Zt)}),wt.settledY=!0}}}function K(it,nt){switch(it.align){case"left":return u.cellPad;case"right":return it.column.columnWidth-(nt||0)-u.cellPad;case"center":return(it.column.columnWidth-(nt||0))/2;default:return u.cellPad}}function ot(it){it.attr("transform",function(nt){var dt=nt.rowBlocks[0].auxiliaryBlocks.reduce(function(Ct,Nt){return Ct+Q(Nt,1/0)},0),Tt=J(nt),wt=Q(Tt,nt.key),It=wt+dt;return n(0,It)}).selectAll("."+u.cn.cellRect).attr("height",function(nt){return q(J(nt),nt.key).rowHeight})}function X(it,nt){for(var dt=0,Tt=nt-1;Tt>=0;Tt--)dt+=ut(it[Tt]);return dt}function Q(it,nt){for(var dt=0,Tt=0;Tt<it.rows.length&&it.rows[Tt].rowIndex<nt;Tt++)dt+=it.rows[Tt].rowHeight;return dt}function ut(it){var nt=it.allRowsHeight;if(nt!==void 0)return nt;for(var dt=0,Tt=0;Tt<it.rows.length;Tt++)dt+=it.rows[Tt].rowHeight;return it.allRowsHeight=dt,dt}function J(it){return it.rowBlocks[it.page]}function q(it,nt){return it.rows[nt-it.firstRowIndex]}}),pL=Vt(Z=>{var V=If().getModuleCalcData,u=q5(),d="table";Z.name=d,Z.plot=function(E){var A=V(E.calcdata,d)[0];A.length&&u(E,A)},Z.clean=function(E,A,t,e){var r=e._has&&e._has(d),i=A._has&&A._has(d);r&&!i&&e._paperdiv.selectAll(".table").remove()}}),dL=Vt((Z,V)=>{V.exports={attributes:V5(),supplyDefaults:uL(),calc:cL(),plot:q5(),moduleType:"trace",name:"table",basePlotModule:pL(),categories:["noOpacity"],meta:{}}}),mL=Vt((Z,V)=>{V.exports=dL()}),gL=Vt((Z,V)=>{var u=yu(),d=nf(),E=Pf(),A=fc().descriptionWithDates,t=Cu().overrideAll,e=Cf().dash,r=So().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:u({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:u({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","SI extended"],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:d.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:d.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((Z,V)=>{var u=yu(),d=gL(),E=nf(),A=u({editType:"calc"}),t=pc().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:d,baxis:d,font:A,color:{valType:"color",dflt:E.defaultLine,editType:"plot"},zorder:t}}),vL=Vt((Z,V)=>{var u=Xr().isArray1D;V.exports=function(d,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||u(t))&&(!i||u(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}}),yL=Vt((Z,V)=>{var u=$x(),d=Pi().addOpacity,E=ji(),A=Xr(),t=i0(),e=Td(),r=kd(),i=Jy(),n=mp(),o=xm();V.exports=function(s,f,v){var g=v.letter,m=v.font||{},w=u[g+"axis"];function l(N,j){return A.coerce(s,f,w,N,j)}function x(N,j){return A.coerce2(s,f,w,N,j)}v.name&&(f._name=v.name,f._id=v.name),l("autotypenumbers",v.autotypenumbersDflt);var y=l("type");if(y==="-"&&(v.data&&a(f,v.data),f.type==="-"?f.type="linear":y=s.type=f.type),l("smoothing"),l("cheatertype"),l("showticklabels"),l("labelprefix",g+" = "),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"),f.tickmode==="array"&&(l("arraytick0"),l("arraydtick")),l("labelpadding"),f._hovertitle=g,y==="date"){var S=E.getComponentMethod("calendars","handleDefaults");S(s,f,"calendar",v.calendar)}n(f,v.fullLayout),f.c2p=A.identity;var k=l("color",v.dfltColor),M=k===s.color?k:m.color,T=l("title.text");T&&(A.coerceFont(l,"title.font",m,{overrideDflt:{size:A.bigFont(m.size),color:M}}),l("title.offset")),l("tickangle");var c=l("autorange",!f.isValidRange(s.range));c&&l("rangemode"),l("range"),f.cleanRange(),l("fixedrange"),t(s,f,l,y),r(s,f,l,y,v),e(s,f,l,y,v),i(s,f,l,{data:v.data,dataAttr:g});var h=x("gridcolor",d(k,.3)),b=x("gridwidth"),_=x("griddash"),P=l("showgrid");P||(delete f.gridcolor,delete f.gridwidth,delete f.griddash);var L=x("startlinecolor",k),D=x("startlinewidth",b),B=l("startline",f.showgrid||!!L||!!D);B||(delete f.startlinecolor,delete f.startlinewidth);var R=x("endlinecolor",k),I=x("endlinewidth",b),F=l("endline",f.showgrid||!!R||!!I);return F||(delete f.endlinecolor,delete f.endlinewidth),P?(l("minorgridcount"),l("minorgridwidth",b),l("minorgriddash",_),l("minorgridcolor",d(h,.06)),f.minorgridcount||(delete f.minorgridwidth,delete f.minorgriddash,delete f.minorgridcolor)):(delete f.gridcolor,delete f.gridwidth,delete f.griddash),f.showticklabels==="none"&&(delete f.tickfont,delete f.tickangle,delete f.showexponent,delete f.exponentformat,delete f.minexponent,delete f.tickformat,delete f.showticksuffix,delete f.showtickprefix),f.showticksuffix||delete f.ticksuffix,f.showtickprefix||delete f.tickprefix,l("tickmode"),f};function a(s,f){if(s.type==="-"){var v=s._id,g=v.charAt(0),m=g+"calendar",w=s[m];s.type=o(f,w,{autotypenumbers:s.autotypenumbers})}}}),xL=Vt((Z,V)=>{var u=yL(),d=cl();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=d.newContainer(t,n),f={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};u(a,s,f),s._categories=s._categories||[],!A[n]&&a.type!=="-"&&(A[n]={type:a.type})})}}),_L=Vt((Z,V)=>{var u=Xr(),d=vL(),E=xL(),A=$x(),t=nf();V.exports=function(e,r,i,n){function o(f,v){return u.coerce(e,r,A,f,v)}r._clipPathId="clip"+r.uid+"carpet";var a=o("color",t.defaultLine);if(u.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=d(e,r,o);s||(r.visible=!1),r._cheater&&o("cheaterslope"),o("zorder")}}),W5=Vt((Z,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(d,E,A){var t;for(u(d)?d.length>E.length&&(d=d.slice(0,E.length)):d=[],t=0;t<E.length;t++)d[t]=A(E[t]);return d}}),G5=Vt((Z,V)=>{V.exports=function(u,d,E){if(u.length===0)return"";var A,t=[],e=E?3:1;for(A=0;A<u.length;A+=e)t.push(u[A]+","+d[A]),E&&A<u.length-e&&(t.push("C"),t.push([u[A+1]+","+d[A+1],u[A+2]+","+d[A+2]+" "].join(" ")));return t.join(E?"":"L")}}),bL=Vt((Z,V)=>{V.exports=function(u,d,E,A,t,e){var r=t[0]*u.dpdx(d),i=t[1]*u.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]),f=(t[0]*e[0]+t[1]*e[1])/a/s;o=Math.max(0,f)}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:u.c2p(A,d,E),offsetMultplier:o}}}),wL=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=W5(),A=G5(),t=bL(),e=Dl(),r=Xr(),i=r.strRotate,n=r.strTranslate,o=mf();V.exports=function(l,x,y,S){var k=l._context.staticPlot,M=x.xaxis,T=x.yaxis,c=l._fullLayout,h=c._clips;r.makeTraceGroups(S,y,"trace").each(function(b){var _=u.select(this),P=b[0],L=P.trace,D=L.aaxis,B=L.baxis,R=r.ensureSingle(_,"g","minorlayer"),I=r.ensureSingle(_,"g","majorlayer"),F=r.ensureSingle(_,"g","boundarylayer"),N=r.ensureSingle(_,"g","labellayer");_.style("opacity",L.opacity),s(M,T,I,D,"a",D._gridlines,!0),s(M,T,I,B,"b",B._gridlines,!0),s(M,T,R,D,"a",D._minorgridlines,!0),s(M,T,R,B,"b",B._minorgridlines,!0),s(M,T,F,D,"a-boundary",D._boundarylines,k),s(M,T,F,B,"b-boundary",B._boundarylines,k);var j=f(l,M,T,L,P,N,D._labels,"a-label"),G=f(l,M,T,L,P,N,B._labels,"b-label");v(l,N,L,P,M,T,j,G),a(L,P,h,M,T)})};function a(l,x,y,S,k){var M,T,c,h,b=y.select("#"+l._clipPathId);b.size()||(b=y.append("clipPath").classed("carpetclip",!0));var _=r.ensureSingle(b,"path","carpetboundary"),P=x.clipsegments,L=[];for(h=0;h<P.length;h++)M=P[h],T=E([],M.x,S.c2p),c=E([],M.y,k.c2p),L.push(A(T,c,M.bicubic));var D="M"+L.join("L")+"Z";b.attr("id",l._clipPathId),_.attr("d",D)}function s(l,x,y,S,k,M,T){var c="const-"+k+"-lines",h=y.selectAll("."+c).data(M);h.enter().append("path").classed(c,!0).style("vector-effect",T?"none":"non-scaling-stroke"),h.each(function(b){var _=b,P=_.x,L=_.y,D=E([],P,l.c2p),B=E([],L,x.c2p),R="M"+A(D,B,_.smoothing),I=u.select(this);I.attr("d",R).style("stroke-width",_.width).style("stroke",_.color).style("stroke-dasharray",d.dashStyle(_.dash,_.width)).style("fill","none")}),h.exit().remove()}function f(l,x,y,S,k,M,T,c){var h=M.selectAll("text."+c).data(T);h.enter().append("text").classed(c,!0);var b=0,_={};return h.each(function(P,L){var D;if(P.axis.tickangle==="auto")D=t(S,x,y,P.xy,P.dxy);else{var B=(P.axis.tickangle+180)*Math.PI/180;D=t(S,x,y,P.xy,[Math.cos(B),Math.sin(B)])}L||(_={angle:D.angle,flip:D.flip});var R=(P.endAnchor?-1:1)*D.flip,I=u.select(this).attr({"text-anchor":R>0?"start":"end","data-notex":1}).call(d.font,P.font).text(P.text).call(e.convertToTspans,l),F=d.bBox(this);I.attr("transform",n(D.p[0],D.p[1])+i(D.angle)+n(P.axis.labelpadding*R,F.height*.3)),b=Math.max(b,F.width+P.axis.labelpadding)}),h.exit().remove(),_.maxExtent=b,_}function v(l,x,y,S,k,M,T,c){var h,b,_,P,L=r.aggNums(Math.min,null,y.a),D=r.aggNums(Math.max,null,y.a),B=r.aggNums(Math.min,null,y.b),R=r.aggNums(Math.max,null,y.b);h=.5*(L+D),b=B,_=y.ab2xy(h,b,!0),P=y.dxyda_rough(h,b),T.angle===void 0&&r.extendFlat(T,t(y,k,M,_,y.dxydb_rough(h,b))),w(l,x,y,S,_,P,y.aaxis,k,M,T,"a-title"),h=L,b=.5*(B+R),_=y.ab2xy(h,b,!0),P=y.dxydb_rough(h,b),c.angle===void 0&&r.extendFlat(c,t(y,k,M,_,y.dxyda_rough(h,b))),w(l,x,y,S,_,P,y.baxis,k,M,c,"b-title")}var g=o.LINE_SPACING,m=(1-o.MID_SHIFT)/g+1;function w(l,x,y,S,k,M,T,c,h,b,_){var P=[];T.title.text&&P.push(T.title.text);var L=x.selectAll("text."+_).data(P),D=b.maxExtent;L.enter().append("text").classed(_,!0),L.each(function(){var B=t(y,c,h,k,M);["start","both"].indexOf(T.showticklabels)===-1&&(D=0);var R=T.title.font.size;D+=R+T.title.offset;var I=b.angle+(b.flip<0?180:0),F=(I-B.angle+450)%360,N=F>90&&F<270,j=u.select(this);j.text(T.title.text).call(e.convertToTspans,l),N&&(D=(-e.lineCount(j)+m)*g*R-D),j.attr("transform",n(B.p[0],B.p[1])+i(B.angle)+n(0,D)).attr("text-anchor","middle").call(d.font,T.title.font)}),L.exit().remove()}}),TL=Vt((Z,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(d,E,A){var t,e,r,i,n,o,a=[],s=u(d)?d.length:d,f=u(E)?E.length:E,v=u(d)?d:null,g=u(E)?E:null;v&&(r=(v.length-1)/(v[v.length-1]-v[0])/(s-1)),g&&(i=(g.length-1)/(g[g.length-1]-g[0])/(f-1));var m,w=1/0,l=-1/0;for(e=0;e<f;e++)for(a[e]=[],o=g?(g[e]-g[0])*i:e/(f-1),t=0;t<s;t++)n=v?(v[t]-v[0])*r:t/(s-1),m=n-o*A,w=Math.min(m,w),l=Math.max(m,l),a[e][t]=m;var x=1/(l-w),y=-w*x;for(e=0;e<f;e++)for(t=0;t<s;t++)a[e][t]=x*a[e][t]+y;return a}}),kL=Vt((Z,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(E){return d(E,0)};function d(E,A){if(!u(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(u(n)){var o=d(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]}}),AL=Vt((Z,V)=>{var u=yo(),d=So().extendFlat;V.exports=function(E,A,t){var e,r,i,n,o,a,s,f,v,g,m,w,l,x,y=E["_"+A],S=E[A+"axis"],k=S._gridlines=[],M=S._minorgridlines=[],T=S._boundarylines=[],c=E["_"+t],h=E[t+"axis"];S.tickmode==="array"&&(S.tickvals=y.slice());var b=E._xctrl,_=E._yctrl,P=b[0].length,L=b.length,D=E._a.length,B=E._b.length;u.prepTicks(S),S.tickmode==="array"&&delete S.tickvals;var R=S.smoothing?3:1;function I(N){var j,G,rt,ct,st,et,K,ot,X,Q,ut,J,q=[],it=[],nt={};if(A==="b")for(G=E.b2j(N),rt=Math.floor(Math.max(0,Math.min(B-2,G))),ct=G-rt,nt.length=B,nt.crossLength=D,nt.xy=function(dt){return E.evalxy([],dt,G)},nt.dxy=function(dt,Tt){return E.dxydi([],dt,rt,Tt,ct)},j=0;j<D;j++)et=Math.min(D-2,j),K=j-et,ot=E.evalxy([],j,G),h.smoothing&&j>0&&(X=E.dxydi([],j-1,rt,0,ct),q.push(st[0]+X[0]/3),it.push(st[1]+X[1]/3),Q=E.dxydi([],j-1,rt,1,ct),q.push(ot[0]-Q[0]/3),it.push(ot[1]-Q[1]/3)),q.push(ot[0]),it.push(ot[1]),st=ot;else for(j=E.a2i(N),et=Math.floor(Math.max(0,Math.min(D-2,j))),K=j-et,nt.length=D,nt.crossLength=B,nt.xy=function(dt){return E.evalxy([],j,dt)},nt.dxy=function(dt,Tt){return E.dxydj([],et,dt,K,Tt)},G=0;G<B;G++)rt=Math.min(B-2,G),ct=G-rt,ot=E.evalxy([],j,G),h.smoothing&&G>0&&(ut=E.dxydj([],et,G-1,K,0),q.push(st[0]+ut[0]/3),it.push(st[1]+ut[1]/3),J=E.dxydj([],et,G-1,K,1),q.push(ot[0]-J[0]/3),it.push(ot[1]-J[1]/3)),q.push(ot[0]),it.push(ot[1]),st=ot;return nt.axisLetter=A,nt.axis=S,nt.crossAxis=h,nt.value=N,nt.constvar=t,nt.index=f,nt.x=q,nt.y=it,nt.smoothing=h.smoothing,nt}function F(N){var j,G,rt,ct,st,et=[],K=[],ot={};if(ot.length=y.length,ot.crossLength=c.length,A==="b")for(rt=Math.max(0,Math.min(B-2,N)),st=Math.min(1,Math.max(0,N-rt)),ot.xy=function(X){return E.evalxy([],X,N)},ot.dxy=function(X,Q){return E.dxydi([],X,rt,Q,st)},j=0;j<P;j++)et[j]=b[N*R][j],K[j]=_[N*R][j];else for(G=Math.max(0,Math.min(D-2,N)),ct=Math.min(1,Math.max(0,N-G)),ot.xy=function(X){return E.evalxy([],N,X)},ot.dxy=function(X,Q){return E.dxydj([],G,X,ct,Q)},j=0;j<L;j++)et[j]=b[j][N*R],K[j]=_[j][N*R];return ot.axisLetter=A,ot.axis=S,ot.crossAxis=h,ot.value=y[N],ot.constvar=t,ot.index=N,ot.x=et,ot.y=K,ot.smoothing=h.smoothing,ot}if(S.tickmode==="array"){for(n=5e-15,o=[Math.floor((y.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,f=a;f<s;f++)r=S.arraytick0+S.arraydtick*f,!(r<0||r>y.length-1)&&k.push(d(F(r),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(f=a;f<s;f++)if(i=S.arraytick0+S.arraydtick*f,m=Math.min(i+S.arraydtick,y.length-1),!(i<0||i>y.length-1)&&!(m<0||m>y.length-1))for(w=y[i],l=y[m],e=0;e<S.minorgridcount;e++)x=m-i,!(x<=0)&&(g=w+(l-w)*(e+1)/(S.minorgridcount+1)*(S.arraydtick/x),!(g<y[0]||g>y[y.length-1])&&M.push(d(I(g),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash})));S.startline&&T.push(d(F(0),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&T.push(d(F(y.length-1),{color:S.endlinecolor,width:S.endlinewidth}))}else{for(n=5e-15,o=[Math.floor((y[y.length-1]-S.tick0)/S.dtick*(1+n)),Math.ceil((y[0]-S.tick0)/S.dtick/(1+n))].sort(function(N,j){return N-j}),a=o[0],s=o[1],f=a;f<=s;f++)v=S.tick0+S.dtick*f,k.push(d(I(v),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(f=a-1;f<s+1;f++)for(v=S.tick0+S.dtick*f,e=0;e<S.minorgridcount;e++)g=v+S.dtick*(e+1)/(S.minorgridcount+1),!(g<y[0]||g>y[y.length-1])&&M.push(d(I(g),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&T.push(d(I(y[0]),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&T.push(d(I(y[y.length-1]),{color:S.endlinecolor,width:S.endlinewidth}))}}}),ML=Vt((Z,V)=>{var u=yo(),d=So().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=u.tickText(A,n.value),d(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=u.tickText(A,n.value),d(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))}}),SL=Vt((Z,V)=>{V.exports=function(u,d,E,A){var t,e,r,i=[],n=!!E.smoothing,o=!!A.smoothing,a=u[0].length-1,s=u.length-1;for(t=0,e=[],r=[];t<=a;t++)e[t]=u[0][t],r[t]=d[0][t];for(i.push({x:e,y:r,bicubic:n}),t=0,e=[],r=[];t<=s;t++)e[t]=u[t][a],r[t]=d[t][a];for(i.push({x:e,y:r,bicubic:o}),t=a,e=[],r=[];t>=0;t--)e[a-t]=u[s][t],r[a-t]=d[s][t];for(i.push({x:e,y:r,bicubic:n}),t=s,e=[],r=[];t>=0;t--)e[s-t]=u[t][0],r[s-t]=d[t][0];return i.push({x:e,y:r,bicubic:o}),i}}),EL=Vt((Z,V)=>{var u=Xr();V.exports=function(d,E,A){var t,e,r,i=[],n=[],o=d[0].length,a=d.length;function s(G,rt){var ct=0,st,et=0;return G>0&&(st=d[rt][G-1])!==void 0&&(et++,ct+=st),G<o-1&&(st=d[rt][G+1])!==void 0&&(et++,ct+=st),rt>0&&(st=d[rt-1][G])!==void 0&&(et++,ct+=st),rt<a-1&&(st=d[rt+1][G])!==void 0&&(et++,ct+=st),ct/Math.max(1,et)}var f=0;for(t=0;t<o;t++)for(e=0;e<a;e++)d[e][t]===void 0&&(i.push(t),n.push(e),d[e][t]=s(t,e)),f=Math.max(f,Math.abs(d[e][t]));if(!i.length)return d;var v,g,m,w,l,x,y,S,k,M,T,c=1e-5,h=0,b=100,_=0,P=i.length;do{for(h=0,r=0;r<P;r++){t=i[r],e=n[r];var L=0,D=0,B,R,I,F,N,j;t===0?(N=Math.min(o-1,2),I=E[N],F=E[1],B=d[e][N],R=d[e][1],D+=R+(R-B)*(E[0]-F)/(F-I),L++):t===o-1&&(N=Math.max(0,o-3),I=E[N],F=E[o-2],B=d[e][N],R=d[e][o-2],D+=R+(R-B)*(E[o-1]-F)/(F-I),L++),(t===0||t===o-1)&&e>0&&e<a-1&&(v=A[e+1]-A[e],g=A[e]-A[e-1],D+=(g*d[e+1][t]+v*d[e-1][t])/(g+v),L++),e===0?(j=Math.min(a-1,2),I=A[j],F=A[1],B=d[j][t],R=d[1][t],D+=R+(R-B)*(A[0]-F)/(F-I),L++):e===a-1&&(j=Math.max(0,a-3),I=A[j],F=A[a-2],B=d[j][t],R=d[a-2][t],D+=R+(R-B)*(A[a-1]-F)/(F-I),L++),(e===0||e===a-1)&&t>0&&t<o-1&&(v=E[t+1]-E[t],g=E[t]-E[t-1],D+=(g*d[e][t+1]+v*d[e][t-1])/(g+v),L++),L?D/=L:(m=E[t+1]-E[t],w=E[t]-E[t-1],l=A[e+1]-A[e],x=A[e]-A[e-1],y=m*w*(m+w),S=l*x*(l+x),D=(y*(x*d[e+1][t]+l*d[e-1][t])+S*(w*d[e][t+1]+m*d[e][t-1]))/(S*(w+m)+y*(x+l))),k=D-d[e][t],M=k/f,h+=M*M,T=L?0:.85,d[e][t]+=k*(1+T)}h=Math.sqrt(h)}while(_++<b&&h>c);return u.log("Smoother converged to",h,"after",_,"iterations"),d}}),zL=Vt((Z,V)=>{V.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),LL=Vt((Z,V)=>{var u=.5;V.exports=function(d,E,A,t){var e=d[0]-E[0],r=d[1]-E[1],i=A[0]-E[0],n=A[1]-E[1],o=Math.pow(e*e+r*r,u/2),a=Math.pow(i*i+n*n,u/2),s=(a*a*e-o*o*i)*t,f=(a*a*r-o*o*n)*t,v=a*(o+a)*3,g=o*(o+a)*3;return[[E[0]+(v&&s/v),E[1]+(v&&f/v)],[E[0]-(g&&s/g),E[1]-(g&&f/g)]]}}),CL=Vt((Z,V)=>{var u=LL(),d=Xr().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,f,v,g,m,w,l,x,y=e[0].length,S=e.length,k=i?3*y-2:y,M=n?3*S-2:S;for(A=d(A,M),t=d(t,M),s=0;s<M;s++)A[s]=d(A[s],k),t[s]=d(t[s],k);for(a=0,f=0;a<S;a++,f+=n?3:1)for(v=A[f],g=t[f],m=e[a],w=r[a],o=0,s=0;o<y;o++,s+=i?3:1)v[s]=m[o],g[s]=w[o];if(i)for(a=0,f=0;a<S;a++,f+=n?3:1){for(o=1,s=3;o<y-1;o++,s+=3)l=u([e[a][o-1],r[a][o-1]],[e[a][o],r[a][o]],[e[a][o+1],r[a][o+1]],i),A[f][s-1]=l[0][0],t[f][s-1]=l[0][1],A[f][s+1]=l[1][0],t[f][s+1]=l[1][1];x=E([A[f][0],t[f][0]],[A[f][2],t[f][2]],[A[f][3],t[f][3]]),A[f][1]=x[0],t[f][1]=x[1],x=E([A[f][k-1],t[f][k-1]],[A[f][k-3],t[f][k-3]],[A[f][k-4],t[f][k-4]]),A[f][k-2]=x[0],t[f][k-2]=x[1]}if(n)for(s=0;s<k;s++){for(f=3;f<M-3;f+=3)l=u([A[f-3][s],t[f-3][s]],[A[f][s],t[f][s]],[A[f+3][s],t[f+3][s]],n),A[f-1][s]=l[0][0],t[f-1][s]=l[0][1],A[f+1][s]=l[1][0],t[f+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(f=1;f<M;f+=(f+1)%3===0?2:1){for(s=3;s<k-3;s+=3)l=u([A[f][s-3],t[f][s-3]],[A[f][s],t[f][s]],[A[f][s+3],t[f][s+3]],i),A[f][s-1]=.5*(A[f][s-1]+l[0][0]),t[f][s-1]=.5*(t[f][s-1]+l[0][1]),A[f][s+1]=.5*(A[f][s+1]+l[1][0]),t[f][s+1]=.5*(t[f][s+1]+l[1][1]);x=E([A[f][0],t[f][0]],[A[f][2],t[f][2]],[A[f][3],t[f][3]]),A[f][1]=.5*(A[f][1]+x[0]),t[f][1]=.5*(t[f][1]+x[1]),x=E([A[f][k-1],t[f][k-1]],[A[f][k-3],t[f][k-3]],[A[f][k-4],t[f][k-4]]),A[f][k-2]=.5*(A[f][k-2]+x[0]),t[f][k-2]=.5*(t[f][k-2]+x[1])}return[A,t]}}),IL=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){var e=d-2,r=E-2;return A&&t?function(i,n,o){i||(i=[]);var a,s,f,v,g,m,w=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-w)),y=Math.max(0,Math.min(1,o-l));w*=3,l*=3;var S=x*x,k=S*x,M=1-x,T=M*M,c=T*M,h=y*y,b=h*y,_=1-y,P=_*_,L=P*_;for(m=0;m<u.length;m++)g=u[m],a=c*g[l][w]+3*(T*x*g[l][w+1]+M*S*g[l][w+2])+k*g[l][w+3],s=c*g[l+1][w]+3*(T*x*g[l+1][w+1]+M*S*g[l+1][w+2])+k*g[l+1][w+3],f=c*g[l+2][w]+3*(T*x*g[l+2][w+1]+M*S*g[l+2][w+2])+k*g[l+2][w+3],v=c*g[l+3][w]+3*(T*x*g[l+3][w+1]+M*S*g[l+3][w+2])+k*g[l+3][w+3],i[m]=L*a+3*(P*y*s+_*h*f)+b*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)),f=Math.max(0,Math.min(1,n-a)),v=Math.max(0,Math.min(1,o-s)),g,m,w,l,x,y;a*=3;var S=f*f,k=S*f,M=1-f,T=M*M,c=T*M,h=1-v;for(x=0;x<u.length;x++)y=u[x],g=h*y[s][a]+v*y[s+1][a],m=h*y[s][a+1]+v*y[s+1][a+1],w=h*y[s][a+2]+v*y[s+1][a+1],l=h*y[s][a+3]+v*y[s+1][a+1],i[x]=c*g+3*(T*f*m+M*S*w)+k*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)),f=Math.max(0,Math.min(1,n-a)),v=Math.max(0,Math.min(1,o-s)),g,m,w,l,x,y;s*=3;var S=v*v,k=S*v,M=1-v,T=M*M,c=T*M,h=1-f;for(x=0;x<u.length;x++)y=u[x],g=h*y[s][a]+f*y[s][a+1],m=h*y[s+1][a]+f*y[s+1][a+1],w=h*y[s+2][a]+f*y[s+2][a+1],l=h*y[s+3][a]+f*y[s+3][a+1],i[x]=c*g+3*(T*v*m+M*S*w)+k*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)),f=Math.max(0,Math.min(1,n-a)),v=Math.max(0,Math.min(1,o-s)),g,m,w,l,x=1-v,y=1-f;for(w=0;w<u.length;w++)l=u[w],g=y*l[s][a]+f*l[s][a+1],m=y*l[s+1][a]+f*l[s+1][a+1],i[w]=x*g+v*m;return i}}}),PL=Vt((Z,V)=>{V.exports=function(u,d,E){return d&&E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f,v;t*=3,e*=3;var g=r*r,m=1-r,w=m*m,l=m*r*2,x=-3*w,y=3*(w-l),S=3*(l-g),k=3*g,M=i*i,T=M*i,c=1-i,h=c*c,b=h*c;for(v=0;v<u.length;v++)f=u[v],n=x*f[e][t]+y*f[e][t+1]+S*f[e][t+2]+k*f[e][t+3],o=x*f[e+1][t]+y*f[e+1][t+1]+S*f[e+1][t+2]+k*f[e+1][t+3],a=x*f[e+2][t]+y*f[e+2][t+1]+S*f[e+2][t+2]+k*f[e+2][t+3],s=x*f[e+3][t]+y*f[e+3][t+1]+S*f[e+3][t+2]+k*f[e+3][t+3],A[v]=b*n+3*(h*i*o+c*M*a)+T*s;return A}:d?function(A,t,e,r,i){A||(A=[]);var n,o,a,s;t*=3;var f=r*r,v=1-r,g=v*v,m=v*r*2,w=-3*g,l=3*(g-m),x=3*(m-f),y=3*f,S=1-i;for(a=0;a<u.length;a++)s=u[a],n=w*s[e][t]+l*s[e][t+1]+x*s[e][t+2]+y*s[e][t+3],o=w*s[e+1][t]+l*s[e+1][t+1]+x*s[e+1][t+2]+y*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,f,v;e*=3;var g=i*i,m=g*i,w=1-i,l=w*w,x=l*w;for(f=0;f<u.length;f++)v=u[f],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[f]=x*n+3*(l*i*o+w*g*a)+m*s;return A}:function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f=1-i;for(a=0;a<u.length;a++)s=u[a],n=s[e][t+1]-s[e][t],o=s[e+1][t+1]-s[e+1][t],A[a]=f*n+i*o;return A}}}),OL=Vt((Z,V)=>{V.exports=function(u,d,E){return d&&E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f,v;t*=3,e*=3;var g=r*r,m=g*r,w=1-r,l=w*w,x=l*w,y=i*i,S=1-i,k=S*S,M=S*i*2,T=-3*k,c=3*(k-M),h=3*(M-y),b=3*y;for(v=0;v<u.length;v++)f=u[v],n=T*f[e][t]+c*f[e+1][t]+h*f[e+2][t]+b*f[e+3][t],o=T*f[e][t+1]+c*f[e+1][t+1]+h*f[e+2][t+1]+b*f[e+3][t+1],a=T*f[e][t+2]+c*f[e+1][t+2]+h*f[e+2][t+2]+b*f[e+3][t+2],s=T*f[e][t+3]+c*f[e+1][t+3]+h*f[e+2][t+3]+b*f[e+3][t+3],A[v]=x*n+3*(l*r*o+w*g*a)+m*s;return A}:d?function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f,v;t*=3;var g=i*i,m=g*i,w=1-i,l=w*w,x=l*w;for(f=0;f<u.length;f++)v=u[f],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[f]=x*n+3*(l*i*o+w*g*a)+m*s;return A}:E?function(A,t,e,r,i){A||(A=[]);var n,o,a,s;e*=3;var f=1-r,v=i*i,g=1-i,m=g*g,w=g*i*2,l=-3*m,x=3*(m-w),y=3*(w-v),S=3*v;for(a=0;a<u.length;a++)s=u[a],n=l*s[e][t]+x*s[e+1][t]+y*s[e+2][t]+S*s[e+3][t],o=l*s[e][t+1]+x*s[e+1][t+1]+y*s[e+2][t+1]+S*s[e+3][t+1],A[a]=f*n+r*o;return A}:function(A,t,e,r,i){A||(A=[]);var n,o,a,s,f=1-r;for(a=0;a<u.length;a++)s=u[a],n=s[e+1][t]-s[e][t],o=s[e+1][t+1]-s[e][t+1],A[a]=f*n+r*o;return A}}}),DL=Vt((Z,V)=>{var u=zL(),d=Fy().findBin,E=CL(),A=IL(),t=PL(),e=OL();V.exports=function(r){var i=r._a,n=r._b,o=i.length,a=n.length,s=r.aaxis,f=r.baxis,v=i[0],g=i[o-1],m=n[0],w=n[a-1],l=i[i.length-1]-i[0],x=n[n.length-1]-n[0],y=l*u.RELATIVE_CULL_TOLERANCE,S=x*u.RELATIVE_CULL_TOLERANCE;v-=y,g+=y,m-=S,w+=S,r.isVisible=function(k,M){return k>v&&k<g&&M>m&&M<w},r.isOccluded=function(k,M){return k<v||k>g||M<m||M>w},r.setScale=function(){var k=r._x,M=r._y,T=E(r._xctrl,r._yctrl,k,M,s.smoothing,f.smoothing);r._xctrl=T[0],r._yctrl=T[1],r.evalxy=A([r._xctrl,r._yctrl],o,a,s.smoothing,f.smoothing),r.dxydi=t([r._xctrl,r._yctrl],s.smoothing,f.smoothing),r.dxydj=e([r._xctrl,r._yctrl],s.smoothing,f.smoothing)},r.i2a=function(k){var M=Math.max(0,Math.floor(k[0]),o-2),T=k[0]-M;return(1-T)*i[M]+T*i[M+1]},r.j2b=function(k){var M=Math.max(0,Math.floor(k[1]),o-2),T=k[1]-M;return(1-T)*n[M]+T*n[M+1]},r.ij2ab=function(k){return[r.i2a(k[0]),r.j2b(k[1])]},r.a2i=function(k){var M=Math.max(0,Math.min(d(k,i),o-2)),T=i[M],c=i[M+1];return Math.max(0,Math.min(o-1,M+(k-T)/(c-T)))},r.b2j=function(k){var M=Math.max(0,Math.min(d(k,n),a-2)),T=n[M],c=n[M+1];return Math.max(0,Math.min(a-1,M+(k-T)/(c-T)))},r.ab2ij=function(k){return[r.a2i(k[0]),r.b2j(k[1])]},r.i2c=function(k,M){return r.evalxy([],k,M)},r.ab2xy=function(k,M,T){if(!T&&(k<i[0]||k>i[o-1]|M<n[0]||M>n[a-1]))return[!1,!1];var c=r.a2i(k),h=r.b2j(M),b=r.evalxy([],c,h);if(T){var _=0,P=0,L=[],D,B,R,I;k<i[0]?(D=0,B=0,_=(k-i[0])/(i[1]-i[0])):k>i[o-1]?(D=o-2,B=1,_=(k-i[o-1])/(i[o-1]-i[o-2])):(D=Math.max(0,Math.min(o-2,Math.floor(c))),B=c-D),M<n[0]?(R=0,I=0,P=(M-n[0])/(n[1]-n[0])):M>n[a-1]?(R=a-2,I=1,P=(M-n[a-1])/(n[a-1]-n[a-2])):(R=Math.max(0,Math.min(a-2,Math.floor(h))),I=h-R),_&&(r.dxydi(L,D,R,B,I),b[0]+=L[0]*_,b[1]+=L[1]*_),P&&(r.dxydj(L,D,R,B,I),b[0]+=L[0]*P,b[1]+=L[1]*P)}return b},r.c2p=function(k,M,T){return[M.c2p(k[0]),T.c2p(k[1])]},r.p2x=function(k,M,T){return[M.p2c(k[0]),T.p2c(k[1])]},r.dadi=function(k){var M=Math.max(0,Math.min(i.length-2,k));return i[M+1]-i[M]},r.dbdj=function(k){var M=Math.max(0,Math.min(n.length-2,k));return n[M+1]-n[M]},r.dxyda=function(k,M,T,c){var h=r.dxydi(null,k,M,T,c),b=r.dadi(k,T);return[h[0]/b,h[1]/b]},r.dxydb=function(k,M,T,c){var h=r.dxydj(null,k,M,T,c),b=r.dbdj(M,c);return[h[0]/b,h[1]/b]},r.dxyda_rough=function(k,M,T){var c=l*(T||.1),h=r.ab2xy(k+c,M,!0),b=r.ab2xy(k-c,M,!0);return[(h[0]-b[0])*.5/c,(h[1]-b[1])*.5/c]},r.dxydb_rough=function(k,M,T){var c=x*(T||.1),h=r.ab2xy(k,M+c,!0),b=r.ab2xy(k,M-c,!0);return[(h[0]-b[0])*.5/c,(h[1]-b[1])*.5/c]},r.dpdx=function(k){return k._m},r.dpdy=function(k){return k._m}}}),FL=Vt((Z,V)=>{var u=yo(),d=Xr().isArray1D,E=TL(),A=kL(),t=AL(),e=ML(),r=SL(),i=m1(),n=EL(),o=d1(),a=DL();V.exports=function(s,f){var v=u.getFromId(s,f.xaxis),g=u.getFromId(s,f.yaxis),m=f.aaxis,w=f.baxis,l=f.x,x=f.y,y=[];l&&d(l)&&y.push("x"),x&&d(x)&&y.push("y"),y.length&&o(f,m,w,"a","b",y);var S=f._a=f._a||f.a,k=f._b=f._b||f.b;l=f._x||f.x,x=f._y||f.y;var M={};if(f._cheater){var T=m.cheatertype==="index"?S.length:S,c=w.cheatertype==="index"?k.length:k;l=E(T,c,f.cheaterslope)}f._x=l=i(l),f._y=x=i(x),n(l,S,k),n(x,S,k),a(f),f.setScale();var h=A(l),b=A(x),_=.5*(h[1]-h[0]),P=.5*(h[1]+h[0]),L=.5*(b[1]-b[0]),D=.5*(b[1]+b[0]),B=1.3;return h=[P-_*B,P+_*B],b=[D-L*B,D+L*B],f._extremes[v._id]=u.findExtremes(v,h,{padded:!0}),f._extremes[g._id]=u.findExtremes(g,b,{padded:!0}),t(f,"a","b"),t(f,"b","a"),e(f,m),e(f,w),M.clipsegments=r(f._xctrl,f._yctrl,m,w),M.x=l,M.y=x,M.a=S,M.b=k,[M]}}),BL=Vt((Z,V)=>{V.exports={attributes:$x(),supplyDefaults:_L(),plot:wL(),calc:FL(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Kc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),RL=Vt((Z,V)=>{V.exports=BL()}),Z5=Vt((Z,V)=>{var u=Qh(),d=pc(),E=Tl(),{hovertemplateAttrs:A,texttemplateAttrs:t,templatefallbackAttrs:e}=kl(),r=Wl(),i=So().extendFlat,n=d.marker,o=d.line,a=n.line;V.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:i({},d.mode,{dflt:"markers"}),text:i({},d.text,{}),texttemplate:t({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:e({editType:"plot"}),hovertext:i({},d.hovertext,{}),line:{color:o.color,width:o.width,dash:o.dash,backoff:o.backoff,shape:i({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:d.connectgaps,fill:i({},d.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:u(),marker:i({symbol:n.symbol,opacity:n.opacity,maxdisplayed:n.maxdisplayed,angle:n.angle,angleref:n.angleref,standoff:n.standoff,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,line:i({width:a.width,editType:"calc"},r("marker.line")),gradient:n.gradient,editType:"calc"},r("marker")),textfont:d.textfont,textposition:d.textposition,selected:d.selected,unselected:d.unselected,hoverinfo:i({},E.hoverinfo,{flags:["a","b","text","name"]}),hoveron:d.hoveron,hovertemplate:A(),hovertemplatefallback:e(),zorder:d.zorder}}),NL=Vt((Z,V)=>{var u=Xr(),d=gp(),E=nu(),A=zh(),t=Bh(),e=wm(),r=Rh(),i=ep(),n=Z5();V.exports=function(o,a,s,f){function v(S,k){return u.coerce(o,a,n,S,k)}v("carpet"),a.xaxis="x",a.yaxis="y";var g=v("a"),m=v("b"),w=Math.min(g.length,m.length);if(!w){a.visible=!1;return}a._length=w,v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext");var l=w<d.PTS_LINESONLY?"lines+markers":"lines";v("mode",l),E.hasMarkers(a)&&A(o,a,s,f,v,{gradient:!0}),E.hasLines(a)&&(t(o,a,s,f,v,{backoff:!0}),e(o,a,v),v("connectgaps")),E.hasText(a)&&r(o,a,f,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 y=v("hoveron",x.join("+")||"points");y!=="fills"&&(v("hovertemplate"),v("hovertemplatefallback")),v("zorder"),u.coerceSelectionMarkerOpacity(a,v)}}),jL=Vt((Z,V)=>{V.exports=function(u,d){var E={},A=d._carpet,t=A.ab2ij([u.a,u.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((Z,V)=>{V.exports=function(u,d){for(var E=u._fullData.length,A,t=0;t<E;t++){var e=u._fullData[t];if(e.index!==d.index&&e.type==="carpet"&&(A||(A=e),e.carpet===d.carpet))return e}return A}}),UL=Vt((Z,V)=>{var u=Lo(),d=Nh(),E=vp(),A=jh(),t=Uh().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),f,v,g=!1;for(o=0;o<a;o++)if(f=i.a[o],v=i.b[o],u(f)&&u(v)){var m=n.ab2xy(+f,+v,!0),w=n.isVisible(+f,+v);w||(g=!0),s[o]={x:m[0],y:m[1],a:f,b:v,vis:w}}else s[o]={x:!1,y:!1};return i._needsCull=g,s[0].carpet=n,s[0].trace=i,t(i,a),d(r,i),E(s,i),A(s,i),s}}}),VL=Vt((Z,V)=>{var u=Tm(),d=yo(),E=Eo();V.exports=function(A,t,e,r){var i,n,o,a=e[0][0].carpet,s=d.getFromId(A,a.xaxis||"x"),f=d.getFromId(A,a.yaxis||"y"),v={xaxis:s,yaxis:f,plot:t.plot};for(i=0;i<e.length;i++)n=e[i][0].trace,n._xA=s,n._yA=f;for(u(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)}}),HL=Vt((Z,V)=>{var u=Am(),d=Xr().fillText;V.exports=function(E,A,t,e){var r=u(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 f=i.cd[i.index];i.a=f.a,i.b=f.b,i.xLabelVal=void 0,i.yLabelVal=void 0;var v=i.trace,g=v._carpet,m=v._module.formatLabels(f,v);i.yLabel=m.yLabel,delete i.text;var w=[];function l(S,k){var M;S.labelprefix&&S.labelprefix.length>0?M=S.labelprefix.replace(/ = $/,""):M=S._hovertitle,w.push(M+": "+k.toFixed(3)+S.labelsuffix)}if(!v.hovertemplate){var x=f.hi||v.hoverinfo,y=x.split("+");y.indexOf("all")!==-1&&(y=["a","b","text"]),y.indexOf("a")!==-1&&l(g.aaxis,f.a),y.indexOf("b")!==-1&&l(g.baxis,f.b),w.push("y: "+i.yLabel),y.indexOf("text")!==-1&&d(f,v,w),i.extraText=w.join("<br>")}return r}}),qL=Vt((Z,V)=>{V.exports=function(u,d,E,A,t){var e=A[t];return u.a=e.a,u.b=e.b,u.y=e.y,u}}),WL=Vt((Z,V)=>{V.exports={attributes:Z5(),supplyDefaults:NL(),colorbar:Gf(),formatLabels:jL(),calc:UL(),plot:VL(),style:mh().style,styleOnSelect:mh().styleOnSelect,hoverPoints:HL(),selectPoints:Mm(),eventData:qL(),moduleType:"trace",name:"scattercarpet",basePlotModule:Kc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),GL=Vt((Z,V)=>{V.exports=WL()}),K5=Vt((Z,V)=>{var u=zm(),d=Yg(),E=Wl(),A=So().extendFlat,t=d.contours;V.exports=A({carpet:{valType:"string",editType:"calc"},z:u.z,a:u.x,a0:u.x0,da:u.dx,b:u.y,b0:u.y0,db:u.dy,text:u.text,hovertext:u.hovertext,transpose:u.transpose,atype:u.xtype,btype:u.ytype,fillcolor:d.fillcolor,autocontour:d.autocontour,ncontours:d.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:d.line.color,width:d.line.width,dash:d.line.dash,smoothing:d.line.smoothing,editType:"plot"},zorder:d.zorder},E("",{cLetter:"z",autoColorDflt:!1}))}),Y5=Vt((Z,V)=>{var u=Xr(),d=p1(),E=K5(),A=_2(),t=S1(),e=E1();V.exports=function(r,i,n,o){function a(g,m){return u.coerce(r,i,E,g,m)}function s(g){return u.coerce2(r,i,E,g)}if(a("carpet"),r.a&&r.b){var f=d(r,i,a,o,"a","b");if(!f){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")}}),ZL=Vt((Z,V)=>{var u=ah(),d=Xr(),E=d1(),A=m1(),t=g1(),e=v1(),r=a2(),i=Y5(),n=Jx(),o=f2();V.exports=function(s,f){var v=f._carpetTrace=n(s,f);if(!(!v||!v.visible||v.visible==="legendonly")){if(!f.a||!f.b){var g=s.data[v.index],m=s.data[f.index];m.a||(m.a=g.a),m.b||(m.b=g.b),i(m,f,f._defaultColor,s._fullLayout)}var w=a(s,f);return o(f,f._z),w}};function a(s,f){var v=f._carpetTrace,g=v.aaxis,m=v.baxis,w,l,x,y,S,k,M;g._minDtick=0,m._minDtick=0,d.isArray1D(f.z)&&E(f,g,m,"a","b",["z"]),w=f._a=f._a||f.a,y=f._b=f._b||f.b,w=w?g.makeCalcdata(f,"_a"):[],y=y?m.makeCalcdata(f,"_b"):[],l=f.a0||0,x=f.da||1,S=f.b0||0,k=f.db||1,M=f._z=A(f._z||f.z,f.transpose),f._emptypoints=e(M),t(M,f._emptypoints);var T=d.maxRowLength(M),c=f.xtype==="scaled"?"":w,h=r(f,c,l,x,T,g),b=f.ytype==="scaled"?"":y,_=r(f,b,S,k,M.length,m),P={a:h,b:_,z:M};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&u(s,f,{vals:M,containerStr:"",cLetter:"z"}),[P]}}),KL=Vt((Z,V)=>{var u=Xr().isArrayOrTypedArray;V.exports=function(d,E,A,t){var e,r,i,n,o,a,s,f,v,g,m,w,l,x=u(A)?"a":"b",y=x==="a"?d.aaxis:d.baxis,S=y.smoothing,k=x==="a"?d.a2i:d.b2j,M=x==="a"?A:t,T=x==="a"?t:A,c=x==="a"?E.a.length:E.b.length,h=x==="a"?E.b.length:E.a.length,b=Math.floor(x==="a"?d.b2j(T):d.a2i(T)),_=x==="a"?function(ct){return d.evalxy([],ct,b)}:function(ct){return d.evalxy([],b,ct)};S&&(i=Math.max(0,Math.min(h-2,b)),n=b-i,r=x==="a"?function(ct,st){return d.dxydi([],ct,i,st,n)}:function(ct,st){return d.dxydj([],i,ct,n,st)});var P=k(M[0]),L=k(M[1]),D=P<L?1:-1,B=(L-P)*1e-8,R=D>0?Math.floor:Math.ceil,I=D>0?Math.ceil:Math.floor,F=D>0?Math.min:Math.max,N=D>0?Math.max:Math.min,j=R(P+B),G=I(L-B);s=_(P);var rt=[[s]];for(e=j;e*D<G*D;e+=D)o=[],m=N(P,e),w=F(L,e+D),l=w-m,a=Math.max(0,Math.min(c-2,Math.floor(.5*(m+w)))),f=_(w),S&&(v=r(a,m-a),g=r(a,w-a),o.push([s[0]+v[0]/3*l,s[1]+v[1]/3*l]),o.push([f[0]-g[0]/3*l,f[1]-g[1]/3*l])),o.push(f),rt.push(o),s=f;return rt}}),YL=Vt((Z,V)=>{var u=Ni(),d=W5(),E=G5(),A=Eo(),t=Xr(),e=p2(),r=d2(),i=z1(),n=$g(),o=g2(),a=m2(),s=v2(),f=Jx(),v=KL();V.exports=function(T,c,h,b){var _=c.xaxis,P=c.yaxis;t.makeTraceGroups(b,h,"contour").each(function(L){var D=u.select(this),B=L[0],R=B.trace,I=R._carpetTrace=f(T,R),F=T.calcdata[I.index][0];if(!I.visible||I.visible==="legendonly")return;var N=B.a,j=B.b,G=R.contours,rt=a(G,c,B),ct=G.type==="constraint",st=G._operation,et=ct?st==="="?"lines":"fill":G.coloring;function K(wt){var It=I.ab2xy(wt[0],wt[1],!0);return[_.c2p(It[0]),P.c2p(It[1])]}var ot=[[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 X=(N[N.length-1]-N[0])*1e-8,Q=(j[j.length-1]-j[0])*1e-8;r(rt,X,Q);var ut=rt;G.type==="constraint"&&(ut=o(rt,st)),g(rt,K);var J,q,it,nt,dt=[];for(nt=F.clipsegments.length-1;nt>=0;nt--)J=F.clipsegments[nt],q=d([],J.x,_.c2p),it=d([],J.y,P.c2p),q.reverse(),it.reverse(),dt.push(E(q,it,J.bicubic));var Tt="M"+dt.join("L")+"Z";S(D,F.clipsegments,_,P,ct,et),k(R,D,_,P,ut,ot,K,I,F,et,Tt),m(D,rt,T,B,G,c,I),A.setClipUrl(D,I._clipPathId,T)})};function g(T,c){var h,b,_,P,L,D,B,R,I;for(h=0;h<T.length;h++){for(P=T[h],L=P.pedgepaths=[],D=P.ppaths=[],b=0;b<P.edgepaths.length;b++){for(I=P.edgepaths[b],B=[],_=0;_<I.length;_++)B[_]=c(I[_]);L.push(B)}for(b=0;b<P.paths.length;b++){for(I=P.paths[b],R=[],_=0;_<I.length;_++)R[_]=c(I[_]);D.push(R)}}}function m(T,c,h,b,_,P,L){var D=h._context.staticPlot,B=t.ensureSingle(T,"g","contourlines"),R=_.showlines!==!1,I=_.showlabels,F=R&&I,N=i.createLines(B,R||I,c,D),j=i.createLineClip(B,F,h,b.trace.uid),G=T.selectAll("g.contourlabels").data(I?[0]:[]);if(G.exit().remove(),G.enter().append("g").classed("contourlabels",!0),I){var rt=P.xaxis,ct=P.yaxis,st=rt._length,et=ct._length,K=[[[0,0],[st,0],[st,et],[0,et]]],ot=[];t.clearLocationCache();var X=i.labelFormatter(h,b),Q=A.tester.append("text").attr("data-notex",1).call(A.font,_.labelfont),ut={left:0,right:st,center:st/2,top:0,bottom:et,middle:et/2},J=Math.sqrt(st*st+et*et),q=n.LABELDISTANCE*J/Math.max(1,c.length/n.LABELINCREASE);N.each(function(it){var nt=i.calcTextOpts(it.level,X,Q,h);u.select(this).selectAll("path").each(function(dt){var Tt=this,wt=t.getVisibleSegment(Tt,ut,nt.height/2);if(wt&&(w(Tt,dt,it,wt,L,nt.height),!(wt.len<(nt.width+nt.height)*n.LABELMIN)))for(var It=Math.min(Math.ceil(wt.len/q),n.LABELMAX),Ct=0;Ct<It;Ct++){var Nt=i.findBestTextLocation(Tt,wt,nt,ot,ut);if(!Nt)break;i.addLabelData(Nt,nt,ot,K)}})}),Q.remove(),i.drawLabels(G,ot,h,j,F?K:null)}I&&!R&&N.remove()}function w(T,c,h,b,_,P){for(var L,D=0;D<h.pedgepaths.length;D++)c===h.pedgepaths[D]&&(L=h.edgepaths[D]);if(!L)return;var B=_.a[0],R=_.a[_.a.length-1],I=_.b[0],F=_.b[_.b.length-1];function N(st,et){var K=0,ot,X=.1;return(Math.abs(st[0]-B)<X||Math.abs(st[0]-R)<X)&&(ot=x(_.dxydb_rough(st[0],st[1],X)),K=Math.max(K,P*y(et,ot)/2)),(Math.abs(st[1]-I)<X||Math.abs(st[1]-F)<X)&&(ot=x(_.dxyda_rough(st[0],st[1],X)),K=Math.max(K,P*y(et,ot)/2)),K}var j=l(T,0,1),G=l(T,b.total,b.total-1),rt=N(L[0],j),ct=b.total-N(L[L.length-1],G);b.min<rt&&(b.min=rt),b.max>ct&&(b.max=ct),b.len=b.max-b.min}function l(T,c,h){var b=T.getPointAtLength(c),_=T.getPointAtLength(h),P=_.x-b.x,L=_.y-b.y,D=Math.sqrt(P*P+L*L);return[P/D,L/D]}function x(T){var c=Math.sqrt(T[0]*T[0]+T[1]*T[1]);return[T[0]/c,T[1]/c]}function y(T,c){var h=Math.abs(T[0]*c[0]+T[1]*c[1]),b=Math.sqrt(1-h*h);return b/h}function S(T,c,h,b,_,P){var L,D,B,R,I=t.ensureSingle(T,"g","contourbg"),F=I.selectAll("path").data(P==="fill"&&!_?[0]:[]);F.enter().append("path"),F.exit().remove();var N=[];for(R=0;R<c.length;R++)L=c[R],D=d([],L.x,h.c2p),B=d([],L.y,b.c2p),N.push(E(D,B,L.bicubic));F.attr("d","M"+N.join("L")+"Z").style("stroke","none")}function k(T,c,h,b,_,P,L,D,B,R,I){var F=R==="fill";F&&s(_,T.contours);var N=t.ensureSingle(c,"g","contourfill"),j=N.selectAll("path").data(F?_:[]);j.enter().append("path"),j.exit().remove(),j.each(function(G){var rt=(G.prefixBoundary?I:"")+M(T,G,P,L,D,B,h,b);rt?u.select(this).attr("d",rt).style("stroke","none"):u.select(this).remove()})}function M(T,c,h,b,_,P,L,D){var B,R="",I=c.edgepaths.map(function(nt,dt){return dt}),F=!0,N,j,G,rt,ct,st,et=Math.abs(h[0][0]-h[2][0])*1e-4,K=Math.abs(h[0][1]-h[2][1])*1e-4;function ot(nt){return Math.abs(nt[1]-h[0][1])<K}function X(nt){return Math.abs(nt[1]-h[2][1])<K}function Q(nt){return Math.abs(nt[0]-h[0][0])<et}function ut(nt){return Math.abs(nt[0]-h[2][0])<et}function J(nt,dt){var Tt,wt,It,Ct,Nt="";for(ot(nt)&&!ut(nt)||X(nt)&&!Q(nt)?(Ct=_.aaxis,It=v(_,P,[nt[0],dt[0]],.5*(nt[1]+dt[1]))):(Ct=_.baxis,It=v(_,P,.5*(nt[0]+dt[0]),[nt[1],dt[1]])),Tt=1;Tt<It.length;Tt++)for(Nt+=Ct.smoothing?"C":"L",wt=0;wt<It[Tt].length;wt++){var ee=It[Tt][wt];Nt+=[L.c2p(ee[0]),D.c2p(ee[1])]+" "}return Nt}for(B=0,N=null;I.length;){var q=c.edgepaths[B][0];for(N&&(R+=J(N,q)),st=A.smoothopen(c.edgepaths[B].map(b),c.smoothing),R+=F?st:st.replace(/^M/,"L"),I.splice(I.indexOf(B),1),N=c.edgepaths[B][c.edgepaths[B].length-1],rt=-1,G=0;G<4;G++){if(!N){t.log("Missing end?",B,c);break}for(ot(N)&&!ut(N)?j=h[1]:Q(N)?j=h[0]:X(N)?j=h[3]:ut(N)&&(j=h[2]),ct=0;ct<c.edgepaths.length;ct++){var it=c.edgepaths[ct][0];Math.abs(N[0]-j[0])<et?Math.abs(N[0]-it[0])<et&&(it[1]-N[1])*(j[1]-it[1])>=0&&(j=it,rt=ct):Math.abs(N[1]-j[1])<K?Math.abs(N[1]-it[1])<K&&(it[0]-N[0])*(j[0]-it[0])>=0&&(j=it,rt=ct):t.log("endpt to newendpt is not vert. or horz.",N,j,it)}if(rt>=0)break;R+=J(N,j),N=j}if(rt===c.edgepaths.length){t.log("unclosed perimeter path");break}B=rt,F=I.indexOf(B)===-1,F&&(B=I[0],R+=J(N,j)+"Z",N=null)}for(B=0;B<c.paths.length;B++)R+=A.smoothclosed(c.paths[B].map(b),c.smoothing);return R}}),XL=Vt((Z,V)=>{V.exports={attributes:K5(),supplyDefaults:Y5(),colorbar:C1(),calc:ZL(),plot:YL(),style:L1(),moduleType:"trace",name:"contourcarpet",basePlotModule:Kc(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),$L=Vt((Z,V)=>{V.exports=XL()}),Qx=Vt((Z,V)=>{var u=Xr().extendFlat,d=pc(),E=fc().axisHoverFormat,A=Cf().dash,t=hm(),e=Lm(),r=e.INCREASING.COLOR,i=e.DECREASING.COLOR,n=d.line;function o(a){return{line:{color:u({},n.color,{dflt:a}),width:n.width,dash:A,editType:"style"},editType:"style"}}V.exports={xperiod:d.xperiod,xperiod0:d.xperiod0,xperiodalignment:d.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:u({},n.width,{}),dash:u({},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:u({},t.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:d.zorder}}),X5=Vt((Z,V)=>{var u=ji(),d=Xr();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=u.getComponentMethod("calendars","handleTraceDefaults");if(s(E,A,["x"],e),!!(i&&n&&o&&a)){var f=Math.min(i.length,n.length,o.length,a.length);return r&&(f=Math.min(f,d.minRowLength(r))),A._length=f,f}}}),JL=Vt((Z,V)=>{var u=Xr(),d=X5(),E=tp(),A=Qx();V.exports=function(e,r,i,n){function o(s,f){return u.coerce(e,r,A,s,f)}var a=d(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)}}),$5=Vt((Z,V)=>{var u=Xr(),d=u._,E=yo(),A=rp(),t=ks().BADNUM;function e(o,a){var s=E.getFromId(o,a.xaxis),f=E.getFromId(o,a.yaxis),v=n(o,s,a),g=a._minDiff;a._minDiff=null;var m=a._origX;a._origX=null;var w=a._xcalc;a._xcalc=null;var l=i(o,a,m,w,f,r);return a._extremes[s._id]=E.findExtremes(s,w,{vpad:g/2}),l.length?(u.extendFlat(l[0].t,{wHover:g/2,tickLen:v}),l):[{t:{empty:!0}}]}function r(o,a,s,f){return{o,h:a,l:s,c:f}}function i(o,a,s,f,v,g){for(var m=v.makeCalcdata(a,"open"),w=v.makeCalcdata(a,"high"),l=v.makeCalcdata(a,"low"),x=v.makeCalcdata(a,"close"),y=u.isArrayOrTypedArray(a.text),S=u.isArrayOrTypedArray(a.hovertext),k=!0,M=null,T=!!a.xperiodalignment,c=[],h=0;h<f.length;h++){var b=f[h],_=m[h],P=w[h],L=l[h],D=x[h];if(b!==t&&_!==t&&P!==t&&L!==t&&D!==t){D===_?M!==null&&D!==M&&(k=D>M):k=D>_,M=D;var B=g(_,P,L,D);B.pos=b,B.yc=(_+D)/2,B.i=h,B.dir=k?"increasing":"decreasing",B.x=B.pos,B.y=[L,P],T&&(B.orig_p=s[h]),y&&(B.tx=a.text[h]),S&&(B.htx=a.hovertext[h]),c.push(B)}else c.push({pos:b,empty:!0})}return a._extremes[v._id]=E.findExtremes(v,u.concat(l,w),{padded:!0}),c.length&&(c[0].t={labels:{open:d(o,"open:")+" ",high:d(o,"high:")+" ",low:d(o,"low:")+" ",close:d(o,"close:")+" "}}),c}function n(o,a,s){var f=s._minDiff;if(!f){var v=o._fullData,g=[];f=1/0;var m;for(m=0;m<v.length;m++){var w=v[m];if(w.type==="ohlc"&&w.visible===!0&&w.xaxis===a._id){g.push(w);var l=a.makeCalcdata(w,"x");w._origX=l;var x=A(s,a,"x",l).vals;w._xcalc=x;var y=u.distinctVals(x).minDiff;y&&isFinite(y)&&(f=Math.min(f,y))}}for(f===1/0&&(f=1),m=0;m<g.length;m++)g[m]._minDiff=f}return f*s.tickwidth}V.exports={calc:e,calcCommon:i}}),QL=Vt((Z,V)=>{var u=Ni(),d=Xr();V.exports=function(E,A,t,e){var r=A.yaxis,i=A.xaxis,n=!!i.rangebreaks;d.makeTraceGroups(e,t,"trace ohlc").each(function(o){var a=u.select(this),s=o[0],f=s.t,v=s.trace;if(v.visible!==!0||f.empty){a.remove();return}var g=f.tickLen,m=a.selectAll("path").data(d.identity);m.enter().append("path"),m.exit().remove(),m.attr("d",function(w){if(w.empty)return"M0,0Z";var l=i.c2p(w.pos-g,!0),x=i.c2p(w.pos+g,!0),y=n?(l+x)/2:i.c2p(w.pos,!0),S=r.c2p(w.o,!0),k=r.c2p(w.h,!0),M=r.c2p(w.l,!0),T=r.c2p(w.c,!0);return"M"+l+","+S+"H"+y+"M"+y+","+k+"V"+M+"M"+x+","+T+"H"+y})})}}),tC=Vt((Z,V)=>{var u=Ni(),d=Eo(),E=Pi();V.exports=function(A,t,e){var r=e||u.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;u.select(this).selectAll("path").each(function(o){if(!o.empty){var a=n[o.dir].line;u.select(this).style("fill","none").call(E.stroke,a.color).call(d.dashLine,a.dash,a.width).style("opacity",n.selectedpoints&&!o.selected?.3:1)}})})}}),J5=Vt((Z,V)=>{var u=yo(),d=Xr(),E=hc(),A=Pi(),t=Xr().fillText,e=Lm(),r={increasing:e.INCREASING.SYMBOL,decreasing:e.DECREASING.SYMBOL};function i(s,f,v,g){var m=s.cd,w=m[0].trace;return w.hoverlabel.split?o(s,f,v,g):a(s,f,v,g)}function n(s,f,v,g){var m=s.cd,w=s.xa,l=m[0].trace,x=m[0].t,y=l.type,S=y==="ohlc"?"l":"min",k=y==="ohlc"?"h":"max",M,T,c=x.bPos||0,h=function(G){return G.pos+c-f},b=x.bdPos||x.tickLen,_=x.wHover,P=Math.min(1,b/Math.abs(w.r2c(w.range[1])-w.r2c(w.range[0])));M=s.maxHoverDistance-P,T=s.maxSpikeDistance-P;function L(G){var rt=h(G);return E.inbox(rt-_,rt+_,M)}function D(G){var rt=G[S],ct=G[k];return rt===ct||E.inbox(rt-v,ct-v,M)}function B(G){return(L(G)+D(G))/2}var R=E.getDistanceFunction(g,L,D,B);if(E.getClosest(m,R,s),s.index===!1)return null;var I=m[s.index];if(I.empty)return null;var F=I.dir,N=l[F],j=N.line.color;return A.opacity(j)&&N.line.width?s.color=j:s.color=N.fillcolor,s.x0=w.c2p(I.pos+c-b,!0),s.x1=w.c2p(I.pos+c+b,!0),s.xLabelVal=I.orig_p!==void 0?I.orig_p:I.pos,s.spikeDistance=B(I)*T/M,s.xSpike=w.c2p(I.pos,!0),s}function o(s,f,v,g){var m=s.cd,w=s.ya,l=m[0].trace,x=m[0].t,y=[],S=n(s,f,v,g);if(!S)return[];var k=S.index,M=m[k],T=M.hi||l.hoverinfo,c=T.split("+"),h=T==="all",b=h||c.indexOf("y")!==-1;if(!b)return[];for(var _=["high","open","close","low"],P={},L=0;L<_.length;L++){var D=_[L],B=l[D][S.index],R=w.c2p(B,!0),I;B in P?(I=P[B],I.yLabel+="<br>"+x.labels[D]+u.hoverLabelText(w,B,l.yhoverformat)):(I=d.extendFlat({},S),I.y0=I.y1=R,I.yLabelVal=B,I.yLabel=x.labels[D]+u.hoverLabelText(w,B,l.yhoverformat),I.name="",y.push(I),P[B]=I)}return y}function a(s,f,v,g){var m=s.cd,w=s.ya,l=m[0].trace,x=m[0].t,y=n(s,f,v,g);if(!y)return[];var S=y.index,k=m[S],M=y.index=k.i,T=k.dir;function c(B){return x.labels[B]+u.hoverLabelText(w,l[B][M],l.yhoverformat)}var h=k.hi||l.hoverinfo,b=h.split("+"),_=h==="all",P=_||b.indexOf("y")!==-1,L=_||b.indexOf("text")!==-1,D=P?[c("open"),c("high"),c("low"),c("close")+" "+r[T]]:[];return L&&t(k,l,D),y.extraText=D.join("<br>"),y.y0=y.y1=w.c2p(k.yc,!0),[y]}V.exports={hoverPoints:i,hoverSplit:o,hoverOnPoints:a}}),Q5=Vt((Z,V)=>{V.exports=function(u,d){var E=u.cd,A=u.xaxis,t=u.yaxis,e=[],r,i=E[0].t.bPos||0;if(d===!1)for(r=0;r<E.length;r++)E[r].selected=0;else for(r=0;r<E.length;r++){var n=E[r];d.contains([A.c2p(n.pos+i),t.c2p(n.yc)],null,n.i,u)?(e.push({pointNumber:n.i,x:A.c2d(n.pos),y:t.c2d(n.yc)}),n.selected=1):n.selected=0}return e}}),eC=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"ohlc",basePlotModule:Kc(),categories:["cartesian","svg","showLegend"],meta:{},attributes:Qx(),supplyDefaults:JL(),calc:$5().calc,plot:QL(),style:tC(),hoverPoints:J5().hoverPoints,selectPoints:Q5()}}),rC=Vt((Z,V)=>{V.exports=eC()}),t4=Vt((Z,V)=>{var u=Xr().extendFlat,d=fc().axisHoverFormat,E=Qx(),A=Wg();function t(e){return{line:{color:u({},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:d("x"),yhoverformat:d("y"),x:E.x,open:E.open,high:E.high,low:E.low,close:E.close,line:{width:u({},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:u({},A.whiskerwidth,{dflt:0}),hoverlabel:E.hoverlabel,zorder:A.zorder}}),nC=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=X5(),A=tp(),t=t4();V.exports=function(r,i,n,o){function a(f,v){return u.coerce(r,i,t,f,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",d.addOpacity(a,.5))}}),aC=Vt((Z,V)=>{var u=Xr(),d=yo(),E=rp(),A=$5().calcCommon;V.exports=function(e,r){var i=e._fullLayout,n=d.getFromId(e,r.xaxis),o=d.getFromId(e,r.yaxis),a=n.makeCalcdata(r,"x"),s=E(r,n,"x",a).vals,f=A(e,r,a,s,o,t);return f.length?(u.extendFlat(f[0].t,{num:i._numBoxes,dPos:u.distinctVals(s).minDiff/2,posLetter:"x",valLetter:"y"}),i._numBoxes++,f):[{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}}}),iC=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"candlestick",basePlotModule:Kc(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:t4(),layoutAttributes:Gg(),supplyLayoutDefaults:u1().supplyLayoutDefaults,crossTraceCalc:c1().crossTraceCalc,supplyDefaults:nC(),calc:aC(),plot:f1().plot,layerName:"boxlayer",style:h1().style,hoverPoints:J5().hoverPoints,selectPoints:Q5()}}),oC=Vt((Z,V)=>{V.exports=iC()}),e4=Vt((Z,V)=>{var u=Xr(),d=mp(),E=u.deg2rad,A=u.rad2deg;V.exports=function(n,o,a){switch(d(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],f=n._rl[1],v=a.innerRadius,g=(a.radius-v)/(f-s),m=v/g,w=s>f?function(l){return l<=0}:function(l){return l>=0};n.c2g=function(l){var x=n.c2l(l)-s;return(w(x)?x:0)+m},n.g2c=function(l){return n.l2c(l+s-m)},n.g2p=function(l){return l*g},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,f=n.c2d;n.d2c=function(v,g){return e(s(v),g)},n.c2d=function(v,g){return f(r(v,g))}}n.makeCalcdata=function(v,g){var m=v[g],w=v._length,l,x,y=function(c){return n.d2c(c,v.thetaunit)};if(m)for(l=new Array(w),x=0;x<w;x++)l[x]=y(m[x]);else{var S=g+"0",k="d"+g,M=S in v?y(v[S]):0,T=v[k]?y(v[k]):(n.period||2*Math.PI)/w;for(l=new Array(w),x=0;x<w;x++)l[x]=M+x*T}return l},n.setGeometry=function(){var v=o.sector,g=v.map(E),m={clockwise:-1,counterclockwise:1}[n.direction],w=E(n.rotation),l=function(h){return m*h+w},x=function(h){return(h-w)/m},y,S,k,M;switch(a){case"linear":S=y=u.identity,M=E,k=A,n.range=u.isFullCircle(g)?[v[0],v[0]+360]:g.map(x).map(A);break;case"category":var T=n._categories.length,c=n.period?Math.max(n.period,T):T;c===0&&(c=1),S=M=function(h){return h*2*Math.PI/c},y=k=function(h){return h*c/Math.PI/2},n.range=[0,c];break}n.c2g=function(h){return l(S(h))},n.g2c=function(h){return y(x(h))},n.t2g=function(h){return l(M(h))},n.g2t=function(h){return k(x(h))}}}}),t_=Vt((Z,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}}),e_=Vt((Z,V)=>{var u=Xr(),d=Rg().tester,E=u.findIndexOfMin,A=u.isAngleInsideSector,t=u.angleDelta,e=u.angleDist;function r(x,y,S,k,M){if(!A(y,k))return!1;var T,c;S[0]<S[1]?(T=S[0],c=S[1]):(T=S[1],c=S[0]);var h=d(s(T,k[0],k[1],M)),b=d(s(c,k[0],k[1],M)),_=[x*Math.cos(y),x*Math.sin(y)];return b.contains(_)&&!h.contains(_)}function i(x,y,S,k){var M,T,c=k[0],h=k[1],b=g(Math.sin(y)-Math.sin(x)),_=g(Math.cos(y)-Math.cos(x)),P=Math.tan(S),L=g(1/P),D=b/_,B=h-D*c;return L?b&&_?(M=B/(P-D),T=P*M):_?(M=h*L,T=h):(M=c,T=c*P):b&&_?(M=0,T=B):_?(M=0,T=h):M=T=NaN,[M,T]}function n(x,y,S,k){var M=-y*S,T=y*y+1,c=2*(y*M-S),h=M*M+S*S-x*x,b=Math.sqrt(c*c-4*T*h),_=(-c+b)/(2*T),P=(-c-b)/(2*T);return[[_,y*_+M+k],[P,y*P+M+k]]}function o(x,y){var S=y.length,k=new Array(S+1),M;for(M=0;M<S;M++){var T=y[M];k[M]=[x*Math.cos(T),x*Math.sin(T)]}return k[M]=k[0].slice(),k}function a(x,y,S,k){var M=k.length,T=[],c,h;function b(N){return[x*Math.cos(N),x*Math.sin(N)]}function _(N,j,G){return i(N,j,G,b(N))}function P(N){return u.mod(N,M)}function L(N){return A(N,[y,S])}var D=E(k,function(N){return L(N)?e(N,y):1/0}),B=_(k[D],k[P(D-1)],y);for(T.push(B),c=D,h=0;h<M;c++,h++){var R=k[P(c)];if(!L(R))break;T.push(b(R))}var I=E(k,function(N){return L(N)?e(N,S):1/0}),F=_(k[I],k[P(I+1)],S);return T.push(F),T.push([0,0]),T.push(T[0].slice()),T}function s(x,y,S,k){return u.isFullCircle([y,S])?o(x,k):a(x,y,S,k)}function f(x,y,S,k){for(var M=1/0,T=1/0,c=s(x,y,S,k),h=0;h<c.length;h++){var b=c[h];M=Math.min(M,b[0]),T=Math.min(T,-b[1])}return[M,T]}function v(x,y){var S=function(T){var c=t(T,x);return c>0?c:1/0},k=E(y,S),M=u.mod(k+1,y.length);return[y[k],y[M]]}function g(x){return Math.abs(x)>1e-10?x:0}function m(x,y,S){y=y||0,S=S||0;for(var k=x.length,M=new Array(k),T=0;T<k;T++){var c=x[T];M[T]=[y+c[0],S-c[1]]}return M}function w(x,y,S,k,M,T){var c=s(x,y,S,k);return"M"+m(c,M,T).join("L")}function l(x,y,S,k,M,T,c){var h,b;x<y?(h=x,b=y):(h=y,b=x);var _=m(s(h,S,k,M),T,c),P=m(s(b,S,k,M),T,c);return"M"+P.reverse().join("L")+"M"+_.join("L")}V.exports={isPtInsidePolygon:r,findPolygonOffset:f,findEnclosingVertexAngles:v,findIntersectionXY:i,findXYatLength:n,clampTiny:g,pathPolygon:w,pathPolygonAnnulus:l}}),r4=Vt((Z,V)=>{function u(r){return r<0?-1:r>0?1:0}function d(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,d([n,i])),s=a[0],f=a[1],v=E(r,d([o,i])),g=v[0],m=v[1];if(i===0)return["M"+s+","+f,"L"+g+","+m].join(" ");var w=A(r,1/Math.abs(i));return["M"+s+","+f,"A"+w+","+w+" 0 0,"+(i<0?1:0)+" "+g+","+m].join(" ")}function e(r,i,n,o){var a=A(r,1/(i+1)),s=E(r,d([i,n])),f=s[0],v=s[1],g=E(r,d([i,o])),m=g[0],w=g[1];if(u(n)!==u(o)){var l=E(r,d([i,0])),x=l[0],y=l[1];return["M"+f+","+v,"A"+a+","+a+" 0 0,"+(0<n?0:1)+" "+x+","+y,"A"+a+","+a+" 0 0,"+(o<0?0:1)+m+","+w].join(" ")}return["M"+f+","+v,"A"+a+","+a+" 0 0,"+(o<n?0:1)+" "+m+","+w].join(" ")}V.exports={smith:d,reactanceArc:t,resistanceArc:e,smithTransform:E}}),n4=Vt((Z,V)=>{var u=Ni(),d=kf(),E=ji(),A=Xr(),t=A.strRotate,e=A.strTranslate,r=Pi(),i=Eo(),n=Uu(),o=yo(),a=mp(),s=e4(),f=Xh().doAutoRange,v=Eb(),g=ih(),m=hc(),w=o0(),l=Sc().prepSelect,x=Sc().selectOnClick,y=Sc().clearOutline,S=$h(),k=Dg(),M=Bg().redrawReglTraces,T=mf().MID_SHIFT,c=t_(),h=e_(),b=r4(),_=b.smith,P=b.reactanceArc,L=b.resistanceArc,D=b.smithTransform,B=A._,R=A.mod,I=A.deg2rad,F=A.rad2deg;function N(et,K,ot){this.isSmith=ot||!1,this.id=K,this.gd=et,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var X=et._fullLayout,Q="clip"+X._uid+K;this.clipIds.forTraces=Q+"-for-traces",this.clipPaths.forTraces=X._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=X["_"+(ot?"smith":"polar")+"layer"].append("g").attr("class",K),this.getHole=function(ut){return this.isSmith?0:ut.hole},this.getSector=function(ut){return this.isSmith?[0,360]:ut.sector},this.getRadial=function(ut){return this.isSmith?ut.realaxis:ut.radialaxis},this.getAngular=function(ut){return this.isSmith?ut.imaginaryaxis:ut.angularaxis},ot||(this.radialTickLayout=null,this.angularTickLayout=null)}var j=N.prototype;V.exports=function(et,K,ot){return new N(et,K,ot)},j.plot=function(et,K){for(var ot=this,X=K[ot.id],Q=!1,ut=0;ut<et.length;ut++){var J=et[ut][0].trace;if(J.cliponaxis===!1){Q=!0;break}}ot._hasClipOnAxisFalse=Q,ot.updateLayers(K,X),ot.updateLayout(K,X),n.generalUpdatePerTraceModule(ot.gd,ot,et,X),ot.updateFx(K,X),ot.isSmith&&(delete X.realaxis.range,delete X.imaginaryaxis.range)},j.updateLayers=function(et,K){var ot=this,X=ot.isSmith,Q=ot.layers,ut=ot.getRadial(K),J=ot.getAngular(K),q=c.layerNames,it=q.indexOf("frontplot"),nt=q.slice(0,it),dt=J.layer==="below traces",Tt=ut.layer==="below traces";dt&&nt.push("angular-line"),Tt&&nt.push("radial-line"),dt&&nt.push("angular-axis"),Tt&&nt.push("radial-axis"),nt.push("frontplot"),dt||nt.push("angular-line"),Tt||nt.push("radial-line"),dt||nt.push("angular-axis"),Tt||nt.push("radial-axis");var wt=(X?"smith":"polar")+"sublayer",It=ot.framework.selectAll("."+wt).data(nt,String);It.enter().append("g").attr("class",function(Ct){return wt+" "+Ct}).each(function(Ct){var Nt=Q[Ct]=u.select(this);switch(Ct){case"frontplot":X||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}}),It.order()},j.updateLayout=function(et,K){var ot=this,X=ot.layers,Q=et._size,ut=ot.getRadial(K),J=ot.getAngular(K),q=K.domain.x,it=K.domain.y;ot.xOffset=Q.l+Q.w*q[0],ot.yOffset=Q.t+Q.h*(1-it[1]);var nt=ot.xLength=Q.w*(q[1]-q[0]),dt=ot.yLength=Q.h*(it[1]-it[0]),Tt=ot.getSector(K);ot.sectorInRad=Tt.map(I);var wt=ot.sectorBBox=rt(Tt),It=wt[2]-wt[0],Ct=wt[3]-wt[1],Nt=dt/nt,ee=Math.abs(Ct/It),Jt,te,Kt,mt,bt;Nt>ee?(Jt=nt,te=nt*ee,bt=(dt-te)/Q.h/2,Kt=[q[0],q[1]],mt=[it[0]+bt,it[1]-bt]):(Jt=dt/ee,te=dt,bt=(nt-Jt)/Q.w/2,Kt=[q[0]+bt,q[1]-bt],mt=[it[0],it[1]]),ot.xLength2=Jt,ot.yLength2=te,ot.xDomain2=Kt,ot.yDomain2=mt;var vt=ot.xOffset2=Q.l+Q.w*Kt[0],Ut=ot.yOffset2=Q.t+Q.h*(1-mt[1]),re=ot.radius=Jt/It,Zt=ot.innerRadius=ot.getHole(K)*re,ue=ot.cx=vt-re*wt[0],Me=ot.cy=Ut+re*wt[3],Ce=ot.cxx=ue-vt,We=ot.cyy=Me-Ut,qe=ut.side,vr;qe==="counterclockwise"?(vr=qe,qe="top"):qe==="clockwise"&&(vr=qe,qe="bottom"),ot.radialAxis=ot.mockAxis(et,K,ut,{_id:"x",side:qe,_trueSide:vr,domain:[Zt/Q.w,re/Q.w]}),ot.angularAxis=ot.mockAxis(et,K,J,{side:"right",domain:[0,Math.PI],autorange:!1}),ot.doAutoRange(et,K),ot.updateAngularAxis(et,K),ot.updateRadialAxis(et,K),ot.updateRadialAxisTitle(et,K),ot.xaxis=ot.mockCartesianAxis(et,K,{_id:"x",domain:Kt}),ot.yaxis=ot.mockCartesianAxis(et,K,{_id:"y",domain:mt});var _r=ot.pathSubplot();ot.clipPaths.forTraces.select("path").attr("d",_r).attr("transform",e(Ce,We)),X.frontplot.attr("transform",e(vt,Ut)).call(i.setClipUrl,ot._hasClipOnAxisFalse?null:ot.clipIds.forTraces,ot.gd),X.bg.attr("d",_r).attr("transform",e(ue,Me)).call(r.fill,K.bgcolor)},j.mockAxis=function(et,K,ot,X){var Q=A.extendFlat({},ot,X);return s(Q,K,et),Q},j.mockCartesianAxis=function(et,K,ot){var X=this,Q=X.isSmith,ut=ot._id,J=A.extendFlat({type:"linear"},ot);a(J,et);var q={x:[0,2],y:[1,3]};return J.setRange=function(){var it=X.sectorBBox,nt=q[ut],dt=X.radialAxis._rl,Tt=(dt[1]-dt[0])/(1-X.getHole(K));J.range=[it[nt[0]]*Tt,it[nt[1]]*Tt]},J.isPtWithinRange=ut==="x"&&!Q?function(it){return X.isPtInside(it)}:function(){return!0},J.setRange(),J.setScale(),J},j.doAutoRange=function(et,K){var ot=this,X=ot.gd,Q=ot.radialAxis,ut=ot.getRadial(K);f(X,Q);var J=Q.range;if(ut.range=J.slice(),ut._input.range=J.slice(),Q._rl=[Q.r2l(J[0],null,"gregorian"),Q.r2l(J[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 it=Q.r2l(Q.maxallowed);Q._rl[0]<Q._rl[1]?Q._rl[1]=Math.min(Q._rl[1],it):Q._rl[0]=Math.min(Q._rl[0],it)}},j.updateRadialAxis=function(et,K){var ot=this,X=ot.gd,Q=ot.layers,ut=ot.radius,J=ot.innerRadius,q=ot.cx,it=ot.cy,nt=ot.getRadial(K),dt=R(ot.getSector(K)[0],360),Tt=ot.radialAxis,wt=J<ut,It=ot.isSmith;It||(ot.fillViewInitialKey("radialaxis.angle",nt.angle),ot.fillViewInitialKey("radialaxis.range",Tt.range.slice()),Tt.setGeometry()),Tt.tickangle==="auto"&&dt>90&&dt<=270&&(Tt.tickangle=180);var Ct=It?function(re){var Zt=D(ot,_([re.x,0]));return e(Zt[0]-q,Zt[1]-it)}:function(re){return e(Tt.l2p(re.x)+J,0)},Nt=It?function(re){return L(ot,re.x,-1/0,1/0)}:function(re){return ot.pathArc(Tt.r2p(re.x)+J)},ee=G(nt);if(ot.radialTickLayout!==ee&&(Q["radial-axis"].selectAll(".xtick").remove(),ot.radialTickLayout=ee),wt){Tt.setScale();var Jt=0,te=It?(Tt.tickvals||[]).filter(function(re){return re>=0}).map(function(re){return o.tickText(Tt,re,!0,!1)}):o.calcTicks(Tt),Kt=It?te:o.clipEnds(Tt,te),mt=o.getTickSigns(Tt)[2];It&&((Tt.ticks==="top"&&Tt.side==="bottom"||Tt.ticks==="bottom"&&Tt.side==="top")&&(mt=-mt),Tt.ticks==="top"&&Tt.side==="top"&&(Jt=-Tt.ticklen),Tt.ticks==="bottom"&&Tt.side==="bottom"&&(Jt=Tt.ticklen)),o.drawTicks(X,Tt,{vals:te,layer:Q["radial-axis"],path:o.makeTickPath(Tt,0,mt),transFn:Ct,crisp:!1}),o.drawGrid(X,Tt,{vals:Kt,layer:Q["radial-grid"],path:Nt,transFn:A.noop,crisp:!1}),o.drawLabels(X,Tt,{vals:te,layer:Q["radial-axis"],transFn:Ct,labelFns:o.makeLabelFns(Tt,Jt)})}var bt=ot.radialAxisAngle=ot.vangles?F(ct(I(nt.angle),ot.vangles)):nt.angle,vt=e(q,it),Ut=vt+t(-bt);st(Q["radial-axis"],wt&&(nt.showticklabels||nt.ticks),{transform:Ut}),st(Q["radial-grid"],wt&&nt.showgrid,{transform:It?"":vt}),st(Q["radial-line"].select("line"),wt&&nt.showline,{x1:It?-ut:J,y1:0,x2:ut,y2:0,transform:Ut}).attr("stroke-width",nt.linewidth).call(r.stroke,nt.linecolor)},j.updateRadialAxisTitle=function(et,K,ot){if(!this.isSmith){var X=this,Q=X.gd,ut=X.radius,J=X.cx,q=X.cy,it=X.getRadial(K),nt=X.id+"title",dt=0;if(it.title){var Tt=i.bBox(X.layers["radial-axis"].node()).height,wt=it.title.font.size,It=it.side;dt=It==="top"?wt:It==="counterclockwise"?-(Tt+wt*.4):Tt+wt*.8}var Ct=ot!==void 0?ot:X.radialAxisAngle,Nt=I(Ct),ee=Math.cos(Nt),Jt=Math.sin(Nt),te=J+ut/2*ee+dt*Jt,Kt=q-ut/2*Jt+dt*ee;X.layers["radial-axis-title"]=w.draw(Q,nt,{propContainer:it,propName:X.id+".radialaxis.title.text",placeholder:B(Q,"Click to enter radial axis title"),attributes:{x:te,y:Kt,"text-anchor":"middle"},transform:{rotate:-Ct}})}},j.updateAngularAxis=function(et,K){var ot=this,X=ot.gd,Q=ot.layers,ut=ot.radius,J=ot.innerRadius,q=ot.cx,it=ot.cy,nt=ot.getAngular(K),dt=ot.angularAxis,Tt=ot.isSmith;Tt||(ot.fillViewInitialKey("angularaxis.rotation",nt.rotation),dt.setGeometry(),dt.setScale());var wt=Tt?function(Zt){var ue=D(ot,_([0,Zt.x]));return Math.atan2(ue[0]-q,ue[1]-it)-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 It=function(Zt){return e(q+ut*Math.cos(Zt),it-ut*Math.sin(Zt))},Ct=Tt?function(Zt){var ue=D(ot,_([0,Zt.x]));return e(ue[0],ue[1])}:function(Zt){return It(wt(Zt))},Nt=Tt?function(Zt){var ue=D(ot,_([0,Zt.x])),Me=Math.atan2(ue[0]-q,ue[1]-it)-Math.PI/2;return e(ue[0],ue[1])+t(-F(Me))}:function(Zt){var ue=wt(Zt);return It(ue)+t(-F(ue))},ee=Tt?function(Zt){return P(ot,Zt.x,0,1/0)}:function(Zt){var ue=wt(Zt),Me=Math.cos(ue),Ce=Math.sin(ue);return"M"+[q+J*Me,it-J*Ce]+"L"+[q+ut*Me,it-ut*Ce]},Jt=o.makeLabelFns(dt,0),te=Jt.labelStandoff,Kt={};Kt.xFn=function(Zt){var ue=wt(Zt);return Math.cos(ue)*te},Kt.yFn=function(Zt){var ue=wt(Zt),Me=Math.sin(ue)>0?.2:1;return-Math.sin(ue)*(te+Zt.fontSize*Me)+Math.abs(Math.cos(ue))*(Zt.fontSize*T)},Kt.anchorFn=function(Zt){var ue=wt(Zt),Me=Math.cos(ue);return Math.abs(Me)<.1?"middle":Me>0?"start":"end"},Kt.heightFn=function(Zt,ue,Me){var Ce=wt(Zt);return-.5*(1+Math.sin(Ce))*Me};var mt=G(nt);ot.angularTickLayout!==mt&&(Q["angular-axis"].selectAll("."+dt._id+"tick").remove(),ot.angularTickLayout=mt);var bt=Tt?[1/0].concat(dt.tickvals||[]).map(function(Zt){return o.tickText(dt,Zt,!0,!1)}):o.calcTicks(dt);Tt&&(bt[0].text="∞",bt[0].fontSize*=1.75);var vt;if(K.gridshape==="linear"?(vt=bt.map(wt),A.angleDelta(vt[0],vt[1])<0&&(vt=vt.slice().reverse())):vt=null,ot.vangles=vt,dt.type==="category"&&(bt=bt.filter(function(Zt){return A.isAngleInsideSector(wt(Zt),ot.sectorInRad)})),dt.visible){var Ut=dt.ticks==="inside"?-1:1,re=(dt.linewidth||1)/2;o.drawTicks(X,dt,{vals:bt,layer:Q["angular-axis"],path:"M"+Ut*re+",0h"+Ut*dt.ticklen,transFn:Nt,crisp:!1}),o.drawGrid(X,dt,{vals:bt,layer:Q["angular-grid"],path:ee,transFn:A.noop,crisp:!1}),o.drawLabels(X,dt,{vals:bt,layer:Q["angular-axis"],repositionOnUpdate:!0,transFn:Ct,labelFns:Kt})}st(Q["angular-line"].select("path"),nt.showline,{d:ot.pathSubplot(),transform:e(q,it)}).attr("stroke-width",nt.linewidth).call(r.stroke,nt.linecolor)},j.updateFx=function(et,K){if(!this.gd._context.staticPlot){var ot=!this.isSmith;ot&&(this.updateAngularDrag(et),this.updateRadialDrag(et,K,0),this.updateRadialDrag(et,K,1)),this.updateHoverAndMainDrag(et)}},j.updateHoverAndMainDrag=function(et){var K=this,ot=K.isSmith,X=K.gd,Q=K.layers,ut=et._zoomlayer,J=c.MINZOOM,q=c.OFFEDGE,it=K.radius,nt=K.innerRadius,dt=K.cx,Tt=K.cy,wt=K.cxx,It=K.cyy,Ct=K.sectorInRad,Nt=K.vangles,ee=K.radialAxis,Jt=h.clampTiny,te=h.findXYatLength,Kt=h.findEnclosingVertexAngles,mt=c.cornerHalfWidth,bt=c.cornerLen/2,vt,Ut,re=v.makeDragger(Q,"path","maindrag",et.dragmode===!1?"none":"crosshair");u.select(re).attr("d",K.pathSubplot()).attr("transform",e(dt,Tt)),re.onmousemove=function(ar){m.hover(X,ar,K.id),X._fullLayout._lasthover=re,X._fullLayout._hoversubplot=K.id},re.onmouseout=function(ar){X._dragging||g.unhover(X,ar)};var Zt={element:re,gd:X,subplot:K.id,plotinfo:{id:K.id,xaxis:K.xaxis,yaxis:K.yaxis},xaxes:[K.xaxis],yaxes:[K.yaxis]},ue,Me,Ce,We,qe,vr,_r,er,Mr;function Ir(ar,Ye){return Math.sqrt(ar*ar+Ye*Ye)}function de(ar,Ye){return Ir(ar-wt,Ye-It)}function Dt(ar,Ye){return Math.atan2(It-Ye,ar-wt)}function qt(ar,Ye){return[ar*Math.cos(Ye),ar*Math.sin(-Ye)]}function _t(ar,Ye){if(ar===0)return K.pathSector(2*mt);var Er=bt/ar,pn=Ye-Er,dn=Ye+Er,bn=Math.max(0,Math.min(ar,it)),Zn=bn-mt,En=bn+mt;return"M"+qt(Zn,pn)+"A"+[Zn,Zn]+" 0,0,0 "+qt(Zn,dn)+"L"+qt(En,dn)+"A"+[En,En]+" 0,0,1 "+qt(En,pn)+"Z"}function lt(ar,Ye,Er){if(ar===0)return K.pathSector(2*mt);var pn=qt(ar,Ye),dn=qt(ar,Er),bn=Jt((pn[0]+dn[0])/2),Zn=Jt((pn[1]+dn[1])/2),En,gn;if(bn&&Zn){var da=Zn/bn,ra=-1/da,Se=te(mt,da,bn,Zn);En=te(bt,ra,Se[0][0],Se[0][1]),gn=te(bt,ra,Se[1][0],Se[1][1])}else{var Re,Ze;Zn?(Re=bt,Ze=mt):(Re=mt,Ze=bt),En=[[bn-Re,Zn-Ze],[bn+Re,Zn-Ze]],gn=[[bn-Re,Zn+Ze],[bn+Re,Zn+Ze]]}return"M"+En.join("L")+"L"+gn.reverse().join("L")+"Z"}function yt(){Ce=null,We=null,qe=K.pathSubplot(),vr=!1;var ar=X._fullLayout[K.id];_r=d(ar.bgcolor).getLuminance(),er=v.makeZoombox(ut,_r,dt,Tt,qe),er.attr("fill-rule","evenodd"),Mr=v.makeCorners(ut,dt,Tt),y(X)}function St(ar,Ye){return Ye=Math.max(Math.min(Ye,it),nt),ar<q?ar=0:it-ar<q?ar=it:Ye<q?Ye=0:it-Ye<q&&(Ye=it),Math.abs(Ye-ar)>J?(ar<Ye?(Ce=ar,We=Ye):(Ce=Ye,We=ar),!0):(Ce=null,We=null,!1)}function Ht(ar,Ye){ar=ar||qe,Ye=Ye||"M0,0Z",er.attr("d",ar),Mr.attr("d",Ye),v.transitionZoombox(er,Mr,vr,_r),vr=!0;var Er={};Ue(Er),X.emit("plotly_relayouting",Er)}function Yt(ar,Ye){ar=ar*vt,Ye=Ye*Ut;var Er=ue+ar,pn=Me+Ye,dn=de(ue,Me),bn=Math.min(de(Er,pn),it),Zn=Dt(ue,Me),En,gn;St(dn,bn)&&(En=qe+K.pathSector(We),Ce&&(En+=K.pathSector(Ce)),gn=_t(Ce,Zn)+_t(We,Zn)),Ht(En,gn)}function se(ar,Ye,Er,pn){var dn=h.findIntersectionXY(Er,pn,Er,[ar-wt,It-Ye]);return Ir(dn[0],dn[1])}function ke(ar,Ye){var Er=ue+ar,pn=Me+Ye,dn=Dt(ue,Me),bn=Dt(Er,pn),Zn=Kt(dn,Nt),En=Kt(bn,Nt),gn=se(ue,Me,Zn[0],Zn[1]),da=Math.min(se(Er,pn,En[0],En[1]),it),ra,Se;St(gn,da)&&(ra=qe+K.pathSector(We),Ce&&(ra+=K.pathSector(Ce)),Se=[lt(Ce,Zn[0],Zn[1]),lt(We,Zn[0],Zn[1])].join(" ")),Ht(ra,Se)}function Ee(){if(v.removeZoombox(X),!(Ce===null||We===null)){var ar={};Ue(ar),v.showDoubleClickNotifier(X),E.call("_guiRelayout",X,ar)}}function Ue(ar){var Ye=ee._rl,Er=(Ye[1]-Ye[0])/(1-nt/it)/it,pn=[Ye[0]+(Ce-nt)*Er,Ye[0]+(We-nt)*Er];ar[K.id+".radialaxis.range"]=pn}function ir(ar,Ye){var Er=X._fullLayout.clickmode;if(v.removeZoombox(X),ar===2){var pn={};for(var dn in K.viewInitial)pn[K.id+"."+dn]=K.viewInitial[dn];X.emit("plotly_doubleclick",null),E.call("_guiRelayout",X,pn)}Er.indexOf("select")>-1&&ar===1&&x(Ye,X,[K.xaxis],[K.yaxis],K.id,Zt),Er.indexOf("event")>-1&&m.click(X,Ye,K.id)}Zt.prepFn=function(ar,Ye,Er){var pn=X._fullLayout.dragmode,dn=re.getBoundingClientRect();X._fullLayout._calcInverseTransform(X);var bn=X._fullLayout._invTransform;vt=X._fullLayout._invScaleX,Ut=X._fullLayout._invScaleY;var Zn=A.apply3DTransform(bn)(Ye-dn.left,Er-dn.top);if(ue=Zn[0],Me=Zn[1],Nt){var En=h.findPolygonOffset(it,Ct[0],Ct[1],Nt);ue+=wt+En[0],Me+=It+En[1]}switch(pn){case"zoom":Zt.clickFn=ir,ot||(Nt?Zt.moveFn=ke:Zt.moveFn=Yt,Zt.doneFn=Ee,yt());break;case"select":case"lasso":l(ar,Ye,Er,Zt,pn);break}},g.init(Zt)},j.updateRadialDrag=function(et,K,ot){var X=this,Q=X.gd,ut=X.layers,J=X.radius,q=X.innerRadius,it=X.cx,nt=X.cy,dt=X.radialAxis,Tt=c.radialDragBoxSize,wt=Tt/2;if(!dt.visible)return;var It=I(X.radialAxisAngle),Ct=dt._rl,Nt=Ct[0],ee=Ct[1],Jt=Ct[ot],te=.75*(Ct[1]-Ct[0])/(1-X.getHole(K))/J,Kt,mt,bt;ot?(Kt=it+(J+wt)*Math.cos(It),mt=nt-(J+wt)*Math.sin(It),bt="radialdrag"):(Kt=it+(q-wt)*Math.cos(It),mt=nt-(q-wt)*Math.sin(It),bt="radialdrag-inner");var vt=v.makeRectDragger(ut,bt,"crosshair",-wt,-wt,Tt,Tt),Ut={element:vt,gd:Q};et.dragmode===!1&&(Ut.dragmode=!1),st(u.select(vt),dt.visible&&q<J,{transform:e(Kt,mt)});var re,Zt,ue;function Me(_r,er){if(re)re(_r,er);else{var Mr=[_r,-er],Ir=[Math.cos(It),Math.sin(It)],de=Math.abs(A.dot(Mr,Ir)/Math.sqrt(A.dot(Mr,Mr)));isNaN(de)||(re=de<.5?qe:vr)}var Dt={};Ce(Dt),Q.emit("plotly_relayouting",Dt)}function Ce(_r){Zt!==null?_r[X.id+".radialaxis.angle"]=Zt:ue!==null&&(_r[X.id+".radialaxis.range["+ot+"]"]=ue)}function We(){Zt!==null?E.call("_guiRelayout",Q,X.id+".radialaxis.angle",Zt):ue!==null&&E.call("_guiRelayout",Q,X.id+".radialaxis.range["+ot+"]",ue)}function qe(_r,er){if(ot!==0){var Mr=Kt+_r,Ir=mt+er;Zt=Math.atan2(nt-Ir,Mr-it),X.vangles&&(Zt=ct(Zt,X.vangles)),Zt=F(Zt);var de=e(it,nt)+t(-Zt);ut["radial-axis"].attr("transform",de),ut["radial-line"].select("line").attr("transform",de);var Dt=X.gd._fullLayout,qt=Dt[X.id];X.updateRadialAxisTitle(Dt,qt,Zt)}}function vr(_r,er){var Mr=A.dot([_r,-er],[Math.cos(It),Math.sin(It)]);if(ue=Jt-te*Mr,te>0!=(ot?ue>Nt:ue<ee)){ue=null;return}var Ir=Q._fullLayout,de=Ir[X.id];dt.range[ot]=ue,dt._rl[ot]=ue,X.updateRadialAxis(Ir,de),X.xaxis.setRange(),X.xaxis.setScale(),X.yaxis.setRange(),X.yaxis.setScale();var Dt=!1;for(var qt in X.traceHash){var _t=X.traceHash[qt],lt=A.filterVisible(_t),yt=_t[0][0].trace._module;yt.plot(Q,X,lt,de),E.traceIs(qt,"gl")&&lt.length&&(Dt=!0)}Dt&&(k(Q),M(Q))}Ut.prepFn=function(){re=null,Zt=null,ue=null,Ut.moveFn=Me,Ut.doneFn=We,y(Q)},Ut.clampFn=function(_r,er){return Math.sqrt(_r*_r+er*er)<c.MINDRAG&&(_r=0,er=0),[_r,er]},g.init(Ut)},j.updateAngularDrag=function(et){var K=this,ot=K.gd,X=K.layers,Q=K.radius,ut=K.angularAxis,J=K.cx,q=K.cy,it=K.cxx,nt=K.cyy,dt=c.angularDragBoxSize,Tt=v.makeDragger(X,"path","angulardrag",et.dragmode===!1?"none":"move"),wt={element:Tt,gd:ot};et.dragmode===!1?wt.dragmode=!1:u.select(Tt).attr("d",K.pathAnnulus(Q,Q+dt)).attr("transform",e(J,q)).call(S,"move");function It(ue,Me){return Math.atan2(nt+dt-Me,ue-it-dt)}var Ct=X.frontplot.select(".scatterlayer").selectAll(".trace"),Nt=Ct.selectAll(".point"),ee=Ct.selectAll(".textpoint"),Jt,te,Kt,mt,bt,vt;function Ut(ue,Me){var Ce=K.gd._fullLayout,We=Ce[K.id],qe=Jt+ue*et._invScaleX,vr=te+Me*et._invScaleY,_r=It(qe,vr),er=F(_r-vt);if(mt=Kt+er,X.frontplot.attr("transform",e(K.xOffset2,K.yOffset2)+t([-er,it,nt])),K.vangles){bt=K.radialAxisAngle+er;var Mr=e(J,q)+t(-er),Ir=e(J,q)+t(-bt);X.bg.attr("transform",Mr),X["radial-grid"].attr("transform",Mr),X["radial-axis"].attr("transform",Ir),X["radial-line"].select("line").attr("transform",Ir),K.updateRadialAxisTitle(Ce,We,bt)}else K.clipPaths.forTraces.select("path").attr("transform",e(it,nt)+t(er));Nt.each(function(){var St=u.select(this),Ht=i.getTranslate(St);St.attr("transform",e(Ht.x,Ht.y)+t([er]))}),ee.each(function(){var St=u.select(this),Ht=St.select("text"),Yt=i.getTranslate(St);St.attr("transform",t([er,Ht.attr("x"),Ht.attr("y")])+e(Yt.x,Yt.y))}),ut.rotation=A.modHalf(mt,360),K.updateAngularAxis(Ce,We),K._hasClipOnAxisFalse&&!A.isFullCircle(K.sectorInRad)&&Ct.call(i.hideOutsideRangePoints,K);var de=!1;for(var Dt in K.traceHash)if(E.traceIs(Dt,"gl")){var qt=K.traceHash[Dt],_t=A.filterVisible(qt),lt=qt[0][0].trace._module;lt.plot(ot,K,_t,We),_t.length&&(de=!0)}de&&(k(ot),M(ot));var yt={};re(yt),ot.emit("plotly_relayouting",yt)}function re(ue){ue[K.id+".angularaxis.rotation"]=mt,K.vangles&&(ue[K.id+".radialaxis.angle"]=bt)}function Zt(){ee.select("text").attr("transform",null);var ue={};re(ue),E.call("_guiRelayout",ot,ue)}wt.prepFn=function(ue,Me,Ce){var We=et[K.id];Kt=We.angularaxis.rotation;var qe=Tt.getBoundingClientRect();Jt=Me-qe.left,te=Ce-qe.top,ot._fullLayout._calcInverseTransform(ot);var vr=A.apply3DTransform(et._invTransform)(Jt,te);Jt=vr[0],te=vr[1],vt=It(Jt,te),wt.moveFn=Ut,wt.doneFn=Zt,y(ot)},K.vangles&&!A.isFullCircle(K.sectorInRad)&&(wt.prepFn=A.noop,S(u.select(Tt),null)),g.init(wt)},j.isPtInside=function(et){if(this.isSmith)return!0;var K=this.sectorInRad,ot=this.vangles,X=this.angularAxis.c2g(et.theta),Q=this.radialAxis,ut=Q.c2l(et.r),J=Q._rl,q=ot?h.isPtInsidePolygon:A.isPtInsideSector;return q(ut,X,J,K,ot)},j.pathArc=function(et){var K=this.sectorInRad,ot=this.vangles,X=ot?h.pathPolygon:A.pathArc;return X(et,K[0],K[1],ot)},j.pathSector=function(et){var K=this.sectorInRad,ot=this.vangles,X=ot?h.pathPolygon:A.pathSector;return X(et,K[0],K[1],ot)},j.pathAnnulus=function(et,K){var ot=this.sectorInRad,X=this.vangles,Q=X?h.pathPolygonAnnulus:A.pathAnnulus;return Q(et,K,ot[0],ot[1],X)},j.pathSubplot=function(){var et=this.innerRadius,K=this.radius;return et?this.pathAnnulus(et,K):this.pathSector(K)},j.fillViewInitialKey=function(et,K){et in this.viewInitial||(this.viewInitial[et]=K)};function G(et){var K=et.ticks+String(et.ticklen)+String(et.showticklabels);return"side"in et&&(K+=et.side),K}function rt(et){var K=et[0],ot=et[1],X=ot-K,Q=R(K,360),ut=Q+X,J=Math.cos(I(Q)),q=Math.sin(I(Q)),it=Math.cos(I(ut)),nt=Math.sin(I(ut)),dt,Tt,wt,It;return Q<=90&&ut>=90||Q>90&&ut>=450?It=1:q<=0&&nt<=0?It=0:It=Math.max(q,nt),Q<=180&&ut>=180||Q>180&&ut>=540?dt=-1:J>=0&&it>=0?dt=0:dt=Math.min(J,it),Q<=270&&ut>=270||Q>270&&ut>=630?Tt=-1:q>=0&&nt>=0?Tt=0:Tt=Math.min(q,nt),ut>=360?wt=1:J<=0&&it<=0?wt=0:wt=Math.max(J,it),[dt,Tt,wt,It]}function ct(et,K){var ot=function(Q){return A.angleDist(et,Q)},X=A.findIndexOfMin(K,ot);return K[X]}function st(et,K,ot){return K?(et.attr("display",null),et.attr(ot)):et&&et.attr("display","none"),et}}),a4=Vt((Z,V)=>{var u=nf(),d=Pf(),E=Vu().attributes,A=Xr().extendFlat,t=Cu().overrideAll,e=t({color:d.color,showline:A({},d.showline,{dflt:!0}),linecolor:d.linecolor,linewidth:d.linewidth,showgrid:A({},d.showgrid,{dflt:!0}),gridcolor:d.gridcolor,gridwidth:d.gridwidth,griddash:d.griddash},"plot","from-root"),r=t({tickmode:d.minor.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:d.ticks,ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,ticklabelstep:d.ticklabelstep,showticklabels:d.showticklabels,labelalias:d.labelalias,minorloglabels:d.minorloglabels,showtickprefix:d.showtickprefix,tickprefix:d.tickprefix,showticksuffix:d.showticksuffix,ticksuffix:d.ticksuffix,showexponent:d.showexponent,exponentformat:d.exponentformat,minexponent:d.minexponent,separatethousands:d.separatethousands,tickfont:d.tickfont,tickangle:d.tickangle,tickformat:d.tickformat,tickformatstops:d.tickformatstops,layer:d.layer},"plot","from-root"),i={visible:A({},d.visible,{dflt:!0}),type:A({},d.type,{values:["-","linear","log","date","category"]}),autotypenumbers:d.autotypenumbers,autorangeoptions:{minallowed:d.autorangeoptions.minallowed,maxallowed:d.autorangeoptions.maxallowed,clipmin:d.autorangeoptions.clipmin,clipmax:d.autorangeoptions.clipmax,include:d.autorangeoptions.include,editType:"plot"},autorange:A({},d.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:A({},d.minallowed,{editType:"plot"}),maxallowed:A({},d.maxallowed,{editType:"plot"}),range:A({},d.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:d.categoryorder,categoryarray:d.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:d.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:A({},d.title.text,{editType:"plot",dflt:""}),font:A({},d.title.font,{editType:"plot"}),editType:"plot"},hoverformat:d.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};A(i,e,r);var n={visible:A({},d.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:d.autotypenumbers,categoryorder:d.categoryorder,categoryarray:d.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:d.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:u.background},radialaxis:i,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),sC=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=cl(),A=zd(),t=If().getSubplotData,e=i0(),r=vm(),i=Td(),n=kd(),o=Jy(),a=Ug(),s=ub(),f=xm(),v=a4(),g=e4(),m=t_(),w=m.axisNames;function l(y,S,k,M){var T=k("bgcolor");M.bgColor=d.combine(T,M.paper_bgcolor);var c=k("sector");k("hole");var h=t(M.fullData,m.name,M.id),b=M.layoutOut,_;function P(Tt,wt){return k(_+"."+Tt,wt)}for(var L=0;L<w.length;L++){_=w[L],u.isPlainObject(y[_])||(y[_]={});var D=y[_],B=E.newContainer(S,_);B._id=B._name=_,B._attr=M.id+"."+_,B._traceIndices=h.map(function(Tt){return Tt.index});var R=m.axisName2dataArray[_],I=x(D,B,P,h,R,M);o(D,B,P,{axData:h,dataAttr:R});var F=P("visible");switch(g(B,S,b),P("uirevision",S.uirevision),B._m=1,_){case"radialaxis":P("minallowed"),P("maxallowed");var N=P("range"),j=B.getAutorangeDflt(N),G=P("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=P("autorange",j)),D.autorange=G,G&&(s(P,G,N),(I==="linear"||I==="-")&&P("rangemode"),B.isReversed()&&(B._m=-1)),B.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(I==="date"){u.log("Polar plots do not support date angular axes yet.");for(var ct=0;ct<h.length;ct++)h[ct].visible=!1;I=D.type=B.type="linear"}P(I==="linear"?"thetaunit":"period");var st=P("direction");P("rotation",{counterclockwise:0,clockwise:90}[st]);break}if(n(D,B,P,B.type,{tickSuffixDflt:B.thetaunit==="degrees"?"°":void 0}),F){var et,K,ot,X,Q,ut,J,q,it,nt,dt=M.font||{};et=P("color"),K=et===D.color?et:dt.color,ot=dt.size,X=dt.family,Q=dt.weight,ut=dt.style,J=dt.variant,q=dt.textcase,it=dt.lineposition,nt=dt.shadow,e(D,B,P,B.type),i(D,B,P,B.type,{font:{weight:Q,style:ut,variant:J,textcase:q,lineposition:it,shadow:nt,color:K,size:ot,family:X},noAutotickangles:_==="angularaxis",noTicklabelshift:!0,noTicklabelstandoff:!0}),r(D,B,P,{outerTicks:!0}),a(D,B,P,{dfltColor:et,bgColor:M.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:v[_]}),P("layer"),_==="radialaxis"&&(P("side"),P("angle",c[0]),P("title.text"),u.coerceFont(P,"title.font",{weight:Q,style:ut,variant:J,textcase:q,lineposition:it,shadow:nt,color:K,size:u.bigFont(ot),family:X}))}I!=="category"&&P("hoverformat"),B._input=D}S.angularaxis.type==="category"&&k("gridshape")}function x(y,S,k,M,T,c){var h=k("autotypenumbers",c.autotypenumbersDflt),b=k("type");if(b==="-"){for(var _,P=0;P<M.length;P++)if(M[P].visible){_=M[P];break}_&&_[T]&&(S.type=f(_[T],"gregorian",{noMultiCategory:!0,autotypenumbers:h})),S.type==="-"?S.type="linear":y.type=S.type}return S.type}V.exports=function(y,S,k){A(y,S,k,{type:m.name,attributes:v,handleDefaults:l,font:S.font,autotypenumbersDflt:S.autotypenumbers,paper_bgcolor:S.paper_bgcolor,fullData:k,layoutOut:S})}}),r_=Vt((Z,V)=>{var u=If().getSubplotCalcData,d=Xr().counterRegex,E=n4(),A=t_(),t=A.attr,e=A.name,r=d(e),i={};i[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(a){for(var s=a._fullLayout,f=a.calcdata,v=s._subplots[e],g=0;g<v.length;g++){var m=v[g],w=u(f,e,m),l=s[m]._subplot;l||(l=E(a,m),s[m]._subplot=l),l.plot(w,s,a._promises)}}function o(a,s,f,v){for(var g=v._subplots[e]||[],m=v._has&&v._has("gl"),w=s._has&&s._has("gl"),l=m&&!w,x=0;x<g.length;x++){var y=g[x],S=v[y]._subplot;if(!s[y]&&S){S.framework.remove(),S.layers["radial-axis-title"].remove();for(var k in S.clipPaths)S.clipPaths[k].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:a4(),supplyLayoutDefaults:sC(),plot:n,clean:o,toSVG:Kc().toSVG}}),Dv=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=So().extendFlat,t=Qh(),e=pc(),r=Tl(),i=e.line;V.exports={mode:e.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:e.text,texttemplate:d({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:A({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:A({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:A({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),hoverinfo:A({},r.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:e.hoveron,hovertemplate:u(),hovertemplatefallback:E(),selected:e.selected,unselected:e.unselected}}),n_=Vt((Z,V)=>{var u=Xr(),d=nu(),E=zh(),A=Bh(),t=wm(),e=Rh(),r=ep(),i=gp().PTS_LINESONLY,n=Dv();function o(s,f,v,g){function m(x,y){return u.coerce(s,f,n,x,y)}var w=a(s,f,g,m);if(!w){f.visible=!1;return}m("thetaunit"),m("mode",w<i?"lines+markers":"lines"),m("text"),m("hovertext"),f.hoveron!=="fills"&&(m("hovertemplate"),m("hovertemplatefallback")),d.hasMarkers(f)&&E(s,f,v,g,m,{gradient:!0}),d.hasLines(f)&&(A(s,f,v,g,m,{backoff:!0}),t(s,f,m),m("connectgaps")),d.hasText(f)&&(m("texttemplate"),m("texttemplatefallback"),e(s,f,g,m));var l=[];(d.hasMarkers(f)||d.hasText(f))&&(m("cliponaxis"),m("marker.maxdisplayed"),l.push("points")),m("fill"),f.fill!=="none"&&(r(s,f,v,m),d.hasLines(f)||t(s,f,m)),(f.fill==="tonext"||f.fill==="toself")&&l.push("fills"),m("hoveron",l.join("+")||"points"),u.coerceSelectionMarkerOpacity(f,m)}function a(s,f,v,g){var m=g("r"),w=g("theta");u.isTypedArray(m)&&(f.r=m=Array.from(m)),u.isTypedArray(w)&&(f.theta=w=Array.from(w));var l;if(m)w?l=Math.min(m.length,w.length):(l=m.length,g("theta0"),g("dtheta"));else{if(!w)return 0;l=f.theta.length,g("r0"),g("dr")}return f._length=l,l}V.exports={handleRThetaDefaults:a,supplyDefaults:o}}),a_=Vt((Z,V)=>{var u=Xr(),d=yo();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=d.tickText(i,o,!0).text;var a=n.thetaunit==="degrees"?u.rad2deg(E.theta):E.theta;return e.thetaLabel=d.tickText(n,a,!0).text,e}}),lC=Vt((Z,V)=>{var u=Lo(),d=ks().BADNUM,E=yo(),A=Nh(),t=vp(),e=jh(),r=Uh().calcMarkerSize;V.exports=function(i,n){for(var o=i._fullLayout,a=n.subplot,s=o[a].radialaxis,f=o[a].angularaxis,v=s.makeCalcdata(n,"r"),g=f.makeCalcdata(n,"theta"),m=n._length,w=new Array(m),l=0;l<m;l++){var x=v[l],y=g[l],S=w[l]={};u(x)&&u(y)?(S.r=x,S.theta=y):S.r=d}var k=r(n,m);return n._extremes.x=E.findExtremes(s,v,{ppad:k}),A(i,n),t(w,n),e(w,n),w}}),uC=Vt((Z,V)=>{var u=Tm(),d=ks().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 f=t[s],v=0;v<f.length;v++){v===0&&(f[0].trace._xA=r,f[0].trace._yA=i);var g=f[v],m=g.r;if(m===d)g.x=g.y=d;else{var w=o.c2g(m),l=a.c2g(g.theta);g.x=w*Math.cos(l),g.y=w*Math.sin(l)}}u(E,n,t,e)}}),i_=Vt((Z,V)=>{var u=Am();function d(A,t,e,r){var i=u(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,f=[];function v(m,w){f.push(m._hovertitle+": "+w)}if(!t.hovertemplate){var g=s.split("+");g.indexOf("all")!==-1&&(g=["r","theta","text"]),g.indexOf("r")!==-1&&v(i,r.rLabel),g.indexOf("theta")!==-1&&v(n,r.thetaLabel),g.indexOf("text")!==-1&&r.text&&(f.push(r.text),delete r.text),r.extraText=f.join("<br>")}}V.exports={hoverPoints:d,makeHoverPointText:E}}),cC=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:r_(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Dv(),supplyDefaults:n_().supplyDefaults,colorbar:Gf(),formatLabels:a_(),calc:lC(),plot:uC(),style:mh().style,styleOnSelect:mh().styleOnSelect,hoverPoints:i_().hoverPoints,selectPoints:Mm(),meta:{}}}),fC=Vt((Z,V)=>{V.exports=cC()}),i4=Vt((Z,V)=>{var u=Dv(),{cliponaxis:d,hoveron:E}=u,A=U4(u,["cliponaxis","hoveron"]),{connectgaps:t,line:{color:e,dash:r,width:i},fill:n,fillcolor:o,marker:a,textfont:s,textposition:f}=Mv();V.exports=um(gd({},A),{connectgaps:t,fill:n,fillcolor:o,line:{color:e,dash:r,editType:"calc",width:i},marker:a,textfont:s,textposition:f})}),hC=Vt((Z,V)=>{var u=Xr(),d=nu(),E=n_().handleRThetaDefaults,A=zh(),t=Bh(),e=Rh(),r=ep(),i=gp().PTS_LINESONLY,n=i4();V.exports=function(o,a,s,f){function v(m,w){return u.coerce(o,a,n,m,w)}var g=E(o,a,f,v);if(!g){a.visible=!1;return}v("thetaunit"),v("mode",g<i?"lines+markers":"lines"),v("text"),v("hovertext"),a.hoveron!=="fills"&&(v("hovertemplate"),v("hovertemplatefallback")),d.hasMarkers(a)&&A(o,a,s,f,v,{noAngleRef:!0,noStandOff:!0}),d.hasLines(a)&&(t(o,a,s,f,v),v("connectgaps")),d.hasText(a)&&(v("texttemplate"),v("texttemplatefallback"),e(o,a,f,v,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),v("fill"),a.fill!=="none"&&r(o,a,s,v),u.coerceSelectionMarkerOpacity(a,v)}}),pC=Vt((Z,V)=>{var u=a_();V.exports=function(d,E,A){var t=d.i;return"r"in d||(d.r=E._r[t]),"theta"in d||(d.theta=E._theta[t]),u(d,E,A)}}),dC=Vt((Z,V)=>{var u=Nh(),d=Uh().calcMarkerSize,E=z0(),A=yo(),t=Ud().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"),f=r._theta=a.makeCalcdata(r,"theta"),v=r._length,g={};v<s.length&&(s=s.slice(0,v)),v<f.length&&(f=f.slice(0,v)),g.r=s,g.theta=f,u(e,r);var m=g.opts=E.style(e,r),w;return v<t?w=d(r,v):m.marker&&(w=2*(m.marker.sizeAvg||Math.max(m.marker.size,3))),r._extremes.x=A.findExtremes(o,s,{ppad:w}),[{x:!1,y:!1,t:g,trace:r}]}}),mC=Vt((Z,V)=>{var u=Px(),d=i_().makeHoverPointText;function E(A,t,e,r){var i=A.cd,n=i[0].t,o=n.r,a=n.theta,s=u.hoverPoints(A,t,e,r);if(!(!s||s[0].index===!1)){var f=s[0];if(f.index===void 0)return s;var v=A.subplot,g=f.cd[f.index],m=f.trace;if(g.r=o[f.index],g.theta=a[f.index],!!v.isPtInside(g))return f.xLabelVal=void 0,f.yLabelVal=void 0,d(g,m,v,f),s}}V.exports={hoverPoints:E}}),gC=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:r_(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:i4(),supplyDefaults:hC(),colorbar:Gf(),formatLabels:pC(),calc:dC(),hoverPoints:mC().hoverPoints,selectPoints:j3(),meta:{}}}),vC=Vt((Z,V)=>{var u=Dx(),d=Lo(),E=c5(),A=R3(),t=z0(),e=Xr(),r=Ud().TOO_MANY_POINTS,i={};V.exports=function(n,o,a){if(a.length){var s=o.radialAxis,f=o.angularAxis,v=A(n,o);return a.forEach(function(g){if(!(!g||!g[0]||!g[0].trace)){var m=g[0],w=m.trace,l=m.t,x=w._length,y=l.r,S=l.theta,k=l.opts,M,T=y.slice(),c=S.slice();for(M=0;M<y.length;M++)o.isPtInside({r:y[M],theta:S[M]})||(T[M]=NaN,c[M]=NaN);var h=new Array(x*2),b=Array(x),_=Array(x);for(M=0;M<x;M++){var P=T[M],L,D;if(d(P)){var B=s.c2g(P),R=f.c2g(c[M],w.thetaunit);L=B*Math.cos(R),D=B*Math.sin(R)}else L=D=NaN;b[M]=h[M*2]=L,_[M]=h[M*2+1]=D}l.tree=u(h),k.marker&&x>=r&&(k.marker.cluster=l.tree),k.marker&&(k.markerSel.positions=k.markerUnsel.positions=k.marker.positions=h),k.line&&h.length>1&&e.extendFlat(k.line,t.linePositions(n,w,h)),k.text&&(e.extendFlat(k.text,{positions:h},t.textPosition(n,w,k.text,k.marker)),e.extendFlat(k.textSel,{positions:h},t.textPosition(n,w,k.text,k.markerSel)),e.extendFlat(k.textUnsel,{positions:h},t.textPosition(n,w,k.text,k.markerUnsel))),k.fill&&!v.fill2d&&(v.fill2d=!0),k.marker&&!v.scatter2d&&(v.scatter2d=!0),k.line&&!v.line2d&&(v.line2d=!0),k.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(k.line),v.fillOptions.push(k.fill),v.markerOptions.push(k.marker),v.markerSelectedOptions.push(k.markerSel),v.markerUnselectedOptions.push(k.markerUnsel),v.textOptions.push(k.text),v.textSelectedOptions.push(k.textSel),v.textUnselectedOptions.push(k.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),l.x=b,l.y=_,l.rawx=b,l.rawy=_,l.r=y,l.theta=S,l.positions=h,l._scene=v,l.index=v.count,v.count++}}),E(n,o,a)}},V.exports.reglPrecompiled=i}),yC=Vt((Z,V)=>{var u=gC();u.plot=vC(),V.exports=u}),xC=Vt((Z,V)=>{V.exports=yC()}),o4=Vt((Z,V)=>{var{hovertemplateAttrs:u,templatefallbackAttrs:d}=kl(),E=So().extendFlat,A=Dv(),t=yp();V.exports={r:A.r,theta:A.theta,r0:A.r0,dr:A.dr,theta0:A.theta0,dtheta:A.dtheta,thetaunit:A.thetaunit,base:E({},t.base,{}),offset:E({},t.offset,{}),width:E({},t.width,{}),text:E({},t.text,{}),hovertext:E({},t.hovertext,{}),marker:e(),hoverinfo:A.hoverinfo,hovertemplate:u(),hovertemplatefallback:d(),selected:t.selected,unselected:t.unselected};function e(){var r=E({},t.marker);return delete r.cornerradius,r}}),s4=Vt((Z,V)=>{V.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),_C=Vt((Z,V)=>{var u=Xr(),d=n_().handleRThetaDefaults,E=s1(),A=o4();V.exports=function(t,e,r,i){function n(a,s){return u.coerce(t,e,A,a,s)}var o=d(t,e,i,n);if(!o){e.visible=!1;return}n("thetaunit"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),E(t,e,n,r,i),u.coerceSelectionMarkerOpacity(e,n)}}),bC=Vt((Z,V)=>{var u=Xr(),d=s4();V.exports=function(E,A,t){var e={},r;function i(a,s){return u.coerce(E[r]||{},A[r],d,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))}}}),l4=Vt((Z,V)=>{var u=nh().hasColorscale,d=ah(),E=Xr().isArrayOrTypedArray,A=qg(),t=c0().setGroupPositions,e=jh(),r=ji().traceIs,i=Xr().extendFlat;function n(a,s){for(var f=a._fullLayout,v=s.subplot,g=f[v].radialaxis,m=f[v].angularaxis,w=g.makeCalcdata(s,"r"),l=m.makeCalcdata(s,"theta"),x=s._length,y=new Array(x),S=w,k=l,M=0;M<x;M++)y[M]={p:k[M],s:S[M]};function T(c){var h=s[c];h!==void 0&&(s["_"+c]=E(h)?m.makeCalcdata(s,c):m.d2c(h,s.thetaunit))}return m.type==="linear"&&(T("width"),T("offset")),u(s,"marker")&&d(a,s,{vals:s.marker.color,containerStr:"marker",cLetter:"c"}),u(s,"marker.line")&&d(a,s,{vals:s.marker.line.color,containerStr:"marker.line",cLetter:"c"}),A(y,s),e(y,s),y}function o(a,s,f){for(var v=a.calcdata,g=[],m=0;m<v.length;m++){var w=v[m],l=w[0].trace;l.visible===!0&&r(l,"bar")&&l.subplot===f&&g.push(w)}var x=i({},s.radialaxis,{_id:"x"}),y=s.angularaxis;t(a,y,x,g,{mode:s.barmode,norm:s.barnorm,gap:s.bargap,groupgap:s.bargroupgap})}V.exports={calc:n,crossTraceCalc:o}}),wC=Vt((Z,V)=>{var u=Ni(),d=Lo(),E=Xr(),A=Eo(),t=e_();V.exports=function(r,i,n){var o=r._context.staticPlot,a=i.xaxis,s=i.yaxis,f=i.radialAxis,v=i.angularAxis,g=e(i),m=i.layers.frontplot.select("g.barlayer");E.makeTraceGroups(m,n,"trace bars").each(function(){var w=u.select(this),l=E.ensureSingle(w,"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(y){var S=u.select(this),k=y.rp0=f.c2p(y.s0),M=y.rp1=f.c2p(y.s1),T=y.thetag0=v.c2g(y.p0),c=y.thetag1=v.c2g(y.p1),h;if(!d(k)||!d(M)||!d(T)||!d(c)||k===M||T===c)h="M0,0Z";else{var b=f.c2g(y.s1),_=(T+c)/2;y.ct=[a.c2p(b*Math.cos(_)),s.c2p(b*Math.sin(_))],h=g(k,M,T,c)}E.ensureSingle(S,"path").attr("d",h)}),A.setClipUrl(w,i._hasClipOnAxisFalse?i.clipIds.forTraces:null,r)})};function e(r){var i=r.cxx,n=r.cyy;return r.vangles?function(o,a,s,f){var v,g;E.angleDelta(s,f)>0?(v=s,g=f):(v=f,g=s);var m=t.findEnclosingVertexAngles(v,r.vangles)[0],w=t.findEnclosingVertexAngles(g,r.vangles)[1],l=[m,(v+g)/2,w];return t.pathPolygonAnnulus(o,a,v,g,l,i,n)}:function(o,a,s,f){return E.pathAnnulus(o,a,s,f,i,n)}}}),TC=Vt((Z,V)=>{var u=hc(),d=Xr(),E=Sm().getTraceColor,A=d.fillText,t=i_().makeHoverPointText,e=e_().isPtInsidePolygon;V.exports=function(r,i,n){var o=r.cd,a=o[0].trace,s=r.subplot,f=s.radialAxis,v=s.angularAxis,g=s.vangles,m=g?e:d.isPtInsideSector,w=r.maxHoverDistance,l=v._period||2*Math.PI,x=Math.abs(f.g2p(Math.sqrt(i*i+n*n))),y=Math.atan2(n,i);f.range[0]>f.range[1]&&(y+=Math.PI);var S=function(c){return m(x,y,[c.rp0,c.rp1],[c.thetag0,c.thetag1],g)?w+Math.min(1,Math.abs(c.thetag1-c.thetag0)/l)-1+(c.rp1-x)/(c.rp1-c.rp0)-1:1/0};if(u.getClosest(o,S,r),r.index!==!1){var k=r.index,M=o[k];r.x0=r.x1=M.ct[0],r.y0=r.y1=M.ct[1];var T=d.extendFlat({},M,{r:M.s,theta:M.p});return A(M,a,r),t(T,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]}}}),kC=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"barpolar",basePlotModule:r_(),categories:["polar","bar","showLegend"],attributes:o4(),layoutAttributes:s4(),supplyDefaults:_C(),supplyLayoutDefaults:bC(),calc:l4().calc,crossTraceCalc:l4().crossTraceCalc,plot:wC(),colorbar:Gf(),formatLabels:a_(),style:Vh().style,styleOnSelect:Vh().styleOnSelect,hoverPoints:TC(),selectPoints:Em(),meta:{}}}),AC=Vt((Z,V)=>{V.exports=kC()}),u4=Vt((Z,V)=>{V.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),c4=Vt((Z,V)=>{var u=nf(),d=Pf(),E=Vu().attributes,A=Xr().extendFlat,t=Cu().overrideAll,e=t({color:d.color,showline:A({},d.showline,{dflt:!0}),linecolor:d.linecolor,linewidth:d.linewidth,showgrid:A({},d.showgrid,{dflt:!0}),gridcolor:d.gridcolor,gridwidth:d.gridwidth,griddash:d.griddash},"plot","from-root"),r=t({ticklen:d.ticklen,tickwidth:A({},d.tickwidth,{dflt:2}),tickcolor:d.tickcolor,showticklabels:d.showticklabels,labelalias:d.labelalias,showtickprefix:d.showtickprefix,tickprefix:d.tickprefix,showticksuffix:d.showticksuffix,ticksuffix:d.ticksuffix,tickfont:d.tickfont,tickformat:d.tickformat,hoverformat:d.hoverformat,layer:d.layer},"plot","from-root"),i=A({visible:A({},d.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:A({},d.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({},d.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:d.ticks,editType:"calc"},e,r);V.exports={domain:E({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:u.background},realaxis:i,imaginaryaxis:n,editType:"calc"}}),MC=Vt((Z,V)=>{var u=Xr(),d=Pi(),E=cl(),A=zd(),t=If().getSubplotData,e=kd(),r=Td(),i=Ug(),n=mp(),o=c4(),a=u4(),s=a.axisNames,f=g(function(m){return u.isTypedArray(m)&&(m=Array.from(m)),m.slice().reverse().map(function(w){return-w}).concat([0]).concat(m)},String);function v(m,w,l,x){var y=l("bgcolor");x.bgColor=d.combine(y,x.paper_bgcolor);var S=t(x.fullData,a.name,x.id),k=x.layoutOut,M;function T(j,G){return l(M+"."+j,G)}for(var c=0;c<s.length;c++){M=s[c],u.isPlainObject(m[M])||(m[M]={});var h=m[M],b=E.newContainer(w,M);b._id=b._name=M,b._attr=x.id+"."+M,b._traceIndices=S.map(function(j){return j.index});var _=T("visible");if(b.type="linear",n(b,k),e(h,b,T,b.type),_){var P=M==="realaxis";if(P&&T("side"),P)T("tickvals");else{var L=f(w.realaxis.tickvals||o.realaxis.tickvals.dflt);T("tickvals",L)}u.isTypedArray(b.tickvals)&&(b.tickvals=Array.from(b.tickvals));var D,B,R,I,F=x.font||{};_&&(D=T("color"),B=D===h.color?D:F.color,R=F.size,I=F.family),r(h,b,T,b.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!P,noExp:!0,font:{color:B,size:R,family:I}}),u.coerce2(m,w,o,M+".ticklen"),u.coerce2(m,w,o,M+".tickwidth"),u.coerce2(m,w,o,M+".tickcolor",w.color);var N=T("ticks");N||(delete w[M].ticklen,delete w[M].tickwidth,delete w[M].tickcolor),i(h,b,T,{dfltColor:D,bgColor:x.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:o[M]}),T("layer")}T("hoverformat"),delete b.type,b._input=h}}V.exports=function(m,w,l){A(m,w,l,{noUirevision:!0,type:a.name,attributes:o,handleDefaults:v,font:w.font,paper_bgcolor:w.paper_bgcolor,fullData:l,layoutOut:w})};function g(m,w){var l={};return function(x){var y=w?w(x):x;if(y in l)return l[y];var S=m(x);return l[y]=S,S}}}),SC=Vt((Z,V)=>{var u=If().getSubplotCalcData,d=Xr().counterRegex,E=n4(),A=u4(),t=A.attr,e=A.name,r=d(e),i={};i[t]={valType:"subplotid",dflt:e,editType:"calc"};function n(a){for(var s=a._fullLayout,f=a.calcdata,v=s._subplots[e],g=0;g<v.length;g++){var m=v[g],w=u(f,e,m),l=s[m]._subplot;l||(l=E(a,m,!0),s[m]._subplot=l),l.plot(w,s,a._promises)}}function o(a,s,f,v){for(var g=v._subplots[e]||[],m=0;m<g.length;m++){var w=g[m],l=v[w]._subplot;if(!s[w]&&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:c4(),supplyLayoutDefaults:MC(),plot:n,clean:o,toSVG:Kc().toSVG}}),f4=Vt((Z,V)=>{var{hovertemplateAttrs:u,texttemplateAttrs:d,templatefallbackAttrs:E}=kl(),A=So().extendFlat,t=Qh(),e=pc(),r=Tl(),i=e.line;V.exports={mode:e.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:e.text,texttemplate:d({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:E({editType:"plot"}),hovertext:e.hovertext,line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:A({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:A({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:A({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),hoverinfo:A({},r.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:e.hoveron,hovertemplate:u(),hovertemplatefallback:E(),selected:e.selected,unselected:e.unselected}}),EC=Vt((Z,V)=>{var u=Xr(),d=nu(),E=zh(),A=Bh(),t=wm(),e=Rh(),r=ep(),i=gp().PTS_LINESONLY,n=f4();V.exports=function(a,s,f,v){function g(l,x){return u.coerce(a,s,n,l,x)}var m=o(a,s,v,g);if(!m){s.visible=!1;return}g("mode",m<i?"lines+markers":"lines"),g("text"),g("hovertext"),s.hoveron!=="fills"&&(g("hovertemplate"),g("hovertemplatefallback")),d.hasMarkers(s)&&E(a,s,f,v,g,{gradient:!0}),d.hasLines(s)&&(A(a,s,f,v,g,{backoff:!0}),t(a,s,g),g("connectgaps")),d.hasText(s)&&(g("texttemplate"),g("texttemplatefallback"),e(a,s,v,g));var w=[];(d.hasMarkers(s)||d.hasText(s))&&(g("cliponaxis"),g("marker.maxdisplayed"),w.push("points")),g("fill"),s.fill!=="none"&&(r(a,s,f,g),d.hasLines(s)||t(a,s,g)),(s.fill==="tonext"||s.fill==="toself")&&w.push("fills"),g("hoveron",w.join("+")||"points"),u.coerceSelectionMarkerOpacity(s,g)};function o(a,s,f,v){var g=v("real"),m=v("imag"),w;return g&&m&&(w=Math.min(g.length,m.length)),u.isTypedArray(g)&&(s.real=g=Array.from(g)),u.isTypedArray(m)&&(s.imag=m=Array.from(m)),s._length=w,w}}),zC=Vt((Z,V)=>{var u=yo();V.exports=function(d,E,A){var t={},e=A[E.subplot]._subplot;return t.realLabel=u.tickText(e.radialAxis,d.real,!0).text,t.imagLabel=u.tickText(e.angularAxis,d.imag,!0).text,t}}),LC=Vt((Z,V)=>{var u=Lo(),d=ks().BADNUM,E=Nh(),A=vp(),t=jh(),e=Uh().calcMarkerSize;V.exports=function(r,i){for(var n=r._fullLayout,o=i.subplot,a=n[o].realaxis,s=n[o].imaginaryaxis,f=a.makeCalcdata(i,"real"),v=s.makeCalcdata(i,"imag"),g=i._length,m=new Array(g),w=0;w<g;w++){var l=f[w],x=v[w],y=m[w]={};u(l)&&u(x)?(y.real=l,y.imag=x):y.real=d}return e(i,g),E(r,i),A(m,i),t(m,i),m}}),CC=Vt((Z,V)=>{var u=Tm(),d=ks().BADNUM,E=r4(),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 f=r[s],v=0;v<f.length;v++){v===0&&(f[0].trace._xA=n,f[0].trace._yA=o);var g=f[v],m=g.real;if(m===d)g.x=g.y=d;else{var w=A([m,g.imag]);g.x=w[0],g.y=w[1]}}u(t,a,r,i)}}),IC=Vt((Z,V)=>{var u=Am();function d(A,t,e,r){var i=u(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,f=[];function v(m,w){f.push(m._hovertitle+": "+w)}if(!t.hovertemplate){var g=s.split("+");g.indexOf("all")!==-1&&(g=["real","imag","text"]),g.indexOf("real")!==-1&&v(i,r.realLabel),g.indexOf("imag")!==-1&&v(n,r.imagLabel),g.indexOf("text")!==-1&&r.text&&(f.push(r.text),delete r.text),r.extraText=f.join("<br>")}}V.exports={hoverPoints:d,makeHoverPointText:E}}),PC=Vt((Z,V)=>{V.exports={moduleType:"trace",name:"scattersmith",basePlotModule:SC(),categories:["smith","symbols","showLegend","scatter-like"],attributes:f4(),supplyDefaults:EC(),colorbar:Gf(),formatLabels:zC(),calc:LC(),plot:CC(),style:mh().style,styleOnSelect:mh().styleOnSelect,hoverPoints:IC().hoverPoints,selectPoints:Mm(),meta:{}}}),OC=Vt((Z,V)=>{V.exports=PC()}),sh=Vt((Z,V)=>{var u=af();function d(){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={}}u(d.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 f=o%10;a=(f===0?"":i[f]+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}u(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"}u(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 f=i.year()+(o==="y"?n:0),v=i.monthOfYear()+(o==="m"?n:0),s=i.day(),g=function(l){for(;v<l.minMonth;)f--,v+=l.monthsInYear(f);for(var x=l.monthsInYear(f);v>x-1+l.minMonth;)f++,v-=x,x=l.monthsInYear(f)};o==="y"?(i.month()!==this.fromMonthOfYear(f,v)&&(v=this.newDate(f,i.month(),this.minDay).monthOfYear()),v=Math.min(v,this.monthsInYear(f)),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,v)))):o==="m"&&(g(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,v))));var m=[f,this.fromMonthOfYear(f,v),s];return this._validateLevel--,m}catch(w){throw this._validateLevel--,w}},_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],f=o<0?-1:1;n=this._add(i,o*s[0]+f*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(),f=o==="d"?n:i.day();return(o==="y"||o==="m")&&(f=Math.min(f,this.daysInMonth(a,s))),i.date(a,s,f)},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(f){throw this._validateLevel--,f}}});function e(i){this.local=this.regionalOptions[i]||this.regionalOptions[""]}e.prototype=new t,u(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),f=2-s+Math.floor(s/4);return Math.floor(365.25*(i+4716))+Math.floor(30.6001*(n+1))+o+f-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),f=Math.floor(365.25*s),v=Math.floor((a-f)/30.6001),g=a-f-Math.floor(v*30.6001),m=v-(v>13.5?13:1),w=s-(m>2.5?4716:4715);return w<=0&&w--,this.newDate(w,m,g)},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 d;r.cdate=E,r.baseCalendar=t,r.calendars.gregorian=e}),DC=Vt(()=>{var Z=af(),V=sh();Z(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[""],Z(V.cdate.prototype,{formatDate:function(u,d){return typeof u!="string"&&(d=u,u=""),this._calendar.formatDate(u||"",this,d)}}),Z(V.baseCalendar.prototype,{UNIX_EPOCH:V.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:V.instance().jdEpoch,TICKS_PER_DAY:1440*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(u,d,E){if(typeof u!="string"&&(E=d,d=u,u=""),!d)return"";if(d.calendar()!==this)throw V.local.invalidFormat||V.regionalOptions[""].invalidFormat;u=u||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,k){for(var M=1;y+M<u.length&&u.charAt(y+M)===S;)M++;return y+=M-1,Math.floor(M/(k||1))>1},a=function(S,k,M,T){var c=""+k;if(o(S,T))for(;c.length<M;)c="0"+c;return c},s=function(S,k,M,T){return o(S)?T[k]:M[k]},f=this,v=function(S){return typeof e=="function"?e.call(f,S,o("m")):w(a("m",S.month(),2))},g=function(S,k){return k?typeof i=="function"?i.call(f,S):i[S.month()-f.minMonth]:typeof r=="function"?r.call(f,S):r[S.month()-f.minMonth]},m=this.local.digits,w=function(S){return E.localNumbers&&m?m(S):S},l="",x=!1,y=0;y<u.length;y++)if(x)u.charAt(y)==="'"&&!o("'")?x=!1:l+=u.charAt(y);else switch(u.charAt(y)){case"d":l+=w(a("d",d.day(),2));break;case"D":l+=s("D",d.dayOfWeek(),A,t);break;case"o":l+=a("o",d.dayOfYear(),3);break;case"w":l+=a("w",d.weekOfYear(),2);break;case"m":l+=v(d);break;case"M":l+=g(d,o("M"));break;case"y":l+=o("y",2)?d.year():(d.year()%100<10?"0":"")+d.year()%100;break;case"Y":o("Y",2),l+=d.formatYear();break;case"J":l+=d.toJD();break;case"@":l+=(d.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":l+=(d.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":o("'")?l+="'":x=!0;break;default:l+=u.charAt(y)}return l},parseDate:function(u,d,E){if(d==null)throw V.local.invalidArguments||V.regionalOptions[""].invalidArguments;if(d=typeof d=="object"?d.toString():d+"",d==="")return null;u=u||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,f=-1,v=-1,g=-1,m=!1,w=!1,l=function(P,L){for(var D=1;h+D<u.length&&u.charAt(h+D)===P;)D++;return h+=D-1,Math.floor(D/(L||1))>1},x=function(P,L){var D=l(P,L),B=[2,3,D?4:2,D?4:2,10,11,20]["oyYJ@!".indexOf(P)+1],R=new RegExp("^-?\\d{1,"+B+"}"),I=d.substring(c).match(R);if(!I)throw(V.local.missingNumberAt||V.regionalOptions[""].missingNumberAt).replace(/\{0\}/,c);return c+=I[0].length,parseInt(I[0],10)},y=this,S=function(){if(typeof i=="function"){l("m");var P=i.call(y,d.substring(c));return c+=P.length,P}return x("m")},k=function(P,L,D,B){for(var R=l(P,B)?D:L,I=0;I<R.length;I++)if(d.substr(c,R[I].length).toLowerCase()===R[I].toLowerCase())return c+=R[I].length,I+y.minMonth;throw(V.local.unknownNameAt||V.regionalOptions[""].unknownNameAt).replace(/\{0\}/,c)},M=function(){if(typeof o=="function"){var P=l("M")?o.call(y,d.substring(c)):n.call(y,d.substring(c));return c+=P.length,P}return k("M",n,o)},T=function(){if(d.charAt(c)!==u.charAt(h))throw(V.local.unexpectedLiteralAt||V.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,c);c++},c=0,h=0;h<u.length;h++)if(w)u.charAt(h)==="'"&&!l("'")?w=!1:T();else switch(u.charAt(h)){case"d":v=x("d");break;case"D":k("D",t,e);break;case"o":g=x("o");break;case"w":x("w");break;case"m":f=S();break;case"M":f=M();break;case"y":var b=h;m=!l("y",2),h=b,s=x("y",2);break;case"Y":s=x("Y",2);break;case"J":a=x("J")+.5,d.charAt(c)==="."&&(c++,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"*":c=d.length;break;case"'":l("'")?T():w=!0;break;default:T()}if(c<d.length)throw V.local.unexpectedText||V.regionalOptions[""].unexpectedText;if(s===-1?s=this.today().year():s<100&&m&&(s+=A===-1?1900:this.today().year()-this.today().year()%100-(s<=A?0:100)),typeof f=="string"&&(f=r.call(this,s,f)),g>-1){f=1,v=g;for(var _=this.daysInMonth(s,f);v>_;_=this.daysInMonth(s,f))f++,v-=_}return a>-1?this.fromJD(a):this.newDate(s,f,v)},determineDate:function(u,d,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 d=d?d.newDate():null,u=u==null?d:typeof u=="string"?r(u):typeof u=="number"?isNaN(u)||u===1/0||u===-1/0?d:e.today().add(u,"d"):e.newDate(u),u}})}),FC=Vt(()=>{var Z=sh(),V=af(),u=Z.instance();function d(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.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 f=a.match(A);return f?f[0]:""}var v=this._validateYear(a),g=a.month(),m=""+this.toChineseMonth(v,g);return s&&m.length<2&&(m="0"+m),this.isIntercalaryMonth(v,g)&&(m+="i"),m},monthNames:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var f=this._validateYear(a),v=a.month(),g=this.toChineseMonth(f,v),m=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][g-1];return this.isIntercalaryMonth(f,v)&&(m="闰"+m),m},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var f=this._validateYear(a),v=a.month(),g=this.toChineseMonth(f,v),m=["一","二","三","四","五","六","七","八","九","十","十一","十二"][g-1];return this.isIntercalaryMonth(f,v)&&(m="闰"+m),m},parseMonth:function(a,s){a=this._validateYear(a);var f=parseInt(s),v;if(isNaN(f))s[0]==="闰"&&(v=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),f=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var g=s[s.length-1];v=g==="i"||g==="I"}var m=this.toMonthIndex(a,f,v);return m},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,f){var v=this.intercalaryMonth(a),g=f&&s!==v;if(g||s<1||s>12)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return v?!f&&s<=v?m=s-1:m=s:m=s-1,m},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a),v=f?12:11;if(s<0||s>v)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var g;return f?s<f?g=s+1:g=s:g=s+1,g},intercalaryMonth:function(a){a=this._validateYear(a);var s=r[a-r[0]],f=s>>13;return f},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a);return!!f&&f===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,f){var v=this._validateYear(a,Z.local.invalidyear),g=i[v-i[0]],m=g>>9&4095,w=g>>5&15,l=g&31,x;x=u.newDate(m,w,l),x.add(4-(x.dayOfWeek()||7),"d");var y=this.toJD(a,s,f)-x.toJD();return 1+Math.floor(y/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 f=r[a-r[0]],v=f>>13,g=v?12:11;if(s>g)throw Z.local.invalidMonth.replace(/\{0\}/,this.local.name);var m=f&1<<12-s?30:29;return m},weekDay:function(a,s,f){return(this.dayOfWeek(a,s,f)||7)<6},toJD:function(a,s,f){var v=this._validate(a,m,f,Z.local.invalidDate);a=this._validateYear(v.year()),s=v.month(),f=v.day();var g=this.isIntercalaryMonth(a,s),m=this.toChineseMonth(a,s),w=o(a,m,f,g);return u.toJD(w.year,w.month,w.day)},fromJD:function(a){var s=u.fromJD(a),f=n(s.year(),s.month(),s.day()),v=this.toMonthIndex(f.year,f.month,f.isIntercalary);return this.newDate(f.year,v,f.day)},fromString:function(a){var s=a.match(E),f=this._validateYear(+s[1]),v=+s[2],g=!!s[3],m=this.toMonthIndex(f,v,g),w=+s[4];return this.newDate(f,m,w)},add:function(a,s,f){var v=a.year(),g=a.month(),m=this.isIntercalaryMonth(v,g),w=this.toChineseMonth(v,g),l=Object.getPrototypeOf(d.prototype).add.call(this,a,s,f);if(f==="y"){var x=l.year(),y=l.month(),S=this.isIntercalaryMonth(x,w),k=m&&S?this.toMonthIndex(x,w,!0):this.toMonthIndex(x,w,!1);k!==y&&l.month(k)}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;Z.calendars.chinese=d;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,f,v){var g,m;if(typeof a=="object")g=a,m=s||{};else{var w=typeof a=="number"&&a>=1888&&a<=2111;if(!w)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 f=="number"&&f>=1&&f<=31;if(!x)throw new Error("Solar day outside range 1 - 31");g={year:a,month:s,day:f},m={}}var y=i[g.year-i[0]],S=g.year<<9|g.month<<5|g.day;m.year=S>=y?g.year:g.year-1,y=i[m.year-i[0]];var k=y>>9&4095,M=y>>5&15,T=y&31,c,h=new Date(k,M-1,T),b=new Date(g.year,g.month-1,g.day);c=Math.round((b-h)/(24*3600*1e3));var _=r[m.year-r[0]],P;for(P=0;P<13;P++){var L=_&1<<12-P?30:29;if(c<L)break;c-=L}var D=_>>13;return!D||P<D?(m.isIntercalary=!1,m.month=1+P):P===D?(m.isIntercalary=!0,m.month=P):(m.isIntercalary=!1,m.month=P),m.day=1+c,m}function o(a,s,f,v,g){var m,w;if(typeof a=="object")w=a,m=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 y=typeof f=="number"&&f>=1&&f<=30;if(!y)throw new Error("Lunar day outside range 1 - 30");var S;typeof v=="object"?(S=!1,m=v):(S=!!v,m={}),w={year:a,month:s,day:f,isIntercalary:S}}var k;k=w.day-1;var M=r[w.year-r[0]],T=M>>13,c;T&&(w.month>T||w.isIntercalary)?c=w.month:c=w.month-1;for(var h=0;h<c;h++){var b=M&1<<12-h?30:29;k+=b}var _=i[w.year-i[0]],P=_>>9&4095,L=_>>5&15,D=_&31,B=new Date(P,L-1,D+k);return m.year=B.getFullYear(),m.month=1+B.getMonth(),m.day=B.getDate(),m}}),BC=Vt(()=>{var Z=sh(),V=af();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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,Z.local.invalidYear),A=E.year()+(E.year()<0?1:0);return A%4===3||A%4===-1},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===13&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return(this.dayOfWeek(d,E,A)||7)<6},toJD:function(d,E,A){var t=this._validate(d,E,A,Z.local.invalidDate);return d=t.year(),d<0&&d++,t.day()+(t.month()-1)*30+(d-1)*365+Math.floor(d/4)+this.jdEpoch-1},fromJD:function(d){var E=Math.floor(d)+.5-this.jdEpoch,A=Math.floor((E-Math.floor((E+366)/1461))/365)+1;A<=0&&A--,E=Math.floor(d)+.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)}}),Z.calendars.coptic=u}),RC=Vt(()=>{var Z=sh(),V=af();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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,Z.local.invalidYear),!1},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.local.invalidYear),13},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.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,Z.local.invalidMonth);return this.daysPerMonth[t.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(E,A,t){var e=this._validate(E,A,t,Z.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,Z.local.invalidDate);return{century:d[Math.floor((e.year()-1)/100)+1]||""}},toJD:function(E,A,t){var e=this._validate(E,A,t,Z.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 d={20:"Fruitbat",21:"Anchovy"};Z.calendars.discworld=u}),NC=Vt(()=>{var Z=sh(),V=af();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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,Z.local.invalidYear),A=E.year()+(E.year()<0?1:0);return A%4===3||A%4===-1},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,Z.local.invalidYear||Z.regionalOptions[""].invalidYear),13},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===13&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return(this.dayOfWeek(d,E,A)||7)<6},toJD:function(d,E,A){var t=this._validate(d,E,A,Z.local.invalidDate);return d=t.year(),d<0&&d++,t.day()+(t.month()-1)*30+(d-1)*365+Math.floor(d/4)+this.jdEpoch-1},fromJD:function(d){var E=Math.floor(d)+.5-this.jdEpoch,A=Math.floor((E-Math.floor((E+366)/1461))/365)+1;A<=0&&A--,E=Math.floor(d)+.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)}}),Z.calendars.ethiopian=u}),jC=Vt(()=>{var Z=sh(),V=af();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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,Z.local.invalidYear);return this._leapYear(A.year())},_leapYear:function(E){return E=E<0?E+1:E,d(E*7+1,19)<7},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Z.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,Z.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,Z.local.invalidMonth),A===12&&this.leapYear(E)||A===8&&d(this.daysInYear(E),10)===5?30:A===9&&d(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,Z.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,Z.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 d(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 d(E,A){return E-A*Math.floor(E/A)}Z.calendars.hebrew=u}),UC=Vt(()=>{var Z=sh(),V=af();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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(d){var E=this._validate(d,this.minMonth,this.minDay,Z.local.invalidYear);return(E.year()*11+14)%30<11},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(d){return this.leapYear(d)?355:354},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===12&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return this.dayOfWeek(d,E,A)!==5},toJD:function(d,E,A){var t=this._validate(d,E,A,Z.local.invalidDate);return d=t.year(),E=t.month(),A=t.day(),d=d<=0?d+1:d,A+Math.ceil(29.5*(E-1))+(d-1)*354+Math.floor((3+11*d)/30)+this.jdEpoch-1},fromJD:function(d){d=Math.floor(d)+.5;var E=Math.floor((30*(d-this.jdEpoch)+10646)/10631);E=E<=0?E-1:E;var A=Math.min(12,Math.ceil((d-29-this.toJD(E,1,1))/29.5)+1),t=d-this.toJD(E,A,1)+1;return this.newDate(E,A,t)}}),Z.calendars.islamic=u}),VC=Vt(()=>{var Z=sh(),V=af();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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,Z.local.invalidYear),A=E.year()<0?E.year()+1:E.year();return A%4===0},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(4-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(d,E){var A=this._validate(d,E,this.minDay,Z.local.invalidMonth);return this.daysPerMonth[A.month()-1]+(A.month()===2&&this.leapYear(A.year())?1:0)},weekDay:function(d,E,A){return(this.dayOfWeek(d,E,A)||7)<6},toJD:function(d,E,A){var t=this._validate(d,E,A,Z.local.invalidDate);return d=t.year(),E=t.month(),A=t.day(),d<0&&d++,E<=2&&(d--,E+=12),Math.floor(365.25*(d+4716))+Math.floor(30.6001*(E+1))+A-1524.5},fromJD:function(d){var E=Math.floor(d+.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)}}),Z.calendars.julian=u}),HC=Vt(()=>{var Z=sh(),V=af();function u(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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,Z.local.invalidYear),!1},formatYear:function(A){var t=this._validate(A,this.minMonth,this.minDay,Z.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,Z.local.invalidYear),18},weekOfYear:function(A,t,e){return this._validate(A,t,e,Z.local.invalidDate),0},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Z.local.invalidYear),360},daysInMonth:function(A,t){return this._validate(A,t,this.minDay,Z.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(A,t,e){var r=this._validate(A,t,e,Z.local.invalidDate);return r.day()},weekDay:function(A,t,e){return this._validate(A,t,e,Z.local.invalidDate),!0},extraInfo:function(A,t,e){var r=this._validate(A,t,e,Z.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=d(A+8+340,365);return[Math.floor(t/20)+1,d(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,Z.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 d(A,t){return A-t*Math.floor(A/t)}function E(A,t){return d(A-1,t)+1}Z.calendars.mayan=u}),qC=Vt(()=>{var Z=sh(),V=af();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar;var d=Z.instance("gregorian");V(u.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,Z.local.invalidYear||Z.regionalOptions[""].invalidYear);return d.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,Z.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,Z.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+d.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)}}),Z.calendars.nanakshahi=u}),WC=Vt(()=>{var Z=sh(),V=af();function u(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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(d){return this.daysInYear(d)!==this.daysPerYear},weekOfYear:function(d,E,A){var t=this.newDate(d,E,A);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(d){var E=this._validate(d,this.minMonth,this.minDay,Z.local.invalidYear);if(d=E.year(),typeof this.NEPALI_CALENDAR_DATA[d]>"u")return this.daysPerYear;for(var A=0,t=this.minMonth;t<=12;t++)A+=this.NEPALI_CALENDAR_DATA[d][t];return A},daysInMonth:function(d,E){return d.year&&(E=d.month(),d=d.year()),this._validate(d,E,this.minDay,Z.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[d]>"u"?this.daysPerMonth[E-1]:this.NEPALI_CALENDAR_DATA[d][E]},weekDay:function(d,E,A){return this.dayOfWeek(d,E,A)!==6},toJD:function(d,E,A){var t=this._validate(d,E,A,Z.local.invalidDate);d=t.year(),E=t.month(),A=t.day();var e=Z.instance(),r=0,i=E,n=d;this._createMissingCalendarData(d);var o=d-(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(d){var E=Z.instance(),A=E.fromJD(d),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(d){var E=this.daysPerMonth.slice(0);E.unshift(17);for(var A=d-1;A<d+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]}}),Z.calendars.nepali=u}),GC=Vt(()=>{var Z=sh(),V=af();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}function d(E){var A=E-475;E<0&&A++;var t=.242197,e=t*A,r=t*(A+1),i=e-Math.floor(e),n=r-Math.floor(r);return i>n}u.prototype=new Z.baseCalendar,V(u.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","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","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,Z.local.invalidYear);return d(A.year())},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,Z.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,Z.local.invalidDate);E=e.year(),A=e.month(),t=e.day();var r=0;if(E>0)for(var i=1;i<E;i++)d(i)&&r++;else if(E<0)for(var i=E;i<0;i++)d(i)&&r--;return t+(A<=7?(A-1)*31:(A-1)*30+6)+(E>0?E-1:E)*365+r+this.jdEpoch-1},fromJD:function(E){E=Math.floor(E)+.5;var A=475+(E-this.toJD(475,1,1))/365.242197,t=Math.floor(A);t<=0&&t--,E>this.toJD(t,12,d(t)?30:29)&&(t++,t===0&&t++);var e=E-this.toJD(t,1,1)+1,r=e<=186?Math.ceil(e/31):Math.ceil((e-6)/30),i=E-this.toJD(t,r,1)+1;return this.newDate(t,r,i)}}),Z.calendars.persian=u,Z.calendars.jalali=u}),ZC=Vt(()=>{var Z=sh(),V=af(),u=Z.instance();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.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,Z.local.invalidYear),t=this._t2gYear(A.year());return u.leapYear(t)},weekOfYear:function(r,A,t){var e=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(e.year());return u.weekOfYear(r,e.month(),e.day())},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,Z.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,Z.local.invalidDate),r=this._t2gYear(e.year());return u.toJD(r,e.month(),e.day())},fromJD:function(E){var A=u.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)}}),Z.calendars.taiwan=d}),KC=Vt(()=>{var Z=sh(),V=af(),u=Z.instance();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Z.baseCalendar,V(d.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,Z.local.invalidYear),t=this._t2gYear(A.year());return u.leapYear(t)},weekOfYear:function(r,A,t){var e=this._validate(r,this.minMonth,this.minDay,Z.local.invalidYear),r=this._t2gYear(e.year());return u.weekOfYear(r,e.month(),e.day())},daysInMonth:function(E,A){var t=this._validate(E,A,this.minDay,Z.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,Z.local.invalidDate),r=this._t2gYear(e.year());return u.toJD(r,e.month(),e.day())},fromJD:function(E){var A=u.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)}}),Z.calendars.thai=d}),YC=Vt(()=>{var Z=sh(),V=af();function u(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}u.prototype=new Z.baseCalendar,V(u.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-Juma","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,Z.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,Z.local.invalidMonth),e=t.toJD()-24e5+.5,r=0,i=0;i<d.length;i++){if(d[i]>e)return d[r]-d[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,Z.local.invalidDate),r=12*(e.year()-1)+e.month()-15292,i=e.day()+d[r-1]-1;return i+24e5-.5},fromJD:function(E){for(var A=E-24e5+.5,t=0,e=0;e<d.length&&!(d[e]>A);e++)t++;var r=t+15292,i=Math.floor((r-1)/12),n=i+1,o=r-12*i,a=A-d[t-1]+1;return this.newDate(n,o,a)},isValid:function(E,A,t){var e=Z.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=Z.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw e.replace(/\{0\}/,this.local.name);return r}}),Z.calendars.ummalqura=u;var d=[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]}),XC=Vt((Z,V)=>{V.exports=sh(),DC(),FC(),BC(),RC(),NC(),jC(),UC(),VC(),HC(),qC(),WC(),GC(),ZC(),KC(),YC()}),$C=Vt((Z,V)=>{var u=XC(),d=Xr(),E=ks(),A=E.EPOCHJD,t=E.ONEDAY,e={valType:"enumerated",values:d.sortObjectKeys(u.calendars),editType:"calc",dflt:"gregorian"},r=function(M,T,c,h){var b={};return b[c]=e,d.coerce(M,T,b,c,h)},i=function(M,T,c,h){for(var b=0;b<c.length;b++)r(M,T,c[b]+"calendar",h.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="##",f={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,T,c){for(var h=Math.floor((T+.05)/t)+A,b=m(c).fromJD(h),_=0,P,L,D,B,R;(_=M.indexOf("%",_))!==-1;)P=M.charAt(_+1),P==="0"||P==="-"||P==="_"?(D=3,L=M.charAt(_+2),P==="_"&&(P="-")):(L=P,P="0",D=2),B=f[L],B?(B===s?R=s:R=b.formatDate(B[P]),M=M.substr(0,_)+R+M.substr(_+D),_+=R.length):_+=D;return M}var g={};function m(M){var T=g[M];return T||(T=g[M]=u.instance(M),T)}function w(M){return d.extendFlat({},e,{description:M})}function l(M){return"Sets the calendar system to use with `"+M+"` date data."}var x={xcalendar:w(l("x"))},y=d.extendFlat({},x,{ycalendar:w(l("y"))}),S=d.extendFlat({},y,{zcalendar:w(l("z"))}),k=w(["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:y,bar:y,box:y,heatmap:y,contour:y,histogram:y,histogram2d:y,histogram2dcontour:y,scatter3d:S,surface:S,mesh3d:S,scattergl:y,ohlc:x,candlestick:x},layout:{calendar:w(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:k},yaxis:{calendar:k},scene:{xaxis:{calendar:k},yaxis:{calendar:k},zaxis:{calendar:k}},polar:{radialaxis:{calendar:k}}}},layoutAttributes:e,handleDefaults:r,handleTraceDefaults:i,CANONICAL_SUNDAY:o,CANONICAL_TICK:n,DFLTRANGE:a,getCal:m,worldCalFmt:v}}),JC=Vt((Z,V)=>{V.exports=$C()}),QC=Vt((Z,V)=>{var u=L6();u.register([O6(),B6(),U6(),G6(),X6(),tA(),nA(),dA(),TA(),OA(),qA(),c8(),g8(),rS(),fS(),xS(),MS(),HS(),ZS(),YS(),QS(),aE(),uE(),pE(),EE(),CE(),d9(),z9(),V9(),K9(),az(),lz(),gz(),zz(),Pz(),Uz(),rL(),lL(),mL(),RL(),GL(),$L(),rC(),oC(),fC(),xC(),AC(),OC(),JC()]),V.exports=u});return QC()})();/*!
* 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.
*//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *//*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*//*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*//*! 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=Dp,Dp})}(Ey)),Ey.exports}var F4=NI();const jI=FI(F4),VI=BI({__proto__:null,default:jI},[F4]);export{jI as P,VI as p};